@cntrl-site/components 1.0.46 → 1.0.48-alpha.0
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/Marquee/Marquee.d.ts +1 -0
- package/dist/Components/SimpleButton/SimpleButton.d.ts +72 -0
- package/dist/Components/SimpleButton/SimpleButtonComponent.d.ts +620 -0
- package/dist/Components/Waterfall/Waterfall.d.ts +7 -1
- package/dist/index.js +1208 -298
- package/dist/index.mjs +7600 -5781
- package/dist/types/SchemaV1.d.ts +2 -0
- 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"),pt=require("classnames"),E=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),mi=require("react-dom");function mc(e){return e.type==="object"&&e.version===1}const gc="ControlSlider-module__wrapper___sHEkd",hc="ControlSlider-module__hoverArrow___A-dOH",fc="ControlSlider-module__sliderItem___QQSkR",yc="ControlSlider-module__sliderImage___9hRl-",vc="ControlSlider-module__arrow___05ghY",xc="ControlSlider-module__arrowVertical___tBfVN",bc="ControlSlider-module__nextArrow___-30Yc",wc="ControlSlider-module__arrowInner___aEra3",Sc="ControlSlider-module__arrowIcon___S4ztF",$c="ControlSlider-module__arrowImg___2dwJW",Cc="ControlSlider-module__mirror___brd6U",Tc="ControlSlider-module__pagination___bicLF",Lc="ControlSlider-module__paginationInner___bT-P-",Ic="ControlSlider-module__paginationVertical___zYqKw",Rc="ControlSlider-module__paginationItem___nTRbk",Ec="ControlSlider-module__dot___p1Qun",Mc="ControlSlider-module__activeDot___LHFaj",kc="ControlSlider-module__paginationInsideBottom___R3FWn",Pc="ControlSlider-module__paginationInsideTop___V-qb-",Ac="ControlSlider-module__paginationOutsideBottom___14w8D",Wc="ControlSlider-module__paginationOutsideTop___SCLqB",Fc="ControlSlider-module__paginationInsideLeft___yOBRZ",_c="ControlSlider-module__paginationInsideRight___Rtt3o",Hc="ControlSlider-module__paginationOutsideLeft___lahaw",Nc="ControlSlider-module__paginationOutsideRight___EtuQa",Oc="ControlSlider-module__imgWrapper___UjEgB",jc="ControlSlider-module__captionBlock___dJ6-j",zc="ControlSlider-module__captionTextWrapper___HFlpf",Bc="ControlSlider-module__captionText___uGBVc",Dc="ControlSlider-module__active___WZK4G",Vc="ControlSlider-module__withPointerEvents___t-18M",Gc="ControlSlider-module__topLeftAlignment___zjnGM",qc="ControlSlider-module__topCenterAlignment___gD1xW",Kc="ControlSlider-module__topRightAlignment___NMapS",Uc="ControlSlider-module__middleLeftAlignment___OnUrY",Xc="ControlSlider-module__middleCenterAlignment___Tdkl0",Yc="ControlSlider-module__middleRightAlignment___wEbfX",Jc="ControlSlider-module__bottomLeftAlignment___cTP2-",Zc="ControlSlider-module__bottomCenterAlignment___c54fB",Qc="ControlSlider-module__bottomRightAlignment___kEwrz",ed="ControlSlider-module__clickOverlay___DZA28",td="ControlSlider-module__contain___pLyq7",nd="ControlSlider-module__cover___KdDat",Xe={wrapper:gc,hoverArrow:hc,sliderItem:fc,sliderImage:yc,arrow:vc,arrowVertical:xc,nextArrow:bc,arrowInner:wc,arrowIcon:Sc,arrowImg:$c,mirror:Cc,pagination:Tc,paginationInner:Lc,paginationVertical:Ic,paginationItem:Rc,dot:Ec,activeDot:Mc,paginationInsideBottom:kc,paginationInsideTop:Pc,paginationOutsideBottom:Ac,paginationOutsideTop:Wc,paginationInsideLeft:Fc,paginationInsideRight:_c,paginationOutsideLeft:Hc,paginationOutsideRight:Nc,imgWrapper:Oc,captionBlock:jc,captionTextWrapper:zc,captionText:Bc,active:Dc,withPointerEvents:Vc,topLeftAlignment:Gc,topCenterAlignment:qc,topRightAlignment:Kc,middleLeftAlignment:Uc,middleCenterAlignment:Xc,middleRightAlignment:Yc,bottomLeftAlignment:Jc,bottomCenterAlignment:Zc,bottomRightAlignment:Qc,clickOverlay:ed,contain:td,cover:nd};function id(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 od(e,t,n){return t&&id(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ga="(prefers-reduced-motion: reduce)",Si=1,rd=2,Li=3,ji=4,ho=5,Vo=6,Zo=7,ad={CREATED:Si,MOUNTED:rd,IDLE:Li,MOVING:ji,SCROLLING:ho,DRAGGING:Vo,DESTROYED:Zo};function Fn(e){e.length=0}function Xn(e,t,n){return Array.prototype.slice.call(e,t,n)}function jt(e){return e.bind.apply(e,[null].concat(Xn(arguments,1)))}var tl=setTimeout,Jr=function(){};function qa(e){return requestAnimationFrame(e)}function lr(e,t){return typeof t===e}function no(e){return!pa(e)&&lr("object",e)}var ua=Array.isArray,nl=jt(lr,"function"),Gn=jt(lr,"string"),fo=jt(lr,"undefined");function pa(e){return e===null}function il(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function yo(e){return ua(e)?e:[e]}function vn(e,t){yo(e).forEach(t)}function ma(e,t){return e.indexOf(t)>-1}function Go(e,t){return e.push.apply(e,yo(t)),e}function Mn(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,Gn(t)?t.split(" "):t,!0)}function vo(e,t){vn(t,e.appendChild.bind(e))}function ga(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function io(e,t){return il(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ol(e,t){var n=e?Xn(e.children):[];return t?n.filter(function(i){return io(i,t)}):n}function xo(e,t){return t?ol(e,t)[0]:e.firstElementChild}var oo=Object.keys;function di(e,t,n){return e&&(n?oo(e).reverse():oo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ro(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){ua(n)?e[i]=n.slice():no(n)?e[i]=zn({},no(e[i])?e[i]:{},n):e[i]=n})}),e}function Ka(e,t){vn(t||oo(e),function(n){delete e[n]})}function Ln(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function lt(e,t,n){no(t)?di(t,function(i,o){lt(e,o,i)}):vn(e,function(i){pa(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function $i(e,t,n){var i=document.createElement(e);return t&&(Gn(t)?Tn(i,t):lt(i,t)),n&&vo(n,i),i}function xn(e,t,n){if(fo(n))return getComputedStyle(e)[t];pa(n)||(e.style[t]=""+n)}function ao(e,t){xn(e,"display",t)}function rl(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function Ua(e,t){return e&&e.classList.contains(t)}function pn(e){return e.getBoundingClientRect()}function ui(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function al(e){return xo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function sl(e,t){return e&&e.querySelector(t)}function ha(e,t){return t?Xn(e.querySelectorAll(t)):[]}function kn(e,t){Mn(e,t,!1)}function Zr(e){return e.timeStamp}function ti(e){return Gn(e)?e:e?e+"px":""}var bo="splide",fa="data-"+bo;function Ji(e,t){if(!e)throw new Error("["+bo+"] "+(t||""))}var qn=Math.min,Qo=Math.max,er=Math.floor,so=Math.ceil,sn=Math.abs;function ll(e,t,n){return sn(e-t)<n}function qo(e,t,n,i){var o=qn(t,n),s=Qo(t,n);return i?o<e&&e<s:o<=e&&e<=s}function xi(e,t,n){var i=qn(t,n),o=Qo(t,n);return qn(Qo(i,e),o)}function Qr(e){return+(e>0)-+(e<0)}function ea(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function ya(e){return e<10?"0"+e:""+e}var Xa={};function sd(e){return""+e+ya(Xa[e]=(Xa[e]||0)+1)}function cl(){var e=[];function t(l,d,c,u){o(l,d,function(m,v,b){var S="addEventListener"in m,y=S?m.removeEventListener.bind(m,v,c,u):m.removeListener.bind(m,c);S?m.addEventListener(v,c,u):m.addListener(c),e.push([m,v,b,c,y])})}function n(l,d,c){o(l,d,function(u,m,v){e=e.filter(function(b){return b[0]===u&&b[1]===m&&b[2]===v&&(!c||b[3]===c)?(b[4](),!1):!0})})}function i(l,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){vn(l,function(u){u&&vn(d,function(m){m.split(" ").forEach(function(v){var b=v.split(".");c(u,b[0],b[1])})})})}function s(){e.forEach(function(l){l[4]()}),Fn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Yn="mounted",ta="ready",_n="move",zi="moved",va="click",dl="active",ul="inactive",pl="visible",ml="hidden",Yt="refresh",rn="updated",Ii="resize",cr="resized",gl="drag",hl="dragging",fl="dragged",dr="scroll",gi="scrolled",ld="overflow",xa="destroy",yl="arrows:mounted",vl="arrows:updated",xl="pagination:mounted",bl="pagination:updated",ba="navigation:mounted",wa="autoplay:play",wl="autoplay:playing",Sa="autoplay:pause",$a="lazyload:loaded",Sl="sk",$l="sh",tr="ei";function qt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=cl();function i(s,l){n.bind(t,yo(s).join(" "),function(d){l.apply(l,ua(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Xn(arguments,1))}return e&&e.event.on(xa,n.destroy),ro(n,{bus:t,on:i,off:jt(n.unbind,t),emit:o})}function ur(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function m(){if(!c){if(l=e?qn((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return b();d=qa(m)}}function v(L){L||y(),s=o()-(L?l*e:0),c=!1,d=qa(m)}function b(){c=!0}function S(){s=o(),l=0,n&&n(l)}function y(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function w(L){e=L}function C(){return c}return{start:v,rewind:S,pause:b,cancel:y,set:w,isPaused:C}}function cd(e){var t=e;function n(o){t=o}function i(o){return ma(yo(o),t)}return{set:n,is:i}}function dd(e,t){var n=ur(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ud(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=cl(),d=[];function c(){var y=n.mediaQuery==="min";oo(o).sort(function(w,C){return y?+w-+C:+C-+w}).forEach(function(w){m(o[w],"("+(y?"min":"max")+"-width:"+w+"px)")}),m(s,Ga),v()}function u(y){y&&l.destroy()}function m(y,w){var C=matchMedia(w);l.bind(C,"change",v),d.push([y,C])}function v(){var y=i.is(Zo),w=n.direction,C=d.reduce(function(L,k){return zn(L,k[1].matches?k[0]:{})},{});Ka(n),S(C),n.destroy?e.destroy(n.destroy==="completely"):y?(u(!0),e.mount()):w!==n.direction&&e.refresh()}function b(y){matchMedia(Ga).matches&&(y?zn(n,s):Ka(n,oo(s)))}function S(y,w,C){zn(n,y),w&&zn(Object.getPrototypeOf(n),y),(C||!i.is(Si))&&e.emit(rn,n)}return{setup:c,destroy:u,reduce:b,set:S}}var pr="Arrow",mr=pr+"Left",gr=pr+"Right",Cl=pr+"Up",Tl=pr+"Down",Ya="rtl",hr="ttb",Er={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Cl,gr],ArrowRight:[Tl,mr]};function pd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===Ya&&!l?1:d===hr?0:-1;return Er[s]&&Er[s][c]||s.replace(/width|left|right/i,function(u,m){var v=Er[u.toLowerCase()][c]||u;return m>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(s){return s*(n.direction===Ya?1:-1)}return{resolve:i,orient:o}}var Pn="role",Ci="tabindex",md="disabled",wn="aria-",wo=wn+"controls",Ll=wn+"current",Ja=wn+"selected",gn=wn+"label",Ca=wn+"labelledby",Il=wn+"hidden",Ta=wn+"orientation",lo=wn+"roledescription",Za=wn+"live",Qa=wn+"busy",es=wn+"atomic",La=[Pn,Ci,md,wo,Ll,gn,Ca,Il,Ta,lo],In=bo+"__",Jn="is-",Mr=bo,ts=In+"track",gd=In+"list",fr=In+"slide",Rl=fr+"--clone",hd=fr+"__container",Ia=In+"arrows",yr=In+"arrow",El=yr+"--prev",Ml=yr+"--next",vr=In+"pagination",kl=vr+"__page",fd=In+"progress",yd=fd+"__bar",vd=In+"toggle",xd=In+"spinner",bd=In+"sr",wd=Jn+"initialized",pi=Jn+"active",Pl=Jn+"prev",Al=Jn+"next",na=Jn+"visible",ia=Jn+"loading",Wl=Jn+"focus-in",Fl=Jn+"overflow",Sd=[pi,na,Pl,Al,ia,Wl,Fl],$d={slide:fr,clone:Rl,arrows:Ia,arrow:yr,prev:El,next:Ml,pagination:vr,page:kl,spinner:xd};function Cd(e,t){if(nl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!io(n,t);)n=n.parentElement;return n}var Td=5,ns=200,_l="touchstart mousedown",kr="touchmove mousemove",Pr="touchend touchcancel mouseup click";function Ld(e,t,n){var i=qt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],m=[],v=[],b,S,y;function w(){A(),O(),k()}function C(){o(Yt,L),o(Yt,w),o(rn,k),s(document,_l+" keydown",function(R){y=R.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,Wl,!!y)})}function L(R){var x=La.concat("style");Fn(u),kn(l,m),kn(b,v),Ln([b,S],x),Ln(l,R?x:["style",lo])}function k(){kn(l,m),kn(b,v),m=D(Mr),v=D(ts),Tn(l,m),Tn(b,v),lt(l,gn,n.label),lt(l,Ca,n.labelledby)}function A(){b=P("."+ts),S=xo(b,"."+gd),Ji(b&&S,"A track/list element is missing."),Go(u,ol(S,"."+fr+":not(."+Rl+")")),di({arrows:Ia,pagination:vr,prev:El,next:Ml,bar:yd,toggle:vd},function(R,x){c[x]=P("."+R)}),ro(c,{root:l,track:b,list:S,slides:u})}function O(){var R=l.id||sd(bo),x=n.role;l.id=R,b.id=b.id||R+"-track",S.id=S.id||R+"-list",!bn(l,Pn)&&l.tagName!=="SECTION"&&x&<(l,Pn,x),lt(l,lo,d.carousel),lt(S,Pn,"presentation")}function P(R){var x=sl(l,R);return x&&Cd(x,"."+Mr)===l?x:void 0}function D(R){return[R+"--"+n.type,R+"--"+n.direction,n.drag&&R+"--draggable",n.isNavigation&&R+"--nav",R===Mr&&pi]}return ro(c,{setup:w,mount:C,destroy:L})}var Ri="slide",Bi="loop",So="fade";function Id(e,t,n,i){var o=qt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,v=m.isNavigation,b=m.updateOnMove,S=m.i18n,y=m.pagination,w=m.slideFocus,C=c.Direction.resolve,L=bn(i,"style"),k=bn(i,gn),A=n>-1,O=xo(i,"."+hd),P;function D(){A||(i.id=u.id+"-slide"+ya(t+1),lt(i,Pn,y?"tabpanel":"group"),lt(i,lo,S.slide),lt(i,gn,k||ea(S.slideLabel,[t+1,e.length]))),R()}function R(){d(i,"click",jt(l,va,H)),d(i,"keydown",jt(l,Sl,H)),s([zi,$l,gi],I),s(ba,U),b&&s(_n,h)}function x(){P=!0,o.destroy(),kn(i,Sd),Ln(i,La),lt(i,"style",L),lt(i,gn,k||"")}function U(){var $=e.splides.map(function(M){var q=M.splide.Components.Slides.getAt(t);return q?q.slide.id:""}).join(" ");lt(i,gn,ea(S.slideX,(A?n:t)+1)),lt(i,wo,$),lt(i,Pn,w?"button":""),w&&Ln(i,lo)}function h(){P||I()}function I(){if(!P){var $=e.index;W(),V(),Mn(i,Pl,t===$-1),Mn(i,Al,t===$+1)}}function W(){var $=ae();$!==Ua(i,pi)&&(Mn(i,pi,$),lt(i,Ll,v&&$||""),l($?dl:ul,H))}function V(){var $=Z(),M=!$&&(!ae()||A);if(e.state.is([ji,ho])||lt(i,Il,M||""),lt(ha(i,m.focusableNodes||""),Ci,M?-1:""),w&<(i,Ci,M?-1:0),$!==Ua(i,na)&&(Mn(i,na,$),l($?pl:ml,H)),!$&&document.activeElement===i){var q=c.Slides.getAt(e.index);q&&rl(q.slide)}}function Y($,M,q){xn(q&&O||i,$,M)}function ae(){var $=e.index;return $===t||m.cloneStatus&&$===n}function Z(){if(e.is(So))return ae();var $=pn(c.Elements.track),M=pn(i),q=C("left",!0),B=C("right",!0);return er($[q])<=so(M[q])&&er(M[B])<=so($[B])}function G($,M){var q=sn($-t);return!A&&(m.rewind||e.is(Bi))&&(q=qn(q,e.length-q)),q<=M}var H={index:t,slideIndex:n,slide:i,container:O,isClone:A,mount:D,destroy:x,update:I,style:Y,isWithin:G};return H}function Rd(e,t,n){var i=qt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function v(){b(),o(Yt,S),o(Yt,b)}function b(){c.forEach(function(I,W){w(I,W,-1)})}function S(){P(function(I){I.destroy()}),Fn(m)}function y(){P(function(I){I.update()})}function w(I,W,V){var Y=Id(e,W,V,I);Y.mount(),m.push(Y),m.sort(function(ae,Z){return ae.index-Z.index})}function C(I){return I?D(function(W){return!W.isClone}):m}function L(I){var W=t.Controller,V=W.toIndex(I),Y=W.hasFocus()?1:n.perPage;return D(function(ae){return qo(ae.index,V,V+Y-1)})}function k(I){return D(I)[0]}function A(I,W){vn(I,function(V){if(Gn(V)&&(V=al(V)),il(V)){var Y=c[W];Y?ga(V,Y):vo(u,V),Tn(V,n.classes.slide),x(V,jt(s,Ii))}}),s(Yt)}function O(I){ui(D(I).map(function(W){return W.slide})),s(Yt)}function P(I,W){C(W).forEach(I)}function D(I){return m.filter(nl(I)?I:function(W){return Gn(I)?io(W.slide,I):ma(yo(I),W.index)})}function R(I,W,V){P(function(Y){Y.style(I,W,V)})}function x(I,W){var V=ha(I,"img"),Y=V.length;Y?V.forEach(function(ae){l(ae,"load error",function(){--Y||W()})}):W()}function U(I){return I?c.length:m.length}function h(){return m.length>n.perPage}return{mount:v,destroy:S,update:y,register:w,get:C,getIn:L,getAt:k,add:A,remove:O,forEach:P,filter:D,style:R,getLength:U,isEnough:h}}function Ed(e,t,n){var i=qt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,v=u.track,b=u.list,S=d.getAt,y=d.style,w,C,L;function k(){A(),s(window,"resize load",dd(jt(l,Ii))),o([rn,Yt],A),o(Ii,O)}function A(){w=n.direction===hr,xn(m,"maxWidth",ti(n.width)),xn(v,c("paddingLeft"),P(!1)),xn(v,c("paddingRight"),P(!0)),O(!0)}function O(H){var $=pn(m);(H||C.width!==$.width||C.height!==$.height)&&(xn(v,"height",D()),y(c("marginRight"),ti(n.gap)),y("width",x()),y("height",U(),!0),C=$,l(cr),L!==(L=G())&&(Mn(m,Fl,L),l(ld,L)))}function P(H){var $=n.padding,M=c(H?"right":"left");return $&&ti($[M]||(no($)?0:$))||"0px"}function D(){var H="";return w&&(H=R(),Ji(H,"height or heightRatio is missing."),H="calc("+H+" - "+P(!1)+" - "+P(!0)+")"),H}function R(){return ti(n.height||pn(b).width*n.heightRatio)}function x(){return n.autoWidth?null:ti(n.fixedWidth)||(w?"":h())}function U(){return ti(n.fixedHeight)||(w?n.autoHeight?null:h():R())}function h(){var H=ti(n.gap);return"calc((100%"+(H&&" + "+H)+")/"+(n.perPage||1)+(H&&" - "+H)+")"}function I(){return pn(b)[c("width")]}function W(H,$){var M=S(H||0);return M?pn(M.slide)[c("width")]+($?0:ae()):0}function V(H,$){var M=S(H);if(M){var q=pn(M.slide)[c("right")],B=pn(b)[c("left")];return sn(q-B)+($?0:ae())}return 0}function Y(H){return V(e.length-1)-V(0)+W(0,H)}function ae(){var H=S(0);return H&&parseFloat(xn(H.slide,c("marginRight")))||0}function Z(H){return parseFloat(xn(v,c("padding"+(H?"Right":"Left"))))||0}function G(){return e.is(So)||Y(!0)>I()}return{mount:k,resize:O,listSize:I,slideSize:W,sliderSize:Y,totalSize:V,getPadding:Z,isOverflow:G}}var Md=2;function kd(e,t,n){var i=qt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(Yt,v),o([rn,Ii],S),(u=C())&&(y(u),t.Layout.resize(!0))}function v(){b(),m()}function b(){ui(c),Fn(c),i.destroy()}function S(){var L=C();u!==L&&(u<L||!L)&&i.emit(Yt)}function y(L){var k=l.get().slice(),A=k.length;if(A){for(;k.length<L;)Go(k,k);Go(k.slice(-L),k.slice(0,L)).forEach(function(O,P){var D=P<L,R=w(O.slide,P);D?ga(R,k[0].slide):vo(s.list,R),Go(c,R),l.register(R,P-L+(D?0:A),O.index)})}}function w(L,k){var A=L.cloneNode(!0);return Tn(A,n.classes.clone),A.id=e.root.id+"-clone"+ya(k+1),A}function C(){var L=n.clones;if(!e.is(Bi))L=0;else if(fo(L)){var k=n[d("fixedWidth")]&&t.Layout.slideSize(0),A=k&&so(pn(s.track)[d("width")]/k);L=A||n[d("autoWidth")]&&e.length||n.perPage*Md}return L}return{mount:m,destroy:b}}function Pd(e,t,n){var i=qt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,v=d.listSize,b=d.sliderSize,S=t.Direction,y=S.resolve,w=S.orient,C=t.Elements,L=C.list,k=C.track,A;function O(){A=t.Transition,o([Yn,cr,rn,Yt],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),R(e.index),t.Slides.update())}function D(M,q,B,ee){M!==q&&H(M>B)&&(I(),x(h(Y(),M>B),!0)),l(ji),s(_n,q,B,M),A.start(q,function(){l(Li),s(zi,q,B,M),ee&&ee()})}function R(M){x(V(M,!0))}function x(M,q){if(!e.is(So)){var B=q?M:U(M);xn(L,"transform","translate"+y("X")+"("+B+"px)"),M!==B&&s($l)}}function U(M){if(e.is(Bi)){var q=W(M),B=q>t.Controller.getEnd(),ee=q<0;(ee||B)&&(M=h(M,B))}return M}function h(M,q){var B=M-G(q),ee=b();return M-=w(ee*(so(sn(B)/ee)||1))*(q?1:-1),M}function I(){x(Y(),!0),A.cancel()}function W(M){for(var q=t.Slides.get(),B=0,ee=1/0,_=0;_<q.length;_++){var ye=q[_].index,f=sn(V(ye,!0)-M);if(f<=ee)ee=f,B=ye;else break}return B}function V(M,q){var B=w(m(M-1)-Z(M));return q?ae(B):B}function Y(){var M=y("left");return pn(L)[M]-pn(k)[M]+w(u(!1))}function ae(M){return n.trimSpace&&e.is(Ri)&&(M=xi(M,0,w(b(!0)-v()))),M}function Z(M){var q=n.focus;return q==="center"?(v()-c(M,!0))/2:+q*c(M)||0}function G(M){return V(M?t.Controller.getEnd():0,!!n.trimSpace)}function H(M){var q=w(h(Y(),M));return M?q>=0:q<=L[y("scrollWidth")]-pn(k)[y("width")]}function $(M,q){q=fo(q)?Y():q;var B=M!==!0&&w(q)<w(G(!1)),ee=M!==!1&&w(q)>w(G(!0));return B||ee}return{mount:O,move:D,jump:R,translate:x,shift:h,cancel:I,toIndex:W,toPosition:V,getPosition:Y,getLimit:G,exceededLimit:$,reposition:P}}function Ad(e,t,n){var i=qt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,m=t.Slides,v=m.isEnough,b=m.getLength,S=n.omitEnd,y=e.is(Bi),w=e.is(Ri),C=jt(Y,!1),L=jt(Y,!0),k=n.start||0,A,O=k,P,D,R;function x(){U(),o([rn,Yt,tr],U),o(cr,h)}function U(){P=b(!0),D=n.perMove,R=n.perPage,A=H();var f=xi(k,0,S?A:P-1);f!==k&&(k=f,l.reposition())}function h(){A!==H()&&s(tr)}function I(f,ve,K){if(!ye()){var le=V(f),$e=G(le);$e>-1&&(ve||$e!==k)&&(B($e),l.move(le,$e,O,K))}}function W(f,ve,K,le){t.Scroll.scroll(f,ve,K,function(){var $e=G(l.toIndex(d()));B(S?qn($e,A):$e),le&&le()})}function V(f){var ve=k;if(Gn(f)){var K=f.match(/([+\-<>])(\d+)?/)||[],le=K[1],$e=K[2];le==="+"||le==="-"?ve=ae(k+ +(""+le+(+$e||1)),k):le===">"?ve=$e?$(+$e):C(!0):le==="<"&&(ve=L(!0))}else ve=y?f:xi(f,0,A);return ve}function Y(f,ve){var K=D||(_()?1:R),le=ae(k+K*(f?-1:1),k,!(D||_()));return le===-1&&w&&!ll(d(),c(!f),1)?f?0:A:ve?le:G(le)}function ae(f,ve,K){if(v()||_()){var le=Z(f);le!==f&&(ve=f,f=le,K=!1),f<0||f>A?!D&&(qo(0,f,ve,!0)||qo(A,ve,f,!0))?f=$(M(f)):y?f=K?f<0?-(P%R||R):P:f:n.rewind?f=f<0?A:0:f=-1:K&&f!==ve&&(f=$(M(ve)+(f<ve?-1:1)))}else f=-1;return f}function Z(f){if(w&&n.trimSpace==="move"&&f!==k)for(var ve=d();ve===u(f,!0)&&qo(f,0,e.length-1,!n.rewind);)f<k?--f:++f;return f}function G(f){return y?(f+P)%P||0:f}function H(){for(var f=P-(_()||y&&D?1:R);S&&f-- >0;)if(u(P-1,!0)!==u(f,!0)){f++;break}return xi(f,0,P-1)}function $(f){return xi(_()?f:R*f,0,A)}function M(f){return _()?qn(f,A):er((f>=A?P-1:f)/R)}function q(f){var ve=l.toIndex(f);return w?xi(ve,0,A):ve}function B(f){f!==k&&(O=k,k=f)}function ee(f){return f?O:k}function _(){return!fo(n.focus)||n.isNavigation}function ye(){return e.state.is([ji,ho])&&!!n.waitForTransition}return{mount:x,go:I,scroll:W,getNext:C,getPrev:L,getAdjacent:Y,getEnd:H,setIndex:B,getIndex:ee,toIndex:$,toPage:M,toDest:q,hasFocus:_,isBusy:ye}}var Wd="http://www.w3.org/2000/svg",Fd="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",Ro=40;function _d(e,t,n){var i=qt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,v=u.arrows,b=u.track,S=v,y=u.prev,w=u.next,C,L,k={};function A(){P(),o(rn,O)}function O(){D(),A()}function P(){var W=n.arrows;W&&!(y&&w)&&U(),y&&w&&(ro(k,{prev:y,next:w}),ao(S,W?"":"none"),Tn(S,L=Ia+"--"+n.direction),W&&(R(),I(),lt([y,w],wo,b.id),l(yl,y,w)))}function D(){i.destroy(),kn(S,L),C?(ui(v?[y,w]:S),y=w=null):Ln([y,w],La)}function R(){o([Yn,zi,Yt,gi,tr],I),s(w,"click",jt(x,">")),s(y,"click",jt(x,"<"))}function x(W){m.go(W,!0)}function U(){S=v||$i("div",d.arrows),y=h(!0),w=h(!1),C=!0,vo(S,[y,w]),!v&&ga(S,b)}function h(W){var V='<button class="'+d.arrow+" "+(W?d.prev:d.next)+'" type="button"><svg xmlns="'+Wd+'" viewBox="0 0 '+Ro+" "+Ro+'" width="'+Ro+'" height="'+Ro+'" focusable="false"><path d="'+(n.arrowPath||Fd)+'" />';return al(V)}function I(){if(y&&w){var W=e.index,V=m.getPrev(),Y=m.getNext(),ae=V>-1&&W<V?c.last:c.prev,Z=Y>-1&&W>Y?c.first:c.next;y.disabled=V<0,w.disabled=Y<0,lt(y,gn,ae),lt(w,gn,Z),l(vl,y,w,V,Y)}}return{arrows:k,mount:A,destroy:D,update:I}}var Hd=fa+"-interval";function Nd(e,t,n){var i=qt(e),o=i.on,s=i.bind,l=i.emit,d=ur(n.interval,e.go.bind(e,">"),R),c=d.isPaused,u=t.Elements,m=t.Elements,v=m.root,b=m.toggle,S=n.autoplay,y,w,C=S==="pause";function L(){S&&(k(),b&<(b,wo,u.track.id),C||A(),D())}function k(){n.pauseOnHover&&s(v,"mouseenter mouseleave",function(U){y=U.type==="mouseenter",P()}),n.pauseOnFocus&&s(v,"focusin focusout",function(U){w=U.type==="focusin",P()}),b&&s(b,"click",function(){C?A():O(!0)}),o([_n,dr,Yt],d.rewind),o(_n,x)}function A(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),w=y=C=!1,D(),l(wa))}function O(U){U===void 0&&(U=!0),C=!!U,D(),c()||(d.pause(),l(Sa))}function P(){C||(y||w?O(!1):A())}function D(){b&&(Mn(b,pi,!C),lt(b,gn,n.i18n[C?"play":"pause"]))}function R(U){var h=u.bar;h&&xn(h,"width",U*100+"%"),l(wl,U)}function x(U){var h=t.Slides.getAt(U);d.set(h&&+bn(h.slide,Hd)||n.interval)}return{mount:L,destroy:d.cancel,play:A,pause:O,isPaused:c}}function Od(e,t,n){var i=qt(e),o=i.on;function s(){n.cover&&(o($a,jt(d,!0)),o([Yn,rn,Yt],jt(l,!0)))}function l(c){t.Slides.forEach(function(u){var m=xo(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),ao(u,c?"none":"")}return{mount:s,destroy:jt(l,!1)}}var jd=10,zd=600,Bd=.6,Dd=1.5,Vd=800;function Gd(e,t,n){var i=qt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,v=d.translate,b=e.is(Ri),S,y,w=1;function C(){o(_n,O),o([rn,Yt],P)}function L(R,x,U,h,I){var W=c();if(O(),U&&(!b||!m())){var V=t.Layout.sliderSize(),Y=Qr(R)*V*er(sn(R)/V)||0;R=d.toPosition(t.Controller.toDest(R%V))+Y}var ae=ll(W,R,1);w=1,x=ae?0:x||Qo(sn(R-W)/Dd,Vd),y=h,S=ur(x,k,jt(A,W,R,I),1),l(ho),s(dr),S.start()}function k(){l(Li),y&&y(),s(gi)}function A(R,x,U,h){var I=c(),W=R+(x-R)*D(h),V=(W-I)*w;v(I+V),b&&!U&&m()&&(w*=Bd,sn(V)<jd&&L(u(m(!0)),zd,!1,y,!0))}function O(){S&&S.cancel()}function P(){S&&!S.isPaused()&&(O(),k())}function D(R){var x=n.easingFunc;return x?x(R):1-Math.pow(1-R,4)}return{mount:C,destroy:O,scroll:L,cancel:P}}var bi={passive:!1,capture:!0};function qd(e,t,n){var i=qt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,v=t.Controller,b=t.Elements.track,S=t.Media.reduce,y=t.Direction,w=y.resolve,C=y.orient,L=u.getPosition,k=u.exceededLimit,A,O,P,D,R,x=!1,U,h,I;function W(){l(b,kr,Jr,bi),l(b,Pr,Jr,bi),l(b,_l,Y,bi),l(b,"click",G,{capture:!0}),l(b,"dragstart",En),o([Yn,rn],V)}function V(){var X=n.drag;fe(!X),D=X==="free"}function Y(X){if(U=!1,!h){var be=$e(X);le(X.target)&&(be||!X.button)&&(v.isBusy()?En(X,!0):(I=be?b:window,R=c.is([ji,ho]),P=null,l(I,kr,ae,bi),l(I,Pr,Z,bi),u.cancel(),m.cancel(),H(X)))}}function ae(X){if(c.is(Vo)||(c.set(Vo),s(gl)),X.cancelable)if(R){u.translate(A+K(_(X)));var be=ye(X)>ns,xe=x!==(x=k());(be||xe)&&H(X),U=!0,s(hl),En(X)}else q(X)&&(R=M(X),En(X))}function Z(X){c.is(Vo)&&(c.set(Li),s(fl)),R&&($(X),En(X)),d(I,kr,ae),d(I,Pr,Z),R=!1}function G(X){!h&&U&&En(X,!0)}function H(X){P=O,O=X,A=L()}function $(X){var be=B(X),xe=ee(be),pe=n.rewind&&n.rewindByDrag;S(!1),D?v.scroll(xe,0,n.snap):e.is(So)?v.go(C(Qr(be))<0?pe?"<":"-":pe?">":"+"):e.is(Ri)&&x&&pe?v.go(k(!0)?">":"<"):v.go(v.toDest(xe),!0),S(!0)}function M(X){var be=n.dragMinThreshold,xe=no(be),pe=xe&&be.mouse||0,se=(xe?be.touch:+be)||10;return sn(_(X))>($e(X)?se:pe)}function q(X){return sn(_(X))>sn(_(X,!0))}function B(X){if(e.is(Bi)||!x){var be=ye(X);if(be&&be<ns)return _(X)/be}return 0}function ee(X){return L()+Qr(X)*qn(sn(X)*(n.flickPower||600),D?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function _(X,be){return ve(X,be)-ve(f(X),be)}function ye(X){return Zr(X)-Zr(f(X))}function f(X){return O===X&&P||O}function ve(X,be){return($e(X)?X.changedTouches[0]:X)["page"+w(be?"Y":"X")]}function K(X){return X/(x&&e.is(Ri)?Td:1)}function le(X){var be=n.noDrag;return!io(X,"."+kl+", ."+yr)&&(!be||!io(X,be))}function $e(X){return typeof TouchEvent<"u"&&X instanceof TouchEvent}function oe(){return R}function fe(X){h=X}return{mount:W,disable:fe,isDragging:oe}}var Kd={Spacebar:" ",Right:gr,Left:mr,Up:Cl,Down:Tl};function Ra(e){return e=Gn(e)?e:e.key,Kd[e]||e}var is="keydown";function Ud(e,t,n){var i=qt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function v(){b(),o(rn,S),o(rn,b),o(_n,w)}function b(){var L=n.keyboard;L&&(u=L==="global"?window:d,s(u,is,C))}function S(){l(u,is)}function y(L){m=L}function w(){var L=m;m=!0,tl(function(){m=L})}function C(L){if(!m){var k=Ra(L);k===c(mr)?e.go("<"):k===c(gr)&&e.go(">")}}return{mount:v,destroy:S,disable:y}}var Zi=fa+"-lazy",Ko=Zi+"-srcset",Xd="["+Zi+"], ["+Ko+"]";function Yd(e,t,n){var i=qt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[zi,gi],m=[];function v(){n.lazyLoad&&(b(),o(Yt,b))}function b(){Fn(m),S(),c?L():(s(u),o(u,y),y())}function S(){t.Slides.forEach(function(k){ha(k.slide,Xd).forEach(function(A){var O=bn(A,Zi),P=bn(A,Ko);if(O!==A.src||P!==A.srcset){var D=n.classes.spinner,R=A.parentElement,x=xo(R,"."+D)||$i("span",D,R);m.push([A,k,x]),A.src||ao(A,"none")}})})}function y(){m=m.filter(function(k){var A=n.perPage*((n.preloadPages||1)+1)-1;return k[1].isWithin(e.index,A)?w(k):!0}),m.length||s(u)}function w(k){var A=k[0];Tn(k[1].slide,ia),l(A,"load error",jt(C,k)),lt(A,"src",bn(A,Zi)),lt(A,"srcset",bn(A,Ko)),Ln(A,Zi),Ln(A,Ko)}function C(k,A){var O=k[0],P=k[1];kn(P.slide,ia),A.type!=="error"&&(ui(k[2]),ao(O,""),d($a,O,P),d(Ii)),c&&L()}function L(){m.length&&w(m.shift())}return{mount:v,destroy:jt(Fn,m),check:y}}function Jd(e,t,n){var i=qt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,v=u.getIndex,b=u.go,S=t.Direction.resolve,y=c.pagination,w=[],C,L;function k(){A(),o([rn,Yt,tr],k);var h=n.pagination;y&&ao(y,h?"":"none"),h&&(o([_n,dr,gi],U),O(),U(),s(xl,{list:C,items:w},x(e.index)))}function A(){C&&(ui(y?Xn(C.children):C),kn(C,L),Fn(w),C=null),i.destroy()}function O(){var h=e.length,I=n.classes,W=n.i18n,V=n.perPage,Y=m()?u.getEnd()+1:so(h/V);C=y||$i("ul",I.pagination,c.track.parentElement),Tn(C,L=vr+"--"+R()),lt(C,Pn,"tablist"),lt(C,gn,W.select),lt(C,Ta,R()===hr?"vertical":"");for(var ae=0;ae<Y;ae++){var Z=$i("li",null,C),G=$i("button",{class:I.page,type:"button"},Z),H=d.getIn(ae).map(function(M){return M.slide.id}),$=!m()&&V>1?W.pageX:W.slideX;l(G,"click",jt(P,ae)),n.paginationKeyboard&&l(G,"keydown",jt(D,ae)),lt(Z,Pn,"presentation"),lt(G,Pn,"tab"),lt(G,wo,H.join(" ")),lt(G,gn,ea($,ae+1)),lt(G,Ci,-1),w.push({li:Z,button:G,page:ae})}}function P(h){b(">"+h,!0)}function D(h,I){var W=w.length,V=Ra(I),Y=R(),ae=-1;V===S(gr,!1,Y)?ae=++h%W:V===S(mr,!1,Y)?ae=(--h+W)%W:V==="Home"?ae=0:V==="End"&&(ae=W-1);var Z=w[ae];Z&&(rl(Z.button),b(">"+ae),En(I,!0))}function R(){return n.paginationDirection||n.direction}function x(h){return w[u.toPage(h)]}function U(){var h=x(v(!0)),I=x(v());if(h){var W=h.button;kn(W,pi),Ln(W,Ja),lt(W,Ci,-1)}if(I){var V=I.button;Tn(V,pi),lt(V,Ja,!0),lt(V,Ci,"")}s(bl,{list:C,items:w},h,I)}return{items:w,mount:k,destroy:A,getAt:x,update:U}}var Zd=[" ","Enter"];function Qd(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(y){y.isParent||(u(e,y.splide),u(y.splide,e))}),i&&m()}function d(){s.forEach(function(y){y.destroy()}),Fn(s)}function c(){d(),l()}function u(y,w){var C=qt(y);C.on(_n,function(L,k,A){w.go(w.is(Bi)?A:L)}),s.push(C)}function m(){var y=qt(e),w=y.on;w(va,b),w(Sl,S),w([Yn,rn],v),s.push(y),y.emit(ba,e.splides)}function v(){lt(t.Elements.list,Ta,n.direction===hr?"vertical":"")}function b(y){e.go(y.index)}function S(y,w){ma(Zd,Ra(w))&&(b(y),En(w))}return{setup:jt(t.Media.set,{slideFocus:fo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function eu(e,t,n){var i=qt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,bi)}function d(u){if(u.cancelable){var m=u.deltaY,v=m<0,b=Zr(u),S=n.wheelMinThreshold||0,y=n.wheelSleep||0;sn(m)>S&&b-s>y&&(e.go(v?"<":">"),s=b),c(v)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(ji)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var tu=90;function nu(e,t,n){var i=qt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=$i("span",bd),c=ur(tu,jt(m,!1));function u(){l&&(b(!t.Autoplay.isPaused()),lt(s,es,!0),d.textContent="…",o(wa,jt(b,!0)),o(Sa,jt(b,!1)),o([zi,gi],jt(m,!0)))}function m(S){lt(s,Qa,S),S?(vo(s,d),c.start()):(ui(d),c.cancel())}function v(){Ln(s,[Za,es,Qa]),ui(d)}function b(S){l&<(s,Za,S?"off":"polite")}return{mount:u,disable:b,destroy:v}}var iu=Object.freeze({__proto__:null,Media:ud,Direction:pd,Elements:Ld,Slides:Rd,Layout:Ed,Clones:kd,Move:Pd,Controller:Ad,Arrows:_d,Autoplay:Nd,Cover:Od,Scroll:Gd,Drag:qd,Keyboard:Ud,LazyLoad:Yd,Pagination:Jd,Sync:Qd,Wheel:eu,Live:nu}),ou={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"},ru={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:$d,i18n:ou,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function au(e,t,n){var i=t.Slides;function o(){qt(e).on([Yn,Yt],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),tl(c)}return{mount:o,start:l,cancel:Jr}}function su(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=jt(xn,l,"transition"),c;function u(){qt(e).bind(l,"transitionend",function(S){S.target===l&&c&&(v(),c())})}function m(S,y){var w=i.toPosition(S,!0),C=i.getPosition(),L=b(S);sn(w-C)>=1&&L>=1?n.useScroll?s.scroll(w,L,!1,y):(d("transform "+L+"ms "+n.easing),i.translate(w,!0),c=y):(i.jump(S),y())}function v(){d(""),s.cancel()}function b(S){var y=n.rewindSpeed;if(e.is(Ri)&&y){var w=o.getIndex(!0),C=o.getEnd();if(w===0&&S>=C||w>=C&&S===0)return y}return n.speed}return{mount:u,start:m,cancel:v}}var lu=(function(){function e(n,i){this.event=qt(),this.Components={},this.state=cd(Si),this.splides=[],this._o={},this._E={};var o=Gn(n)?sl(document,n):n;Ji(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,gn)||"",labelledby:bn(o,Ca)||""},ru,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,fa)))}catch{Ji(!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;Ji(l.is([Si,Zo]),"Already mounted!"),l.set(Si),this._C=d,this._T=o||this._T||(this.is(So)?au:su),this._E=i||this._E;var c=ro({},iu,this._E,{Transition:this._T});return di(c,function(u,m){var v=u(s,d,s._o);d[m]=v,v.setup&&v.setup()}),di(d,function(u){u.mount&&u.mount()}),this.emit(Yn),Tn(this.root,wd),l.set(Li),this.emit(ta),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Li)&&(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(Xn(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(Yt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Si)?qt(this).on(ta,this.destroy.bind(this,i)):(di(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(xa),o.destroy(),i&&Fn(this.splides),s.set(Zo)),this},od(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})(),Ea=lu;Ea.defaults={};Ea.STATES=ad;var os=[[Yn,"onMounted"],[ta,"onReady"],[_n,"onMove"],[zi,"onMoved"],[va,"onClick"],[dl,"onActive"],[ul,"onInactive"],[pl,"onVisible"],[ml,"onHidden"],[Yt,"onRefresh"],[rn,"onUpdated"],[Ii,"onResize"],[cr,"onResized"],[gl,"onDrag"],[hl,"onDragging"],[fl,"onDragged"],[dr,"onScroll"],[gi,"onScrolled"],[xa,"onDestroy"],[yl,"onArrowsMounted"],[vl,"onArrowsUpdated"],[xl,"onPaginationMounted"],[bl,"onPaginationUpdated"],[ba,"onNavigationMounted"],[wa,"onAutoplayPlay"],[wl,"onAutoplayPlaying"],[Sa,"onAutoplayPause"],[$a,"onLazyLoadLoaded"]];function Ma(...e){return e.filter(Boolean).join(" ")}function nr(e){return e!==null&&typeof e=="object"}function oa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!oa(n,t[i]));if(nr(e)&&nr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!oa(e[o],t[o]))}return e===t}function cu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function du(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 ra(e,t){const n=e;return du(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():nr(i)?n[o]=ra(nr(n[o])?n[o]:{},i):n[o]=i}),n}var uu=({children:e,className:t,...n})=>a.createElement("div",{className:Ma("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),ka=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Ea(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=ra({},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&&!oa(this.options,e)&&(this.splide.options=e,this.options=ra({},e));const t=this.getSlides();cu(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){os.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:Ma("splide",e),ref:this.splideRef,...this.omit(o,["options",...os.map(s=>s[1])])},n?a.createElement(uu,null,i):i)}},Pa=({children:e,className:t,...n})=>a.createElement("li",{className:Ma("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),pt=require("classnames"),v=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),mi=require("react-dom");function fc(e){return e.type==="object"&&e.version===1}const yc="ControlSlider-module__wrapper___sHEkd",vc="ControlSlider-module__hoverArrow___A-dOH",xc="ControlSlider-module__sliderItem___QQSkR",bc="ControlSlider-module__sliderImage___9hRl-",wc="ControlSlider-module__arrow___05ghY",Sc="ControlSlider-module__arrowVertical___tBfVN",$c="ControlSlider-module__nextArrow___-30Yc",Cc="ControlSlider-module__arrowInner___aEra3",Tc="ControlSlider-module__arrowIcon___S4ztF",Lc="ControlSlider-module__arrowImg___2dwJW",Ic="ControlSlider-module__mirror___brd6U",Rc="ControlSlider-module__pagination___bicLF",Ec="ControlSlider-module__paginationInner___bT-P-",Mc="ControlSlider-module__paginationVertical___zYqKw",kc="ControlSlider-module__paginationItem___nTRbk",Pc="ControlSlider-module__dot___p1Qun",Ac="ControlSlider-module__activeDot___LHFaj",Fc="ControlSlider-module__paginationInsideBottom___R3FWn",Wc="ControlSlider-module__paginationInsideTop___V-qb-",_c="ControlSlider-module__paginationOutsideBottom___14w8D",Hc="ControlSlider-module__paginationOutsideTop___SCLqB",Nc="ControlSlider-module__paginationInsideLeft___yOBRZ",Oc="ControlSlider-module__paginationInsideRight___Rtt3o",jc="ControlSlider-module__paginationOutsideLeft___lahaw",Bc="ControlSlider-module__paginationOutsideRight___EtuQa",zc="ControlSlider-module__imgWrapper___UjEgB",Dc="ControlSlider-module__captionBlock___dJ6-j",Vc="ControlSlider-module__captionTextWrapper___HFlpf",Gc="ControlSlider-module__captionText___uGBVc",qc="ControlSlider-module__active___WZK4G",Kc="ControlSlider-module__withPointerEvents___t-18M",Uc="ControlSlider-module__topLeftAlignment___zjnGM",Xc="ControlSlider-module__topCenterAlignment___gD1xW",Yc="ControlSlider-module__topRightAlignment___NMapS",Jc="ControlSlider-module__middleLeftAlignment___OnUrY",Zc="ControlSlider-module__middleCenterAlignment___Tdkl0",Qc="ControlSlider-module__middleRightAlignment___wEbfX",ed="ControlSlider-module__bottomLeftAlignment___cTP2-",td="ControlSlider-module__bottomCenterAlignment___c54fB",nd="ControlSlider-module__bottomRightAlignment___kEwrz",id="ControlSlider-module__clickOverlay___DZA28",od="ControlSlider-module__contain___pLyq7",rd="ControlSlider-module__cover___KdDat",Xe={wrapper:yc,hoverArrow:vc,sliderItem:xc,sliderImage:bc,arrow:wc,arrowVertical:Sc,nextArrow:$c,arrowInner:Cc,arrowIcon:Tc,arrowImg:Lc,mirror:Ic,pagination:Rc,paginationInner:Ec,paginationVertical:Mc,paginationItem:kc,dot:Pc,activeDot:Ac,paginationInsideBottom:Fc,paginationInsideTop:Wc,paginationOutsideBottom:_c,paginationOutsideTop:Hc,paginationInsideLeft:Nc,paginationInsideRight:Oc,paginationOutsideLeft:jc,paginationOutsideRight:Bc,imgWrapper:zc,captionBlock:Dc,captionTextWrapper:Vc,captionText:Gc,active:qc,withPointerEvents:Kc,topLeftAlignment:Uc,topCenterAlignment:Xc,topRightAlignment:Yc,middleLeftAlignment:Jc,middleCenterAlignment:Zc,middleRightAlignment:Qc,bottomLeftAlignment:ed,bottomCenterAlignment:td,bottomRightAlignment:nd,clickOverlay:id,contain:od,cover:rd};function ad(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 sd(e,t,n){return t&&ad(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ka="(prefers-reduced-motion: reduce)",Si=1,ld=2,Li=3,ji=4,ho=5,Vo=6,Jo=7,cd={CREATED:Si,MOUNTED:ld,IDLE:Li,MOVING:ji,SCROLLING:ho,DRAGGING:Vo,DESTROYED:Jo};function Wn(e){e.length=0}function Xn(e,t,n){return Array.prototype.slice.call(e,t,n)}function jt(e){return e.bind.apply(e,[null].concat(Xn(arguments,1)))}var ol=setTimeout,Qr=function(){};function Ua(e){return requestAnimationFrame(e)}function sr(e,t){return typeof t===e}function no(e){return!ga(e)&&sr("object",e)}var ma=Array.isArray,rl=jt(sr,"function"),Gn=jt(sr,"string"),fo=jt(sr,"undefined");function ga(e){return e===null}function al(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function yo(e){return ma(e)?e:[e]}function vn(e,t){yo(e).forEach(t)}function ha(e,t){return e.indexOf(t)>-1}function Go(e,t){return e.push.apply(e,yo(t)),e}function Mn(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,Gn(t)?t.split(" "):t,!0)}function vo(e,t){vn(t,e.appendChild.bind(e))}function fa(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function io(e,t){return al(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function sl(e,t){var n=e?Xn(e.children):[];return t?n.filter(function(i){return io(i,t)}):n}function xo(e,t){return t?sl(e,t)[0]:e.firstElementChild}var oo=Object.keys;function di(e,t,n){return e&&(n?oo(e).reverse():oo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ro(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){e[i]=t[i]})}),e}function Bn(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){ma(n)?e[i]=n.slice():no(n)?e[i]=Bn({},no(e[i])?e[i]:{},n):e[i]=n})}),e}function Xa(e,t){vn(t||oo(e),function(n){delete e[n]})}function Ln(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function lt(e,t,n){no(t)?di(t,function(i,o){lt(e,o,i)}):vn(e,function(i){ga(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function $i(e,t,n){var i=document.createElement(e);return t&&(Gn(t)?Tn(i,t):lt(i,t)),n&&vo(n,i),i}function xn(e,t,n){if(fo(n))return getComputedStyle(e)[t];ga(n)||(e.style[t]=""+n)}function ao(e,t){xn(e,"display",t)}function ll(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function Ya(e,t){return e&&e.classList.contains(t)}function gn(e){return e.getBoundingClientRect()}function ui(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function cl(e){return xo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function dl(e,t){return e&&e.querySelector(t)}function ya(e,t){return t?Xn(e.querySelectorAll(t)):[]}function kn(e,t){Mn(e,t,!1)}function ea(e){return e.timeStamp}function ti(e){return Gn(e)?e:e?e+"px":""}var bo="splide",va="data-"+bo;function Ji(e,t){if(!e)throw new Error("["+bo+"] "+(t||""))}var qn=Math.min,Zo=Math.max,Qo=Math.floor,so=Math.ceil,sn=Math.abs;function ul(e,t,n){return sn(e-t)<n}function qo(e,t,n,i){var o=qn(t,n),l=Zo(t,n);return i?o<e&&e<l:o<=e&&e<=l}function xi(e,t,n){var i=qn(t,n),o=Zo(t,n);return qn(Zo(i,e),o)}function ta(e){return+(e>0)-+(e<0)}function na(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function xa(e){return e<10?"0"+e:""+e}var Ja={};function dd(e){return""+e+xa(Ja[e]=(Ja[e]||0)+1)}function pl(){var e=[];function t(s,d,c,u){o(s,d,function(m,b,S){var C="addEventListener"in m,y=C?m.removeEventListener.bind(m,b,c,u):m.removeListener.bind(m,c);C?m.addEventListener(b,c,u):m.addListener(c),e.push([m,b,S,c,y])})}function n(s,d,c){o(s,d,function(u,m,b){e=e.filter(function(S){return S[0]===u&&S[1]===m&&S[2]===b&&(!c||S[3]===c)?(S[4](),!1):!0})})}function i(s,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){vn(s,function(u){u&&vn(d,function(m){m.split(" ").forEach(function(b){var S=b.split(".");c(u,S[0],S[1])})})})}function l(){e.forEach(function(s){s[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Yn="mounted",ia="ready",_n="move",Bi="moved",ba="click",ml="active",gl="inactive",hl="visible",fl="hidden",Yt="refresh",rn="updated",Ii="resize",lr="resized",yl="drag",vl="dragging",xl="dragged",cr="scroll",gi="scrolled",ud="overflow",wa="destroy",bl="arrows:mounted",wl="arrows:updated",Sl="pagination:mounted",$l="pagination:updated",Sa="navigation:mounted",$a="autoplay:play",Cl="autoplay:playing",Ca="autoplay:pause",Ta="lazyload:loaded",Tl="sk",Ll="sh",er="ei";function qt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=pl();function i(l,s){n.bind(t,yo(l).join(" "),function(d){s.apply(s,ma(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Xn(arguments,1))}return e&&e.event.on(wa,n.destroy),ro(n,{bus:t,on:i,off:jt(n.unbind,t),emit:o})}function dr(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function m(){if(!c){if(s=e?qn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return S();d=Ua(m)}}function b(T){T||y(),l=o()-(T?s*e:0),c=!1,d=Ua(m)}function S(){c=!0}function C(){l=o(),s=0,n&&n(s)}function y(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function w(T){e=T}function $(){return c}return{start:b,rewind:C,pause:S,cancel:y,set:w,isPaused:$}}function pd(e){var t=e;function n(o){t=o}function i(o){return ha(yo(o),t)}return{set:n,is:i}}function md(e,t){var n=dr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function gd(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=pl(),d=[];function c(){var y=n.mediaQuery==="min";oo(o).sort(function(w,$){return y?+w-+$:+$-+w}).forEach(function(w){m(o[w],"("+(y?"min":"max")+"-width:"+w+"px)")}),m(l,Ka),b()}function u(y){y&&s.destroy()}function m(y,w){var $=matchMedia(w);s.bind($,"change",b),d.push([y,$])}function b(){var y=i.is(Jo),w=n.direction,$=d.reduce(function(T,R){return Bn(T,R[1].matches?R[0]:{})},{});Xa(n),C($),n.destroy?e.destroy(n.destroy==="completely"):y?(u(!0),e.mount()):w!==n.direction&&e.refresh()}function S(y){matchMedia(Ka).matches&&(y?Bn(n,l):Xa(n,oo(l)))}function C(y,w,$){Bn(n,y),w&&Bn(Object.getPrototypeOf(n),y),($||!i.is(Si))&&e.emit(rn,n)}return{setup:c,destroy:u,reduce:S,set:C}}var ur="Arrow",pr=ur+"Left",mr=ur+"Right",Il=ur+"Up",Rl=ur+"Down",Za="rtl",gr="ttb",Rr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Il,mr],ArrowRight:[Rl,pr]};function hd(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===Za&&!s?1:d===gr?0:-1;return Rr[l]&&Rr[l][c]||l.replace(/width|left|right/i,function(u,m){var b=Rr[u.toLowerCase()][c]||u;return m>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(l){return l*(n.direction===Za?1:-1)}return{resolve:i,orient:o}}var Pn="role",Ci="tabindex",fd="disabled",wn="aria-",wo=wn+"controls",El=wn+"current",Qa=wn+"selected",fn=wn+"label",La=wn+"labelledby",Ml=wn+"hidden",Ia=wn+"orientation",lo=wn+"roledescription",es=wn+"live",ts=wn+"busy",ns=wn+"atomic",Ra=[Pn,Ci,fd,wo,El,fn,La,Ml,Ia,lo],In=bo+"__",Jn="is-",Er=bo,is=In+"track",yd=In+"list",hr=In+"slide",kl=hr+"--clone",vd=hr+"__container",Ea=In+"arrows",fr=In+"arrow",Pl=fr+"--prev",Al=fr+"--next",yr=In+"pagination",Fl=yr+"__page",xd=In+"progress",bd=xd+"__bar",wd=In+"toggle",Sd=In+"spinner",$d=In+"sr",Cd=Jn+"initialized",pi=Jn+"active",Wl=Jn+"prev",_l=Jn+"next",oa=Jn+"visible",ra=Jn+"loading",Hl=Jn+"focus-in",Nl=Jn+"overflow",Td=[pi,oa,Wl,_l,ra,Hl,Nl],Ld={slide:hr,clone:kl,arrows:Ea,arrow:fr,prev:Pl,next:Al,pagination:yr,page:Fl,spinner:Sd};function Id(e,t){if(rl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!io(n,t);)n=n.parentElement;return n}var Rd=5,os=200,Ol="touchstart mousedown",Mr="touchmove mousemove",kr="touchend touchcancel mouseup click";function Ed(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],m=[],b=[],S,C,y;function w(){M(),H(),R()}function $(){o(Yt,T),o(Yt,w),o(rn,R),l(document,Ol+" keydown",function(P){y=P.type==="keydown"},{capture:!0}),l(s,"focusin",function(){Mn(s,Hl,!!y)})}function T(P){var x=Ra.concat("style");Wn(u),kn(s,m),kn(S,b),Ln([S,C],x),Ln(s,P?x:["style",lo])}function R(){kn(s,m),kn(S,b),m=V(Er),b=V(is),Tn(s,m),Tn(S,b),lt(s,fn,n.label),lt(s,La,n.labelledby)}function M(){S=F("."+is),C=xo(S,"."+yd),Ji(S&&C,"A track/list element is missing."),Go(u,sl(C,"."+hr+":not(."+kl+")")),di({arrows:Ea,pagination:yr,prev:Pl,next:Al,bar:bd,toggle:wd},function(P,x){c[x]=F("."+P)}),ro(c,{root:s,track:S,list:C,slides:u})}function H(){var P=s.id||dd(bo),x=n.role;s.id=P,S.id=S.id||P+"-track",C.id=C.id||P+"-list",!bn(s,Pn)&&s.tagName!=="SECTION"&&x&<(s,Pn,x),lt(s,lo,d.carousel),lt(C,Pn,"presentation")}function F(P){var x=dl(s,P);return x&&Id(x,"."+Er)===s?x:void 0}function V(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Er&&pi]}return ro(c,{setup:w,mount:$,destroy:T})}var Ri="slide",zi="loop",So="fade";function Md(e,t,n,i){var o=qt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,b=m.isNavigation,S=m.updateOnMove,C=m.i18n,y=m.pagination,w=m.slideFocus,$=c.Direction.resolve,T=bn(i,"style"),R=bn(i,fn),M=n>-1,H=xo(i,"."+vd),F;function V(){M||(i.id=u.id+"-slide"+xa(t+1),lt(i,Pn,y?"tabpanel":"group"),lt(i,lo,C.slide),lt(i,fn,R||na(C.slideLabel,[t+1,e.length]))),P()}function P(){d(i,"click",jt(s,ba,N)),d(i,"keydown",jt(s,Tl,N)),l([Bi,Ll,gi],E),l(Sa,U),S&&l(_n,h)}function x(){F=!0,o.destroy(),kn(i,Td),Ln(i,Ra),lt(i,"style",T),lt(i,fn,R||"")}function U(){var L=e.splides.map(function(k){var K=k.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");lt(i,fn,na(C.slideX,(M?n:t)+1)),lt(i,wo,L),lt(i,Pn,w?"button":""),w&&Ln(i,lo)}function h(){F||E()}function E(){if(!F){var L=e.index;A(),j(),Mn(i,Wl,t===L-1),Mn(i,_l,t===L+1)}}function A(){var L=ae();L!==Ya(i,pi)&&(Mn(i,pi,L),lt(i,El,b&&L||""),s(L?ml:gl,N))}function j(){var L=Z(),k=!L&&(!ae()||M);if(e.state.is([ji,ho])||lt(i,Ml,k||""),lt(ya(i,m.focusableNodes||""),Ci,k?-1:""),w&<(i,Ci,k?-1:0),L!==Ya(i,oa)&&(Mn(i,oa,L),s(L?hl:fl,N)),!L&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&ll(K.slide)}}function X(L,k,K){xn(K&&H||i,L,k)}function ae(){var L=e.index;return L===t||m.cloneStatus&&L===n}function Z(){if(e.is(So))return ae();var L=gn(c.Elements.track),k=gn(i),K=$("left",!0),z=$("right",!0);return Qo(L[K])<=so(k[K])&&Qo(k[z])<=so(L[z])}function q(L,k){var K=sn(L-t);return!M&&(m.rewind||e.is(zi))&&(K=qn(K,e.length-K)),K<=k}var N={index:t,slideIndex:n,slide:i,container:H,isClone:M,mount:V,destroy:x,update:E,style:X,isWithin:q};return N}function kd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function b(){S(),o(Yt,C),o(Yt,S)}function S(){c.forEach(function(E,A){w(E,A,-1)})}function C(){F(function(E){E.destroy()}),Wn(m)}function y(){F(function(E){E.update()})}function w(E,A,j){var X=Md(e,A,j,E);X.mount(),m.push(X),m.sort(function(ae,Z){return ae.index-Z.index})}function $(E){return E?V(function(A){return!A.isClone}):m}function T(E){var A=t.Controller,j=A.toIndex(E),X=A.hasFocus()?1:n.perPage;return V(function(ae){return qo(ae.index,j,j+X-1)})}function R(E){return V(E)[0]}function M(E,A){vn(E,function(j){if(Gn(j)&&(j=cl(j)),al(j)){var X=c[A];X?fa(j,X):vo(u,j),Tn(j,n.classes.slide),x(j,jt(l,Ii))}}),l(Yt)}function H(E){ui(V(E).map(function(A){return A.slide})),l(Yt)}function F(E,A){$(A).forEach(E)}function V(E){return m.filter(rl(E)?E:function(A){return Gn(E)?io(A.slide,E):ha(yo(E),A.index)})}function P(E,A,j){F(function(X){X.style(E,A,j)})}function x(E,A){var j=ya(E,"img"),X=j.length;X?j.forEach(function(ae){s(ae,"load error",function(){--X||A()})}):A()}function U(E){return E?c.length:m.length}function h(){return m.length>n.perPage}return{mount:b,destroy:C,update:y,register:w,get:$,getIn:T,getAt:R,add:M,remove:H,forEach:F,filter:V,style:P,getLength:U,isEnough:h}}function Pd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,b=u.track,S=u.list,C=d.getAt,y=d.style,w,$,T;function R(){M(),l(window,"resize load",md(jt(s,Ii))),o([rn,Yt],M),o(Ii,H)}function M(){w=n.direction===gr,xn(m,"maxWidth",ti(n.width)),xn(b,c("paddingLeft"),F(!1)),xn(b,c("paddingRight"),F(!0)),H(!0)}function H(N){var L=gn(m);(N||$.width!==L.width||$.height!==L.height)&&(xn(b,"height",V()),y(c("marginRight"),ti(n.gap)),y("width",x()),y("height",U(),!0),$=L,s(lr),T!==(T=q())&&(Mn(m,Nl,T),s(ud,T)))}function F(N){var L=n.padding,k=c(N?"right":"left");return L&&ti(L[k]||(no(L)?0:L))||"0px"}function V(){var N="";return w&&(N=P(),Ji(N,"height or heightRatio is missing."),N="calc("+N+" - "+F(!1)+" - "+F(!0)+")"),N}function P(){return ti(n.height||gn(S).width*n.heightRatio)}function x(){return n.autoWidth?null:ti(n.fixedWidth)||(w?"":h())}function U(){return ti(n.fixedHeight)||(w?n.autoHeight?null:h():P())}function h(){var N=ti(n.gap);return"calc((100%"+(N&&" + "+N)+")/"+(n.perPage||1)+(N&&" - "+N)+")"}function E(){return gn(S)[c("width")]}function A(N,L){var k=C(N||0);return k?gn(k.slide)[c("width")]+(L?0:ae()):0}function j(N,L){var k=C(N);if(k){var K=gn(k.slide)[c("right")],z=gn(S)[c("left")];return sn(K-z)+(L?0:ae())}return 0}function X(N){return j(e.length-1)-j(0)+A(0,N)}function ae(){var N=C(0);return N&&parseFloat(xn(N.slide,c("marginRight")))||0}function Z(N){return parseFloat(xn(b,c("padding"+(N?"Right":"Left"))))||0}function q(){return e.is(So)||X(!0)>E()}return{mount:R,resize:H,listSize:E,slideSize:A,sliderSize:X,totalSize:j,getPadding:Z,isOverflow:q}}var Ad=2;function Fd(e,t,n){var i=qt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(Yt,b),o([rn,Ii],C),(u=$())&&(y(u),t.Layout.resize(!0))}function b(){S(),m()}function S(){ui(c),Wn(c),i.destroy()}function C(){var T=$();u!==T&&(u<T||!T)&&i.emit(Yt)}function y(T){var R=s.get().slice(),M=R.length;if(M){for(;R.length<T;)Go(R,R);Go(R.slice(-T),R.slice(0,T)).forEach(function(H,F){var V=F<T,P=w(H.slide,F);V?fa(P,R[0].slide):vo(l.list,P),Go(c,P),s.register(P,F-T+(V?0:M),H.index)})}}function w(T,R){var M=T.cloneNode(!0);return Tn(M,n.classes.clone),M.id=e.root.id+"-clone"+xa(R+1),M}function $(){var T=n.clones;if(!e.is(zi))T=0;else if(fo(T)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),M=R&&so(gn(l.track)[d("width")]/R);T=M||n[d("autoWidth")]&&e.length||n.perPage*Ad}return T}return{mount:m,destroy:S}}function Wd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,b=d.listSize,S=d.sliderSize,C=t.Direction,y=C.resolve,w=C.orient,$=t.Elements,T=$.list,R=$.track,M;function H(){M=t.Transition,o([Yn,lr,rn,Yt],F)}function F(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function V(k,K,z,ne){k!==K&&N(k>z)&&(E(),x(h(X(),k>z),!0)),s(ji),l(_n,K,z,k),M.start(K,function(){s(Li),l(Bi,K,z,k),ne&&ne()})}function P(k){x(j(k,!0))}function x(k,K){if(!e.is(So)){var z=K?k:U(k);xn(T,"transform","translate"+y("X")+"("+z+"px)"),k!==z&&l(Ll)}}function U(k){if(e.is(zi)){var K=A(k),z=K>t.Controller.getEnd(),ne=K<0;(ne||z)&&(k=h(k,z))}return k}function h(k,K){var z=k-q(K),ne=S();return k-=w(ne*(so(sn(z)/ne)||1))*(K?1:-1),k}function E(){x(X(),!0),M.cancel()}function A(k){for(var K=t.Slides.get(),z=0,ne=1/0,_=0;_<K.length;_++){var ye=K[_].index,f=sn(j(ye,!0)-k);if(f<=ne)ne=f,z=ye;else break}return z}function j(k,K){var z=w(m(k-1)-Z(k));return K?ae(z):z}function X(){var k=y("left");return gn(T)[k]-gn(R)[k]+w(u(!1))}function ae(k){return n.trimSpace&&e.is(Ri)&&(k=xi(k,0,w(S(!0)-b()))),k}function Z(k){var K=n.focus;return K==="center"?(b()-c(k,!0))/2:+K*c(k)||0}function q(k){return j(k?t.Controller.getEnd():0,!!n.trimSpace)}function N(k){var K=w(h(X(),k));return k?K>=0:K<=T[y("scrollWidth")]-gn(R)[y("width")]}function L(k,K){K=fo(K)?X():K;var z=k!==!0&&w(K)<w(q(!1)),ne=k!==!1&&w(K)>w(q(!0));return z||ne}return{mount:H,move:V,jump:P,translate:x,shift:h,cancel:E,toIndex:A,toPosition:j,getPosition:X,getLimit:q,exceededLimit:L,reposition:F}}function _d(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,m=t.Slides,b=m.isEnough,S=m.getLength,C=n.omitEnd,y=e.is(zi),w=e.is(Ri),$=jt(X,!1),T=jt(X,!0),R=n.start||0,M,H=R,F,V,P;function x(){U(),o([rn,Yt,er],U),o(lr,h)}function U(){F=S(!0),V=n.perMove,P=n.perPage,M=N();var f=xi(R,0,C?M:F-1);f!==R&&(R=f,s.reposition())}function h(){M!==N()&&l(er)}function E(f,ve,Y){if(!ye()){var le=j(f),$e=q(le);$e>-1&&(ve||$e!==R)&&(z($e),s.move(le,$e,H,Y))}}function A(f,ve,Y,le){t.Scroll.scroll(f,ve,Y,function(){var $e=q(s.toIndex(d()));z(C?qn($e,M):$e),le&&le()})}function j(f){var ve=R;if(Gn(f)){var Y=f.match(/([+\-<>])(\d+)?/)||[],le=Y[1],$e=Y[2];le==="+"||le==="-"?ve=ae(R+ +(""+le+(+$e||1)),R):le===">"?ve=$e?L(+$e):$(!0):le==="<"&&(ve=T(!0))}else ve=y?f:xi(f,0,M);return ve}function X(f,ve){var Y=V||(_()?1:P),le=ae(R+Y*(f?-1:1),R,!(V||_()));return le===-1&&w&&!ul(d(),c(!f),1)?f?0:M:ve?le:q(le)}function ae(f,ve,Y){if(b()||_()){var le=Z(f);le!==f&&(ve=f,f=le,Y=!1),f<0||f>M?!V&&(qo(0,f,ve,!0)||qo(M,ve,f,!0))?f=L(k(f)):y?f=Y?f<0?-(F%P||P):F:f:n.rewind?f=f<0?M:0:f=-1:Y&&f!==ve&&(f=L(k(ve)+(f<ve?-1:1)))}else f=-1;return f}function Z(f){if(w&&n.trimSpace==="move"&&f!==R)for(var ve=d();ve===u(f,!0)&&qo(f,0,e.length-1,!n.rewind);)f<R?--f:++f;return f}function q(f){return y?(f+F)%F||0:f}function N(){for(var f=F-(_()||y&&V?1:P);C&&f-- >0;)if(u(F-1,!0)!==u(f,!0)){f++;break}return xi(f,0,F-1)}function L(f){return xi(_()?f:P*f,0,M)}function k(f){return _()?qn(f,M):Qo((f>=M?F-1:f)/P)}function K(f){var ve=s.toIndex(f);return w?xi(ve,0,M):ve}function z(f){f!==R&&(H=R,R=f)}function ne(f){return f?H:R}function _(){return!fo(n.focus)||n.isNavigation}function ye(){return e.state.is([ji,ho])&&!!n.waitForTransition}return{mount:x,go:E,scroll:A,getNext:$,getPrev:T,getAdjacent:X,getEnd:N,setIndex:z,getIndex:ne,toIndex:L,toPage:k,toDest:K,hasFocus:_,isBusy:ye}}var Hd="http://www.w3.org/2000/svg",Nd="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",Ro=40;function Od(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,b=u.arrows,S=u.track,C=b,y=u.prev,w=u.next,$,T,R={};function M(){F(),o(rn,H)}function H(){V(),M()}function F(){var A=n.arrows;A&&!(y&&w)&&U(),y&&w&&(ro(R,{prev:y,next:w}),ao(C,A?"":"none"),Tn(C,T=Ea+"--"+n.direction),A&&(P(),E(),lt([y,w],wo,S.id),s(bl,y,w)))}function V(){i.destroy(),kn(C,T),$?(ui(b?[y,w]:C),y=w=null):Ln([y,w],Ra)}function P(){o([Yn,Bi,Yt,gi,er],E),l(w,"click",jt(x,">")),l(y,"click",jt(x,"<"))}function x(A){m.go(A,!0)}function U(){C=b||$i("div",d.arrows),y=h(!0),w=h(!1),$=!0,vo(C,[y,w]),!b&&fa(C,S)}function h(A){var j='<button class="'+d.arrow+" "+(A?d.prev:d.next)+'" type="button"><svg xmlns="'+Hd+'" viewBox="0 0 '+Ro+" "+Ro+'" width="'+Ro+'" height="'+Ro+'" focusable="false"><path d="'+(n.arrowPath||Nd)+'" />';return cl(j)}function E(){if(y&&w){var A=e.index,j=m.getPrev(),X=m.getNext(),ae=j>-1&&A<j?c.last:c.prev,Z=X>-1&&A>X?c.first:c.next;y.disabled=j<0,w.disabled=X<0,lt(y,fn,ae),lt(w,fn,Z),s(wl,y,w,j,X)}}return{arrows:R,mount:M,destroy:V,update:E}}var jd=va+"-interval";function Bd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=dr(n.interval,e.go.bind(e,">"),P),c=d.isPaused,u=t.Elements,m=t.Elements,b=m.root,S=m.toggle,C=n.autoplay,y,w,$=C==="pause";function T(){C&&(R(),S&<(S,wo,u.track.id),$||M(),V())}function R(){n.pauseOnHover&&l(b,"mouseenter mouseleave",function(U){y=U.type==="mouseenter",F()}),n.pauseOnFocus&&l(b,"focusin focusout",function(U){w=U.type==="focusin",F()}),S&&l(S,"click",function(){$?M():H(!0)}),o([_n,cr,Yt],d.rewind),o(_n,x)}function M(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),w=y=$=!1,V(),s($a))}function H(U){U===void 0&&(U=!0),$=!!U,V(),c()||(d.pause(),s(Ca))}function F(){$||(y||w?H(!1):M())}function V(){S&&(Mn(S,pi,!$),lt(S,fn,n.i18n[$?"play":"pause"]))}function P(U){var h=u.bar;h&&xn(h,"width",U*100+"%"),s(Cl,U)}function x(U){var h=t.Slides.getAt(U);d.set(h&&+bn(h.slide,jd)||n.interval)}return{mount:T,destroy:d.cancel,play:M,pause:H,isPaused:c}}function zd(e,t,n){var i=qt(e),o=i.on;function l(){n.cover&&(o(Ta,jt(d,!0)),o([Yn,rn,Yt],jt(s,!0)))}function s(c){t.Slides.forEach(function(u){var m=xo(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),ao(u,c?"none":"")}return{mount:l,destroy:jt(s,!1)}}var Dd=10,Vd=600,Gd=.6,qd=1.5,Kd=800;function Ud(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,b=d.translate,S=e.is(Ri),C,y,w=1;function $(){o(_n,H),o([rn,Yt],F)}function T(P,x,U,h,E){var A=c();if(H(),U&&(!S||!m())){var j=t.Layout.sliderSize(),X=ta(P)*j*Qo(sn(P)/j)||0;P=d.toPosition(t.Controller.toDest(P%j))+X}var ae=ul(A,P,1);w=1,x=ae?0:x||Zo(sn(P-A)/qd,Kd),y=h,C=dr(x,R,jt(M,A,P,E),1),s(ho),l(cr),C.start()}function R(){s(Li),y&&y(),l(gi)}function M(P,x,U,h){var E=c(),A=P+(x-P)*V(h),j=(A-E)*w;b(E+j),S&&!U&&m()&&(w*=Gd,sn(j)<Dd&&T(u(m(!0)),Vd,!1,y,!0))}function H(){C&&C.cancel()}function F(){C&&!C.isPaused()&&(H(),R())}function V(P){var x=n.easingFunc;return x?x(P):1-Math.pow(1-P,4)}return{mount:$,destroy:H,scroll:T,cancel:F}}var bi={passive:!1,capture:!0};function Xd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,b=t.Controller,S=t.Elements.track,C=t.Media.reduce,y=t.Direction,w=y.resolve,$=y.orient,T=u.getPosition,R=u.exceededLimit,M,H,F,V,P,x=!1,U,h,E;function A(){s(S,Mr,Qr,bi),s(S,kr,Qr,bi),s(S,Ol,X,bi),s(S,"click",q,{capture:!0}),s(S,"dragstart",En),o([Yn,rn],j)}function j(){var G=n.drag;xe(!G),V=G==="free"}function X(G){if(U=!1,!h){var he=$e(G);le(G.target)&&(he||!G.button)&&(b.isBusy()?En(G,!0):(E=he?S:window,P=c.is([ji,ho]),F=null,s(E,Mr,ae,bi),s(E,kr,Z,bi),u.cancel(),m.cancel(),N(G)))}}function ae(G){if(c.is(Vo)||(c.set(Vo),l(yl)),G.cancelable)if(P){u.translate(M+Y(_(G)));var he=ye(G)>os,be=x!==(x=R());(he||be)&&N(G),U=!0,l(vl),En(G)}else K(G)&&(P=k(G),En(G))}function Z(G){c.is(Vo)&&(c.set(Li),l(xl)),P&&(L(G),En(G)),d(E,Mr,ae),d(E,kr,Z),P=!1}function q(G){!h&&U&&En(G,!0)}function N(G){F=H,H=G,M=T()}function L(G){var he=z(G),be=ne(he),ce=n.rewind&&n.rewindByDrag;C(!1),V?b.scroll(be,0,n.snap):e.is(So)?b.go($(ta(he))<0?ce?"<":"-":ce?">":"+"):e.is(Ri)&&x&&ce?b.go(R(!0)?">":"<"):b.go(b.toDest(be),!0),C(!0)}function k(G){var he=n.dragMinThreshold,be=no(he),ce=be&&he.mouse||0,se=(be?he.touch:+he)||10;return sn(_(G))>($e(G)?se:ce)}function K(G){return sn(_(G))>sn(_(G,!0))}function z(G){if(e.is(zi)||!x){var he=ye(G);if(he&&he<os)return _(G)/he}return 0}function ne(G){return T()+ta(G)*qn(sn(G)*(n.flickPower||600),V?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function _(G,he){return ve(G,he)-ve(f(G),he)}function ye(G){return ea(G)-ea(f(G))}function f(G){return H===G&&F||H}function ve(G,he){return($e(G)?G.changedTouches[0]:G)["page"+w(he?"Y":"X")]}function Y(G){return G/(x&&e.is(Ri)?Rd:1)}function le(G){var he=n.noDrag;return!io(G,"."+Fl+", ."+fr)&&(!he||!io(G,he))}function $e(G){return typeof TouchEvent<"u"&&G instanceof TouchEvent}function oe(){return P}function xe(G){h=G}return{mount:A,disable:xe,isDragging:oe}}var Yd={Spacebar:" ",Right:mr,Left:pr,Up:Il,Down:Rl};function Ma(e){return e=Gn(e)?e:e.key,Yd[e]||e}var rs="keydown";function Jd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function b(){S(),o(rn,C),o(rn,S),o(_n,w)}function S(){var T=n.keyboard;T&&(u=T==="global"?window:d,l(u,rs,$))}function C(){s(u,rs)}function y(T){m=T}function w(){var T=m;m=!0,ol(function(){m=T})}function $(T){if(!m){var R=Ma(T);R===c(pr)?e.go("<"):R===c(mr)&&e.go(">")}}return{mount:b,destroy:C,disable:y}}var Zi=va+"-lazy",Ko=Zi+"-srcset",Zd="["+Zi+"], ["+Ko+"]";function Qd(e,t,n){var i=qt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Bi,gi],m=[];function b(){n.lazyLoad&&(S(),o(Yt,S))}function S(){Wn(m),C(),c?T():(l(u),o(u,y),y())}function C(){t.Slides.forEach(function(R){ya(R.slide,Zd).forEach(function(M){var H=bn(M,Zi),F=bn(M,Ko);if(H!==M.src||F!==M.srcset){var V=n.classes.spinner,P=M.parentElement,x=xo(P,"."+V)||$i("span",V,P);m.push([M,R,x]),M.src||ao(M,"none")}})})}function y(){m=m.filter(function(R){var M=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,M)?w(R):!0}),m.length||l(u)}function w(R){var M=R[0];Tn(R[1].slide,ra),s(M,"load error",jt($,R)),lt(M,"src",bn(M,Zi)),lt(M,"srcset",bn(M,Ko)),Ln(M,Zi),Ln(M,Ko)}function $(R,M){var H=R[0],F=R[1];kn(F.slide,ra),M.type!=="error"&&(ui(R[2]),ao(H,""),d(Ta,H,F),d(Ii)),c&&T()}function T(){m.length&&w(m.shift())}return{mount:b,destroy:jt(Wn,m),check:y}}function eu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,b=u.getIndex,S=u.go,C=t.Direction.resolve,y=c.pagination,w=[],$,T;function R(){M(),o([rn,Yt,er],R);var h=n.pagination;y&&ao(y,h?"":"none"),h&&(o([_n,cr,gi],U),H(),U(),l(Sl,{list:$,items:w},x(e.index)))}function M(){$&&(ui(y?Xn($.children):$),kn($,T),Wn(w),$=null),i.destroy()}function H(){var h=e.length,E=n.classes,A=n.i18n,j=n.perPage,X=m()?u.getEnd()+1:so(h/j);$=y||$i("ul",E.pagination,c.track.parentElement),Tn($,T=yr+"--"+P()),lt($,Pn,"tablist"),lt($,fn,A.select),lt($,Ia,P()===gr?"vertical":"");for(var ae=0;ae<X;ae++){var Z=$i("li",null,$),q=$i("button",{class:E.page,type:"button"},Z),N=d.getIn(ae).map(function(k){return k.slide.id}),L=!m()&&j>1?A.pageX:A.slideX;s(q,"click",jt(F,ae)),n.paginationKeyboard&&s(q,"keydown",jt(V,ae)),lt(Z,Pn,"presentation"),lt(q,Pn,"tab"),lt(q,wo,N.join(" ")),lt(q,fn,na(L,ae+1)),lt(q,Ci,-1),w.push({li:Z,button:q,page:ae})}}function F(h){S(">"+h,!0)}function V(h,E){var A=w.length,j=Ma(E),X=P(),ae=-1;j===C(mr,!1,X)?ae=++h%A:j===C(pr,!1,X)?ae=(--h+A)%A:j==="Home"?ae=0:j==="End"&&(ae=A-1);var Z=w[ae];Z&&(ll(Z.button),S(">"+ae),En(E,!0))}function P(){return n.paginationDirection||n.direction}function x(h){return w[u.toPage(h)]}function U(){var h=x(b(!0)),E=x(b());if(h){var A=h.button;kn(A,pi),Ln(A,Qa),lt(A,Ci,-1)}if(E){var j=E.button;Tn(j,pi),lt(j,Qa,!0),lt(j,Ci,"")}l($l,{list:$,items:w},h,E)}return{items:w,mount:R,destroy:M,getAt:x,update:U}}var tu=[" ","Enter"];function nu(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(y){y.isParent||(u(e,y.splide),u(y.splide,e))}),i&&m()}function d(){l.forEach(function(y){y.destroy()}),Wn(l)}function c(){d(),s()}function u(y,w){var $=qt(y);$.on(_n,function(T,R,M){w.go(w.is(zi)?M:T)}),l.push($)}function m(){var y=qt(e),w=y.on;w(ba,S),w(Tl,C),w([Yn,rn],b),l.push(y),y.emit(Sa,e.splides)}function b(){lt(t.Elements.list,Ia,n.direction===gr?"vertical":"")}function S(y){e.go(y.index)}function C(y,w){ha(tu,Ma(w))&&(S(y),En(w))}return{setup:jt(t.Media.set,{slideFocus:fo(o)?i:o},!0),mount:s,destroy:d,remount:c}}function iu(e,t,n){var i=qt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,bi)}function d(u){if(u.cancelable){var m=u.deltaY,b=m<0,S=ea(u),C=n.wheelMinThreshold||0,y=n.wheelSleep||0;sn(m)>C&&S-l>y&&(e.go(b?"<":">"),l=S),c(b)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(ji)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var ou=90;function ru(e,t,n){var i=qt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=$i("span",$d),c=dr(ou,jt(m,!1));function u(){s&&(S(!t.Autoplay.isPaused()),lt(l,ns,!0),d.textContent="…",o($a,jt(S,!0)),o(Ca,jt(S,!1)),o([Bi,gi],jt(m,!0)))}function m(C){lt(l,ts,C),C?(vo(l,d),c.start()):(ui(d),c.cancel())}function b(){Ln(l,[es,ns,ts]),ui(d)}function S(C){s&<(l,es,C?"off":"polite")}return{mount:u,disable:S,destroy:b}}var au=Object.freeze({__proto__:null,Media:gd,Direction:hd,Elements:Ed,Slides:kd,Layout:Pd,Clones:Fd,Move:Wd,Controller:_d,Arrows:Od,Autoplay:Bd,Cover:zd,Scroll:Ud,Drag:Xd,Keyboard:Jd,LazyLoad:Qd,Pagination:eu,Sync:nu,Wheel:iu,Live:ru}),su={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"},lu={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:Ld,i18n:su,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function cu(e,t,n){var i=t.Slides;function o(){qt(e).on([Yn,Yt],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),ol(c)}return{mount:o,start:s,cancel:Qr}}function du(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=jt(xn,s,"transition"),c;function u(){qt(e).bind(s,"transitionend",function(C){C.target===s&&c&&(b(),c())})}function m(C,y){var w=i.toPosition(C,!0),$=i.getPosition(),T=S(C);sn(w-$)>=1&&T>=1?n.useScroll?l.scroll(w,T,!1,y):(d("transform "+T+"ms "+n.easing),i.translate(w,!0),c=y):(i.jump(C),y())}function b(){d(""),l.cancel()}function S(C){var y=n.rewindSpeed;if(e.is(Ri)&&y){var w=o.getIndex(!0),$=o.getEnd();if(w===0&&C>=$||w>=$&&C===0)return y}return n.speed}return{mount:u,start:m,cancel:b}}var uu=(function(){function e(n,i){this.event=qt(),this.Components={},this.state=pd(Si),this.splides=[],this._o={},this._E={};var o=Gn(n)?dl(document,n):n;Ji(o,o+" is invalid."),this.root=o,i=Bn({label:bn(o,fn)||"",labelledby:bn(o,La)||""},lu,e.defaults,i||{});try{Bn(i,JSON.parse(bn(o,va)))}catch{Ji(!1,"Invalid JSON")}this._o=Object.create(Bn({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Ji(s.is([Si,Jo]),"Already mounted!"),s.set(Si),this._C=d,this._T=o||this._T||(this.is(So)?cu:du),this._E=i||this._E;var c=ro({},au,this._E,{Transition:this._T});return di(c,function(u,m){var b=u(l,d,l._o);d[m]=b,b.setup&&b.setup()}),di(d,function(u){u.mount&&u.mount()}),this.emit(Yn),Tn(this.root,Cd),s.set(Li),this.emit(ia),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Li)&&(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(Xn(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(Yt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(Si)?qt(this).on(ia,this.destroy.bind(this,i)):(di(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(wa),o.destroy(),i&&Wn(this.splides),l.set(Jo)),this},sd(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})(),ka=uu;ka.defaults={};ka.STATES=cd;var as=[[Yn,"onMounted"],[ia,"onReady"],[_n,"onMove"],[Bi,"onMoved"],[ba,"onClick"],[ml,"onActive"],[gl,"onInactive"],[hl,"onVisible"],[fl,"onHidden"],[Yt,"onRefresh"],[rn,"onUpdated"],[Ii,"onResize"],[lr,"onResized"],[yl,"onDrag"],[vl,"onDragging"],[xl,"onDragged"],[cr,"onScroll"],[gi,"onScrolled"],[wa,"onDestroy"],[bl,"onArrowsMounted"],[wl,"onArrowsUpdated"],[Sl,"onPaginationMounted"],[$l,"onPaginationUpdated"],[Sa,"onNavigationMounted"],[$a,"onAutoplayPlay"],[Cl,"onAutoplayPlaying"],[Ca,"onAutoplayPause"],[Ta,"onLazyLoadLoaded"]];function Pa(...e){return e.filter(Boolean).join(" ")}function tr(e){return e!==null&&typeof e=="object"}function aa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!aa(n,t[i]));if(tr(e)&&tr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!aa(e[o],t[o]))}return e===t}function pu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function mu(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 sa(e,t){const n=e;return mu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():tr(i)?n[o]=sa(tr(n[o])?n[o]:{},i):n[o]=i}),n}var gu=({children:e,className:t,...n})=>a.createElement("div",{className:Pa("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Aa=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 ka(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=sa({},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&&!aa(this.options,e)&&(this.splide.options=e,this.options=sa({},e));const t=this.getSlides();pu(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){as.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:Pa("splide",e),ref:this.splideRef,...this.omit(o,["options",...as.map(l=>l[1])])},n?a.createElement(gu,null,i):i)}},Fa=({children:e,className:t,...n})=>a.createElement("li",{className:Pa("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 pu="RichTextRenderer-module__link___BWeZ2",mu={link:pu},gu=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))},xr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>gu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function hn(e){const{color:t,...n}=e;return n}function Qt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:xr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:E.scalingValue(e.letterSpacing,t),wordSpacing:E.scalingValue(e.wordSpacing,t),fontSize:E.scalingValue(n,t),lineHeight:i!==void 0?E.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 Ei=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:mu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:hu(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 hu(e){return{...e.fontFamily&&{fontFamily:xr(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 fu="SvgImage-module__svg___q3xE-",yu="SvgImage-module__img___VsTm-",rs={svg:fu,img:yu},vu=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},xu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,fn=({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)}},[]),!vu(e)||!s?r.jsx("img",{src:e,alt:"",className:pt(rs.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:pt(rs.svg,i),style:{"--svg":xu(e),"--fill":t,"--hover-fill":n,...o??{}}})},bu={"top-left":Xe.topLeftAlignment,"top-center":Xe.topCenterAlignment,"top-right":Xe.topRightAlignment,"middle-left":Xe.middleLeftAlignment,"middle-center":Xe.middleCenterAlignment,"middle-right":Xe.middleRightAlignment,"bottom-left":Xe.bottomLeftAlignment,"bottom-center":Xe.bottomCenterAlignment,"bottom-right":Xe.bottomRightAlignment};function wu({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:v,textAppearance:b,color:S}=n.imageCaption??{},[y,w]=a.useState(void 0),[C,L]=a.useState(null),[k,A]=a.useState(0),[O,P]=a.useState(0),{direction:D,transition:R,controls:x,pagination:U,imageCaption:h,triggers:I}=e,W=a.useRef(R.type),{x:V,y:Y}=e.controls.offset,ae=Z=>{o&&o.go(Z)};return a.useEffect(()=>{if(!C)return;const Z=new ResizeObserver(G=>{if(!o)return;const[H]=G;w({width:Math.round(H.contentRect.width),height:Math.round(H.contentRect.height)})});return Z.observe(C),()=>Z.unobserve(C)},[C]),a.useEffect(()=>{!o||W.current===R.type||(P(Z=>Z+1),W.current=R.type)},[R.type]),r.jsx("div",{className:pt(Xe.wrapper,{[Xe.editor]:i}),ref:L,children:r.jsxs("div",{className:Xe.sliderInner,style:{width:y?y.width:"100%",height:y?y.height:"100%",backgroundColor:R.backgroundColor&&R.type==="fade in"?R.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:pt(Xe.captionBlock),children:r.jsx("div",{className:Xe.captionTextWrapper,children:t.map((Z,G)=>r.jsx("div",{className:pt(Xe.captionText,bu[h.alignment],{[Xe.withPointerEvents]:G===k&&i,[Xe.active]:G===k}),style:{fontFamily:xr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":E.scalingValue(l.width,i),letterSpacing:E.scalingValue(c,i),wordSpacing:E.scalingValue(m,i),textAlign:u,fontSize:E.scalingValue(v.fontSize,i),lineHeight:E.scalingValue(v.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:S,transitionDuration:R.duration?`${Math.round(parseInt(R.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Xe.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:E.scalingValue(h.offset.y,i),left:E.scalingValue(h.offset.x,i)},children:r.jsx(Ei,{content:Z.imageCaption})})},G))})}),r.jsx(ka,{onMove:Z=>{A(Z.index)},ref:s,options:{arrows:!1,speed:R.duration?parseInt(R.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:D==="horiz"||R.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:y?y.width:"100%",height:y?y.height:"100%",type:R.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((Z,G)=>r.jsx(Pa,{children:r.jsx("div",{className:Xe.sliderItem,children:r.jsx("div",{className:Xe.imgWrapper,children:r.jsx("img",{className:pt(Xe.sliderImage,{[Xe.contain]:Z.image.objectFit==="contain",[Xe.cover]:Z.image.objectFit==="cover"}),src:Z.image.url,alt:Z.image.name??""})})})},G))},O),x.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:pt(Xe.arrow,{[Xe.arrowVertical]:D==="vert",[Xe.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:r.jsxs("button",{onClick:()=>{ae("-1")},className:Xe.arrowInner,style:{transform:`translate(${E.scalingValue(V,i)}, ${E.scalingValue(Y*(D==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${D==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&r.jsx(fn,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:pt(Xe.arrowImg,Xe.mirror)}),!x.arrowsImgUrl&&r.jsx(as,{color:x.color,className:pt(Xe.arrowIcon,Xe.arrowImg,Xe.mirror)})]})}),r.jsx("div",{className:pt(Xe.arrow,Xe.nextArrow,{[Xe.arrowVertical]:D==="vert",[Xe.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:r.jsxs("button",{className:Xe.arrowInner,onClick:()=>ae("+1"),style:{transform:`translate(${E.scalingValue(V*(D==="horiz"?-1:1),i)}, ${E.scalingValue(Y,i)}) scale(${e.controls.scale/100}) rotate(${D==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&r.jsx(fn,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:Xe.arrowImg}),!x.arrowsImgUrl&&r.jsx(as,{color:x.color,className:pt(Xe.arrowIcon,Xe.arrowImg)})]})})]}),I.triggersList.click&&r.jsx("div",{className:Xe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),U.isActive&&r.jsx("div",{className:pt(Xe.pagination,{[Xe.paginationInsideBottom]:U.position==="inside-1"&&D==="horiz",[Xe.paginationInsideTop]:U.position==="inside-2"&&D==="horiz",[Xe.paginationOutsideBottom]:U.position==="outside-1"&&D==="horiz",[Xe.paginationOutsideTop]:U.position==="outside-2"&&D==="horiz",[Xe.paginationInsideLeft]:U.position==="inside-1"&&D==="vert",[Xe.paginationInsideRight]:U.position==="inside-2"&&D==="vert",[Xe.paginationOutsideLeft]:U.position==="outside-1"&&D==="vert",[Xe.paginationOutsideRight]:U.position==="outside-2"&&D==="vert",[Xe.paginationVertical]:D==="vert"}),children:r.jsx("div",{className:Xe.paginationInner,style:{backgroundColor:U.colors[2],transform:`scale(${U.scale/100}) translate(${E.scalingValue(U.offset.x,i)}, ${E.scalingValue(U.offset.y,i)}) rotate(${D==="horiz"?"0deg":"90deg"})`},children:t.map((Z,G)=>r.jsx("button",{onClick:()=>{o&&o.go(G)},className:pt(Xe.paginationItem),children:r.jsx("div",{className:pt(Xe.dot,{[Xe.activeDot]:G===k}),style:{backgroundColor:G===k?U.colors[0]:U.colors[1],"--pagination-hover-color":U.hover}})},G))})})]})})}function as({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 Su={element:wu,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"]}},$u="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Cu="ImageRevealSlider-module__image___Qjt-e",Tu="ImageRevealSlider-module__link___N-iLG",Lu="ImageRevealSlider-module__cursor___2U03d",yi={imageRevealSlider:$u,image:Cu,link:Tu,cursor:Lu};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 Ar(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Iu(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Ar(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ar(e);s=l.height/l.width*o}else{const l=await Ar(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function Ru({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),[m,v]=a.useState({x:0,y:0}),[b,S]=a.useState(1),[y,w]=a.useState("none"),C=a.useRef({x:0,y:0}),[L,k]=a.useState(!1),{sizeType:A,imageWidth:O,randomRangeImageWidth:P}=e.imageSize,{revealPosition:D,visible:R}=e.position,{cursorType:x,target:U,defaultCursorScale:h,defaultCursor:I,hoverCursorScale:W,hoverCursor:V}=e.cursor;a.useEffect(()=>{if(!i)return;const Z=($,M)=>{const q=i.getBoundingClientRect(),B=$-q.left,ee=M-q.top;if(v({x:B,y:ee}),x==="system"){w("none"),S(1);return}const _=B,ye=ee,f=document.elementFromPoint(q.left+_,q.top+ye);if(f&&f.closest("a")){w("none"),S(1);return}const ve=ss(_,ye,s)||U==="area"?{img:V??"none",scale:W}:{img:I??"none",scale:h};w(ve.img),S(ve.scale)},G=$=>{$.stopPropagation(),C.current={x:$.clientX,y:$.clientY},Z($.clientX,$.clientY)},H=()=>{L&&Z(C.current.x,C.current.y)};return i.addEventListener("mousemove",G),window.addEventListener("scroll",H,!0),()=>{i.removeEventListener("mousemove",G),window.removeEventListener("scroll",H,!0)}},[i,L,m,x,U,V,I,W,h,s]),a.useEffect(()=>{L||(w("none"),S(0))},[L]);const Y=async(Z,G,H,$={})=>{const{width:M,height:q,finalWidth:B}=await Iu(Z.image.url,A,O,P);let ee=0,_=0;D==="same"?(ee=G/2,_=H/2):(ee=$.x??Math.random()*G,_=$.y??Math.random()*H);const ye=Math.min(Math.max(ee,M/2),G-M/2),f=Math.min(Math.max(_,q/2),H-q/2);return{id:u.current++,url:Z.image.url,link:Z.link,name:Z.image.name,x:ye,y:f,width:B}};a.useEffect(()=>{if(!i||t.length===0)return;const Z=i.getBoundingClientRect(),G=Z.width,H=Z.height,$=[];(async()=>{const q=t[0],B=await Y(q,G,H);$.push(B),l($),c(1)})()},[A,O,P,D,i]),a.useEffect(()=>{R==="last One"&&l(Z=>Z.length>0?[Z[Z.length-1]]:[])},[R]);const ae=async Z=>{if(!i)return;const G=i.getBoundingClientRect(),H=Z.clientX-G.left,$=Z.clientY-G.top;if(U==="image"&&!ss(H,$,s))return;let M=0,q=0;D==="on Click"?(M=H,q=$):D==="same"?(M=G.width/2,q=G.height/2):(M=Math.random()*G.width,q=Math.random()*G.height);const B=t[d],ee=await Y(B,G.width,G.height,{x:M,y:q});l(_=>R==="all"?[..._,ee]:[ee]),c(_=>_>=t.length-1?0:_+1)};return r.jsxs("div",{ref:o,onClick:ae,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),className:yi.imageRevealSlider,style:{cursor:y==="none"?"default":"none"},children:[s.map(Z=>r.jsx("div",{className:yi.wrapper,style:{top:`${Z.y}px`,left:`${Z.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:Z.width??"auto",height:"auto",cursor:y==="none"?"default":"none"},children:U==="area"&&Z.link?r.jsx("a",{href:Z.link,target:"_blank",className:yi.link,children:r.jsx("img",{src:Z.url,alt:Z.name,className:yi.image},Z.id)}):r.jsx("img",{src:Z.url,alt:Z.name,className:yi.image},Z.id)},Z.id)),L&&r.jsx("div",{className:yi.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${y}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Eu={element:Ru,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:""}]}}}},Mu="LightBox-module__hidden___9s-9x",ku="LightBox-module__heroImage___sTxNF",Pu="LightBox-module__background___rm9ml",Au="LightBox-module__editor___4ACaY",Wu="LightBox-module__contentStyle___Bgnsq",Fu="LightBox-module__imageStyle___tLIlB",_u="LightBox-module__imgWrapper___LuFUp",Hu="LightBox-module__contain___8-yaS",Nu="LightBox-module__cover___hNvOG",Ou="LightBox-module__caption___b6L2I",ju="LightBox-module__captionTextInner___rCGNH",zu="LightBox-module__lightboxSplide___XFuWC",Bu="LightBox-module__arrow___iz38X",Du="LightBox-module__arrowVertical___Zfz81",Vu="LightBox-module__nextArrow___zkAQN",Gu="LightBox-module__arrowInner___p48sW",qu="LightBox-module__arrowIcon___3VaFf",Ku="LightBox-module__arrowImg___pNV88",Uu="LightBox-module__mirror___pjeXc",Xu="LightBox-module__thumbsWrapper___GB-nU",Yu="LightBox-module__thumbsContainerVertical___wttk5",Ju="LightBox-module__thumbsContainer___osSma",Zu="LightBox-module__thumbsAlignStart___MO6tY",Qu="LightBox-module__thumbsAlignCenter___Q4sUx",ep="LightBox-module__thumbsAlignEnd___p4y9R",tp="LightBox-module__thumbItem___HvnF3",np="LightBox-module__closeButton___g2khP",ip="LightBox-module__fadeIn___0m5GW",op="LightBox-module__slideInLeft___gPYwC",rp="LightBox-module__slideInRight___S-pPp",ap="LightBox-module__slideInTop___DFdAj",sp="LightBox-module__slideInBottom___m27kZ",lp="LightBox-module__fadeOut___55qBR",cp="LightBox-module__slideOutLeft___NvU7P",dp="LightBox-module__slideOutRight___SK7eC",up="LightBox-module__slideOutTop___Vgg0z",pp="LightBox-module__slideOutBottom___nJ0Ef",mp="LightBox-module__scaleSlide___vZriG",We={hidden:Mu,heroImage:ku,background:Pu,editor:Au,contentStyle:Wu,imageStyle:Fu,imgWrapper:_u,contain:Hu,cover:Nu,caption:Ou,captionTextInner:ju,lightboxSplide:zu,arrow:Bu,arrowVertical:Du,nextArrow:Vu,arrowInner:Gu,arrowIcon:qu,arrowImg:Ku,mirror:Uu,thumbsWrapper:Xu,thumbsContainerVertical:Yu,thumbsContainer:Ju,thumbsAlignStart:Zu,thumbsAlignCenter:Qu,thumbsAlignEnd:ep,thumbItem:tp,closeButton:np,fadeIn:ip,slideInLeft:op,slideInRight:rp,slideInTop:ap,slideInBottom:sp,fadeOut:lp,slideOutLeft:cp,slideOutRight:dp,slideOutTop:up,slideOutBottom:pp,scaleSlide:mp},Eo=(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% + ${E.scalingValue(t.x,n)}), calc(-50% + ${E.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${E.scalingValue(t.x,n)}, calc(-50% + ${E.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), ${E.scalingValue(t.y,n)})`:i.transform=`translate(${E.scalingValue(t.x,n)}, ${E.scalingValue(t.y,n)})`,i};function Hl(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 ir(e){const t=e.getBoundingClientRect(),n=Hl(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,d=i/o,c=s/l;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const v=t.left+n.left,b=t.top+n.top,S=(i-u)/2+v,y=(o-m)/2+b;return{x:S,y,width:u,height:m}}function ls(e){const t=e.getBoundingClientRect(),n=Hl(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 gp(e,t){const n=(()=>{if(e==="fade in")return We.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return We.slideInLeft;case"right":return We.slideInRight;case"top":return We.slideInTop;case"bottom":return We.slideInBottom;default:return We.slideInRight}return We.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return We.fadeIn;if(e==="slide in")switch(t){case"left":return We.slideInLeft;case"right":return We.slideInRight;case"top":return We.slideInTop;case"bottom":return We.slideInBottom;default:return We.slideInRight}return We.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return We.fadeOut;if(e==="slide in")switch(t){case"left":return We.slideOutLeft;case"right":return We.slideOutRight;case"top":return We.slideOutTop;case"bottom":return We.slideOutBottom;default:return We.slideOutRight}return We.fadeOut})(),s=(()=>{if(e==="fade in")return We.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return We.slideOutLeft;case"right":return We.slideOutRight;case"top":return We.slideOutTop;case"bottom":return We.slideOutBottom;default:return We.slideOutRight}return We.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const hp=({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:We.heroImage,onClick:()=>c(!0)}),r.jsx(fp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},fp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:v,wordSpacing:b,fontSizeLineHeight:S,textAppearance:y,color:w}=i.imageCaption??{},[C,L]=a.useState(0),[k,A]=a.useState(0),[O,P]=a.useState(!1),[D,R]=a.useState(!1),[x,U]=a.useState({}),h=a.useRef(null),I=a.useRef(null),W=a.useRef(null),V=a.useRef(!1),Y=a.useRef(null),ae=a.useRef(null),Z=a.useRef(null),G=a.useRef(null),H=a.useRef(!1),$=a.useRef(null),[M,q]=a.useState(!1),{appear:B,triggers:ee,slider:_,thumbnail:ye,controls:f,area:ve,caption:K,layout:le}=o.lightboxBlock,{appearClass:$e,backdropAppearClass:oe,backdropDisappearClass:fe,disappearClass:X}=gp(B.type,B.direction),be=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const z=()=>{setTimeout(()=>{var F,te;(te=(F=h.current)==null?void 0:F.splide)==null||te.refresh()},16)},re=()=>{A(F=>F+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",re),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",re)}},[]),a.useEffect(()=>{if(!e||!ye.isActive){q(!1);return}const z=$.current;if(!z)return;const re=()=>{_.direction==="horiz"?q(z.scrollWidth>z.clientWidth):q(z.scrollHeight>z.clientHeight)};re();const F=new ResizeObserver(re);return F.observe(z),()=>F.disconnect()},[e,ye.isActive,n.length,x,_.direction]);const xe=a.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,re=cs(ve.color);z&&!l&&re>.9&&(document.body.style.backgroundColor=""),P(!0),V.current=!0;const F=te=>{te.target===Y.current&&te.animationName&&(Y.current&&ae.current&&Y.current.removeEventListener("animationend",ae.current),ae.current=null,V.current&&(V.current=!1,t()),P(!1))};Y.current&&(ae.current=F,Y.current.addEventListener("animationend",F))},[t,ve.color,l]),pe=(z,re,F)=>{var te,ne;if(z){if(ee.type==="click"&&ee.switch==="image")ee.repeat==="close"&&C===n.length-1?xe():(te=h.current)==null||te.go("+1");else if(ee.type==="click"&&ee.switch==="50/50"){const ue=z.getBoundingClientRect(),me=re-ue.left,he=F-ue.top,Le=ue.width,Q=ue.height;let ge;_.direction==="horiz"?ge=me<Le/2?"-1":"+1":ge=he<Q/2?"-1":"+1",(ne=h.current)==null||ne.go(ge)}}},se=z=>{if(H.current){H.current=!1;return}const re=n[C],F=(re==null?void 0:re.image.objectFit)==="cover";let te,ne;if("changedTouches"in z&&z.changedTouches.length>0)te=z.changedTouches[0].clientX,ne=z.changedTouches[0].clientY;else if("clientX"in z)te=z.clientX,ne=z.clientY;else return;let ue;if(F&&W.current){const me=ls(W.current);ue=te>=me.left&&te<=me.right&&ne>=me.top&&ne<=me.bottom}else{const me=W.current?ir(W.current):null;if(!me){z.target===z.currentTarget&&xe();return}ue=te>=me.x&&te<=me.x+me.width&&ne>=me.y&&ne<=me.y+me.height}ue?pe(W.current,te,ne):xe()},Re=z=>{const re=z.target;(re.classList.contains(We.thumbsWrapper)||re.classList.contains(We.thumbsContainer))&&se(z)};a.useEffect(()=>{if(!e)return;const z=re=>{var F,te;if(re.key==="Escape"){xe();return}if(re.key==="ArrowRight"){L(ne=>(ne+1)%Math.max(n.length,1)),(F=h.current)==null||F.go("+1");return}re.key==="ArrowLeft"&&(L(ne=>(ne-1+Math.max(n.length,1))%Math.max(n.length,1)),(te=h.current)==null||te.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,xe,n.length]),a.useEffect(()=>{if(e){if(L(0),A(re=>re+1),V.current=!1,P(!1),R(!1),U({}),!be)return;const z=new CustomEvent("page-overlay",{detail:{itemId:be}});window.dispatchEvent(z)}return()=>{Y.current&&ae.current&&(Y.current.removeEventListener("animationend",ae.current),ae.current=null),R(!1)}},[e,be]),a.useEffect(()=>{I.current!==null&&I.current!==_.type&&A(z=>z+1),I.current=_.type},[_.type]),a.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,re=window.matchMedia("(max-width: 768px)").matches,F=cs(ve.color);document.body.style.overflow="hidden",R(!1);const te=ue=>{ue.target===Y.current&&!V.current&&ue.animationName&&(re&&!l&&F>.9&&(document.body.style.backgroundColor=ve.color),R(!0),Y.current&&Z.current&&Y.current.removeEventListener("animationend",Z.current),Z.current=null)};Y.current&&(Z.current=te,Y.current.addEventListener("animationend",te));const ne=ue=>{const me=ue.target;me&&(me.closest(`.${We.thumbsWrapper}`)||me.closest(`.${We.thumbsContainer}`))||_.type!=="slide"&&ue.preventDefault()};return document.addEventListener("touchmove",ne,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",ne),Y.current&&Z.current&&(Y.current.removeEventListener("animationend",Z.current),Z.current=null),R(!1)}},[e,l,ve.color,_.type]),a.useEffect(()=>{if(!e)return;const z=re=>{var te,ne;if(V.current){re.stopPropagation();return}if(H.current){H.current=!1;return}const F=re.target;if(!(F&&(F.closest(`.${We.thumbsContainer}`)||F.closest(`.${We.thumbItem}`)||F.closest(`.${We.arrow}`)||F.closest(`.${We.closeButton}`)||F.closest(`.${We.caption}`)))){if(_.type==="slide"&&ee.type==="drag"&&((ne=(te=h.current)==null?void 0:te.splide)!=null&&ne.root)){const ue=h.current.splide.root;if(F&&(ue.contains(F)||ue===F))return}if(re.touches.length===0&&re.changedTouches.length>0){const ue=n[C],me=(ue==null?void 0:ue.image.objectFit)==="cover",he=re.changedTouches[0];let Le;if(me&&W.current){const Q=ls(W.current);Le=he.clientX>=Q.left&&he.clientX<=Q.right&&he.clientY>=Q.top&&he.clientY<=Q.bottom}else{const Q=W.current?ir(W.current):null;if(!Q)return;Le=he.clientX>=Q.x&&he.clientX<=Q.x+Q.width&&he.clientY>=Q.y&&he.clientY<=Q.y+Q.height}if(!Le){re.stopPropagation(),V.current=!0;const Q=ge=>{ge.stopPropagation(),ge.preventDefault(),document.removeEventListener("click",Q,!0)};document.addEventListener("click",Q,!0),xe()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,xe,C,n]);const ke=(_.type==="scale"||_.type==="fade")&&_.direction==="vert"&&ee.type==="drag";a.useEffect(()=>{var ge,Ae;if(!e||!ke||!((Ae=(ge=h.current)==null?void 0:ge.splide)!=null&&Ae.root))return;const z=h.current.splide.root,re=30,F=(ie,j)=>{if(G.current){const Oe=Math.abs(ie-G.current.x),Fe=Math.abs(j-G.current.y);(Oe>0||Fe>0)&&(H.current=!0)}},te=ie=>{G.current&&(ie.preventDefault(),F(ie.clientX,ie.clientY))},ne=ie=>{G.current&&ie.touches.length>0&&(ie.preventDefault(),F(ie.touches[0].clientX,ie.touches[0].clientY))},ue=(ie,j)=>{if(!G.current||!h.current){G.current=null;return}const Oe=Math.abs(ie-G.current.x),Fe=Math.abs(j-G.current.y);Fe>re&&Fe>Oe&&h.current.go(j<G.current.y?"+1":"-1"),G.current=null},me=ie=>{G.current&&ue(ie.clientX,ie.clientY),document.removeEventListener("pointerup",me),document.removeEventListener("pointercancel",me),document.removeEventListener("pointermove",te)},he=ie=>{if(G.current){if(ie.changedTouches.length>0){const j=ie.changedTouches[0];ue(j.clientX,j.clientY)}document.removeEventListener("touchend",he),document.removeEventListener("touchcancel",he),document.removeEventListener("touchmove",ne)}},Le=ie=>{G.current={x:ie.clientX,y:ie.clientY},H.current=!1,document.addEventListener("pointermove",te,{passive:!1}),document.addEventListener("pointerup",me),document.addEventListener("pointercancel",me)},Q=ie=>{ie.touches.length>0&&(G.current={x:ie.touches[0].clientX,y:ie.touches[0].clientY},H.current=!1,document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",he),document.addEventListener("touchcancel",he))};return z.addEventListener("pointerdown",Le),z.addEventListener("touchstart",Q),()=>{z.removeEventListener("pointerdown",Le),z.removeEventListener("touchstart",Q),document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",me),document.removeEventListener("pointercancel",me),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",he),document.removeEventListener("touchcancel",he),G.current=null,H.current=!1}},[e,ke,k]);const we={backgroundColor:ve.color,backdropFilter:`blur(${ve.blur}px)`,animationDuration:`${parseInt(B.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:mi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:Y,className:pt(We.background,O?fe:oe,{[We.editor]:l},{[We.hidden]:!e}),style:{...we,...D&&!l&&!O?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?Y:null,className:pt(We.contentStyle,O?X:$e,{[We.editor]:l},{[We.hidden]:!e}),style:{animationDuration:`${parseInt(B.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(ka,{onMove:z=>L(z.index),ref:h,className:We.lightboxSplide,options:{arrows:!1,speed:_.duration?parseInt(_.duration):500,direction:_.direction==="horiz"||_.type==="fade"||_.type==="scale"?"ltr":"ttb",pagination:!1,drag:ee.type==="drag"&&!ke,perPage:1,width:"100%",height:"100%",type:_.type==="fade"||_.type==="scale"?"fade":"loop",padding:0,rewind:ee.repeat!=="close",start:0},style:{"--splide-speed":_.duration},children:n.map((z,re)=>{const F=Eo(le.position,le.offset,l),te=`${E.scalingValue(le.padding.top,l)} ${E.scalingValue(le.padding.right,l)} ${E.scalingValue(le.padding.bottom,l)} ${E.scalingValue(le.padding.left,l)}`,ne=_.type==="scale"?(()=>{const{transform:ue,...me}=F;return{...me,position:"absolute",padding:te,boxSizing:"border-box","--position-transform":ue||"none"}})():{...F,position:"absolute",padding:te,boxSizing:"border-box"};return r.jsx(Pa,{children:r.jsx("div",{className:We.imgWrapper,onClick:se,children:r.jsx("img",{ref:re===C?W:null,className:pt(We.imageStyle,{[We.contain]:z.image.objectFit==="contain",[We.cover]:z.image.objectFit==="cover",[We.scaleSlide]:_.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...ne,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},re)})},k),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:pt(We.arrow,{[We.arrowVertical]:_.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:We.arrowInner,style:{transform:`translate(${E.scalingValue(f.offset.x,l)}, ${E.scalingValue(f.offset.y*(_.direction==="horiz"?1:-1),l)}) scale(${f.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=h.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(fn,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:pt(We.arrowImg,We.mirror)}),!f.arrowsImgUrl&&r.jsx(ds,{color:f.color,className:pt(We.arrowIcon,We.arrowImg,We.mirror)})]})}),r.jsx("div",{className:pt(We.arrow,We.nextArrow,{[We.arrowVertical]:_.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:We.arrowInner,style:{transform:`translate(${E.scalingValue(f.offset.x*(_.direction==="horiz"?-1:1),l)}, ${E.scalingValue(f.offset.y,l)}) scale(${f.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=h.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(fn,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:We.arrowImg}),!f.arrowsImgUrl&&r.jsx(ds,{color:f.color,className:pt(We.arrowIcon,We.arrowImg)})]})})]}),ve.closeIconUrl&&(()=>{const z=Eo(ve.closeIconAlign,ve.closeIconOffset,l),re=`scale(${ve.closeIconScale})`,F=z.transform?`${z.transform} ${re}`:re;return r.jsx("button",{className:We.closeButton,style:{...z,transform:F},onClick:xe,"aria-label":"Close lightbox",children:r.jsx(fn,{url:ve.closeIconUrl,fill:ve.closeIconColor??"#000000",hoverFill:ve.closeIconHover??"#cccccc"})})})(),K&&K.isActive&&i.imageCaption&&((Se=n[C])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:We.caption,style:{...Eo(K.alignment,K.offset,l),fontFamily:xr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":E.scalingValue(c.width,l),letterSpacing:E.scalingValue(m,l),wordSpacing:E.scalingValue(b,l),textAlign:v,fontSize:E.scalingValue(S.fontSize,l),lineHeight:E.scalingValue(S.lineHeight,l),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:w},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:We.captionTextInner,style:{"--link-color":K.linkColor,"--link-hover-color":K.linkHoverColor},children:r.jsx(Ei,{content:n[C].imageCaption})})}),ye.isActive&&(()=>{const[z,re]=ye.position.split("-"),F=_.direction==="horiz"?`${z}-left`:ye.position,te=Eo(F,ye.offset,l),ne=()=>{if(_.direction==="horiz"){if(re==="left")return"flex-start";if(re==="center")return"center";if(re==="right")return"flex-end"}else{if(z==="top")return"flex-start";if(z==="middle")return"center";if(z==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:$,className:We.thumbsWrapper,onClick:ue=>Re(ue),style:{position:l?"absolute":"fixed",...te,..._.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:pt(We.thumbsContainer,{[We.thumbsContainerVertical]:_.direction==="vert",[We.thumbsAlignStart]:ye.align==="start",[We.thumbsAlignCenter]:ye.align==="center",[We.thumbsAlignEnd]:ye.align==="end"}),style:{gap:E.scalingValue(ye.grid.gap,l),justifyContent:M?"flex-start":ne()},children:n.map((ue,me)=>{const he=me===C,Le=x[me],ge=ye.grid.size*(he?ye.activeState.scale:1),Ae=()=>{if(ye.fit!=="fit")return{};if(!Le)return _.direction==="horiz"?{height:E.scalingValue(ge,l)}:{width:E.scalingValue(ge,l)};const ie=Le.width/Le.height;if(_.direction==="horiz"){const j=ge,Oe=j*ie;return{width:E.scalingValue(Oe,l),height:E.scalingValue(j,l)}}else{const j=ge,Oe=j/ie;return{width:E.scalingValue(j,l),height:E.scalingValue(Oe,l)}}};return r.jsx("button",{className:We.thumbItem,style:{..._.direction==="horiz"&&ye.fit!=="fit"?{height:E.scalingValue(ge,l)}:{},..._.direction==="vert"&&ye.fit!=="fit"?{width:E.scalingValue(ge,l)}:{},...ye.fit==="cover"?{width:E.scalingValue(ge,l),height:E.scalingValue(ge,l)}:{},...Ae(),transition:he?"all 0.25s ease-out":"none",opacity:he?ye.activeState.opacity/100:ye.opacity/100,"--thumb-hover":ye.activeState.opacity/100},onClick:ie=>{var j;ie.stopPropagation(),L(me),(j=h.current)==null||j.go(me)},onMouseEnter:()=>{var ie;ye.triggers==="hov"&&((ie=h.current)==null||ie.go(me))},children:r.jsx("img",{src:ue.image.url,alt:ue.image.name??"",onLoad:ie=>{const j=ie.currentTarget;j.naturalWidth&&j.naturalHeight&&U(Oe=>({...Oe,[me]:{width:j.naturalWidth,height:j.naturalHeight}}))},style:{objectFit:ye.fit==="cover"?"cover":"contain",...ye.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ye.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ue.image.name}-${me}`)})})})})()]})]}),document.getElementById(s))};function ds({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 yp={element:hp,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 Mo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vp(e){return`
|
|
6
|
+
*/const hu="RichTextRenderer-module__link___BWeZ2",fu={link:hu},yu=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))},vr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>yu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function cn(e){const{color:t,...n}=e;return n}function Jt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:vr(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:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Ei=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:fu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:vu(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 vu(e){return{...e.fontFamily&&{fontFamily:vr(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 xu="SvgImage-module__svg___q3xE-",bu="SvgImage-module__img___VsTm-",ss={svg:xu,img:bu},wu=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Su=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,dn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=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("")');s(d)}},[]),!wu(e)||!l?r.jsx("img",{src:e,alt:"",className:pt(ss.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:pt(ss.svg,i),style:{"--svg":Su(e),"--fill":t,"--hover-fill":n,...o??{}}})},$u={"top-left":Xe.topLeftAlignment,"top-center":Xe.topCenterAlignment,"top-right":Xe.topRightAlignment,"middle-left":Xe.middleLeftAlignment,"middle-center":Xe.middleCenterAlignment,"middle-right":Xe.middleRightAlignment,"bottom-left":Xe.bottomLeftAlignment,"bottom-center":Xe.bottomCenterAlignment,"bottom-right":Xe.bottomRightAlignment};function Cu({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:b,textAppearance:S,color:C}=n.imageCaption??{},[y,w]=a.useState(void 0),[$,T]=a.useState(null),[R,M]=a.useState(0),[H,F]=a.useState(0),{direction:V,transition:P,controls:x,pagination:U,imageCaption:h,triggers:E}=e,A=a.useRef(P.type),{x:j,y:X}=e.controls.offset,ae=Z=>{o&&o.go(Z)};return a.useEffect(()=>{if(!$)return;const Z=new ResizeObserver(q=>{if(!o)return;const[N]=q;w({width:Math.round(N.contentRect.width),height:Math.round(N.contentRect.height)})});return Z.observe($),()=>Z.unobserve($)},[$]),a.useEffect(()=>{!o||A.current===P.type||(F(Z=>Z+1),A.current=P.type)},[P.type]),r.jsx("div",{className:pt(Xe.wrapper,{[Xe.editor]:i}),ref:T,children:r.jsxs("div",{className:Xe.sliderInner,style:{width:y?y.width:"100%",height:y?y.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:pt(Xe.captionBlock),children:r.jsx("div",{className:Xe.captionTextWrapper,children:t.map((Z,q)=>r.jsx("div",{className:pt(Xe.captionText,$u[h.alignment],{[Xe.withPointerEvents]:q===R&&i,[Xe.active]:q===R}),style:{fontFamily:vr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":v.scalingValue(s.width,i),letterSpacing:v.scalingValue(c,i),wordSpacing:v.scalingValue(m,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:C,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Xe.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:v.scalingValue(h.offset.y,i),left:v.scalingValue(h.offset.x,i)},children:r.jsx(Ei,{content:Z.imageCaption})})},q))})}),r.jsx(Aa,{onMove:Z=>{M(Z.index)},ref:l,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:E.autoPlay!==null,...E.autoPlay!==null&&{interval:parseInt(E.autoPlay)*1e3},direction:V==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:E.triggersList.drag,perPage:1,width:y?y.width:"100%",height:y?y.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((Z,q)=>r.jsx(Fa,{children:r.jsx("div",{className:Xe.sliderItem,children:r.jsx("div",{className:Xe.imgWrapper,children:r.jsx("img",{className:pt(Xe.sliderImage,{[Xe.contain]:Z.image.objectFit==="contain",[Xe.cover]:Z.image.objectFit==="cover"}),src:Z.image.url,alt:Z.image.name??""})})})},q))},H),x.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:pt(Xe.arrow,{[Xe.arrowVertical]:V==="vert",[Xe.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:r.jsxs("button",{onClick:()=>{ae("-1")},className:Xe.arrowInner,style:{transform:`translate(${v.scalingValue(j,i)}, ${v.scalingValue(X*(V==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&r.jsx(dn,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:pt(Xe.arrowImg,Xe.mirror)}),!x.arrowsImgUrl&&r.jsx(ls,{color:x.color,className:pt(Xe.arrowIcon,Xe.arrowImg,Xe.mirror)})]})}),r.jsx("div",{className:pt(Xe.arrow,Xe.nextArrow,{[Xe.arrowVertical]:V==="vert",[Xe.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:r.jsxs("button",{className:Xe.arrowInner,onClick:()=>ae("+1"),style:{transform:`translate(${v.scalingValue(j*(V==="horiz"?-1:1),i)}, ${v.scalingValue(X,i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&r.jsx(dn,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:Xe.arrowImg}),!x.arrowsImgUrl&&r.jsx(ls,{color:x.color,className:pt(Xe.arrowIcon,Xe.arrowImg)})]})})]}),E.triggersList.click&&r.jsx("div",{className:Xe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),U.isActive&&r.jsx("div",{className:pt(Xe.pagination,{[Xe.paginationInsideBottom]:U.position==="inside-1"&&V==="horiz",[Xe.paginationInsideTop]:U.position==="inside-2"&&V==="horiz",[Xe.paginationOutsideBottom]:U.position==="outside-1"&&V==="horiz",[Xe.paginationOutsideTop]:U.position==="outside-2"&&V==="horiz",[Xe.paginationInsideLeft]:U.position==="inside-1"&&V==="vert",[Xe.paginationInsideRight]:U.position==="inside-2"&&V==="vert",[Xe.paginationOutsideLeft]:U.position==="outside-1"&&V==="vert",[Xe.paginationOutsideRight]:U.position==="outside-2"&&V==="vert",[Xe.paginationVertical]:V==="vert"}),children:r.jsx("div",{className:Xe.paginationInner,style:{backgroundColor:U.colors[2],transform:`scale(${U.scale/100}) translate(${v.scalingValue(U.offset.x,i)}, ${v.scalingValue(U.offset.y,i)}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:t.map((Z,q)=>r.jsx("button",{onClick:()=>{o&&o.go(q)},className:pt(Xe.paginationItem),children:r.jsx("div",{className:pt(Xe.dot,{[Xe.activeDot]:q===R}),style:{backgroundColor:q===R?U.colors[0]:U.colors[1],"--pagination-hover-color":U.hover}})},q))})})]})})}function ls({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 Tu={element:Cu,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"]}},Lu="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Iu="ImageRevealSlider-module__image___Qjt-e",Ru="ImageRevealSlider-module__link___N-iLG",Eu="ImageRevealSlider-module__cursor___2U03d",yi={imageRevealSlider:Lu,image:Iu,link:Ru,cursor:Eu};function cs(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,c=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function Pr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Mu(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await Pr(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await Pr(e);l=s.height/s.width*o}else{const s=await Pr(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function ku({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[l,s]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[m,b]=a.useState({x:0,y:0}),[S,C]=a.useState(1),[y,w]=a.useState("none"),$=a.useRef({x:0,y:0}),[T,R]=a.useState(!1),{sizeType:M,imageWidth:H,randomRangeImageWidth:F}=e.imageSize,{revealPosition:V,visible:P}=e.position,{cursorType:x,target:U,defaultCursorScale:h,defaultCursor:E,hoverCursorScale:A,hoverCursor:j}=e.cursor;a.useEffect(()=>{if(!i)return;const Z=(L,k)=>{const K=i.getBoundingClientRect(),z=L-K.left,ne=k-K.top;if(b({x:z,y:ne}),x==="system"){w("none"),C(1);return}const _=z,ye=ne,f=document.elementFromPoint(K.left+_,K.top+ye);if(f&&f.closest("a")){w("none"),C(1);return}const ve=cs(_,ye,l)||U==="area"?{img:j??"none",scale:A}:{img:E??"none",scale:h};w(ve.img),C(ve.scale)},q=L=>{L.stopPropagation(),$.current={x:L.clientX,y:L.clientY},Z(L.clientX,L.clientY)},N=()=>{T&&Z($.current.x,$.current.y)};return i.addEventListener("mousemove",q),window.addEventListener("scroll",N,!0),()=>{i.removeEventListener("mousemove",q),window.removeEventListener("scroll",N,!0)}},[i,T,m,x,U,j,E,A,h,l]),a.useEffect(()=>{T||(w("none"),C(0))},[T]);const X=async(Z,q,N,L={})=>{const{width:k,height:K,finalWidth:z}=await Mu(Z.image.url,M,H,F);let ne=0,_=0;V==="same"?(ne=q/2,_=N/2):(ne=L.x??Math.random()*q,_=L.y??Math.random()*N);const ye=Math.min(Math.max(ne,k/2),q-k/2),f=Math.min(Math.max(_,K/2),N-K/2);return{id:u.current++,url:Z.image.url,link:Z.link,name:Z.image.name,x:ye,y:f,width:z}};a.useEffect(()=>{if(!i||t.length===0)return;const Z=i.getBoundingClientRect(),q=Z.width,N=Z.height,L=[];(async()=>{const K=t[0],z=await X(K,q,N);L.push(z),s(L),c(1)})()},[M,H,F,V,i]),a.useEffect(()=>{P==="last One"&&s(Z=>Z.length>0?[Z[Z.length-1]]:[])},[P]);const ae=async Z=>{if(!i)return;const q=i.getBoundingClientRect(),N=Z.clientX-q.left,L=Z.clientY-q.top;if(U==="image"&&!cs(N,L,l))return;let k=0,K=0;V==="on Click"?(k=N,K=L):V==="same"?(k=q.width/2,K=q.height/2):(k=Math.random()*q.width,K=Math.random()*q.height);const z=t[d],ne=await X(z,q.width,q.height,{x:k,y:K});s(_=>P==="all"?[..._,ne]:[ne]),c(_=>_>=t.length-1?0:_+1)};return r.jsxs("div",{ref:o,onClick:ae,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:yi.imageRevealSlider,style:{cursor:y==="none"?"default":"none"},children:[l.map(Z=>r.jsx("div",{className:yi.wrapper,style:{top:`${Z.y}px`,left:`${Z.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:Z.width??"auto",height:"auto",cursor:y==="none"?"default":"none"},children:U==="area"&&Z.link?r.jsx("a",{href:Z.link,target:"_blank",className:yi.link,children:r.jsx("img",{src:Z.url,alt:Z.name,className:yi.image},Z.id)}):r.jsx("img",{src:Z.url,alt:Z.name,className:yi.image},Z.id)},Z.id)),T&&r.jsx("div",{className:yi.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${S})`,backgroundImage:`url('${y}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Pu={element:ku,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:""}]}}}},Au="LightBox-module__hidden___9s-9x",Fu="LightBox-module__heroImage___sTxNF",Wu="LightBox-module__background___rm9ml",_u="LightBox-module__editor___4ACaY",Hu="LightBox-module__contentStyle___Bgnsq",Nu="LightBox-module__imageStyle___tLIlB",Ou="LightBox-module__imgWrapper___LuFUp",ju="LightBox-module__contain___8-yaS",Bu="LightBox-module__cover___hNvOG",zu="LightBox-module__caption___b6L2I",Du="LightBox-module__captionTextInner___rCGNH",Vu="LightBox-module__lightboxSplide___XFuWC",Gu="LightBox-module__arrow___iz38X",qu="LightBox-module__arrowVertical___Zfz81",Ku="LightBox-module__nextArrow___zkAQN",Uu="LightBox-module__arrowInner___p48sW",Xu="LightBox-module__arrowIcon___3VaFf",Yu="LightBox-module__arrowImg___pNV88",Ju="LightBox-module__mirror___pjeXc",Zu="LightBox-module__thumbsWrapper___GB-nU",Qu="LightBox-module__thumbsContainerVertical___wttk5",ep="LightBox-module__thumbsContainer___osSma",tp="LightBox-module__thumbsAlignStart___MO6tY",np="LightBox-module__thumbsAlignCenter___Q4sUx",ip="LightBox-module__thumbsAlignEnd___p4y9R",op="LightBox-module__thumbItem___HvnF3",rp="LightBox-module__closeButton___g2khP",ap="LightBox-module__fadeIn___0m5GW",sp="LightBox-module__slideInLeft___gPYwC",lp="LightBox-module__slideInRight___S-pPp",cp="LightBox-module__slideInTop___DFdAj",dp="LightBox-module__slideInBottom___m27kZ",up="LightBox-module__fadeOut___55qBR",pp="LightBox-module__slideOutLeft___NvU7P",mp="LightBox-module__slideOutRight___SK7eC",gp="LightBox-module__slideOutTop___Vgg0z",hp="LightBox-module__slideOutBottom___nJ0Ef",fp="LightBox-module__scaleSlide___vZriG",Fe={hidden:Au,heroImage:Fu,background:Wu,editor:_u,contentStyle:Hu,imageStyle:Nu,imgWrapper:Ou,contain:ju,cover:Bu,caption:zu,captionTextInner:Du,lightboxSplide:Vu,arrow:Gu,arrowVertical:qu,nextArrow:Ku,arrowInner:Uu,arrowIcon:Xu,arrowImg:Yu,mirror:Ju,thumbsWrapper:Zu,thumbsContainerVertical:Qu,thumbsContainer:ep,thumbsAlignStart:tp,thumbsAlignCenter:np,thumbsAlignEnd:ip,thumbItem:op,closeButton:rp,fadeIn:ap,slideInLeft:sp,slideInRight:lp,slideInTop:cp,slideInBottom:dp,fadeOut:up,slideOutLeft:pp,slideOutRight:mp,slideOutTop:gp,slideOutBottom:hp,scaleSlide:fp},Eo=(e,t,n)=>{const i={},[o,l]=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"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="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)}))`:l==="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 jl(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 nr(e){const t=e.getBoundingClientRect(),n=jl(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,c=l/s;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const b=t.left+n.left,S=t.top+n.top,C=(i-u)/2+b,y=(o-m)/2+S;return{x:C,y,width:u,height:m}}function ds(e){const t=e.getBoundingClientRect(),n=jl(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function us(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function yp(e,t){const n=(()=>{if(e==="fade in")return Fe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Fe.slideInLeft;case"right":return Fe.slideInRight;case"top":return Fe.slideInTop;case"bottom":return Fe.slideInBottom;default:return Fe.slideInRight}return Fe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Fe.fadeIn;if(e==="slide in")switch(t){case"left":return Fe.slideInLeft;case"right":return Fe.slideInRight;case"top":return Fe.slideInTop;case"bottom":return Fe.slideInBottom;default:return Fe.slideInRight}return Fe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Fe.fadeOut;if(e==="slide in")switch(t){case"left":return Fe.slideOutLeft;case"right":return Fe.slideOutRight;case"top":return Fe.slideOutTop;case"bottom":return Fe.slideOutBottom;default:return Fe.slideOutRight}return Fe.fadeOut})(),l=(()=>{if(e==="fade in")return Fe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Fe.slideOutLeft;case"right":return Fe.slideOutRight;case"top":return Fe.slideOutTop;case"bottom":return Fe.slideOutBottom;default:return Fe.slideOutRight}return Fe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const vp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{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:Fe.heroImage,onClick:()=>c(!0)}),r.jsx(xp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},xp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:b,wordSpacing:S,fontSizeLineHeight:C,textAppearance:y,color:w}=i.imageCaption??{},[$,T]=a.useState(0),[R,M]=a.useState(0),[H,F]=a.useState(!1),[V,P]=a.useState(!1),[x,U]=a.useState({}),h=a.useRef(null),E=a.useRef(null),A=a.useRef(null),j=a.useRef(!1),X=a.useRef(null),ae=a.useRef(null),Z=a.useRef(null),q=a.useRef(null),N=a.useRef(!1),L=a.useRef(null),[k,K]=a.useState(!1),{appear:z,triggers:ne,slider:_,thumbnail:ye,controls:f,area:ve,caption:Y,layout:le}=o.lightboxBlock,{appearClass:$e,backdropAppearClass:oe,backdropDisappearClass:xe,disappearClass:G}=yp(z.type,z.direction),he=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const B=()=>{setTimeout(()=>{var W,te;(te=(W=h.current)==null?void 0:W.splide)==null||te.refresh()},16)},Q=()=>{M(W=>W+1)};return window.addEventListener("ArticleEditor.Layout:change",B),window.addEventListener("ArticleEditor.ComponentContent:change",Q),()=>{window.removeEventListener("ArticleEditor.Layout:change",B),window.removeEventListener("ArticleEditor.ComponentContent:change",Q)}},[]),a.useEffect(()=>{if(!e||!ye.isActive){K(!1);return}const B=L.current;if(!B)return;const Q=()=>{_.direction==="horiz"?K(B.scrollWidth>B.clientWidth):K(B.scrollHeight>B.clientHeight)};Q();const W=new ResizeObserver(Q);return W.observe(B),()=>W.disconnect()},[e,ye.isActive,n.length,x,_.direction]);const be=a.useCallback(()=>{const B=window.matchMedia("(max-width: 768px)").matches,Q=us(ve.color);B&&!s&&Q>.9&&(document.body.style.backgroundColor=""),F(!0),j.current=!0;const W=te=>{te.target===X.current&&te.animationName&&(X.current&&ae.current&&X.current.removeEventListener("animationend",ae.current),ae.current=null,j.current&&(j.current=!1,t()),F(!1))};X.current&&(ae.current=W,X.current.addEventListener("animationend",W))},[t,ve.color,s]),ce=(B,Q,W)=>{var te,ie;if(B){if(ne.type==="click"&&ne.switch==="image")ne.repeat==="close"&&$===n.length-1?be():(te=h.current)==null||te.go("+1");else if(ne.type==="click"&&ne.switch==="50/50"){const pe=B.getBoundingClientRect(),me=Q-pe.left,fe=W-pe.top,Ie=pe.width,ee=pe.height;let ge;_.direction==="horiz"?ge=me<Ie/2?"-1":"+1":ge=fe<ee/2?"-1":"+1",(ie=h.current)==null||ie.go(ge)}}},se=B=>{if(N.current){N.current=!1;return}const Q=n[$],W=(Q==null?void 0:Q.image.objectFit)==="cover";let te,ie;if("changedTouches"in B&&B.changedTouches.length>0)te=B.changedTouches[0].clientX,ie=B.changedTouches[0].clientY;else if("clientX"in B)te=B.clientX,ie=B.clientY;else return;let pe;if(W&&A.current){const me=ds(A.current);pe=te>=me.left&&te<=me.right&&ie>=me.top&&ie<=me.bottom}else{const me=A.current?nr(A.current):null;if(!me){B.target===B.currentTarget&&be();return}pe=te>=me.x&&te<=me.x+me.width&&ie>=me.y&&ie<=me.y+me.height}pe?ce(A.current,te,ie):be()},Le=B=>{const Q=B.target;(Q.classList.contains(Fe.thumbsWrapper)||Q.classList.contains(Fe.thumbsContainer))&&se(B)};a.useEffect(()=>{if(!e)return;const B=Q=>{var W,te;if(Q.key==="Escape"){be();return}if(Q.key==="ArrowRight"){T(ie=>(ie+1)%Math.max(n.length,1)),(W=h.current)==null||W.go("+1");return}Q.key==="ArrowLeft"&&(T(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(te=h.current)==null||te.go("-1"))};return window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B)}},[e,be,n.length]),a.useEffect(()=>{if(e){if(T(0),M(Q=>Q+1),j.current=!1,F(!1),P(!1),U({}),!he)return;const B=new CustomEvent("page-overlay",{detail:{itemId:he}});window.dispatchEvent(B)}return()=>{X.current&&ae.current&&(X.current.removeEventListener("animationend",ae.current),ae.current=null),P(!1)}},[e,he]),a.useEffect(()=>{E.current!==null&&E.current!==_.type&&M(B=>B+1),E.current=_.type},[_.type]),a.useEffect(()=>{if(!e)return;const B=document.body.style.overflow,Q=window.matchMedia("(max-width: 768px)").matches,W=us(ve.color);document.body.style.overflow="hidden",P(!1);const te=pe=>{pe.target===X.current&&!j.current&&pe.animationName&&(Q&&!s&&W>.9&&(document.body.style.backgroundColor=ve.color),P(!0),X.current&&Z.current&&X.current.removeEventListener("animationend",Z.current),Z.current=null)};X.current&&(Z.current=te,X.current.addEventListener("animationend",te));const ie=pe=>{const me=pe.target;me&&(me.closest(`.${Fe.thumbsWrapper}`)||me.closest(`.${Fe.thumbsContainer}`))||_.type!=="slide"&&pe.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=B,document.removeEventListener("touchmove",ie),X.current&&Z.current&&(X.current.removeEventListener("animationend",Z.current),Z.current=null),P(!1)}},[e,s,ve.color,_.type]),a.useEffect(()=>{if(!e)return;const B=Q=>{var te,ie;if(j.current){Q.stopPropagation();return}if(N.current){N.current=!1;return}const W=Q.target;if(!(W&&(W.closest(`.${Fe.thumbsContainer}`)||W.closest(`.${Fe.thumbItem}`)||W.closest(`.${Fe.arrow}`)||W.closest(`.${Fe.closeButton}`)||W.closest(`.${Fe.caption}`)))){if(_.type==="slide"&&ne.type==="drag"&&((ie=(te=h.current)==null?void 0:te.splide)!=null&&ie.root)){const pe=h.current.splide.root;if(W&&(pe.contains(W)||pe===W))return}if(Q.touches.length===0&&Q.changedTouches.length>0){const pe=n[$],me=(pe==null?void 0:pe.image.objectFit)==="cover",fe=Q.changedTouches[0];let Ie;if(me&&A.current){const ee=ds(A.current);Ie=fe.clientX>=ee.left&&fe.clientX<=ee.right&&fe.clientY>=ee.top&&fe.clientY<=ee.bottom}else{const ee=A.current?nr(A.current):null;if(!ee)return;Ie=fe.clientX>=ee.x&&fe.clientX<=ee.x+ee.width&&fe.clientY>=ee.y&&fe.clientY<=ee.y+ee.height}if(!Ie){Q.stopPropagation(),j.current=!0;const ee=ge=>{ge.stopPropagation(),ge.preventDefault(),document.removeEventListener("click",ee,!0)};document.addEventListener("click",ee,!0),be()}}}};return document.addEventListener("touchend",B,{passive:!0}),()=>{document.removeEventListener("touchend",B)}},[e,be,$,n]);const Me=(_.type==="scale"||_.type==="fade")&&_.direction==="vert"&&ne.type==="drag";a.useEffect(()=>{var ge,Ae;if(!e||!Me||!((Ae=(ge=h.current)==null?void 0:ge.splide)!=null&&Ae.root))return;const B=h.current.splide.root,Q=30,W=(re,D)=>{if(q.current){const Oe=Math.abs(re-q.current.x),We=Math.abs(D-q.current.y);(Oe>0||We>0)&&(N.current=!0)}},te=re=>{q.current&&(re.preventDefault(),W(re.clientX,re.clientY))},ie=re=>{q.current&&re.touches.length>0&&(re.preventDefault(),W(re.touches[0].clientX,re.touches[0].clientY))},pe=(re,D)=>{if(!q.current||!h.current){q.current=null;return}const Oe=Math.abs(re-q.current.x),We=Math.abs(D-q.current.y);We>Q&&We>Oe&&h.current.go(D<q.current.y?"+1":"-1"),q.current=null},me=re=>{q.current&&pe(re.clientX,re.clientY),document.removeEventListener("pointerup",me),document.removeEventListener("pointercancel",me),document.removeEventListener("pointermove",te)},fe=re=>{if(q.current){if(re.changedTouches.length>0){const D=re.changedTouches[0];pe(D.clientX,D.clientY)}document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),document.removeEventListener("touchmove",ie)}},Ie=re=>{q.current={x:re.clientX,y:re.clientY},N.current=!1,document.addEventListener("pointermove",te,{passive:!1}),document.addEventListener("pointerup",me),document.addEventListener("pointercancel",me)},ee=re=>{re.touches.length>0&&(q.current={x:re.touches[0].clientX,y:re.touches[0].clientY},N.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",fe),document.addEventListener("touchcancel",fe))};return B.addEventListener("pointerdown",Ie),B.addEventListener("touchstart",ee),()=>{B.removeEventListener("pointerdown",Ie),B.removeEventListener("touchstart",ee),document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",me),document.removeEventListener("pointercancel",me),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),q.current=null,N.current=!1}},[e,Me,R]);const we={backgroundColor:ve.color,backdropFilter:`blur(${ve.blur}px)`,animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:mi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:X,className:pt(Fe.background,H?xe:oe,{[Fe.editor]:s},{[Fe.hidden]:!e}),style:{...we,...V&&!s&&!H?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?X:null,className:pt(Fe.contentStyle,H?G:$e,{[Fe.editor]:s},{[Fe.hidden]:!e}),style:{animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Aa,{onMove:B=>T(B.index),ref:h,className:Fe.lightboxSplide,options:{arrows:!1,speed:_.duration?parseInt(_.duration):500,direction:_.direction==="horiz"||_.type==="fade"||_.type==="scale"?"ltr":"ttb",pagination:!1,drag:ne.type==="drag"&&!Me,perPage:1,width:"100%",height:"100%",type:_.type==="fade"||_.type==="scale"?"fade":"loop",padding:0,rewind:ne.repeat!=="close",start:0},style:{"--splide-speed":_.duration},children:n.map((B,Q)=>{const W=Eo(le.position,le.offset,s),te=`${v.scalingValue(le.padding.top,s)} ${v.scalingValue(le.padding.right,s)} ${v.scalingValue(le.padding.bottom,s)} ${v.scalingValue(le.padding.left,s)}`,ie=_.type==="scale"?(()=>{const{transform:pe,...me}=W;return{...me,position:"absolute",padding:te,boxSizing:"border-box","--position-transform":pe||"none"}})():{...W,position:"absolute",padding:te,boxSizing:"border-box"};return r.jsx(Fa,{children:r.jsx("div",{className:Fe.imgWrapper,onClick:se,children:r.jsx("img",{ref:Q===$?A:null,className:pt(Fe.imageStyle,{[Fe.contain]:B.image.objectFit==="contain",[Fe.cover]:B.image.objectFit==="cover",[Fe.scaleSlide]:_.type==="scale"}),src:B.image.url,alt:B.image.name??"",style:{...ie,pointerEvents:B.image.objectFit==="contain"?"none":"auto"}})})},Q)})},R),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:pt(Fe.arrow,{[Fe.arrowVertical]:_.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:Fe.arrowInner,style:{transform:`translate(${v.scalingValue(f.offset.x,s)}, ${v.scalingValue(f.offset.y*(_.direction==="horiz"?1:-1),s)}) scale(${f.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var B;return(B=h.current)==null?void 0:B.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(dn,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:pt(Fe.arrowImg,Fe.mirror)}),!f.arrowsImgUrl&&r.jsx(ps,{color:f.color,className:pt(Fe.arrowIcon,Fe.arrowImg,Fe.mirror)})]})}),r.jsx("div",{className:pt(Fe.arrow,Fe.nextArrow,{[Fe.arrowVertical]:_.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:Fe.arrowInner,style:{transform:`translate(${v.scalingValue(f.offset.x*(_.direction==="horiz"?-1:1),s)}, ${v.scalingValue(f.offset.y,s)}) scale(${f.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var B;return(B=h.current)==null?void 0:B.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(dn,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:Fe.arrowImg}),!f.arrowsImgUrl&&r.jsx(ps,{color:f.color,className:pt(Fe.arrowIcon,Fe.arrowImg)})]})})]}),ve.closeIconUrl&&(()=>{const B=Eo(ve.closeIconAlign,ve.closeIconOffset,s),Q=`scale(${ve.closeIconScale})`,W=B.transform?`${B.transform} ${Q}`:Q;return r.jsx("button",{className:Fe.closeButton,style:{...B,transform:W},onClick:be,"aria-label":"Close lightbox",children:r.jsx(dn,{url:ve.closeIconUrl,fill:ve.closeIconColor??"#000000",hoverFill:ve.closeIconHover??"#cccccc"})})})(),Y&&Y.isActive&&i.imageCaption&&((Se=n[$])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:Fe.caption,style:{...Eo(Y.alignment,Y.offset,s),fontFamily:vr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":v.scalingValue(c.width,s),letterSpacing:v.scalingValue(m,s),wordSpacing:v.scalingValue(S,s),textAlign:b,fontSize:v.scalingValue(C.fontSize,s),lineHeight:v.scalingValue(C.lineHeight,s),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:w},onClick:B=>B.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Fe.captionTextInner,style:{"--link-color":Y.linkColor,"--link-hover-color":Y.linkHoverColor},children:r.jsx(Ei,{content:n[$].imageCaption})})}),ye.isActive&&(()=>{const[B,Q]=ye.position.split("-"),W=_.direction==="horiz"?`${B}-left`:ye.position,te=Eo(W,ye.offset,s),ie=()=>{if(_.direction==="horiz"){if(Q==="left")return"flex-start";if(Q==="center")return"center";if(Q==="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:L,className:Fe.thumbsWrapper,onClick:pe=>Le(pe),style:{position:s?"absolute":"fixed",...te,..._.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:pt(Fe.thumbsContainer,{[Fe.thumbsContainerVertical]:_.direction==="vert",[Fe.thumbsAlignStart]:ye.align==="start",[Fe.thumbsAlignCenter]:ye.align==="center",[Fe.thumbsAlignEnd]:ye.align==="end"}),style:{gap:v.scalingValue(ye.grid.gap,s),justifyContent:k?"flex-start":ie()},children:n.map((pe,me)=>{const fe=me===$,Ie=x[me],ge=ye.grid.size*(fe?ye.activeState.scale:1),Ae=()=>{if(ye.fit!=="fit")return{};if(!Ie)return _.direction==="horiz"?{height:v.scalingValue(ge,s)}:{width:v.scalingValue(ge,s)};const re=Ie.width/Ie.height;if(_.direction==="horiz"){const D=ge,Oe=D*re;return{width:v.scalingValue(Oe,s),height:v.scalingValue(D,s)}}else{const D=ge,Oe=D/re;return{width:v.scalingValue(D,s),height:v.scalingValue(Oe,s)}}};return r.jsx("button",{className:Fe.thumbItem,style:{..._.direction==="horiz"&&ye.fit!=="fit"?{height:v.scalingValue(ge,s)}:{},..._.direction==="vert"&&ye.fit!=="fit"?{width:v.scalingValue(ge,s)}:{},...ye.fit==="cover"?{width:v.scalingValue(ge,s),height:v.scalingValue(ge,s)}:{},...Ae(),transition:fe?"all 0.25s ease-out":"none",opacity:fe?ye.activeState.opacity/100:ye.opacity/100,"--thumb-hover":ye.activeState.opacity/100},onClick:re=>{var D;re.stopPropagation(),T(me),(D=h.current)==null||D.go(me)},onMouseEnter:()=>{var re;ye.triggers==="hov"&&((re=h.current)==null||re.go(me))},children:r.jsx("img",{src:pe.image.url,alt:pe.image.name??"",onLoad:re=>{const D=re.currentTarget;D.naturalWidth&&D.naturalHeight&&U(Oe=>({...Oe,[me]:{width:D.naturalWidth,height:D.naturalHeight}}))},style:{objectFit:ye.fit==="cover"?"cover":"contain",...ye.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ye.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${pe.image.name}-${me}`)})})})})()]})]}),document.getElementById(l))};function ps({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 bp={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 Mo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function wp(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
|
|
158
|
+
`}function Sp({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:c}=v.useScopedStyles(),{type:u="A",fieldsToShow:m=2,fields:b=[],buttonLabel:S,gap:C,fieldsGap:y,buttonCorners:w,buttonStroke:$,buttonPadding:T,isButtonFullWidth:R,inputCorners:M,inputStroke:H,inputPadding:F,inputColor:V,inputTextColor:P,inputBorderColor:x,placeholderColor:U,buttonColor:h,buttonTextColor:E,buttonBorderColor:A,labelTextColor:j,successColor:X,errorColor:ae,fontFamily:Z,inputFontSettings:q,inputFontSize:N,inputLineHeight:L,inputLetterSpacing:k,inputWordSpacing:K,inputTextAppearance:z,buttonFontSettings:ne,buttonFontSize:_,buttonLineHeight:ye,buttonLetterSpacing:f,buttonWordSpacing:ve,buttonTextAppearance:Y,labelFontSettings:le,labelFontSize:$e,labelLineHeight:oe,labelLetterSpacing:xe,labelWordSpacing:G,labelTextAppearance:he,statusFontSettings:be,statusFontSize:ce,statusLineHeight:se,statusLetterSpacing:Le,statusWordSpacing:Me,statusTextAppearance:we,successMessage:Se,errorMessage:B,stateOverrides:Q}=e,W=u==="B",te=b.slice(0,Math.min(m,b.length)),ie={fontSettings:{fontFamily:Z,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:N??.01,lineHeight:L,letterSpacing:k??0,wordSpacing:K??0,textAppearance:z,color:P},pe=cn(Jt(ie,t)),me=v.scalingValue(H??0,t),fe=v.scalingValue((L??N??.01)+((F==null?void 0:F.top)??0)+((F==null?void 0:F.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),Ie={...pe,borderStyle:"solid",borderRadius:u==="C"?0:v.scalingValue(M??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:me,borderLeftWidth:0}:{borderWidth:me},paddingTop:v.scalingValue((F==null?void 0:F.top)??0,t),paddingRight:v.scalingValue((F==null?void 0:F.right)??0,t),paddingBottom:v.scalingValue((F==null?void 0:F.bottom)??0,t),paddingLeft:v.scalingValue((F==null?void 0:F.left)??0,t),height:fe,minHeight:fe},ee={fontSettings:{fontFamily:Z,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:_??.01,lineHeight:ye,letterSpacing:f??0,wordSpacing:ve??0,textAppearance:Y,color:E},ge=cn(Jt(ee,t)),Ae=v.scalingValue($??0,t),re={fontSettings:{fontFamily:Z,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:$e??.01,lineHeight:oe,letterSpacing:xe??0,wordSpacing:G??0,textAppearance:he,color:j},D=Jt(re,t),Oe={fontSettings:{fontFamily:Z,fontWeight:(be==null?void 0:be.fontWeight)??400,fontStyle:(be==null?void 0:be.fontStyle)??"normal"},fontSize:ce??.01,lineHeight:se,letterSpacing:Le??0,wordSpacing:Me??0,textAppearance:we,color:X},We=cn(Jt(Oe,t)),et=v.buildColorVars(c,{inputColor:V,inputTextColor:P,inputBorderColor:x,placeholderColor:U!=null&&U.trim()?U:"#cccccc",buttonColor:h,buttonTextColor:E,buttonBorderColor:A,labelTextColor:j,successColor:X,errorColor:ae},$p,Cp,Q),[Ye,st]=a.useState(()=>Object.fromEntries(te.map(Ge=>[Ge.name,""]))),[mt,De]=a.useState("idle"),[it,$t]=a.useState(null),ot=l==="success"?"success":l==="error"?"error":mt,Ue=l==="error"?B:it,ht=l==="filled",xt=a.useMemo(()=>{if(!ht)return Ye;let Ge=null;for(const qe of te)(Ye[qe.name]??"").trim().length>0||(Ge=Ge??{...Ye},Ge[qe.name]="Filled");return Ge??Ye},[Ye,ht,te]),ct=ot==="error"?v.getFormFieldValidationError(te,xt):null,_t=`${l&&l!=="default"?`${c}-state-${l}`:""}`.trim(),Qe=o==null?void 0:o.submitUrl,Tt=(Ge,qe)=>{st(Pe=>({...Pe,[Ge]:qe}))},Lt=async Ge=>{if(Ge.preventDefault(),!d)return;const qe=Object.fromEntries(te.map(gt=>{var It;return[gt.name,((It=Ye[gt.name])==null?void 0:It.trim())??""]}).filter(([,gt])=>gt));if(!Qe){De("error"),$t("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Pe=v.getFormFieldValidationError(te,Ye);if(Pe){De("error"),$t(Pe);return}De("submitting"),$t(null);try{const gt=await fetch(Qe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!gt.ok){const It=await gt.text();throw new Error(It||`Request failed: ${gt.status}`)}De("success"),st(Object.fromEntries(te.map(It=>[It.name,""])))}catch(gt){De("error"),$t(gt instanceof Error?gt.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${_t}`.trim(),style:et,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:wp(c)}}),r.jsxs("form",{onSubmit:Lt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:te.map((Ge,qe)=>r.jsxs(a.Fragment,{children:[qe>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${c}-control`:void 0,style:{height:v.scalingValue(y??0,t)}}),r.jsxs("div",{className:`${c}-field-group${W?` ${c}-labeled`:""}`,children:[W&&r.jsx("span",{className:`${c}-field-label`,style:D?{...D,lineHeight:D.fontSize}:void 0,children:Ge.label||Ge.name}),Ge.type==="textarea"?r.jsx("textarea",{name:Ge.name,autoComplete:"off",value:xt[Ge.name]??"",onChange:Pe=>Tt(Ge.name,Pe.target.value),placeholder:Ge.placeholder,className:`${c}-input`,style:Ie,rows:1,"data-filled":ht||(xt[Ge.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Ge.type==="phone"?"tel":Ge.type==="email"?"email":"text",name:Ge.name,autoComplete:"off",value:xt[Ge.name]??"",onChange:Pe=>Tt(Ge.name,Pe.target.value),placeholder:Ge.placeholder,required:Ge.isRequired??Ge.type==="email",className:`${c}-input`,style:Ie,"data-filled":ht||(xt[Ge.name]??"").trim().length>0})]})]},qe))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${c}-control`:void 0,style:{height:v.scalingValue(C??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:v.scalingValue(w??0,t),borderWidth:Ae,paddingTop:v.scalingValue((T==null?void 0:T.top)??0,t),paddingRight:v.scalingValue((T==null?void 0:T.right)??0,t),paddingBottom:v.scalingValue((T==null?void 0:T.bottom)??0,t),paddingLeft:v.scalingValue((T==null?void 0:T.left)??0,t),pointerEvents:d?"auto":void 0,...ge,...R?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:R?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:mt==="submitting"?"...":S})})})]}),ot==="success"&&r.jsx("p",{className:`${c}-success`,style:{...We},children:Se}),ot==="error"&&r.jsx("p",{className:`${c}-error`,style:{...We},role:"alert",children:ct??Ue??B})]})}const $p={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"},Cp=["hover","focus","filled","success","error"],Tp=`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';
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,$p=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{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."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],ko={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Cp=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Tp={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","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"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},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"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",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"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},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"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...ko.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},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:{...ko.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},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"}},labelFontSettings:{...ko.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...ko.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:{fieldsToShow:2,fields:$p,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",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:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{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:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{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:[...Cp],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Lp={element:xp,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:Tp,sourceCode:Sp,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Po(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ip(e){return`
|
|
792
|
+
`,Lp=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{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."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],ko={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ip=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Rp={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","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"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},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"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",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"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},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"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...ko.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},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:{...ko.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},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"}},labelFontSettings:{...ko.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...ko.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:{fieldsToShow:2,fields:Lp,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",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:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{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:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{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:[...Ip],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Ep={element:Sp,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:Rp,sourceCode:Tp,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Po(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Mp(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${Po(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const kp=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=v.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:m=1,fontFamily:b,inputFontSettings:S,inputFontSize:C,inputLineHeight:y,inputLetterSpacing:w,inputWordSpacing:$,inputTextAppearance:T,buttonFontSettings:R,buttonFontSize:M,buttonLineHeight:H,buttonLetterSpacing:F,buttonWordSpacing:V,buttonTextAppearance:P,statusFontSettings:x,statusFontSize:U,statusLineHeight:h,statusLetterSpacing:E,statusWordSpacing:A,statusTextAppearance:j,iconMaxWidth:X,minHeight:ae,corners:Z,stroke:q,stateOverrides:N,inputPadding:L,buttonPadding:k,successMessage:K="Thanks for subscribing!",errorMessage:z="Please, fill all required fields."}=e,ne=d.slice(0,Math.min(m,d.length)),[_,ye]=a.useState(()=>Object.fromEntries(ne.map(re=>[re.name,""]))),[f,ve]=a.useState("idle"),[Y,le]=a.useState(null),$e=o==="success"?"success":o==="error"?"error":f,oe=o==="error"?z:Y,xe=o==="filled",G=a.useMemo(()=>{if(!xe)return _;let re=null;for(const D of ne)(_[D.name]??"").trim().length>0||(re=re??{..._},re[D.name]="Filled");return re??_},[xe,_,ne]),he=$e==="error"?v.getFormFieldValidationError(ne,G):null,be=o&&o!=="default"?`${l}-state-${o}`:"",ce=ne.some(re=>(G[re.name]??"").trim().length>0),se=be!==`${l}-state-filled`&&ce?`${l}-state-filled`:"",Le=`${be} ${se}`.trim(),Me=i==null?void 0:i.submitUrl,we=u??"",Se=(c==null?void 0:c.icon)??"",B=(c==null?void 0:c.mode)==="On",Q=we||"Submit",W={fontSettings:{fontFamily:b,fontWeight:(S==null?void 0:S.fontWeight)??400,fontStyle:(S==null?void 0:S.fontStyle)??"normal"},fontSize:C??.01,lineHeight:y,letterSpacing:w??0,wordSpacing:$??0,textAppearance:T,color:e.inputTextColor??"#111111"},te={fontSettings:{fontFamily:b,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:M??.01,lineHeight:H,letterSpacing:F??0,wordSpacing:V??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},ie={fontSettings:{fontFamily:b,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:U??.01,lineHeight:h,letterSpacing:E??0,wordSpacing:A??0,textAppearance:j,color:e.successColor??"#22c55e"},pe=cn(Jt(W,t)),me=cn(Jt(te,t)),fe=cn(Jt(ie,t)),Ie=v.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(W==null?void 0:W.color)??"#111111",buttonTextColor:e.buttonTextColor??(te==null?void 0:te.color)??"#ffffff"},Pp,Ap,N),ee={borderRadius:v.scalingValue(Z,t),borderWidth:v.scalingValue(q,t),borderStyle:"solid"},ge={borderLeftWidth:v.scalingValue(q,t)},Ae=async re=>{if(re.preventDefault(),!s)return;const D=Object.fromEntries(ne.map(We=>{var et;return[We.name,((et=_[We.name])==null?void 0:et.trim())??""]}).filter(([,We])=>We));if(!Me){ve("error"),le("No integrations were found for this form.");return}if(Object.keys(D).length===0)return;const Oe=v.getFormFieldValidationError(ne,_);if(Oe){ve("error"),le(Oe);return}ve("submitting"),le(null);try{const We=await fetch(Me,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)});if(!We.ok){const et=await We.text();throw new Error(et||`Request failed: ${We.status}`)}ve("success"),ye(Object.fromEntries(ne.map(et=>[et.name,""])))}catch(We){ve("error"),le(We instanceof Error?We.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Le}`.trim(),style:Ie,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Mp(l)}}),r.jsxs("form",{onSubmit:Ae,className:`${l}-form`,style:{...ee,height:v.scalingValue(ae,t),minHeight:v.scalingValue(ae,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:ne.map(re=>r.jsx("input",{type:re.type==="email"?"email":re.type==="phone"?"tel":"text",name:re.name,autoComplete:"off",value:G[re.name]??"",onChange:D=>ye(Oe=>({...Oe,[re.name]:D.target.value})),placeholder:re.placeholder,required:re.isRequired??re.type==="email",className:`${l}-input`,style:{...pe,paddingRight:v.scalingValue(L.right,t),paddingLeft:v.scalingValue(L.left,t),paddingTop:v.scalingValue(L.top,t),paddingBottom:v.scalingValue(L.bottom,t)}},re.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":Q,style:{...me,...ge,paddingRight:v.scalingValue(k.right,t),paddingLeft:v.scalingValue(k.left,t),paddingTop:v.scalingValue(k.top,t),paddingBottom:v.scalingValue(k.bottom,t),pointerEvents:s?"auto":void 0},children:f==="submitting"?"...":B?Se&&r.jsx(dn,{url:Se,className:`${l}-submitBtnIcon`,style:{maxWidth:v.scalingValue(X??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):we})})]}),$e==="success"&&r.jsx("p",{className:`${l}-success`,style:{...fe},children:K}),$e==="error"&&r.jsx("p",{className:`${l}-error`,style:{...fe},role:"alert",children:he??oe??z})]})},Pp={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"},Ap=["hover","focus","filled","success","error"],Fp=`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
|
-
`,Pp="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>'),Ap=[{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."}],Wr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Wp=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Fp={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:{...Wr.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:{...Wr.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:{...Wr.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:Ap,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Pp},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:[...Wp],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"]},_p={element:Rp,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:Fp,sourceCode:kp};function Hp(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1560
|
+
`,Wp="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>'),_p=[{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."}],Ar={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hp=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Np={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:{...Ar.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:{...Ar.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:{...Ar.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:_p,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Wp},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:[...Hp],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"]},Op={element:kp,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:Np,sourceCode:Fp};function jp(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1673,19 +1673,23 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1673
1673
|
pointer-events: auto;
|
|
1674
1674
|
height: 100%;
|
|
1675
1675
|
}
|
|
1676
|
-
.${e}-image-hover-brightness img
|
|
1676
|
+
.${e}-image-hover-brightness img,
|
|
1677
|
+
.${e}-image-hover-brightness video {
|
|
1677
1678
|
transition: filter 0.3s ease;
|
|
1678
1679
|
}
|
|
1679
|
-
.${e}-image-hover-brightness:hover img
|
|
1680
|
+
.${e}-image-hover-brightness:hover img,
|
|
1681
|
+
.${e}-image-hover-brightness:hover video {
|
|
1680
1682
|
filter: brightness(1.25);
|
|
1681
1683
|
}
|
|
1682
|
-
.${e}-image-hover-grayscale img
|
|
1684
|
+
.${e}-image-hover-grayscale img,
|
|
1685
|
+
.${e}-image-hover-grayscale video {
|
|
1683
1686
|
transition: filter 0.3s ease;
|
|
1684
1687
|
}
|
|
1685
|
-
.${e}-image-hover-grayscale:hover img
|
|
1688
|
+
.${e}-image-hover-grayscale:hover img,
|
|
1689
|
+
.${e}-image-hover-grayscale:hover video {
|
|
1686
1690
|
filter: grayscale(100%);
|
|
1687
1691
|
}
|
|
1688
|
-
`}const
|
|
1692
|
+
`}const Bp=30,zp=20,Fr=3,Dp=12,Vp=32,Gp=3,qp=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")},Kp=(e,t)=>Array.from({length:t},()=>e).flat(),Up=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},Bl=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),ms=(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),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(s>0)return s;const d=Array.from({length:t},(u,m)=>e.children[m]),c=Bl(d);return c<=0?0:c+l*Math.max(0,t-1)},Xp=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Bl(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=Number.parseFloat(o.paddingRight)||0;return i+l*Math.max(0,e.children.length-1)+s},Yp=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Jp=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Yp(i,e))},Zp=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??"")},Qp=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,em=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:l,isFirstSet:s,scaled:d,onFirstSetImageDone:c})=>{var h,E,A,j;const u=a.useRef(null),m=!!((h=e.image)!=null&&h.url&&Zp(e.image));a.useLayoutEffect(()=>{s&&Qp(u.current)&&(c==null||c())},[s,(E=e.image)==null?void 0:E.url,c]);const b=n.display==="cover",S=n.ratioValue??"1:1",C=n.reversed??!1,[y,w]=S.split(":").map(Number),R=(C?w:y)/(C?y:w),M=i/R,H=M>o?o:M,F=M>o?o*R:i,V=d(F),P=d(H),x=b?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:d(i),objectFit:"contain"},U=((A=e.image)==null?void 0:A.url)&&(m?r.jsx("video",{ref:X=>{u.current=X},src:e.image.url,style:x,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:s?c:void 0,onError:s?c:void 0}):r.jsx("img",{ref:X=>{u.current=X},src:e.image.url,alt:((j=e.image)==null?void 0:j.name)??"",style:x,onLoad:s?c:void 0,onError:s?c:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...b?{width:V}:{width:"max-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...b?{width:V,height:P,overflow:"hidden"}:{width:"max-content",maxWidth:d(i),height:d(o)}},children:U&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:pt(`${t}-marquee-link`,!b&&`${t}-marquee-link-contain`),children:U}):U})})},tm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=v.useScopedStyles(),[s,d]=a.useState(0),c=s>0?Math.round(s):0,u=a.useMemo(()=>jp(l,c),[l,c]),{speed:m,direction:b,pauseOnHover:S,gap:C,imageMaxWidth:y,imageMaxHeight:w,hoverEffect:$}=e,T=a.useMemo(()=>Up(e.imageFit),[e.imageFit]),R=(t==null?void 0:t.length)??0,M=!!o,H=!n||!!i,F=H&&$!=="off"&&$!=="randomize"?`${l}-image-hover-${$}`:void 0,V=n?!!i:!0,x=((t==null?void 0:t.length)??0)>0&&(V||!!n),U=Math.max(0,m)*Bp,h=ce=>v.scalingValue(ce,n??!1),E=a.useRef(null),A=a.useRef(null),j=a.useRef(null),[X,ae]=a.useState(0),Z=V&&S==="on",[q,N]=a.useState(!1),[L,k]=a.useState({}),K=a.useRef(L);K.current=L;const z=a.useRef(null),ne=a.useRef(0),_=a.useRef(null),ye=a.useMemo(()=>(t??[]).map(ce=>{var se;return((se=ce.image)==null?void 0:se.url)??""}).join("\0"),[t]),[f,ve]=a.useState(Fr),Y=a.useMemo(()=>{const ce=t??[];return ce.length===0||!(V||!!n)?ce:Kp(ce,f)},[t,V,f,n]),le=a.useMemo(()=>(t??[]).filter(ce=>{var se;return!!((se=ce.image)!=null&&se.url)}).length,[t]),$e=x?Gp:1;a.useLayoutEffect(()=>{ne.current=0,k({}),z.current=null,ve(Fr),d(0)},[ye]),a.useEffect(()=>{if(!H||$!=="randomize")return;const ce=E.current;if(!ce)return;const se=Se=>{k(B=>{const Q=Array.from(Se).filter(te=>te in B&&!Jp(ce,te));if(Q.length===0)return B;const W={...B};return Q.forEach(te=>{delete W[te]}),W})},Le=new IntersectionObserver(Se=>{const B=new Set;for(const Q of Se){const W=Q.target.dataset.marqueeItemIndex,te=W!==void 0?Number(W):NaN;Number.isNaN(te)||B.add(te)}B.size>0&&se(B)},{root:ce,threshold:0});Object.keys(L).forEach(Se=>{const B=Number(Se);ce.querySelectorAll(`[data-marquee-item-index="${B}"]`).forEach(Q=>Le.observe(Q))});const Me={current:0},we=()=>{const Se=Object.keys(K.current);Se.length!==0&&(se(Se.map(Number)),Me.current=requestAnimationFrame(we))};return Object.keys(K.current).length>0&&(Me.current=requestAnimationFrame(we)),()=>{cancelAnimationFrame(Me.current),Le.disconnect()}},[$,L,H]),a.useLayoutEffect(()=>{if(!x)return;const ce=E.current,se=j.current;if(!ce||!se)return;const Le={current:0},Me=()=>{const B=ce.getBoundingClientRect().width||ce.offsetWidth,Q=Xp(se),W=z.current,te=typeof W=="number"&&Math.abs(W-Q)<=.25;z.current=Q;let ie=f,pe=0;if((V||n)&&R>0&&B>0){const Ie=ms(se,R);if(Ie>=Vp){pe=Ie;const ee=Math.min(Dp,Math.max(Fr,Math.ceil(B/Ie)+1));ie=ee,ee!==f&&ve(ee)}}const fe=ie!==f&&pe>0?pe*ie:Q>0?Q:pe>0?pe*ie:(()=>{const Ie=ms(se,R);return Ie>0?Ie*ie:0})();fe>0?d(Ie=>Ie<=0?fe:!te||Math.round(Ie)===Math.round(fe)?Ie:fe):!te&&s<=0&&(cancelAnimationFrame(Le.current),Le.current=requestAnimationFrame(Me))},we=()=>{cancelAnimationFrame(Le.current),Le.current=requestAnimationFrame(Me)};_.current=we,we();const Se=new ResizeObserver(we);return Se.observe(ce),Se.observe(se),()=>{_.current=null,cancelAnimationFrame(Le.current),Se.disconnect()}},[V,x,s,ye,f,R,n]),a.useLayoutEffect(()=>{if(!x||c<=0)return;const ce=A.current;ce&&qp(ce)},[x,c,b,U]),a.useLayoutEffect(()=>{if(!x||s<=0){ae(0);return}const ce=A.current,se=j.current;if(!ce||!se)return;const Le=()=>{const we=ce.offsetHeight||ce.getBoundingClientRect().height,Se=Array.from(se.children).reduce((Q,W)=>Math.max(Q,W.offsetHeight||W.getBoundingClientRect().height),0),B=we>0?we:Se;ae(B>0?B:0)};Le();const Me=new ResizeObserver(Le);return Me.observe(ce),Me.observe(se),()=>Me.disconnect()},[x,$e,Y,n,C,y,w,s,T,L]),a.useLayoutEffect(()=>{if(!n||!M||!x||typeof window>"u")return;const ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(ce)},[n,M,x,b,s,X,C,Y]);const oe=()=>{Z&&N(!0)},xe=()=>{Z&&N(!1)},G=a.useCallback(()=>{var ce;ne.current=Math.min(le,ne.current+1),(ce=_.current)==null||ce.call(_)},[le]),he=a.useCallback((ce,se)=>{k(Le=>{const Me=Le[ce]??se,we=(t??[]).filter(B=>B!==Me);if(we.length===0)return Le;const Se=we[Math.floor(Math.random()*we.length)];return{...Le,[ce]:Se}})},[t]),be=(ce,se,Le,Me)=>{const we=H&&$==="randomize"&&T.display==="cover"?L[Le]??ce:ce,Se=`max(${h(C)}, ${zp}px)`,B=`calc(-0.5 * (${Se} + ${h(C)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":Le,onMouseEnter:H&&$==="randomize"&&T.display==="cover"?()=>he(Le,ce):void 0,children:[r.jsx(em,{item:we,prefix:l,imageFit:T,imageMaxWidth:y,imageMaxHeight:w,imageHoverClass:F,isEditor:n,isFirstSet:Me,scaled:h,onFirstSetImageDone:G}),M&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:B,width:Se,height:"100%"}})]},`${se}-${Le}`)};if(x){const ce=V?Z&&q?"paused":"running":"paused",se=c>0&&U>0?c/U*1e3:0,Le=`${Math.max(0,se)/1e3}s`;return r.jsxs("div",{ref:E,className:pt(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:X>0?{height:X}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:A,className:`${l}-marquee-track`,"data-direction":b,onMouseEnter:oe,onMouseLeave:xe,style:{WebkitAnimationDuration:Le,animationDuration:Le,WebkitAnimationPlayState:ce,animationPlayState:ce},children:Array.from({length:$e},(Me,we)=>r.jsx("div",{ref:we===0?j:void 0,className:pt(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:h(C),paddingRight:h(C)},"aria-hidden":we>0,children:Y.map((Se,B)=>be(Se,we,B,we===0&&B<R))},`set-${we}`))})]})}return r.jsxs("div",{ref:E,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:pt(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:h(C),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((ce,se)=>be(ce,0,se))},"marquee-static")]})},nm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1689
1693
|
import cn from 'classnames';
|
|
1690
1694
|
import { CommonComponentProps } from '../props';
|
|
1691
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -1809,16 +1813,20 @@ function getCSS(P: string, setWidthPx: number): string {
|
|
|
1809
1813
|
pointer-events: auto;
|
|
1810
1814
|
height: 100%;
|
|
1811
1815
|
}
|
|
1812
|
-
.\${P}-image-hover-brightness img
|
|
1816
|
+
.\${P}-image-hover-brightness img,
|
|
1817
|
+
.\${P}-image-hover-brightness video {
|
|
1813
1818
|
transition: filter 0.3s ease;
|
|
1814
1819
|
}
|
|
1815
|
-
.\${P}-image-hover-brightness:hover img
|
|
1820
|
+
.\${P}-image-hover-brightness:hover img,
|
|
1821
|
+
.\${P}-image-hover-brightness:hover video {
|
|
1816
1822
|
filter: brightness(1.25);
|
|
1817
1823
|
}
|
|
1818
|
-
.\${P}-image-hover-grayscale img
|
|
1824
|
+
.\${P}-image-hover-grayscale img,
|
|
1825
|
+
.\${P}-image-hover-grayscale video {
|
|
1819
1826
|
transition: filter 0.3s ease;
|
|
1820
1827
|
}
|
|
1821
|
-
.\${P}-image-hover-grayscale:hover img
|
|
1828
|
+
.\${P}-image-hover-grayscale:hover img,
|
|
1829
|
+
.\${P}-image-hover-grayscale:hover video {
|
|
1822
1830
|
filter: grayscale(100%);
|
|
1823
1831
|
}
|
|
1824
1832
|
\`;
|
|
@@ -1909,6 +1917,20 @@ const isAnyCopyOfSlotInView = (wrapper: Element, itemIndex: number): boolean =>
|
|
|
1909
1917
|
return Array.from(cards).some((card) => isCardInMarqueeView(card, wrapper));
|
|
1910
1918
|
};
|
|
1911
1919
|
|
|
1920
|
+
const isVideoMedia = (media: Pick<NonNullable<MarqueeItem['image']>, 'url' | 'type' | 'name'>): boolean => {
|
|
1921
|
+
if (media.type === 'video') return true;
|
|
1922
|
+
if (media.type === 'image') return false;
|
|
1923
|
+
const name = media.name ?? '';
|
|
1924
|
+
if (/\\.(mp4|webm|ogg|mov)(\\?|$)/i.test(name)) return true;
|
|
1925
|
+
return /\\.(mp4|webm|ogg|mov)(\\?|$)/i.test(media.url ?? '');
|
|
1926
|
+
};
|
|
1927
|
+
|
|
1928
|
+
const isMediaReady = (el: HTMLImageElement | HTMLVideoElement | null): boolean => {
|
|
1929
|
+
if (!el) return false;
|
|
1930
|
+
if (el instanceof HTMLVideoElement) return el.readyState >= 2;
|
|
1931
|
+
return el.complete;
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1912
1934
|
type MarqueeItemCardProps = {
|
|
1913
1935
|
item: MarqueeItem;
|
|
1914
1936
|
prefix: string;
|
|
@@ -1933,12 +1955,12 @@ const MarqueeItemCard = ({
|
|
|
1933
1955
|
scaled,
|
|
1934
1956
|
onFirstSetImageDone,
|
|
1935
1957
|
}: MarqueeItemCardProps) => {
|
|
1936
|
-
const
|
|
1958
|
+
const mediaRef = useRef<HTMLImageElement | HTMLVideoElement | null>(null);
|
|
1959
|
+
const isVideo = Boolean(item.image?.url && isVideoMedia(item.image));
|
|
1937
1960
|
|
|
1938
1961
|
useLayoutEffect(() => {
|
|
1939
1962
|
if (!isFirstSet) return;
|
|
1940
|
-
|
|
1941
|
-
if (el?.complete) onFirstSetImageDone?.();
|
|
1963
|
+
if (isMediaReady(mediaRef.current)) onFirstSetImageDone?.();
|
|
1942
1964
|
}, [isFirstSet, item.image?.url, onFirstSetImageDone]);
|
|
1943
1965
|
|
|
1944
1966
|
const isCover = imageFit.display === 'cover';
|
|
@@ -1954,35 +1976,48 @@ const MarqueeItemCard = ({
|
|
|
1954
1976
|
const coverWidthScaled = scaled(coverWidth);
|
|
1955
1977
|
const coverHeightScaled = scaled(coverHeight);
|
|
1956
1978
|
|
|
1979
|
+
const mediaStyle: CSSProperties = isCover
|
|
1980
|
+
? {
|
|
1981
|
+
pointerEvents: 'auto',
|
|
1982
|
+
display: 'block',
|
|
1983
|
+
width: '100%',
|
|
1984
|
+
height: '100%',
|
|
1985
|
+
objectFit: 'cover',
|
|
1986
|
+
}
|
|
1987
|
+
: {
|
|
1988
|
+
pointerEvents: 'auto',
|
|
1989
|
+
display: 'block',
|
|
1990
|
+
height: '100%',
|
|
1991
|
+
width: 'auto',
|
|
1992
|
+
maxWidth: scaled(imageMaxWidth),
|
|
1993
|
+
objectFit: 'contain',
|
|
1994
|
+
};
|
|
1995
|
+
|
|
1957
1996
|
const imageNode =
|
|
1958
1997
|
item.image?.url &&
|
|
1959
|
-
(
|
|
1998
|
+
(isVideo ? (
|
|
1999
|
+
<video
|
|
2000
|
+
ref={(el) => { mediaRef.current = el; }}
|
|
2001
|
+
src={item.image.url}
|
|
2002
|
+
style={mediaStyle}
|
|
2003
|
+
muted
|
|
2004
|
+
loop
|
|
2005
|
+
autoPlay
|
|
2006
|
+
playsInline
|
|
2007
|
+
preload="auto"
|
|
2008
|
+
onLoadedData={isFirstSet ? onFirstSetImageDone : undefined}
|
|
2009
|
+
onError={isFirstSet ? onFirstSetImageDone : undefined}
|
|
2010
|
+
/>
|
|
2011
|
+
) : (
|
|
1960
2012
|
<img
|
|
1961
|
-
ref={
|
|
2013
|
+
ref={(el) => { mediaRef.current = el; }}
|
|
1962
2014
|
src={item.image.url}
|
|
1963
2015
|
alt={item.image?.name ?? ''}
|
|
1964
|
-
style={
|
|
1965
|
-
isCover
|
|
1966
|
-
? {
|
|
1967
|
-
pointerEvents: 'auto',
|
|
1968
|
-
display: 'block',
|
|
1969
|
-
width: '100%',
|
|
1970
|
-
height: '100%',
|
|
1971
|
-
objectFit: 'cover',
|
|
1972
|
-
}
|
|
1973
|
-
: {
|
|
1974
|
-
pointerEvents: 'auto',
|
|
1975
|
-
display: 'block',
|
|
1976
|
-
height: '100%',
|
|
1977
|
-
width: 'auto',
|
|
1978
|
-
maxWidth: scaled(imageMaxWidth),
|
|
1979
|
-
objectFit: 'contain',
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
2016
|
+
style={mediaStyle}
|
|
1982
2017
|
onLoad={isFirstSet ? onFirstSetImageDone : undefined}
|
|
1983
2018
|
onError={isFirstSet ? onFirstSetImageDone : undefined}
|
|
1984
2019
|
/>
|
|
1985
|
-
);
|
|
2020
|
+
));
|
|
1986
2021
|
return (
|
|
1987
2022
|
<div
|
|
1988
2023
|
style={{
|
|
@@ -2385,6 +2420,7 @@ export type MarqueeItem = {
|
|
|
2385
2420
|
image?: {
|
|
2386
2421
|
url?: string;
|
|
2387
2422
|
name?: string;
|
|
2423
|
+
type?: 'image' | 'video';
|
|
2388
2424
|
};
|
|
2389
2425
|
link?: string;
|
|
2390
2426
|
};
|
|
@@ -2411,7 +2447,7 @@ type MarqueeProps = {
|
|
|
2411
2447
|
isPreviewMode?: boolean;
|
|
2412
2448
|
isEditMode?: boolean;
|
|
2413
2449
|
} & CommonComponentProps;
|
|
2414
|
-
`,
|
|
2450
|
+
`,im={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},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"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{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"}}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},om={element:tm,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple_Marquee.mp4"},schema:im,sourceCode:nm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function gs(e){return`
|
|
2415
2451
|
.${e}-marquee-wrapper {
|
|
2416
2452
|
overflow: hidden;
|
|
2417
2453
|
width: 100%;
|
|
@@ -2498,7 +2534,7 @@ type MarqueeProps = {
|
|
|
2498
2534
|
pointer-events: auto;
|
|
2499
2535
|
z-index: 10;
|
|
2500
2536
|
}
|
|
2501
|
-
`}const
|
|
2537
|
+
`}const rm=30,hs=2,am=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=v.useScopedStyles(),{align:s,speed:d,direction:c,pauseOnHover:u,gap:m,cardWidth:b,corners:S,stroke:C,strokeColor:y,bgColor:w,padding:$,logoMarginTop:T,logoWidth:R,logoHeight:M,captionMarginTop:H}=e,F=!!o,V=((t==null?void 0:t.length)??0)>0,P=d>0&&(!n||i),x=V&&(P||n),U=Math.max(0,d)*rm,h=W=>v.scalingValue(W,n??!1),E=a.useRef(null),A=a.useRef(null),j=a.useRef(null),[X,ae]=a.useState(0),[Z,q]=a.useState(0),[N,L]=a.useState(0),k=P&&u==="on",[K,z]=a.useState(!1),ne=a.useRef(null),[_,ye]=a.useState(0),[f,ve]=a.useState(0),Y=a.useRef(null),le=W=>{var ie,pe,me,fe,Ie;return{fontSettings:{fontFamily:(e==null?void 0:e[`${W}FontFamily`])??"Arial",fontWeight:((ie=e==null?void 0:e[`${W}FontSettings`])==null?void 0:ie.fontWeight)??400,fontStyle:((pe=e==null?void 0:e[`${W}FontSettings`])==null?void 0:pe.fontStyle)??"normal"},textAppearance:{textTransform:((me=e==null?void 0:e[`${W}TextAppearance`])==null?void 0:me.textTransform)??"none",textDecoration:((fe=e==null?void 0:e[`${W}TextAppearance`])==null?void 0:fe.textDecoration)??"none",fontVariant:((Ie=e==null?void 0:e[`${W}TextAppearance`])==null?void 0:Ie.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${W}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${W}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${W}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${W}LineHeight`])??.01,color:(e==null?void 0:e[`${W}Color`])??"#000000"}},$e=le("text"),oe=le("caption"),xe=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(W=>{var te,ie;return(((te=W.text)==null?void 0:te.length)??0)>0||(((ie=W.caption)==null?void 0:ie.length)??0)>0}),[t]),G=a.useMemo(()=>!x||(t==null?void 0:t.length)===0?1:Z<=0||X<=0?hs:Math.max(hs,Math.ceil(X/Z)+1),[x,t==null?void 0:t.length,Z,X]);a.useLayoutEffect(()=>{if(!x)return;const W=E.current,te=j.current;if(!W||!te)return;let ie=0;const pe=()=>{const Ie=W.getBoundingClientRect().width,ee=te.getBoundingClientRect().width,ge=Y.current,Ae=typeof ge=="number"&&Math.abs(ge-ee)<=.25;if(Y.current=ee,ae(Ie),typeof ee=="number"&&ee>0&&Z<=0){q(ee);return}Ae&&ee!==Z?q(ee):!Ae&&Z<=0&&(cancelAnimationFrame(ie),ie=requestAnimationFrame(pe))},me=()=>{cancelAnimationFrame(ie),ie=requestAnimationFrame(pe)};me();const fe=new ResizeObserver(me);return fe.observe(W),fe.observe(te),()=>{cancelAnimationFrame(ie),fe.disconnect()}},[P,x,Z]),a.useLayoutEffect(()=>{const W=A.current;if(!x||!W)return;const te=Z>0?Z:0,ie=te>0&&U>0?te/U*1e3:0,pe=`${Math.max(0,ie)/1e3}s`;W.style.setProperty("--marquee-distance",`${te}px`),W.style.setProperty("--marquee-duration",pe)},[P,x,U,Z]),a.useLayoutEffect(()=>{if(!x){L(0);return}const W=j.current,te=A.current;if(!W||!te)return;const ie=()=>{let me=0;for(let fe=0;fe<W.children.length;fe++){const ee=W.children[fe].firstElementChild;ee&&(me=Math.max(me,ee.offsetHeight))}me<=0&&(me=te.offsetHeight),L(me>0?me:0)};ie();const pe=new ResizeObserver(ie);return pe.observe(W),pe.observe(te),()=>{pe.disconnect()}},[x,G,t,n,m,b,$,C,S,R,M,_,f]);const he=()=>{k&&z(!0)},be=()=>{k&&z(!1)},ce=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),se=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),Le=a.useCallback((W,te,ie,pe)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ce,width:"100%"},children:[r.jsx("div",{"data-controls":F?pe==null?void 0:pe.controlsName:void 0,"data-controls-axis":F?"y":void 0,className:F?`${l}-control`:void 0,style:{height:h((pe==null?void 0:pe.marginTop)??0)}}),r.jsx("div",{...pe!=null&&pe.dataMeasureKind?{"data-testimonial-measure":pe.dataMeasureKind}:{},style:{...Jt(W,n),textAlign:se,pointerEvents:"auto",...typeof(pe==null?void 0:pe.minHeightPx)=="number"&&pe.minHeightPx>0?{minHeight:pe.minHeightPx}:{}},children:r.jsx(Ei,{content:te})})]},ie),[ce,se,n,F,l,h]),Me=a.useCallback((W,te,ie)=>{var pe,me,fe;return r.jsxs("div",{style:{padding:`${h($.top)} ${h($.right)} ${h($.bottom)} ${h($.left)}`,width:h(b+C*2),height:"100%",borderRadius:h(S),border:`${h(C)} solid ${y}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:w}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:ce,textAlign:se},children:[W.text&&Le($e,W.text,"text",ie!=null&&ie.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ie==null?void 0:ie.textMinHeightPx)=="number"&&ie.textMinHeightPx>0?{minHeightPx:ie.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ce,width:"100%"},children:[r.jsx("div",{"data-controls":F&&!(ie!=null&&ie.dataMeasureAttrs)?"logoMarginTop":void 0,className:F&&!(ie!=null&&ie.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:h(T)}}),r.jsx("div",{style:{width:h(R),height:h(M)},children:((pe=W.logo)==null?void 0:pe.url)&&r.jsx("img",{src:W.logo.url,alt:((me=W.logo)==null?void 0:me.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((fe=W.logo)==null?void 0:fe.objectFit)||"contain"}})})]}),W.caption&&Le(oe,W.caption,"caption",{...ie!=null&&ie.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...ie!=null&&ie.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ie==null?void 0:ie.captionMinHeightPx)=="number"&&ie.captionMinHeightPx>0?{minHeightPx:ie.captionMinHeightPx}:{}})]})]},te)},[w,H,oe,b,S,M,T,R,ce,se,$.bottom,$.left,$.right,$.top,Le,C,y,$e,n,F,l]),we=a.useCallback(W=>{ye(W.maxTextPx),ve(W.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!xe){we({maxTextPx:0,maxCaptionPx:0});return}const W=ne.current;if(!W)return;const te=()=>{v.readTestimonialTextMeasure(W,we)};te();const ie=new ResizeObserver(te);return ie.observe(W),()=>{ie.disconnect()}},[xe,we,t,Me]);const Se=xe?{textMinHeightPx:_,captionMinHeightPx:f}:void 0,B=xe?r.jsx("div",{ref:ne,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((W,te)=>Me(W,`measure-${te}`,{dataMeasureAttrs:!0}))}):null,Q=(W,te)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Me(W,`card-${te}`,Se),F&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${h(m)})`,width:h(m),height:"100%",pointerEvents:"auto",zIndex:2}})]},te);if(x){const W=P?k&&K?"paused":"running":"paused";return r.jsxs("div",{ref:E,className:pt(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...N>0?{height:N}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:gs(l)}}),B,r.jsx("div",{ref:A,className:`${l}-marquee-track`,"data-direction":c,onMouseEnter:he,onMouseLeave:be,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":W},children:Array.from({length:G},(te,ie)=>r.jsx("div",{ref:ie===0?j:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:h(m),paddingRight:h(m)},"aria-hidden":ie>0,children:t==null?void 0:t.map((pe,me)=>Q(pe,`${ie}-${me}`))},`set-${ie}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:gs(l)}}),B,r.jsx("div",{style:{gap:h(m),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((W,te)=>Q(W,te))})]})},sm=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2502
2538
|
import cn from 'classnames';
|
|
2503
2539
|
import { CommonComponentProps } from '../props';
|
|
2504
2540
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3113,7 +3149,7 @@ type TestimonialsSettings = {
|
|
|
3113
3149
|
logoHeight: number;
|
|
3114
3150
|
captionMarginTop: number;
|
|
3115
3151
|
};
|
|
3116
|
-
`,
|
|
3152
|
+
`,fs={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},lm={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:{...fs.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:{...fs.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"}]}]}]}},cm={element:am,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:lm,sourceCode:sm,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function dm(e){return`
|
|
3117
3153
|
.${e}-container {
|
|
3118
3154
|
position: relative;
|
|
3119
3155
|
overflow-x: clip;
|
|
@@ -3237,7 +3273,7 @@ type TestimonialsSettings = {
|
|
|
3237
3273
|
width: 100%;
|
|
3238
3274
|
height: 100%;
|
|
3239
3275
|
}
|
|
3240
|
-
`}const
|
|
3276
|
+
`}const um=3e3,pm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=v.useScopedStyles(),s=t||[],{speed:d,align:c,width:u,imageMarginTop:m,textMarginTop:b,captionMarginTop:S,imageWidth:C,imageHeight:y,controlsWidth:w,controlsColor:$,controlsHoverColor:T}=e,R=d>0&&(!n||!!i),[M,H]=a.useState(0),[F,V]=a.useState(null),[P,x]=a.useState(!1),U=a.useRef(null),h=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),E=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{H(0),V(null),x(!1)},[s.length]);const A=s[M],j=F===null?null:s[F],X=oe=>{var G,he,be,ce,se;return{fontSettings:{fontFamily:(e==null?void 0:e[`${oe}FontFamily`])??"Arial",fontWeight:((G=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:G.fontWeight)??400,fontStyle:((he=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:he.fontStyle)??"normal"},textAppearance:{textTransform:((be=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:be.textTransform)??"none",textDecoration:((ce=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:ce.textDecoration)??"none",fontVariant:((se=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:se.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${oe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${oe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${oe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${oe}WordSpacing`])??0,color:(e==null?void 0:e[`${oe}Color`])??"#000000"}},ae=X("text"),Z=X("caption"),q=s.length>1&&s.some(oe=>{var xe,G;return(((xe=oe.text)==null?void 0:xe.length)??0)>0||(((G=oe.caption)==null?void 0:G.length)??0)>0}),N=a.useRef(null),[L,k]=a.useState(0),[K,z]=a.useState(0),ne=e.controls??{mode:"Off",icon:null},_=s.length>1,ye=a.useCallback((oe,xe)=>!_||xe===oe?oe:(U.current&&window.clearTimeout(U.current),V(oe),x(!0),U.current=window.setTimeout(()=>{V(null),x(!1),U.current=null},300),xe),[_]),f=a.useCallback(()=>{_&&H(oe=>ye(oe,(oe-1+s.length)%s.length))},[_,ye,s.length]),ve=a.useCallback(()=>{_&&H(oe=>ye(oe,(oe+1)%s.length))},[_,ye,s.length]);a.useEffect(()=>{if(!R||!_)return;const oe=Math.max(300,um/d),xe=window.setInterval(()=>{H(G=>ye(G,(G+1)%s.length))},oe);return()=>{window.clearInterval(xe)}},[R,_,ye,s.length,d]),a.useEffect(()=>()=>{U.current&&window.clearTimeout(U.current)},[]);const Y=(oe,xe)=>{var se,Le,Me,we;const G=xe==null?void 0:xe.textMinHeightPx,he=xe==null?void 0:xe.captionMinHeightPx,be=xe==null?void 0:xe.dataMeasureAttrs,ce=o&&!(xe!=null&&xe.dataMeasureAttrs)&&!(xe!=null&&xe.hideControls);return r.jsxs(r.Fragment,{children:[oe.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ce?"textMarginTop":void 0,className:ce?`${l}-control`:void 0,style:{height:v.scalingValue(b??0,n??!1)}}),r.jsx("div",{...be&&{"data-testimonial-measure":"text"},style:{...Jt(ae,n),...G&&G>0?{minHeight:G}:{},textAlign:E,pointerEvents:"auto"},children:r.jsx(Ei,{content:oe.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ce?"imageMarginTop":void 0,className:ce?`${l}-control`:void 0,style:{height:v.scalingValue(m??0,n??!1)}}),r.jsx("div",{style:{width:v.scalingValue(C??0,n??!1),height:v.scalingValue(y??0,n??!1)},children:((se=oe.image)==null?void 0:se.url)&&r.jsx("img",{src:(Le=oe.image)==null?void 0:Le.url,alt:((Me=oe.image)==null?void 0:Me.name)??"",className:`${l}-icon`,style:{objectFit:((we=oe.image)==null?void 0:we.objectFit)||"contain"}})})]}),oe.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ce?"captionMarginTop":void 0,className:ce?`${l}-control`:void 0,style:{height:v.scalingValue(S??0,n??!1)}}),r.jsx("div",{...be?{"data-testimonial-measure":"caption"}:{},style:{...Jt(Z,n),...he&&he>0?{minHeight:he}:{},textAlign:E,pointerEvents:"auto"},children:r.jsx(Ei,{content:oe.caption})})]})]})},le=a.useCallback(oe=>{k(oe.maxTextPx),z(oe.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!q){le({maxTextPx:0,maxCaptionPx:0});return}const oe=N.current;if(!oe)return;const xe=()=>{v.readTestimonialTextMeasure(oe,le)};xe();const G=new ResizeObserver(xe);return G.observe(oe),()=>{G.disconnect()}},[q,le,t]),!A)return r.jsx(r.Fragment,{});const $e=q?{textMinHeightPx:L,captionMinHeightPx:K}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:dm(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:v.scalingValue(u??0,n??!1),alignItems:h},children:[q&&r.jsx("div",{ref:N,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((oe,xe)=>r.jsx("div",{style:{width:"100%"},children:Y(oe,{dataMeasureAttrs:!0})},xe))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[j&&P&&r.jsx("div",{className:pt(`${l}-fade-item-prev`,`${l}-fade-out`),children:Y(j,{...$e,hideControls:!0})}),r.jsx("div",{className:pt(`${l}-fade-item-current`,P?`${l}-fade-in`:void 0),children:Y(A,$e)})]})]}),ne.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:v.scalingValue(w??.02,n??!1),height:v.scalingValue(w??.02,n??!1),"--arrow-hover-color":T},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:f,disabled:!_,"aria-label":"Previous testimonial",children:ne.icon&&r.jsx(dn,{url:ne.icon,fill:$,hoverFill:T,className:pt(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:pt(`${l}-arrow`,`${l}-next-arrow`),style:{width:v.scalingValue(w??.02,n??!1),height:v.scalingValue(w??.02,n??!1),"--arrow-hover-color":T},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:ve,disabled:!_,"aria-label":"Next testimonial",children:ne.icon&&r.jsx(dn,{url:ne.icon,fill:$,hoverFill:T,className:`${l}-arrow-img`})})})]})]})})},mm=`import cn from 'classnames';
|
|
3241
3277
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3242
3278
|
import { CommonComponentProps } from '../props';
|
|
3243
3279
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3733,12 +3769,12 @@ type TestimonialsSettings = {
|
|
|
3733
3769
|
icon?: string | null;
|
|
3734
3770
|
};
|
|
3735
3771
|
};
|
|
3736
|
-
`,
|
|
3772
|
+
`,gm="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>'),ys={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},hm={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:{...ys.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:{...ys.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:gm},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"}]}]}]}},fm={element:pm,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:hm,sourceCode:mm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function ym(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vs(e){return((e==null?void 0:e.trim().length)??0)>0}function Wr(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function _r(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:v.scalingValue((o-t)/2,i)}}function vm(e){return`
|
|
3737
3773
|
.${e}-wrapper {
|
|
3738
3774
|
display: grid;
|
|
3739
3775
|
align-items: start;
|
|
3740
3776
|
justify-content: center;
|
|
3741
|
-
min-height: ${
|
|
3777
|
+
min-height: ${ym(48)};
|
|
3742
3778
|
}
|
|
3743
3779
|
.${e}-item {
|
|
3744
3780
|
display: flex;
|
|
@@ -4062,7 +4098,7 @@ type TestimonialsSettings = {
|
|
|
4062
4098
|
z-index: 2;
|
|
4063
4099
|
width: 100%;
|
|
4064
4100
|
}
|
|
4065
|
-
`}const Rn=500,gm=750,ni="cubic-bezier(0.22, 1, 0.36, 1)",hm=72,fm=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 vm(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function xm(e){const[t]=e.media;return t!=null&&t.url?t:null}function bm(e){return!Array.isArray(e)||e.length===0?[]:ym(e)?e.flatMap(t=>{const n=vm(t);if(!n)return[];const i=xm(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 Qi(e){return e.type==="video"}function wm(e){e.pause(),e.removeAttribute("src"),e.load()}function ys({media:e,className:t,style:n,onMediaClick:i}){return Qi(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 Ao(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Sm(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function $m({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()=>{wm(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 Cm({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:s,counterClassName:l,counterStyle:d}){const c=n==="cover",u=a.useRef(null),m=a.useRef(null),v=a.useRef(null),b=a.useRef(null),S=a.useRef(0),y=a.useRef(0),w=a.useRef("none"),C=a.useRef(!1),L=a.useRef(!1),k=a.useRef(!1),A=a.useRef(null),[O,P]=a.useState(null),[D,R]=a.useState("opening"),[x,U]=a.useState(0),[h,I]=a.useState(0),[W,V]=a.useState(!1),[Y,ae]=a.useState(!1),[Z,G]=a.useState(!1),H=a.useRef(t),$=e[t],M=$?Qi($):!1,q=h!==0||W,B=a.useCallback(se=>{k.current=se,V(se)},[]),ee=a.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),_=a.useCallback(()=>{ee(),A.current=window.setTimeout(()=>{ee(),B(!1)},Rn+32)},[ee,B]),ye=a.useCallback(()=>{const se=m.current,Re=v.current;if(!se)return;const ke=se.getBoundingClientRect(),we=ke.width,Se=ke.height;if(!we||!Se)return;if(n==="cover"){P({width:we,height:Se,left:ke.left,top:ke.top});return}if(!Re){P(Ao(se));return}const{width:z,height:re}=Sm(Re);if(!z||!re){P(Ao(se));return}const F=z/re,te=we/Se;if(F>te){const ne=we/F;P({width:we,height:ne,left:ke.left,top:ke.top+(Se-ne)/2})}else{const ne=Se*F;P({width:ne,height:Se,left:ke.left+(we-ne)/2,top:ke.top})}},[n]);a.useEffect(()=>{ye();const se=m.current;if(!se)return;const Re=new ResizeObserver(()=>ye());return Re.observe(se),()=>Re.disconnect()},[ye,t]),a.useEffect(()=>{D==="opening"&&O&&R("open")},[D,O]),a.useEffect(()=>{if(D!=="closing")return;const se=setTimeout(()=>i(),Rn);return()=>clearTimeout(se)},[D,i]),a.useEffect(()=>()=>{ee()},[ee]),a.useLayoutEffect(()=>{if(H.current===t)return;ee(),U(0),I(0),B(!1),G(!1),ae(!1),S.current=0,y.current=0,w.current="none",C.current=!1,b.current=null,L.current=!1;const se=m.current;se&&P(Ao(se)),H.current=t},[t,B,ee]),a.useEffect(()=>{if(D!=="open")return;const se=()=>{const re=F=>{F.stopPropagation(),F.preventDefault(),document.removeEventListener("click",re,!0)};document.addEventListener("click",re,!0)},Re=re=>{ee(),k.current=!1,V(!1),I(0),ae(!1),C.current=!1,y.current=0,w.current="none";const F=m.current;F&&P(Ao(F)),re<0?s():o()},ke=re=>{if(Math.abs(re)>fm&&e.length>1){Re(re);return}B(!0),I(0),_()},we=re=>{if(re.touches.length!==1||k.current)return;const F=re.touches[0];L.current=!0,b.current={x:F.clientX,y:F.clientY},w.current="none",y.current=0,C.current=!1},Se=re=>{if(!b.current||re.touches.length!==1||k.current)return;const F=re.touches[0],te=F.clientX-b.current.x,ne=F.clientY-b.current.y;if(w.current==="none"){if(Math.abs(te)<10&&Math.abs(ne)<10)return;if(Math.abs(te)>Math.abs(ne)){if(e.length<=1)return;w.current="horizontal"}else if(ne>0)w.current="vertical";else return}if(w.current==="horizontal"){C.current=!0,ae(!0),y.current=te,I(te),re.preventDefault();return}w.current==="vertical"&&(C.current=!0,ae(!0),S.current=ne,U(ne),re.preventDefault())},z=()=>{if(!b.current)return;const re=w.current,F=C.current;if(F&&re==="horizontal")ke(y.current),se();else if(F&&re==="vertical"){if(S.current>hm){const ne=window.innerHeight;S.current=ne,G(!0),U(ne),R("closing")}else S.current=0,U(0);se()}else re==="horizontal"&&Math.abs(y.current)>0&&(ke(y.current),se());b.current=null,w.current="none",y.current=0,C.current=!1,ae(!1)};return document.addEventListener("touchstart",we,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",z),document.addEventListener("touchcancel",z),()=>{document.removeEventListener("touchstart",we),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",z),document.removeEventListener("touchcancel",z)}},[D,e.length,s,o,B,_]),a.useEffect(()=>{const se=Re=>{Re.key==="Escape"&&(Re.preventDefault(),Re.stopPropagation(),D!=="closing"&&R("closing"))};return window.addEventListener("keydown",se,!0),()=>window.removeEventListener("keydown",se,!0)},[D]);const f=()=>{D!=="closing"&&R("closing")},ve=D==="open",K=D==="closing",le=x>0?Math.max(0,1-x/500):1,$e=x>0?Math.max(.35,1-x/500):1,oe=se=>{if(se.stopPropagation(),L.current){L.current=!1;return}if(e.length<=1)return;const Re=se.currentTarget.getBoundingClientRect(),ke=se.clientY-Re.top,we=Math.min(52,Re.height*.2);if(!(ke>Re.height-we)){if(se.clientX-Re.left<Re.width/2){o();return}s()}},fe=se=>{if(e.length<=1)return;const Re=se.currentTarget.getBoundingClientRect(),ke=se.clientX-Re.left,we=se.clientY-Re.top,Se=Math.min(52,Re.height*.2);if(we>Re.height-Se){se.currentTarget.style.cursor="default";return}se.currentTarget.style.cursor=ke<Re.width/2?"w-resize":"e-resize"},X=a.useCallback(se=>{se.propertyName!=="transform"||!k.current||(ee(),B(!1))},[ee,B]),be=q?`translateX(${h}px)`:x>0?`translateY(${x}px)`:void 0,xe={position:"fixed",top:O==null?void 0:O.top,left:O==null?void 0:O.left,width:O==null?void 0:O.width,height:O==null?void 0:O.height,objectFit:n==="cover"?"cover":"contain",transform:be,opacity:x>0?$e:D==="opening"||K?0:1,transition:Y&&!W?"none":W?`transform ${Rn}ms ${ni}`:Z?`transform ${Rn}ms ${ni}, opacity ${Rn}ms ${ni}`:D==="opening"||K?`opacity ${Rn}ms ${ni}`:"none",pointerEvents:M&&ve&&!q?"auto":"none",touchAction:M&&ve?"none":void 0,zIndex:9998},pe=O?{position:"fixed",top:O.top,height:O.height,width:O.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:u,style:{position:"fixed",top:"var(--cntrl-article-top, 0)",left:"var(--cntrl-article-left, 0)",width:"var(--cntrl-article-width, 100vw) !important",height:"var(--cntrl-viewport-height, 100vh) !important",zIndex:9997,touchAction:D==="open"?"none":void 0},onClick:f,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ve?le:0,transition:Y?"none":`opacity ${Rn}ms ${ni}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:m,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 ${ni}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:l,style:d,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:m,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 ${ni}`},children:e.length>1&&r.jsxs("p",{className:l,style:d,children:[t+1," / ",e.length]})})]})}),O&&$&&(M?r.jsx($m,{src:$.url,phase:D,mediaRef:v,mediaStyle:xe,onLoadedMetadata:ye,onClick:oe,onMouseMove:fe,onTransitionEnd:X},`${t}-${$.url}`):r.jsx("img",{ref:v,src:$.url,alt:$.name,onLoad:ye,onTransitionEnd:X,style:xe},`${t}-${$.url}`)),ve&&pe&&e.length>1&&!M&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...pe,left:O.left,cursor:"w-resize",pointerEvents:q?"none":"auto"},onClick:se=>{if(L.current){L.current=!1;return}se.stopPropagation(),o()}}),r.jsx("div",{style:{...pe,left:O.left+O.width/2,cursor:"e-resize",pointerEvents:q?"none":"auto"},onClick:se=>{if(L.current){L.current=!1;return}se.stopPropagation(),s()}})]})]})}function Tm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Lm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=E.useScopedStyles(),{type:m="a",gridLayout:v,textBoxWidth:b=100,verticalGap:S,entriesCount:y,lightbox:w,imageDisplay:C,lightboxImageDisplay:L,slider:k,sliderTiming:A,direction:O,transition:P,titleMarginTop:D,subtitleMarginTop:R,titleColor:x,subtitleColor:U,lightboxCounterColor:h,titleFontFamily:I,titleFontSettings:W,titleFontSize:V,titleLineHeight:Y,titleLetterSpacing:ae,titleWordSpacing:Z,titleTextAppearance:G,subtitleFontFamily:H,subtitleFontSettings:$,subtitleFontSize:M,subtitleLineHeight:q,subtitleLetterSpacing:B,subtitleWordSpacing:ee,subtitleTextAppearance:_,lightboxCounterFontFamily:ye,lightboxCounterFontSettings:f,lightboxCounterFontSize:ve,lightboxCounterLineHeight:K,lightboxCounterLetterSpacing:le,lightboxCounterWordSpacing:$e,lightboxCounterTextAppearance:oe,showText:fe="always",alignEntries:X="off",align:be="top"}=e,xe={fontSettings:{fontFamily:I,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:V??.01,lineHeight:Y,letterSpacing:ae??0,wordSpacing:Z??0,textAppearance:G,color:x},se={...hn(Qt(xe,n))},Re={fontSettings:{fontFamily:H,fontWeight:($==null?void 0:$.fontWeight)??400,fontStyle:($==null?void 0:$.fontStyle)??"normal"},fontSize:M??.01,lineHeight:q,letterSpacing:B??0,wordSpacing:ee??0,textAppearance:_,color:U},we={...hn(Qt(Re,n))},Se={fontSettings:{fontFamily:ye,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:ve??.01,lineHeight:K,letterSpacing:le??0,wordSpacing:$e??0,textAppearance:oe,color:h},re={...hn(Qt(Se,n)),...Hr(ve,K,u,n)},F=_r(V,Y,`${u}-item-title`,`${u}-text-tight-leading`),te=_r(M,q,`${u}-item-subtitle`,`${u}-text-tight-leading`),ne=Hr(V,Y,u,n),ue=Hr(M,q,u,n),me=_r(ve,K,`${u}-lightbox-counter`,`${u}-text-tight-leading`),he=E.buildColorVars(u,{titleColor:x,subtitleColor:U,lightboxCounterColor:h},Im,Rm),ge=`${l&&l!=="default"?`${u}-state-${l}`:""}${fe==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Ae=y===0?1/0:y,ie=(t??[]).slice(0,Ae),j=v.entryWidth??.2,Oe=(C==null?void 0:C.display)==="cover",Fe=(C==null?void 0:C.ratioValue)??"1:1",et=(C==null?void 0:C.reversed)??!1,[Ye,at]=Fe.split(":").map(Number),it=`${et?at:Ye} / ${et?Ye:at}`,$t=v.columnsCount,ot=E.scalingValue(j??0,n),Ue=ot,ht=!Oe&&k!=="off",xt=ie.length%$t||$t,ct=xt<$t&&ie.length>0,Mt=ie.length-xt,_t=ct?Math.floor(($t-xt)/2)+1:1,Qe={width:Ue,...Oe?{aspectRatio:it,height:"auto",overflow:"hidden"}:{height:"auto"}},Tt=`${u}-item-image-wrapper${ht?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Lt=m==="d"||m==="e"||m==="f",Ge=X==="on",qe=`calc(${E.scalingValue(j??0,n)} * (${b} / 100))`,Pe=E.scalingValue(j*b/100,n),gt=Oe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[It,kt]=a.useState("ltr"),[Dt,en]=a.useState(0),on=a.useRef(null);a.useEffect(()=>{const ze=on.current;if(!ze)return;const dt=new ResizeObserver(_e=>{en(Math.round(_e[0].contentRect.width))});return dt.observe(ze),()=>dt.disconnect()},[]);const bt=(()=>{const ze={...he},dt=on.current?getComputedStyle(on.current).getPropertyValue("--cntrl-article-width").trim():"";return dt&&(ze["--cntrl-article-width"]=dt),ze})(),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState([]),[Jt,Ce]=a.useState(0),je=w==="on"&&(!n||i),Ke=(ze,dt)=>{n&&!i||w!=="off"&&(ft(ze),Ce(dt),Ut(!0))};a.useEffect(()=>{if(!Rt||w!=="on"||typeof document>"u")return;const ze=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ze}},[Rt,w]),a.useEffect(()=>{!n||i||Ut(!1)},[n,i]);const He=a.useMemo(()=>mm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),r.jsx("div",{style:he,children:r.jsx("div",{ref:on,className:`${u}-wrapper ${u}-type-${m}${Ge?` ${u}-align-entries`:""} ${u}-image-align-${be} ${ge}`.trim(),style:{gridTemplateColumns:`repeat(${$t}, ${ot})`,rowGap:Ge?0:E.scalingValue(S??0,n),columnGap:E.scalingValue(v.horizontalGap??0,n),width:E.scalingValue(v.wrapperWidth??0,n),...Ge?{[`--${u}-align-entries-row-gap`]:E.scalingValue(S??0,n)}:{}},children:ie.map((ze,dt)=>{var Gt;const _e=fs(ze.title),Ze=fs(ze.subtitle),tt=(((Gt=ze.link)==null?void 0:Gt.length)??0)>0&&w==="off"?ze.link:void 0,Ft=Math.floor(dt/$t)===Math.ceil(ie.length/$t)-1,Ct=ct&&dt>=Mt?`${_t+(dt-Mt)}`:void 0,st=Lt?r.jsxs("div",{className:`${u}-item-text-block`,children:[_e&&r.jsx("p",{className:F,style:{width:qe,...se,...ne},children:ze.title}),_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(D??0,n),width:Pe}}),Ze&&r.jsx("p",{className:te,style:{width:qe,...we,...ue},children:ze.subtitle}),Ze&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:Pe}})]}):null,Ht=Ge?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?E.scalingValue(D??0,n):0,width:Pe}}),_e&&r.jsx("p",{className:F,style:{width:qe,...se,...ne},children:ze.title}),Lt&&_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(D??0,n),width:Pe}})]}):null,At=Ge?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&Ze?"subtitleMarginTop":void 0,className:o&&Ze?`${u}-control`:void 0,style:{height:Ze?E.scalingValue(R??0,n):0,width:Pe}}),Ze&&r.jsx("p",{className:te,style:{width:qe,...we,...ue},children:ze.subtitle}),Lt&&Ze&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:Pe}})]}):null,Vt=tt?r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:[Ht,At]}):r.jsxs(r.Fragment,{children:[Ht,At]}),zt=bm(ze.gallery),Pt=zt.filter(ut=>ut.lightboxMedia).map(ut=>ut.lightboxMedia),Zt=r.jsx("div",{className:Tt,style:Qe,children:zt.length===0?null:k==="off"?(()=>{const{displayMedia:ut,lightboxMedia:Wt}=zt[0],Bt=Wt?Pt.findIndex(g=>g.url===Wt.url):-1;return r.jsx(ys,{media:ut,className:`${u}-item-${Qi(ut)?"video":"image"}`.trim(),style:gt,onMediaClick:je&&Bt>=0?()=>Ke(Pt,Bt):void 0})})():r.jsxs(r.Fragment,{children:[ht&&Ge&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:ut})=>Qi(ut)?r.jsx("video",{src:ut.url,muted:!0,playsInline:!0},`sizer-${ut.url}`):r.jsx("img",{src:ut.url,alt:""},`sizer-${ut.url}`))}),r.jsx(ka,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:A*1e3,width:"100%",height:"100%",speed:gm,type:P==="fade"?"fade":"loop",rewind:P==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:P==="fade"?"ltr":O!=="random"?O==="horizontal"?"ltr":"ttb":It},onMoved:ut=>{if(O!=="random"||P==="fade")return;const Wt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";kt(Wt),setTimeout(()=>{ut.refresh()},0)},children:zt.map(({displayMedia:ut,lightboxMedia:Wt},Bt)=>{const g=Wt?Pt.findIndex(ce=>ce.url===Wt.url):-1;return r.jsx(Pa,{children:r.jsx(ys,{media:ut,className:`${u}-item-${Qi(ut)?"video":"image"}`.trim(),style:gt,onMediaClick:je&&g>=0?()=>Ke(Pt,g):void 0})},Bt)})},`${P}-${j}-${O}-${A}-${Dt}-${d}`)]})}),wt=Lt?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?E.scalingValue(D??0,n):0,width:Pe}}),r.jsx("p",{className:F,style:{width:qe,...se,...ne},children:ze.title}),r.jsx("div",{"data-controls":o&&Ze?"subtitleMarginTop":void 0,className:o&&Ze?`${u}-control`:void 0,style:{height:Ze?E.scalingValue(R??0,n):0,width:Pe}}),r.jsx("p",{className:te,style:{width:qe,...we,...ue},children:ze.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Ct&&!Ge?{gridColumn:Ct}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Ge&&Ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${ot} * (${b} / 100))`:ot,...Ct&&Ge?{gridColumn:Ct}:{}},children:Ge?r.jsx(r.Fragment,{children:Lt?r.jsxs(r.Fragment,{children:[Vt,r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Zt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Zt}),Vt]})}):tt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:[st,Zt]}),!Lt&&r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:wt})]}):r.jsxs(r.Fragment,{children:[st,Zt,wt]})})},dt)})})}),(!n||i)&&Rt&&typeof document<"u"&&w==="on"&&(()=>{const ze=(c?document.getElementById(c):null)??document.body;return mi.createPortal(r.jsx("div",{style:bt,"data-selection":"none",children:r.jsx(Cm,{items:Kt,index:Jt,imageDisplay:Tm(L),onClose:()=>Ut(!1),onPrev:()=>Ce(dt=>(dt-1+Kt.length)%Kt.length),onNext:()=>Ce(dt=>(dt+1)%Kt.length),counterClassName:me,counterStyle:re})}),ze)})()]})}const Im={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Rm=["hover","focus","filled","success","error"],Em=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4101
|
+
`}const Rn=500,xm=750,ni="cubic-bezier(0.22, 1, 0.36, 1)",bm=72,wm=50;function Sm(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 $m(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Cm(e){const[t]=e.media;return t!=null&&t.url?t:null}function Tm(e){return!Array.isArray(e)||e.length===0?[]:Sm(e)?e.flatMap(t=>{const n=$m(t);if(!n)return[];const i=Cm(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 Qi(e){return e.type==="video"}function Lm(e){e.pause(),e.removeAttribute("src"),e.load()}function xs({media:e,className:t,style:n,onMediaClick:i}){return Qi(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 Ao(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Im(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Rm({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{Lm(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d,style:i})}function Em({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:l,counterClassName:s,counterStyle:d}){const c=n==="cover",u=a.useRef(null),m=a.useRef(null),b=a.useRef(null),S=a.useRef(null),C=a.useRef(0),y=a.useRef(0),w=a.useRef("none"),$=a.useRef(!1),T=a.useRef(!1),R=a.useRef(!1),M=a.useRef(null),[H,F]=a.useState(null),[V,P]=a.useState("opening"),[x,U]=a.useState(0),[h,E]=a.useState(0),[A,j]=a.useState(!1),[X,ae]=a.useState(!1),[Z,q]=a.useState(!1),N=a.useRef(t),L=e[t],k=L?Qi(L):!1,K=h!==0||A,z=a.useCallback(se=>{R.current=se,j(se)},[]),ne=a.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),_=a.useCallback(()=>{ne(),M.current=window.setTimeout(()=>{ne(),z(!1)},Rn+32)},[ne,z]),ye=a.useCallback(()=>{const se=m.current,Le=b.current;if(!se)return;const Me=se.getBoundingClientRect(),we=Me.width,Se=Me.height;if(!we||!Se)return;if(n==="cover"){F({width:we,height:Se,left:Me.left,top:Me.top});return}if(!Le){F(Ao(se));return}const{width:B,height:Q}=Im(Le);if(!B||!Q){F(Ao(se));return}const W=B/Q,te=we/Se;if(W>te){const ie=we/W;F({width:we,height:ie,left:Me.left,top:Me.top+(Se-ie)/2})}else{const ie=Se*W;F({width:ie,height:Se,left:Me.left+(we-ie)/2,top:Me.top})}},[n]);a.useEffect(()=>{ye();const se=m.current;if(!se)return;const Le=new ResizeObserver(()=>ye());return Le.observe(se),()=>Le.disconnect()},[ye,t]),a.useEffect(()=>{V==="opening"&&H&&P("open")},[V,H]),a.useEffect(()=>{if(V!=="closing")return;const se=setTimeout(()=>i(),Rn);return()=>clearTimeout(se)},[V,i]),a.useEffect(()=>()=>{ne()},[ne]),a.useLayoutEffect(()=>{if(N.current===t)return;ne(),U(0),E(0),z(!1),q(!1),ae(!1),C.current=0,y.current=0,w.current="none",$.current=!1,S.current=null,T.current=!1;const se=m.current;se&&F(Ao(se)),N.current=t},[t,z,ne]),a.useEffect(()=>{if(V!=="open")return;const se=()=>{const Q=W=>{W.stopPropagation(),W.preventDefault(),document.removeEventListener("click",Q,!0)};document.addEventListener("click",Q,!0)},Le=Q=>{ne(),R.current=!1,j(!1),E(0),ae(!1),$.current=!1,y.current=0,w.current="none";const W=m.current;W&&F(Ao(W)),Q<0?l():o()},Me=Q=>{if(Math.abs(Q)>wm&&e.length>1){Le(Q);return}z(!0),E(0),_()},we=Q=>{if(Q.touches.length!==1||R.current)return;const W=Q.touches[0];T.current=!0,S.current={x:W.clientX,y:W.clientY},w.current="none",y.current=0,$.current=!1},Se=Q=>{if(!S.current||Q.touches.length!==1||R.current)return;const W=Q.touches[0],te=W.clientX-S.current.x,ie=W.clientY-S.current.y;if(w.current==="none"){if(Math.abs(te)<10&&Math.abs(ie)<10)return;if(Math.abs(te)>Math.abs(ie)){if(e.length<=1)return;w.current="horizontal"}else if(ie>0)w.current="vertical";else return}if(w.current==="horizontal"){$.current=!0,ae(!0),y.current=te,E(te),Q.preventDefault();return}w.current==="vertical"&&($.current=!0,ae(!0),C.current=ie,U(ie),Q.preventDefault())},B=()=>{if(!S.current)return;const Q=w.current,W=$.current;if(W&&Q==="horizontal")Me(y.current),se();else if(W&&Q==="vertical"){if(C.current>bm){const ie=window.innerHeight;C.current=ie,q(!0),U(ie),P("closing")}else C.current=0,U(0);se()}else Q==="horizontal"&&Math.abs(y.current)>0&&(Me(y.current),se());S.current=null,w.current="none",y.current=0,$.current=!1,ae(!1)};return document.addEventListener("touchstart",we,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",B),document.addEventListener("touchcancel",B),()=>{document.removeEventListener("touchstart",we),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",B),document.removeEventListener("touchcancel",B)}},[V,e.length,l,o,z,_]),a.useEffect(()=>{const se=Le=>{Le.key==="Escape"&&(Le.preventDefault(),Le.stopPropagation(),V!=="closing"&&P("closing"))};return window.addEventListener("keydown",se,!0),()=>window.removeEventListener("keydown",se,!0)},[V]);const f=()=>{V!=="closing"&&P("closing")},ve=V==="open",Y=V==="closing",le=x>0?Math.max(0,1-x/500):1,$e=x>0?Math.max(.35,1-x/500):1,oe=se=>{if(se.stopPropagation(),T.current){T.current=!1;return}if(e.length<=1)return;const Le=se.currentTarget.getBoundingClientRect(),Me=se.clientY-Le.top,we=Math.min(52,Le.height*.2);if(!(Me>Le.height-we)){if(se.clientX-Le.left<Le.width/2){o();return}l()}},xe=se=>{if(e.length<=1)return;const Le=se.currentTarget.getBoundingClientRect(),Me=se.clientX-Le.left,we=se.clientY-Le.top,Se=Math.min(52,Le.height*.2);if(we>Le.height-Se){se.currentTarget.style.cursor="default";return}se.currentTarget.style.cursor=Me<Le.width/2?"w-resize":"e-resize"},G=a.useCallback(se=>{se.propertyName!=="transform"||!R.current||(ne(),z(!1))},[ne,z]),he=K?`translateX(${h}px)`:x>0?`translateY(${x}px)`:void 0,be={position:"fixed",top:H==null?void 0:H.top,left:H==null?void 0:H.left,width:H==null?void 0:H.width,height:H==null?void 0:H.height,objectFit:n==="cover"?"cover":"contain",transform:he,opacity:x>0?$e:V==="opening"||Y?0:1,transition:X&&!A?"none":A?`transform ${Rn}ms ${ni}`:Z?`transform ${Rn}ms ${ni}, opacity ${Rn}ms ${ni}`:V==="opening"||Y?`opacity ${Rn}ms ${ni}`:"none",pointerEvents:k&&ve&&!K?"auto":"none",touchAction:k&&ve?"none":void 0,zIndex:9998},ce=H?{position:"fixed",top:H.top,height:H.height,width:H.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:u,style:{position:"fixed",top:"var(--cntrl-article-top, 0)",left:"var(--cntrl-article-left, 0)",width:"var(--cntrl-article-width, 100vw) !important",height:"var(--cntrl-viewport-height, 100vh) !important",zIndex:9997,touchAction:V==="open"?"none":void 0},onClick:f,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ve?le:0,transition:X?"none":`opacity ${Rn}ms ${ni}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:m,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 ${ni}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:m,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 ${ni}`},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]})}),H&&L&&(k?r.jsx(Rm,{src:L.url,phase:V,mediaRef:b,mediaStyle:be,onLoadedMetadata:ye,onClick:oe,onMouseMove:xe,onTransitionEnd:G},`${t}-${L.url}`):r.jsx("img",{ref:b,src:L.url,alt:L.name,onLoad:ye,onTransitionEnd:G,style:be},`${t}-${L.url}`)),ve&&ce&&e.length>1&&!k&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ce,left:H.left,cursor:"w-resize",pointerEvents:K?"none":"auto"},onClick:se=>{if(T.current){T.current=!1;return}se.stopPropagation(),o()}}),r.jsx("div",{style:{...ce,left:H.left+H.width/2,cursor:"e-resize",pointerEvents:K?"none":"auto"},onClick:se=>{if(T.current){T.current=!1;return}se.stopPropagation(),l()}})]})]})}function Mm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function km({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=v.useScopedStyles(),{type:m="a",gridLayout:b,textBoxWidth:S=100,verticalGap:C,entriesCount:y,lightbox:w,imageDisplay:$,lightboxImageDisplay:T,slider:R,sliderTiming:M,direction:H,transition:F,titleMarginTop:V,subtitleMarginTop:P,titleColor:x,subtitleColor:U,lightboxCounterColor:h,titleFontFamily:E,titleFontSettings:A,titleFontSize:j,titleLineHeight:X,titleLetterSpacing:ae,titleWordSpacing:Z,titleTextAppearance:q,subtitleFontFamily:N,subtitleFontSettings:L,subtitleFontSize:k,subtitleLineHeight:K,subtitleLetterSpacing:z,subtitleWordSpacing:ne,subtitleTextAppearance:_,lightboxCounterFontFamily:ye,lightboxCounterFontSettings:f,lightboxCounterFontSize:ve,lightboxCounterLineHeight:Y,lightboxCounterLetterSpacing:le,lightboxCounterWordSpacing:$e,lightboxCounterTextAppearance:oe,showText:xe="always",alignEntries:G="off",align:he="top"}=e,be={fontSettings:{fontFamily:E,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:j??.01,lineHeight:X,letterSpacing:ae??0,wordSpacing:Z??0,textAppearance:q,color:x},se={...cn(Jt(be,n))},Le={fontSettings:{fontFamily:N,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:k??.01,lineHeight:K,letterSpacing:z??0,wordSpacing:ne??0,textAppearance:_,color:U},we={...cn(Jt(Le,n))},Se={fontSettings:{fontFamily:ye,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:ve??.01,lineHeight:Y,letterSpacing:le??0,wordSpacing:$e??0,textAppearance:oe,color:h},Q={...cn(Jt(Se,n)),..._r(ve,Y,u,n)},W=Wr(j,X,`${u}-item-title`,`${u}-text-tight-leading`),te=Wr(k,K,`${u}-item-subtitle`,`${u}-text-tight-leading`),ie=_r(j,X,u,n),pe=_r(k,K,u,n),me=Wr(ve,Y,`${u}-lightbox-counter`,`${u}-text-tight-leading`),fe=v.buildColorVars(u,{titleColor:x,subtitleColor:U,lightboxCounterColor:h},Pm,Am),ge=`${s&&s!=="default"?`${u}-state-${s}`:""}${xe==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Ae=y===0?1/0:y,re=(t??[]).slice(0,Ae),D=b.entryWidth??.2,Oe=($==null?void 0:$.display)==="cover",We=($==null?void 0:$.ratioValue)??"1:1",et=($==null?void 0:$.reversed)??!1,[Ye,st]=We.split(":").map(Number),it=`${et?st:Ye} / ${et?Ye:st}`,$t=b.columnsCount,ot=v.scalingValue(D??0,n),Ue=ot,ht=!Oe&&R!=="off",xt=re.length%$t||$t,ct=xt<$t&&re.length>0,Mt=re.length-xt,_t=ct?Math.floor(($t-xt)/2)+1:1,Qe={width:Ue,...Oe?{aspectRatio:it,height:"auto",overflow:"hidden"}:{height:"auto"}},Tt=`${u}-item-image-wrapper${ht?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Lt=m==="d"||m==="e"||m==="f",Ge=G==="on",qe=`calc(${v.scalingValue(D??0,n)} * (${S} / 100))`,Pe=v.scalingValue(D*S/100,n),gt=Oe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[It,kt]=a.useState("ltr"),[Dt,en]=a.useState(0),on=a.useRef(null);a.useEffect(()=>{const Be=on.current;if(!Be)return;const dt=new ResizeObserver(_e=>{en(Math.round(_e[0].contentRect.width))});return dt.observe(Be),()=>dt.disconnect()},[]);const bt=(()=>{const Be={...fe},dt=on.current?getComputedStyle(on.current).getPropertyValue("--cntrl-article-width").trim():"";return dt&&(Be["--cntrl-article-width"]=dt),Be})(),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState([]),[Zt,Ce]=a.useState(0),je=w==="on"&&(!n||i),Ke=(Be,dt)=>{n&&!i||w!=="off"&&(ft(Be),Ce(dt),Ut(!0))};a.useEffect(()=>{if(!Rt||w!=="on"||typeof document>"u")return;const Be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Be}},[Rt,w]),a.useEffect(()=>{!n||i||Ut(!1)},[n,i]);const He=a.useMemo(()=>vm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),r.jsx("div",{style:fe,children:r.jsx("div",{ref:on,className:`${u}-wrapper ${u}-type-${m}${Ge?` ${u}-align-entries`:""} ${u}-image-align-${he} ${ge}`.trim(),style:{gridTemplateColumns:`repeat(${$t}, ${ot})`,rowGap:Ge?0:v.scalingValue(C??0,n),columnGap:v.scalingValue(b.horizontalGap??0,n),width:v.scalingValue(b.wrapperWidth??0,n),...Ge?{[`--${u}-align-entries-row-gap`]:v.scalingValue(C??0,n)}:{}},children:re.map((Be,dt)=>{var Gt;const _e=vs(Be.title),Ze=vs(Be.subtitle),tt=(((Gt=Be.link)==null?void 0:Gt.length)??0)>0&&w==="off"?Be.link:void 0,Wt=Math.floor(dt/$t)===Math.ceil(re.length/$t)-1,Ct=ct&&dt>=Mt?`${_t+(dt-Mt)}`:void 0,at=Lt?r.jsxs("div",{className:`${u}-item-text-block`,children:[_e&&r.jsx("p",{className:W,style:{width:qe,...se,...ie},children:Be.title}),_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(V??0,n),width:Pe}}),Ze&&r.jsx("p",{className:te,style:{width:qe,...we,...pe},children:Be.subtitle}),Ze&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(P??0,n),width:Pe}})]}):null,Ht=Ge?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?v.scalingValue(V??0,n):0,width:Pe}}),_e&&r.jsx("p",{className:W,style:{width:qe,...se,...ie},children:Be.title}),Lt&&_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(V??0,n),width:Pe}})]}):null,At=Ge?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&Ze?"subtitleMarginTop":void 0,className:o&&Ze?`${u}-control`:void 0,style:{height:Ze?v.scalingValue(P??0,n):0,width:Pe}}),Ze&&r.jsx("p",{className:te,style:{width:qe,...we,...pe},children:Be.subtitle}),Lt&&Ze&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(P??0,n),width:Pe}})]}):null,Vt=tt?r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:[Ht,At]}):r.jsxs(r.Fragment,{children:[Ht,At]}),Bt=Tm(Be.gallery),Pt=Bt.filter(ut=>ut.lightboxMedia).map(ut=>ut.lightboxMedia),Qt=r.jsx("div",{className:Tt,style:Qe,children:Bt.length===0?null:R==="off"?(()=>{const{displayMedia:ut,lightboxMedia:Ft}=Bt[0],zt=Ft?Pt.findIndex(g=>g.url===Ft.url):-1;return r.jsx(xs,{media:ut,className:`${u}-item-${Qi(ut)?"video":"image"}`.trim(),style:gt,onMediaClick:je&&zt>=0?()=>Ke(Pt,zt):void 0})})():r.jsxs(r.Fragment,{children:[ht&&Ge&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Bt.map(({displayMedia:ut})=>Qi(ut)?r.jsx("video",{src:ut.url,muted:!0,playsInline:!0},`sizer-${ut.url}`):r.jsx("img",{src:ut.url,alt:""},`sizer-${ut.url}`))}),r.jsx(Aa,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:M*1e3,width:"100%",height:"100%",speed:xm,type:F==="fade"?"fade":"loop",rewind:F==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:F==="fade"?"ltr":H!=="random"?H==="horizontal"?"ltr":"ttb":It},onMoved:ut=>{if(H!=="random"||F==="fade")return;const Ft=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";kt(Ft),setTimeout(()=>{ut.refresh()},0)},children:Bt.map(({displayMedia:ut,lightboxMedia:Ft},zt)=>{const g=Ft?Pt.findIndex(de=>de.url===Ft.url):-1;return r.jsx(Fa,{children:r.jsx(xs,{media:ut,className:`${u}-item-${Qi(ut)?"video":"image"}`.trim(),style:gt,onMediaClick:je&&g>=0?()=>Ke(Pt,g):void 0})},zt)})},`${F}-${D}-${H}-${M}-${Dt}-${d}`)]})}),wt=Lt?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?v.scalingValue(V??0,n):0,width:Pe}}),r.jsx("p",{className:W,style:{width:qe,...se,...ie},children:Be.title}),r.jsx("div",{"data-controls":o&&Ze?"subtitleMarginTop":void 0,className:o&&Ze?`${u}-control`:void 0,style:{height:Ze?v.scalingValue(P??0,n):0,width:Pe}}),r.jsx("p",{className:te,style:{width:qe,...we,...pe},children:Be.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Ct&&!Ge?{gridColumn:Ct}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Ge&&Wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(S??0)>100?`calc(${ot} * (${S} / 100))`:ot,...Ct&&Ge?{gridColumn:Ct}:{}},children:Ge?r.jsx(r.Fragment,{children:Lt?r.jsxs(r.Fragment,{children:[Vt,r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Qt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Qt}),Vt]})}):tt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:[at,Qt]}),!Lt&&r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:wt})]}):r.jsxs(r.Fragment,{children:[at,Qt,wt]})})},dt)})})}),(!n||i)&&Rt&&typeof document<"u"&&w==="on"&&(()=>{const Be=(c?document.getElementById(c):null)??document.body;return mi.createPortal(r.jsx("div",{style:bt,"data-selection":"none",children:r.jsx(Em,{items:Kt,index:Zt,imageDisplay:Mm(T),onClose:()=>Ut(!1),onPrev:()=>Ce(dt=>(dt-1+Kt.length)%Kt.length),onNext:()=>Ce(dt=>(dt+1)%Kt.length),counterClassName:me,counterStyle:Q})}),Be)})()]})}const Pm={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Am=["hover","focus","filled","success","error"],Fm=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4066
4102
|
import '@splidejs/react-splide/css/core';
|
|
4067
4103
|
import { CommonComponentProps } from '../props';
|
|
4068
4104
|
import {
|
|
@@ -5851,12 +5887,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5851
5887
|
};
|
|
5852
5888
|
|
|
5853
5889
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5854
|
-
`,Nr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Mm=["titleColor","subtitleColor","lightboxCounterColor"],km={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"}}},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:{...Nr.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:{...Nr.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:{...Nr.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,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,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,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","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"]},{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:[...Mm],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Pm={element:Lm,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:km,sourceCode:Em},Am=50,vs=10,Aa="cntrl-lightbox-journal",br=Aa,aa=`${Aa}-`,wr=e=>`${Aa}-${e}`,Wa=e=>e===br||e.startsWith(aa),xs=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},bs=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=xs(t.get(wr(e)));if(i)return i}const n=xs(t.get(br));if(n)return n;for(const[i]of t){if(!i.startsWith(aa))continue;const o=i.slice(aa.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},Ol=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Wa(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(wr(t),String(e)):i.searchParams.set(br,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Wm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===wr(e)||i===br:Wa(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)}},jl=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(wr(e)):[...t.keys()].some(n=>Wa(n))},Fm=(e,t)=>{if(jl(t)){if(e){window.history.back();return}Wm(t)}},_m=20,Hm=2,Or=e=>`max(${e}, ${_m}px)`,Mi=e=>((e==null?void 0:e.image)??[]).slice(0,Hm),zl=e=>e.reduce((t,n)=>t+Mi(n).length,0),Nm=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Mi(s).length,1),i=Mi(e[t]).length;return{start:n,end:n+i-1}},Om=(e,t)=>{const n=zl(e),{start:i,end:o}=Nm(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Uo=(e,t)=>t==="B"?e.flatMap((n,i)=>Mi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Mi(n)})),jm=(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 Om(i,o)},Ss=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",zm=(e,t,n)=>e==="B"?t.length>1:zl(n)>1,mn=.004,Bn=.004,Ti={title1Width:.13,title2Width:.13,title3Width:.14},Dn=(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},ki=(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},co=(e,t)=>ki(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)},Vn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ki(e.length,n),effective:co(e.length,n)}},Bl=(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),Dl=(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"],Be=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Fa={title1:"1",title2:"2",title3:"3",count:"Count"},_a=e=>[Be(e,"fontFamily"),Be(e,"fontSettings"),{type:"row",items:[Be(e,"fontSize"),Be(e,"lineHeight"),Be(e,"letterSpacing"),Be(e,"wordSpacing")]},Be(e,"textAlign"),Be(e,"textAppearance")],Bm=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Fa[e],_a(e)]))}),Dm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Vm={title1:.02,title2:.02,title3:.02,count:.017},li=(e,t)=>{const n=i=>{const o=Be(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[Dm[t]]}},ci=(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??Vm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)};function Vl({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:v=0,title3MarginLeft:b=0,titleRowMarginBottom:S=0,titleHeaderLayout:y="desktop",contentMarginTop:w=0,iconMarginRight:C=0,closeIcon:L=null,closeIconMaxWidth:k=0,closeIconColor:A="#000000",closeIconHoverColor:O="#cccccc"}=n,P=E.scalingValue(w,i),D=E.scalingValue(C,i),R=E.scalingValue(S,i),x=y==="mobile",U=ci("title1",li(n,"title1"),i),h=ci("title2",li(n,"title2"),i),I=ci("title3",li(n,"title3"),i),W=a.useMemo(()=>({title1Width:d??Ti.title1Width,title2Width:c??Ti.title2Width,title3Width:u??Ti.title3Width}),[d,c,u]),V=a.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:b}),[v,b]),Y=a.useMemo(()=>Dn(e,t,U,h,I),[e,t,U,h,I]),ae=a.useMemo(()=>Y.map(Q=>W[Q.widthKey]),[Y,W]),Z=a.useMemo(()=>ki(Y.length,ae),[Y.length,ae]),G=a.useMemo(()=>co(Y.length,ae),[Y.length,ae]),H=a.useMemo(()=>Y.filter(Q=>Q.prefix==="title1"),[Y]),$=a.useMemo(()=>Y.filter(Q=>Q.prefix==="title2"||Q.prefix==="title3"),[Y]),M=a.useMemo(()=>Vn(H,W),[H,W]),q=a.useMemo(()=>Vn($,W),[$,W]),B=!!(t.title1||t.title2||t.title3),ee=L!==null;if(!(B||ee))return null;const ye=(m??0)>0||o,f=(Q,ge)=>{const Ae=Y.findIndex(j=>j.prefix===Q.prefix);if(!x||ge==="single-row")return{effectiveWidth:G[Ae]??0,resolvedWidth:Z[Ae]??0,maxWidth:an(Ae,Z)};if(ge==="two-row-top"){const j=H.findIndex(Oe=>Oe.prefix===Q.prefix);return{effectiveWidth:M.effective[j]??0,resolvedWidth:M.resolved[j]??0,maxWidth:an(j,M.resolved)}}const ie=$.findIndex(j=>j.prefix===Q.prefix);return{effectiveWidth:q.effective[ie]??0,resolvedWidth:q.resolved[ie]??0,maxWidth:an(ie,q.resolved)}},ve=(Q,ge,Ae)=>{if(!x||Ae==="single-row"){const et=Q.findIndex(De=>De.prefix===ge.prefix),Ye=Q.map(De=>W[De.widthKey]),at=ki(Q.length,Ye);return{effectiveWidth:co(Q.length,Ye)[et]??0,resolvedWidth:at[et]??0,maxWidth:an(et,at)}}if(Ae==="two-row-top"){const et=Q.filter(De=>De.prefix==="title1"),Ye=et.findIndex(De=>De.prefix===ge.prefix),{resolved:at,effective:mt}=Vn(et,W);return{effectiveWidth:mt[Ye]??0,resolvedWidth:at[Ye]??0,maxWidth:an(Ye,at)}}const ie=Q.filter(et=>et.prefix==="title2"||et.prefix==="title3"),j=ie.findIndex(et=>et.prefix===ge.prefix),{resolved:Oe,effective:Fe}=Vn(ie,W);return{effectiveWidth:Fe[j]??0,resolvedWidth:Oe[j]??0,maxWidth:an(j,Oe)}},K=Q=>Dl(Y,Z,V,Q)+(x?0:m??0),le=()=>x?0:m??0,$e=Q=>$.slice(0,Q).reduce((ge,Ae,ie)=>ge+(Ae.marginLeftKey?V[Ae.marginLeftKey]??0:0)+(q.resolved[ie]??0),0),oe=Q=>{const ge=$[Q];return $e(Q)+(ge.marginLeftKey?V[ge.marginLeftKey]??0:0)+(q.resolved[Q]??0)},fe=(Q,ge,Ae)=>{const ie=Q.marginLeftKey?V[Q.marginLeftKey]??0:0,{effectiveWidth:j,resolvedWidth:Oe,maxWidth:Fe}=Ae??f(Q,ge),et=Math.max(ie,Bn),Ye=o&&ge==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":Q.prefix,style:{width:E.scalingValue(j,i),...ie>0?{marginLeft:E.scalingValue(ie,i)}:{}},children:[r.jsx("p",{className:Q.className,style:Q.style,children:Q.text}),Ye&&Q.marginLeftKey?r.jsx("div",{"data-controls":Q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:E.scalingValue(-ie,i),width:E.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Ye?r.jsx("div",{"data-controls":Q.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:E.scalingValue(-mn/2,i),width:E.scalingValue(mn,i),height:"100%",pointerEvents:"auto"}}):null]},Q.className)},X=(Q="two-row")=>{const ge=Y.findIndex(j=>j.prefix==="title1"),Ae=ge>=0?Z[ge]:W.title1Width,ie=Q==="two-row"&&o;return r.jsx("div",{...ie?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae)}:{},style:{width:E.scalingValue(m??0,i),flexShrink:0,alignSelf:"stretch",...ie?{pointerEvents:"auto"}:{}}})},be=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:U,"aria-hidden":"true",children:" "}),xe=Q=>{const ge=Dn(e,Q,U,h,I);return r.jsx(r.Fragment,{children:ge.map(Ae=>fe(Ae,"single-row",ve(ge,Ae,"single-row")))})},pe=Q=>{const ge=Dn(e,Q,U,h,I),Ae=ge.find(ie=>ie.prefix==="title1");return Ae?fe(Ae,"two-row-top",ve(ge,Ae,"two-row-top")):null},se=(Q,ge=!1)=>{const Ae=Dn(e,Q,U,h,I),ie=Ae.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),j=o&≥return ie.length>0||j||(S??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(Fe=>fe(Fe,"two-row-bottom",ve(Ae,Fe,"two-row-bottom")))}),ge&&o?r.jsxs(r.Fragment,{children:[te(),ne()]}):null]}):null,(S??0)>0||j?r.jsx("div",{"data-controls":j?"titleRowMarginBottom":void 0,"data-controls-axis":j?"y":void 0,"data-controls-reverse":j?"":void 0,className:j?`${e}-control`:void 0,style:{height:R,width:"100%",flexShrink:0,pointerEvents:j?"auto":"none"}}):null]}):null},Re=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(k??0,i),height:E.scalingValue(k??0,i),marginRight:D,"--close-icon-hover-color":O},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Q=>{Q.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(fn,{url:L??"",fill:A,hoverFill:i&&!s?A:O,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:D,height:"100%",pointerEvents:"auto"}})]}),ke=()=>ee?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Re()}):null,we=Q=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:Q})}),Se=Q=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ee||B?be():null,ye?X("two-row"):null,we(Q),ke()]}),z=(Q,ge=!1)=>r.jsxs(r.Fragment,{children:[Se(pe(Q)),se(Q,ge)]}),re=()=>{const Q=x?-1:Y.findIndex(ie=>ie.prefix==="title1"),ge=!x&&(o||(m??0)>0)?(()=>{const ie=m??0,j=Q>=0?Z[Q]:W.title1Width,Oe=Math.max(ie,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(j),style:{position:"absolute",top:0,left:0,width:E.scalingValue(Oe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ae=Y.flatMap((ie,j)=>{if(!ie.marginLeftKey)return[];const Oe=V[ie.marginLeftKey]??0,Fe=Bl(Y,Z,V,j)+le(),et=Math.max(Oe,Bn);return r.jsx("div",{"data-controls":ie.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Z[j]),style:{position:"absolute",top:0,left:E.scalingValue(Fe,i),width:E.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},ie.marginLeftKey)});return ge?[ge,...Ae]:Ae},F=()=>Y.map((Q,ge)=>{const Ae=an(ge,Z),j=K(ge)-mn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Q.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,left:E.scalingValue(j,i),width:E.scalingValue(mn,i),height:"100%",pointerEvents:"auto"}})},`${Q.widthKey}-junction`)}),te=()=>$.flatMap((Q,ge)=>{if(!Q.marginLeftKey)return[];const Ae=V[Q.marginLeftKey]??0,ie=$e(ge),j=Math.max(Ae,Bn),{resolvedWidth:Oe}=f(Q,"two-row-bottom");return r.jsx("div",{"data-controls":Q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:E.scalingValue(ie,i),width:E.scalingValue(j,i),height:"100%",pointerEvents:"auto"}},Q.marginLeftKey)}),ne=()=>$.map((Q,ge)=>{const{maxWidth:Ae}=f(Q,"two-row-bottom"),j=oe(ge)-mn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Q.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,left:E.scalingValue(j,i),width:E.scalingValue(mn,i),height:"100%",pointerEvents:"auto"}})},`${Q.widthKey}-junction`)}),ue=()=>!o||x?null:r.jsxs(r.Fragment,{children:[re(),F()]}),me=!!(t.title2||t.title3||(S??0)>0||o),he=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ee||B?be():null,ye?X("single-row"):null,B?we(xe(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ke(),ue()]}),Le=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...me?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:me?void 0:{flex:"0 0 auto",height:"auto"},children:z(t,!0)}),ue()]});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%",...x?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${x?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${x?` ${e}-text-bar-cell-stacked`:""}`,style:x?void 0:{flex:1,minWidth:0,width:"100%"},children:x?Le():he()})})})]})}function Gm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function qm(e){return`
|
|
5890
|
+
`,Hr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Wm=["titleColor","subtitleColor","lightboxCounterColor"],_m={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"}}},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:{...Hr.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:{...Hr.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:{...Hr.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,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,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,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","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"]},{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:[...Wm],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Hm={element:km,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:_m,sourceCode:Fm},Nm=50,bs=10,Wa="cntrl-lightbox-journal",xr=Wa,la=`${Wa}-`,br=e=>`${Wa}-${e}`,_a=e=>e===xr||e.startsWith(la),ws=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Ss=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=ws(t.get(br(e)));if(i)return i}const n=ws(t.get(xr));if(n)return n;for(const[i]of t){if(!i.startsWith(la))continue;const o=i.slice(la.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},$s=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},zl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{_a(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(br(t),String(e)):i.searchParams.set(xr,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},Om=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===br(e)||i===xr:_a(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)}},Dl=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(br(e)):[...t.keys()].some(n=>_a(n))},jm=(e,t)=>{if(Dl(t)){if(e){window.history.back();return}Om(t)}},Bm=20,zm=2,Nr=e=>`max(${e}, ${Bm}px)`,Mi=e=>((e==null?void 0:e.image)??[]).slice(0,zm),Vl=e=>e.reduce((t,n)=>t+Mi(n).length,0),Dm=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+Mi(l).length,1),i=Mi(e[t]).length;return{start:n,end:n+i-1}},Vm=(e,t)=>{const n=Vl(e),{start:i,end:o}=Dm(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Uo=(e,t)=>t==="B"?e.flatMap((n,i)=>Mi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Mi(n)})),Gm=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return Vm(i,o)},Cs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",qm=(e,t,n)=>e==="B"?t.length>1:Vl(n)>1,hn=.004,zn=.004,Ti={title1Width:.13,title2Width:.13,title3Width:.14},Dn=(e,t,n,i,o)=>{const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l},ki=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},co=(e,t)=>ki(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)},Vn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ki(e.length,n),effective:co(e.length,n)}},Gl=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),ql=(e,t,n,i)=>e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Kn=["title1","title2","title3","count"],ze=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ha={title1:"1",title2:"2",title3:"3",count:"Count"},Na=e=>[ze(e,"fontFamily"),ze(e,"fontSettings"),{type:"row",items:[ze(e,"fontSize"),ze(e,"lineHeight"),ze(e,"letterSpacing"),ze(e,"wordSpacing")]},ze(e,"textAlign"),ze(e,"textAppearance")],Km=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Ha[e],Na(e)]))}),Um={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Xm={title1:.02,title2:.02,title3:.02,count:.017},li=(e,t)=>{const n=i=>{const o=ze(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Um[t]]}},ci=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??Xm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Jt(i,n)};function Kl({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:b=0,title3MarginLeft:S=0,titleRowMarginBottom:C=0,titleHeaderLayout:y="desktop",contentMarginTop:w=0,iconMarginRight:$=0,closeIcon:T=null,closeIconMaxWidth:R=0,closeIconColor:M="#000000",closeIconHoverColor:H="#cccccc"}=n,F=v.scalingValue(w,i),V=v.scalingValue($,i),P=v.scalingValue(C,i),x=y==="mobile",U=ci("title1",li(n,"title1"),i),h=ci("title2",li(n,"title2"),i),E=ci("title3",li(n,"title3"),i),A=a.useMemo(()=>({title1Width:d??Ti.title1Width,title2Width:c??Ti.title2Width,title3Width:u??Ti.title3Width}),[d,c,u]),j=a.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:S}),[b,S]),X=a.useMemo(()=>Dn(e,t,U,h,E),[e,t,U,h,E]),ae=a.useMemo(()=>X.map(ee=>A[ee.widthKey]),[X,A]),Z=a.useMemo(()=>ki(X.length,ae),[X.length,ae]),q=a.useMemo(()=>co(X.length,ae),[X.length,ae]),N=a.useMemo(()=>X.filter(ee=>ee.prefix==="title1"),[X]),L=a.useMemo(()=>X.filter(ee=>ee.prefix==="title2"||ee.prefix==="title3"),[X]),k=a.useMemo(()=>Vn(N,A),[N,A]),K=a.useMemo(()=>Vn(L,A),[L,A]),z=!!(t.title1||t.title2||t.title3),ne=T!==null;if(!(z||ne))return null;const ye=(m??0)>0||o,f=(ee,ge)=>{const Ae=X.findIndex(D=>D.prefix===ee.prefix);if(!x||ge==="single-row")return{effectiveWidth:q[Ae]??0,resolvedWidth:Z[Ae]??0,maxWidth:an(Ae,Z)};if(ge==="two-row-top"){const D=N.findIndex(Oe=>Oe.prefix===ee.prefix);return{effectiveWidth:k.effective[D]??0,resolvedWidth:k.resolved[D]??0,maxWidth:an(D,k.resolved)}}const re=L.findIndex(D=>D.prefix===ee.prefix);return{effectiveWidth:K.effective[re]??0,resolvedWidth:K.resolved[re]??0,maxWidth:an(re,K.resolved)}},ve=(ee,ge,Ae)=>{if(!x||Ae==="single-row"){const et=ee.findIndex(De=>De.prefix===ge.prefix),Ye=ee.map(De=>A[De.widthKey]),st=ki(ee.length,Ye);return{effectiveWidth:co(ee.length,Ye)[et]??0,resolvedWidth:st[et]??0,maxWidth:an(et,st)}}if(Ae==="two-row-top"){const et=ee.filter(De=>De.prefix==="title1"),Ye=et.findIndex(De=>De.prefix===ge.prefix),{resolved:st,effective:mt}=Vn(et,A);return{effectiveWidth:mt[Ye]??0,resolvedWidth:st[Ye]??0,maxWidth:an(Ye,st)}}const re=ee.filter(et=>et.prefix==="title2"||et.prefix==="title3"),D=re.findIndex(et=>et.prefix===ge.prefix),{resolved:Oe,effective:We}=Vn(re,A);return{effectiveWidth:We[D]??0,resolvedWidth:Oe[D]??0,maxWidth:an(D,Oe)}},Y=ee=>ql(X,Z,j,ee)+(x?0:m??0),le=()=>x?0:m??0,$e=ee=>L.slice(0,ee).reduce((ge,Ae,re)=>ge+(Ae.marginLeftKey?j[Ae.marginLeftKey]??0:0)+(K.resolved[re]??0),0),oe=ee=>{const ge=L[ee];return $e(ee)+(ge.marginLeftKey?j[ge.marginLeftKey]??0:0)+(K.resolved[ee]??0)},xe=(ee,ge,Ae)=>{const re=ee.marginLeftKey?j[ee.marginLeftKey]??0:0,{effectiveWidth:D,resolvedWidth:Oe,maxWidth:We}=Ae??f(ee,ge),et=Math.max(re,zn),Ye=o&&ge==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ee.prefix,style:{width:v.scalingValue(D,i),...re>0?{marginLeft:v.scalingValue(re,i)}:{}},children:[r.jsx("p",{className:ee.className,style:ee.style,children:ee.text}),Ye&&ee.marginLeftKey?r.jsx("div",{"data-controls":ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:v.scalingValue(-re,i),width:v.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Ye?r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(We),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:v.scalingValue(-hn/2,i),width:v.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}}):null]},ee.className)},G=(ee="two-row")=>{const ge=X.findIndex(D=>D.prefix==="title1"),Ae=ge>=0?Z[ge]:A.title1Width,re=ee==="two-row"&&o;return r.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae)}:{},style:{width:v.scalingValue(m??0,i),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},he=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:U,"aria-hidden":"true",children:" "}),be=ee=>{const ge=Dn(e,ee,U,h,E);return r.jsx(r.Fragment,{children:ge.map(Ae=>xe(Ae,"single-row",ve(ge,Ae,"single-row")))})},ce=ee=>{const ge=Dn(e,ee,U,h,E),Ae=ge.find(re=>re.prefix==="title1");return Ae?xe(Ae,"two-row-top",ve(ge,Ae,"two-row-top")):null},se=(ee,ge=!1)=>{const Ae=Dn(e,ee,U,h,E),re=Ae.filter(We=>We.prefix==="title2"||We.prefix==="title3"),D=o&≥return re.length>0||D||(C??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:re.map(We=>xe(We,"two-row-bottom",ve(Ae,We,"two-row-bottom")))}),ge&&o?r.jsxs(r.Fragment,{children:[te(),ie()]}):null]}):null,(C??0)>0||D?r.jsx("div",{"data-controls":D?"titleRowMarginBottom":void 0,"data-controls-axis":D?"y":void 0,"data-controls-reverse":D?"":void 0,className:D?`${e}-control`:void 0,style:{height:P,width:"100%",flexShrink:0,pointerEvents:D?"auto":"none"}}):null]}):null},Le=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:v.scalingValue(R??0,i),height:v.scalingValue(R??0,i),marginRight:V,"--close-icon-hover-color":H},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:ee=>{ee.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(dn,{url:T??"",fill:M,hoverFill:i&&!l?M:H,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"}})]}),Me=()=>ne?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Le()}):null,we=ee=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:ee})}),Se=ee=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ne||z?he():null,ye?G("two-row"):null,we(ee),Me()]}),B=(ee,ge=!1)=>r.jsxs(r.Fragment,{children:[Se(ce(ee)),se(ee,ge)]}),Q=()=>{const ee=x?-1:X.findIndex(re=>re.prefix==="title1"),ge=!x&&(o||(m??0)>0)?(()=>{const re=m??0,D=ee>=0?Z[ee]:A.title1Width,Oe=Math.max(re,zn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D),style:{position:"absolute",top:0,left:0,width:v.scalingValue(Oe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ae=X.flatMap((re,D)=>{if(!re.marginLeftKey)return[];const Oe=j[re.marginLeftKey]??0,We=Gl(X,Z,j,D)+le(),et=Math.max(Oe,zn);return r.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Z[D]),style:{position:"absolute",top:0,left:v.scalingValue(We,i),width:v.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return ge?[ge,...Ae]:Ae},W=()=>X.map((ee,ge)=>{const Ae=an(ge,Z),D=Y(ge)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.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,left:v.scalingValue(D,i),width:v.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)}),te=()=>L.flatMap((ee,ge)=>{if(!ee.marginLeftKey)return[];const Ae=j[ee.marginLeftKey]??0,re=$e(ge),D=Math.max(Ae,zn),{resolvedWidth:Oe}=f(ee,"two-row-bottom");return r.jsx("div",{"data-controls":ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:v.scalingValue(re,i),width:v.scalingValue(D,i),height:"100%",pointerEvents:"auto"}},ee.marginLeftKey)}),ie=()=>L.map((ee,ge)=>{const{maxWidth:Ae}=f(ee,"two-row-bottom"),D=oe(ge)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.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,left:v.scalingValue(D,i),width:v.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)}),pe=()=>!o||x?null:r.jsxs(r.Fragment,{children:[Q(),W()]}),me=!!(t.title2||t.title3||(C??0)>0||o),fe=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ne||z?he():null,ye?G("single-row"):null,z?we(be(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),Me(),pe()]}),Ie=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...me?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:me?void 0:{flex:"0 0 auto",height:"auto"},children:B(t,!0)}),pe()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:F,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...x?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${x?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${x?` ${e}-text-bar-cell-stacked`:""}`,style:x?void 0:{flex:1,minWidth:0,width:"100%"},children:x?Ie():fe()})})})]})}function Ym(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Jm(e){return`
|
|
5855
5891
|
.${e}-wrapper {
|
|
5856
5892
|
display: grid;
|
|
5857
5893
|
align-items: start;
|
|
5858
5894
|
justify-content: center;
|
|
5859
|
-
min-height: ${
|
|
5895
|
+
min-height: ${Ym(48)};
|
|
5860
5896
|
}
|
|
5861
5897
|
.${e}-item {
|
|
5862
5898
|
display: flex;
|
|
@@ -6182,7 +6218,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
6182
6218
|
pointer-events: auto;
|
|
6183
6219
|
flex-shrink: 0;
|
|
6184
6220
|
}
|
|
6185
|
-
`}const $s={url:"",name:"",objectFit:"cover"},$n=500,qi=650,dn="cubic-bezier(0.22, 1, 0.36, 1)",Km=72,Um=50,Xm=1e4,Ym=650,Jm=500;function Zm(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 Gl(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=ir(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 Qm(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Gl(i,n):null}function eg(e){return e.reduce((t,n,i)=>{const o=Ha(n.gallery),l=Na(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 Xi(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 Cs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Xi(e,i,n)}const tg=.03;function ql(e){return e.width*tg}const jr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Wo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Ts(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function ng(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function sa(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 ig(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:sa(e,t.width,t.height)}function og(e,t){if(Di(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 rg(e){const t=new Set,n=[];for(const i of e){const o=Ha(i.gallery),s=Na(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 ag({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=>Di(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 Pi(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=ql(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 or(e,t,n){const i=Pi(e,t,n);return{...i,left:2*i.left-e.left}}function sg(e,t,n){const{left:i,width:o}=n,s=ql(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 Kl(e,t,n,i){const o=Pi(e,"left",i),s=Pi(e,"right",i),l=or(e,"left",i),d=or(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 lg(e,t,n,i){const{start:o,end:s}=Kl(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function cg(e,t,n){const i=Pi(e,t,n),o=or(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ul(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 Ha(e){if(!e)return;if(Ul(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??$s,i??o??$s]}]}function dg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ug(e){const[t]=e.media;return t!=null&&t.url?t:null}function Na(e){if(!Array.isArray(e)||e.length===0)return[];if(Ul(e)){const t=[];for(const n of e){const i=dg(n);if(!i)continue;const o=ug(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 Di(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function pg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Di(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 mg({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 Fo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Di(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 gg({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:v,sourceRect:b,resolveCloseSourceRect:S,onClose:y,onPrev:w,onNext:C}){const L=a.useRef(null),k=a.useRef(null),A=a.useRef(null),O=a.useRef(new Map),[P,D]=a.useState(0),R=a.useRef(null),x=a.useRef(0),U=a.useRef(0),h=a.useRef("none"),I=a.useRef(!1),W=a.useRef(!1),V=a.useRef(!1),Y=a.useRef(null),ae=a.useRef(null),Z=a.useRef(null),G=a.useRef(()=>{}),H=a.useRef(null),$=a.useRef(null),M=a.useRef(null),q=a.useRef(!1),[B,ee]=a.useState(null),[_,ye]=a.useState(jr),[f,ve]=a.useState(0),[K,le]=a.useState("opening"),[$e,oe]=a.useState(0),[fe,X]=a.useState(0),[be,xe]=a.useState(!1),[pe,se]=a.useState(null),[Re,ke]=a.useState(null),[we,Se]=a.useState(null),[z,re]=a.useState(!1),[F,te]=a.useState(null),[ne,ue]=a.useState(!1),me=a.useRef(!1),[he,Le]=a.useState(!1),[Q,ge]=a.useState(!1),Ae=a.useRef(n),ie=a.useRef(void 0),j=t[n],Oe=j?Di(j):!1,Fe=fe!==0||be,et=!l&&(!s||!!d),Ye=c&&!l,at=u.length>1,mt=a.useCallback((g,ce)=>t.length<=1?null:t[(g+ce+t.length)%t.length]??null,[t]),De=at?Xi(u,m,-1):mt(n,-1),it=at?Xi(u,m,1):mt(n,1),$t=pe===-1&&Fe?at&&Re!==null?Xi(u,Re,-1):we!==null?mt(we,-1):null:null,ot=pe===1&&Fe?at&&Re!==null?Xi(u,Re,1):we!==null?mt(we,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=ot&&ot.url!==(it==null?void 0:it.url)?ot:null,xt=De&&Ye?(()=>{const g=at?Cs(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,ct=it&&Ye?(()=>{const g=at?Cs(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==it.url?g:null})():null,Mt=Ue??xt,_t=ht??ct,Qe=a.useCallback((g,ce,Ee)=>{if(!g||!ce||!Ee)return;const Ie=O.current,Je=Ie.get(g);(Je==null?void 0:Je.width)===ce&&(Je==null?void 0:Je.height)===Ee||(Ie.set(g,{width:ce,height:Ee}),D(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ce=O.current.get(g.url);return ig(k.current,ce)},[P,f]),Lt=a.useCallback(()=>{if(!j)return;const g=Tt(j);if(g){ee(g);return}const ce=k.current;ce&&ee(Ts(ce))},[j,Tt]),Ge=a.useCallback(g=>{if(at){const ce=u.length;ke((m+g+ce)%ce),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),ke(null))},[at,u.length,m,t.length,n]),qe=a.useCallback(g=>{V.current=g,xe(g)},[]),Pe=a.useCallback(()=>{Y.current!==null&&(window.clearTimeout(Y.current),Y.current=null)},[]),gt=a.useCallback(()=>{Pe(),Y.current=window.setTimeout(()=>{Pe(),qe(!1)},qi+32)},[Pe,qe]),It=a.useCallback(()=>{const g=L.current;if(!g){ye({left:0,top:0,width:typeof window<"u"?window.innerWidth:jr.width,height:typeof window<"u"?window.innerHeight:jr.height});return}const ce=g.getBoundingClientRect();ye({left:ce.left,top:ce.top,width:ce.width,height:ce.height})},[]),kt=a.useCallback((g,ce)=>{if(Fe){if(he&&!be)return`translate(${fe}px, 0px)`;if(be&&pe!==null){const Ee=Tt(g);if(!Ee)return;const{x:Ie,y:Je}=lg(Ee,ce,pe,_);return`translate(${Ie}px, ${Je}px)`}if(be)return"translate(0px, 0px)"}},[Fe,he,be,fe,pe,_,Tt]),Dt=a.useCallback(()=>{const g=ae.current;ae.current=null,Pe(),qe(!1),se(null),ke(null),Se(null),X(0),Le(!1),I.current=!1,U.current=0,h.current="none",g===-1?w():g===1&&C()},[Pe,qe,w,C]),en=a.useCallback(()=>{Pe(),Y.current=window.setTimeout(()=>{ae.current!==null&&Dt()},qi+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),ae.current=null,qe(!1),se(null),ke(null),Se(null),X(0),Le(!1),I.current=!1,U.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!B)){if(V.current){if(ae.current===g){Z.current=g,Dt();return}on()}Pe(),Ge(g),ae.current=g,se(g),qe(!0),en()}},[Ye,B,Dt,on,Pe,Ge,qe,en]);G.current=bt;const Rt=a.useCallback(()=>{H.current=null,q.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Ut=a.useCallback(g=>{$.current!==null&&window.clearInterval($.current);const ce=q.current?Jm:Ym;$.current=window.setInterval(()=>{G.current(g)},ce)},[]),Kt=a.useCallback(g=>{H.current!==g&&(Rt(),H.current=g,q.current=!1,G.current(g),Ut(g),M.current=window.setTimeout(()=>{M.current=null,H.current===g&&(q.current=!0,Ut(g))},Xm))},[Rt,Ut]),ft=a.useCallback(()=>{const g=k.current;if(!g)return;const ce=j==null?void 0:j.url,Ee=ce?O.current.get(ce):void 0;if(Ee!=null&&Ee.width&&(Ee!=null&&Ee.height)){ee(sa(g,Ee.width,Ee.height));return}const Ie=A.current;if(Ie&&ce&&(Ie.src===ce||Ie.currentSrc===ce)){const{width:Et,height:Ve}=ng(Ie);if(Et&&Ve){Qe(ce,Et,Ve),ee(sa(g,Et,Ve));return}}const Je=Ts(g);!Je.width||!Je.height||ee(Je)},[j==null?void 0:j.url,Qe]),Jt=a.useCallback(g=>{if(A.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Ce=a.useCallback(()=>{It(),ft(),ve(g=>g+1)},[It,ft]);a.useEffect(()=>{Ce();const g=k.current,ce=L.current,Ee=new ResizeObserver(()=>Ce());return g&&Ee.observe(g),ce&&Ee.observe(ce),window.addEventListener("resize",Ce),()=>{Ee.disconnect(),window.removeEventListener("resize",Ce)}},[Ce,n,v]),a.useLayoutEffect(()=>{if(!j)return;const g=A.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[j==null?void 0:j.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,P]),a.useEffect(()=>{const g=new Set,ce=[],Ee=Ie=>{!(Ie!=null&&Ie.url)||g.has(Ie.url)||(g.add(Ie.url),ce.push(Ie))};t.forEach(Ee),u.forEach(Ie=>Ie.items.forEach(Ee)),ce.forEach(Ie=>{O.current.has(Ie.url)||og(Ie,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(K!=="opening"||!B)return;if(!b){le("open");return}re(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),le("open")})});return()=>cancelAnimationFrame(g)},[K,B,b]),a.useEffect(()=>{if(K!=="closing")return;const g=setTimeout(()=>y(),$n);return()=>clearTimeout(g)},[K,y]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&ie.current===(j==null?void 0:j.url)||(Pe(),ae.current=null,se(null),ke(null),Se(null),oe(0),X(0),qe(!1),ge(!1),Le(!1),x.current=0,U.current=0,h.current="none",I.current=!1,R.current=null,W.current=!1,A.current=null,Lt(),Ae.current=n,ie.current=j==null?void 0:j.url)},[n,j==null?void 0:j.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Z.current;g!==null&&(Z.current=null,requestAnimationFrame(()=>{G.current(g)}))},[n,m,j==null?void 0:j.url]),a.useLayoutEffect(()=>{if(K==="opening"){me.current=!1,ue(!1);return}if(K!=="open"||me.current)return;if(!De&&!it){me.current=!0;return}ue(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ue(!0),me.current=!0})});return()=>cancelAnimationFrame(g)},[K,De==null?void 0:De.url,it==null?void 0:it.url]),a.useEffect(()=>{if(K!=="open")return;const g=()=>{const Ve=nt=>{nt.stopPropagation(),nt.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},ce=Ve=>{const nt=Ve<0?1:-1;Pe(),Ge(nt),ae.current=nt,se(nt),qe(!0),en()},Ee=Ve=>{if(Math.abs(Ve)>Um&&Ye){ce(Ve);return}ae.current=null,se(null),ke(null),Se(null),qe(!0),X(0),gt()},Ie=Ve=>{if(Ve.touches.length!==1||V.current)return;const nt=Ve.touches[0];W.current=!0,R.current={x:nt.clientX,y:nt.clientY},h.current="none",U.current=0,I.current=!1},Je=Ve=>{if(!R.current||Ve.touches.length!==1||V.current)return;const nt=Ve.touches[0],Ot=nt.clientX-R.current.x,St=nt.clientY-R.current.y;if(h.current==="none"){if(Math.abs(Ot)<10&&Math.abs(St)<10)return;if(Math.abs(Ot)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){I.current=!0,Le(!0),U.current=Ot,X(Ot),Ve.preventDefault();return}h.current==="vertical"&&(I.current=!0,Le(!0),x.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!R.current)return;const Ve=h.current,nt=I.current;if(nt&&Ve==="horizontal")Ee(U.current),g();else if(nt&&Ve==="vertical"){const Ot=x.current;if(et&&Ot>Km){const St=window.innerHeight;x.current=St,ge(!0),oe(St),le("closing")}else x.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(U.current)>0&&(Ee(U.current),g());R.current=null,h.current="none",U.current=0,I.current=!1,Le(!1)};return document.addEventListener("touchstart",Ie,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ie),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[K,Ye,qe,gt,Pe,et,en,Ge]);const je=a.useCallback(()=>{const g=(S==null?void 0:S())??b??null;g&&B&&(te(g),re(!0)),le("closing")},[S,b,B]);a.useEffect(()=>{const g=Ie=>{if(Ie.key==="Escape"){if(s&&d||K==="closing")return;Rt(),je();return}if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight"||K!=="open"||!Ye)return;Ie.preventDefault();const Je=Ie.key==="ArrowLeft"?-1:1;Ie.repeat&&H.current===Je||Kt(Je)},ce=Ie=>{if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight")return;const Je=Ie.key==="ArrowLeft"?-1:1;H.current===Je&&Rt()},Ee=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ce),window.addEventListener("blur",Ee),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ce),window.removeEventListener("blur",Ee),Rt()}},[K,s,d,je,Ye,Kt,Rt]),a.useEffect(()=>{K!=="open"&&Rt()},[K,Rt]);const Ke=()=>{K==="closing"||l||je()},He=K==="open",ze=K==="closing",dt=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Ze=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!V.current)){if(ae.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=K==="closing"?F??b:b,Ft=tt&&B&&(K==="opening"||ze)?Zm(tt,B):void 0,Ct=Fe&&j?kt(j,"center"):$e>0?`translateY(${$e}px)`:Ft,st=B?Wo(B,_):null,Ht=!!(tt&&B),At=Ht&&(K==="closing"||K==="open"&&z),Vt={position:"absolute",top:st==null?void 0:st.top,left:st==null?void 0:st.left,width:st==null?void 0:st.width,height:st==null?void 0:st.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Ht?1:K==="opening"||ze?0:1,transition:he&&!be?"none":be?`transform ${qi}ms ${dn}`:Q?`transform ${$n}ms ${dn}, opacity ${$n}ms ${dn}`:At?`transform ${$n}ms ${dn}`:K==="opening"||ze?`opacity ${$n}ms ${dn}`:"none",pointerEvents:Oe&&He&&!Fe?"auto":"none",touchAction:Oe&&He?"none":void 0,zIndex:1,overflow:Oe?"hidden":void 0},zt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:He&&!Fe?"auto":"none"},Pt=(g,ce,Ee="adjacent")=>{const Ie=Tt(g);if(!Ie)return{display:"none"};const Je=Ee==="far"?ce==="left"?"far-left":"far-right":ce==="left"?"left-adjacent":"right-adjacent",{start:Et}=pe!==null?Kl(Ie,Je,pe,_):{start:Ee==="far"?or(Ie,ce,_):Pi(Ie,ce,_)},Ve=Wo(Et,_),nt=kt(g,Je),Ot=!Fe&&Ee==="adjacent"&&He&&!ne?cg(Ie,ce,_):null,St=Ee==="far"&&Fe&&pe===(ce==="left"?-1:1),ln=he&&!be?!1:be,cn=Ee==="adjacent"&&He&&ne&&!Fe;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:nt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ee==="far"?He&&St?1:0:He?1:0,transition:ln?Ee==="far"?`transform ${qi}ms ${dn}`:`transform ${qi}ms ${dn}, opacity ${$n}ms ${dn}`:cn?`transform ${$n}ms ${dn}`:K==="opening"||ze?`opacity ${$n}ms ${dn}`:"none",pointerEvents:"none",zIndex:1}},Zt=(g,ce)=>{const Ee=Tt(g);return Ee?sg(Pi(Ee,ce,_),ce,_):null},wt=g=>ce=>{if(!l){if(W.current){W.current=!1;return}ce.stopPropagation(),bt(g)}},Gt=De?Zt(De,"left"):null,ut=it?Zt(it,"right"):null,Wt=Gt?Wo(Gt,_):null,Bt=ut?Wo(ut,_):null;return r.jsxs("div",{ref:L,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:K==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:He?dt:0,transition:he?"none":`opacity ${$n}ms ${dn}`,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:k,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:He?1:0,transition:he?"none":`opacity ${$n}ms ${dn}`,pointerEvents:"none"},children:r.jsx(Vl,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Ke})})]}),He&&Mt&&r.jsx(Fo,{media:Mt,style:Pt(Mt,"left","far"),onMeasure:Qe,onTransitionEnd:Ze},`far-prev-${Mt.url}`),He&&De&&r.jsxs(r.Fragment,{children:[r.jsx(Fo,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Ze},`prev-${De.url}`),Wt&&r.jsx("div",{style:{position:"absolute",top:Wt.top,left:Wt.left,width:Wt.width,height:Wt.height,cursor:l||he?"default":"pointer",pointerEvents:l||he?"none":"auto",zIndex:3},onClick:wt(-1)})]}),He&&it&&r.jsxs(r.Fragment,{children:[r.jsx(Fo,{media:it,style:Pt(it,"right"),onMeasure:Qe,onTransitionEnd:Ze},`next-${it.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||he?"default":"pointer",pointerEvents:l||he?"none":"auto",zIndex:3},onClick:wt(1)})]}),He&&_t&&r.jsx(Fo,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Ze},`far-next-${_t.url}`),B&&j&&(Oe?r.jsx(mg,{src:j.url,phase:K,onMediaElement:Jt,wrapperStyle:Vt,videoStyle:zt,onLoadedMetadata:ft,onTransitionEnd:Ze},`${n}-${j.url}`):r.jsx("img",{ref:Jt,src:j.url,alt:j.name,onLoad:ft,onTransitionEnd:Ze,style:Vt},`${n}-${j.url}`))]})}function hg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=E.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:v}=e,b=(v==null?void 0:v.display)==="cover",S=(v==null?void 0:v.ratioValue)??"1:1",y=(v==null?void 0:v.reversed)??!1,[w,C]=S.split(":").map(Number),A=`${y?C:w} / ${y?w:C}`,O=c.entryWidth??.2,P=c.columnsCount,D=E.scalingValue(O,n),R=E.scalingValue(c.horizontalGap??0,n),x=D,U=D,h={width:x,...b?{aspectRatio:A,height:"auto",overflow:"hidden"}:{height:"auto"}},I=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},W=a.useRef(null),[V,Y]=a.useState(!1),[ae,Z]=a.useState([]),[G,H]=a.useState(0),[$,M]=a.useState(0),[q,B]=a.useState(null),[ee,_]=a.useState({title1:"",title2:"",title3:""}),ye=(()=>{const we={},Se=W.current?getComputedStyle(W.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(we["--cntrl-article-width"]=Se),we})(),f=!n||i||o,ve=a.useMemo(()=>qm(d),[d]),K=t??[],le=K.length%P||P,$e=le<P&&K.length>0,oe=K.length-le,fe=$e?Math.floor((P-le)/2)+1:1,X=a.useMemo(()=>eg(K),[K]),be=a.useMemo(()=>rg(K),[K]),xe=(we,Se,z)=>{if(n&&!o&&!i)return;const re=X.findIndex(te=>te.gridIndex===we);if(re<0)return;const F=X[re];M(re),Z(F.items),H(Se),_(F.entry),B(z??null),Y(!0)},pe=a.useCallback(()=>{Y(!1),B(null)},[]),se=a.useCallback(()=>{const we=X[$];return!we||!W.current?q:Qm(W.current,we.gridIndex,b?"cover":"contain")??q},[X,$,q,b]),Re=a.useCallback(we=>{if(X.length>1){const Se=X.length,z=($+we+Se)%Se,re=X[z],F=Math.min(G,re.items.length-1);M(z),Z(re.items),H(F),_(re.entry);return}H(Se=>(Se+we+ae.length)%ae.length)},[X,$,G,ae.length]),ke=X.length>1||ae.length>1;return a.useEffect(()=>{if(!V||typeof document>"u")return;const we=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=we}},[V]),a.useEffect(()=>{!n||o||i||Y(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ve}}),r.jsx(ag,{mediaList:be}),r.jsx("div",{ref:W,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${P}, ${D})`,rowGap:0,columnGap:R,width:E.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:E.scalingValue(u??0,n)},children:K.map((we,Se)=>{const z=Ha(we.gallery),re=Na(z),F=re.filter(Le=>Le.lightboxMedia).map(Le=>Le.lightboxMedia),te=Math.floor(Se/P)===Math.ceil(K.length/P)-1,ne=$e&&Se>=oe?`${fe+(Se-oe)}`:void 0,ue=re[0],me=ue!=null&&ue.lightboxMedia?F.findIndex(Le=>Le.url===ue.lightboxMedia.url):-1,he=r.jsx("div",{className:`${d}-item-image-wrapper`,style:h,children:re.length>0&&r.jsx(pg,{media:ue.displayMedia,gridIndex:Se,className:`${d}-item-${Di(ue.displayMedia)?"video":"image"}`.trim(),style:I,onMediaClick:f&&me>=0?Le=>xe(Se,me,Gl(Le.currentTarget,b?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,te?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:D,...ne?{gridColumn:ne}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:U}})}),r.jsx("a",{className:`${d}-item-image-link`,children:he}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:U}})})]})},Se)})}),V&&typeof document<"u"&&(()=>{const we=(l?document.getElementById(l):null)??document.body;return mi.createPortal(r.jsx("div",{style:ye,"data-selection":"none",children:r.jsx(gg,{prefix:d,items:ae,index:G,entry:ee,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ke,lightboxEntries:X,entryIdx:$,layoutId:s,sourceRect:q,resolveCloseSourceRect:se,onClose:pe,onPrev:()=>Re(-1),onNext:()=>Re(1)})}),we)})()]})}const fg=`import { CommonComponentProps } from '../props';
|
|
6221
|
+
`}const Ts={url:"",name:"",objectFit:"cover"},$n=500,qi=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Zm=72,Qm=50,eg=1e4,tg=650,ng=500;function ig(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function Ul(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=nr(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 og(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Ul(i,n):null}function rg(e){return e.reduce((t,n,i)=>{const o=Oa(n.gallery),s=ja(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return s.length===0||t.push({gridIndex:i,items:s,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function Xi(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 Ls(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Xi(e,i,n)}const ag=.03;function Xl(e){return e.width*ag}const Or={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Fo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Is(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function sg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ca(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function lg(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ca(e,t.width,t.height)}function cg(e,t){if(Di(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 dg(e){const t=new Set,n=[];for(const i of e){const o=Oa(i.gallery),l=ja(o);for(const s of l)for(const d of[s.displayMedia,s.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function ug({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=>Di(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 Pi(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=Xl(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function ir(e,t,n){const i=Pi(e,t,n);return{...i,left:2*i.left-e.left}}function pg(e,t,n){const{left:i,width:o}=n,l=Xl(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function Yl(e,t,n,i){const o=Pi(e,"left",i),l=Pi(e,"right",i),s=ir(e,"left",i),d=ir(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function mg(e,t,n,i){const{start:o,end:l}=Yl(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function gg(e,t,n){const i=Pi(e,t,n),o=ir(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Jl(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 Oa(e){if(!e)return;if(Jl(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??Ts,i??o??Ts]}]}function hg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function fg(e){const[t]=e.media;return t!=null&&t.url?t:null}function ja(e){if(!Array.isArray(e)||e.length===0)return[];if(Jl(e)){const t=[];for(const n of e){const i=hg(n);if(!i)continue;const o=fg(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 Di(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function yg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Di(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 vg({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){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:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function Wo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Di(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function xg({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:b,sourceRect:S,resolveCloseSourceRect:C,onClose:y,onPrev:w,onNext:$}){const T=a.useRef(null),R=a.useRef(null),M=a.useRef(null),H=a.useRef(new Map),[F,V]=a.useState(0),P=a.useRef(null),x=a.useRef(0),U=a.useRef(0),h=a.useRef("none"),E=a.useRef(!1),A=a.useRef(!1),j=a.useRef(!1),X=a.useRef(null),ae=a.useRef(null),Z=a.useRef(null),q=a.useRef(()=>{}),N=a.useRef(null),L=a.useRef(null),k=a.useRef(null),K=a.useRef(!1),[z,ne]=a.useState(null),[_,ye]=a.useState(Or),[f,ve]=a.useState(0),[Y,le]=a.useState("opening"),[$e,oe]=a.useState(0),[xe,G]=a.useState(0),[he,be]=a.useState(!1),[ce,se]=a.useState(null),[Le,Me]=a.useState(null),[we,Se]=a.useState(null),[B,Q]=a.useState(!1),[W,te]=a.useState(null),[ie,pe]=a.useState(!1),me=a.useRef(!1),[fe,Ie]=a.useState(!1),[ee,ge]=a.useState(!1),Ae=a.useRef(n),re=a.useRef(void 0),D=t[n],Oe=D?Di(D):!1,We=xe!==0||he,et=!s&&(!l||!!d),Ye=c&&!s,st=u.length>1,mt=a.useCallback((g,de)=>t.length<=1?null:t[(g+de+t.length)%t.length]??null,[t]),De=st?Xi(u,m,-1):mt(n,-1),it=st?Xi(u,m,1):mt(n,1),$t=ce===-1&&We?st&&Le!==null?Xi(u,Le,-1):we!==null?mt(we,-1):null:null,ot=ce===1&&We?st&&Le!==null?Xi(u,Le,1):we!==null?mt(we,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=ot&&ot.url!==(it==null?void 0:it.url)?ot:null,xt=De&&Ye?(()=>{const g=st?Ls(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,ct=it&&Ye?(()=>{const g=st?Ls(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==it.url?g:null})():null,Mt=Ue??xt,_t=ht??ct,Qe=a.useCallback((g,de,Ee)=>{if(!g||!de||!Ee)return;const Re=H.current,Je=Re.get(g);(Je==null?void 0:Je.width)===de&&(Je==null?void 0:Je.height)===Ee||(Re.set(g,{width:de,height:Ee}),V(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const de=H.current.get(g.url);return lg(R.current,de)},[F,f]),Lt=a.useCallback(()=>{if(!D)return;const g=Tt(D);if(g){ne(g);return}const de=R.current;de&&ne(Is(de))},[D,Tt]),Ge=a.useCallback(g=>{if(st){const de=u.length;Me((m+g+de)%de),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),Me(null))},[st,u.length,m,t.length,n]),qe=a.useCallback(g=>{j.current=g,be(g)},[]),Pe=a.useCallback(()=>{X.current!==null&&(window.clearTimeout(X.current),X.current=null)},[]),gt=a.useCallback(()=>{Pe(),X.current=window.setTimeout(()=>{Pe(),qe(!1)},qi+32)},[Pe,qe]),It=a.useCallback(()=>{const g=T.current;if(!g){ye({left:0,top:0,width:typeof window<"u"?window.innerWidth:Or.width,height:typeof window<"u"?window.innerHeight:Or.height});return}const de=g.getBoundingClientRect();ye({left:de.left,top:de.top,width:de.width,height:de.height})},[]),kt=a.useCallback((g,de)=>{if(We){if(fe&&!he)return`translate(${xe}px, 0px)`;if(he&&ce!==null){const Ee=Tt(g);if(!Ee)return;const{x:Re,y:Je}=mg(Ee,de,ce,_);return`translate(${Re}px, ${Je}px)`}if(he)return"translate(0px, 0px)"}},[We,fe,he,xe,ce,_,Tt]),Dt=a.useCallback(()=>{const g=ae.current;ae.current=null,Pe(),qe(!1),se(null),Me(null),Se(null),G(0),Ie(!1),E.current=!1,U.current=0,h.current="none",g===-1?w():g===1&&$()},[Pe,qe,w,$]),en=a.useCallback(()=>{Pe(),X.current=window.setTimeout(()=>{ae.current!==null&&Dt()},qi+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),ae.current=null,qe(!1),se(null),Me(null),Se(null),G(0),Ie(!1),E.current=!1,U.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!z)){if(j.current){if(ae.current===g){Z.current=g,Dt();return}on()}Pe(),Ge(g),ae.current=g,se(g),qe(!0),en()}},[Ye,z,Dt,on,Pe,Ge,qe,en]);q.current=bt;const Rt=a.useCallback(()=>{N.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),Ut=a.useCallback(g=>{L.current!==null&&window.clearInterval(L.current);const de=K.current?ng:tg;L.current=window.setInterval(()=>{q.current(g)},de)},[]),Kt=a.useCallback(g=>{N.current!==g&&(Rt(),N.current=g,K.current=!1,q.current(g),Ut(g),k.current=window.setTimeout(()=>{k.current=null,N.current===g&&(K.current=!0,Ut(g))},eg))},[Rt,Ut]),ft=a.useCallback(()=>{const g=R.current;if(!g)return;const de=D==null?void 0:D.url,Ee=de?H.current.get(de):void 0;if(Ee!=null&&Ee.width&&(Ee!=null&&Ee.height)){ne(ca(g,Ee.width,Ee.height));return}const Re=M.current;if(Re&&de&&(Re.src===de||Re.currentSrc===de)){const{width:Et,height:Ve}=sg(Re);if(Et&&Ve){Qe(de,Et,Ve),ne(ca(g,Et,Ve));return}}const Je=Is(g);!Je.width||!Je.height||ne(Je)},[D==null?void 0:D.url,Qe]),Zt=a.useCallback(g=>{if(M.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Ce=a.useCallback(()=>{It(),ft(),ve(g=>g+1)},[It,ft]);a.useEffect(()=>{Ce();const g=R.current,de=T.current,Ee=new ResizeObserver(()=>Ce());return g&&Ee.observe(g),de&&Ee.observe(de),window.addEventListener("resize",Ce),()=>{Ee.disconnect(),window.removeEventListener("resize",Ce)}},[Ce,n,b]),a.useLayoutEffect(()=>{if(!D)return;const g=M.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[D==null?void 0:D.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,F]),a.useEffect(()=>{const g=new Set,de=[],Ee=Re=>{!(Re!=null&&Re.url)||g.has(Re.url)||(g.add(Re.url),de.push(Re))};t.forEach(Ee),u.forEach(Re=>Re.items.forEach(Ee)),de.forEach(Re=>{H.current.has(Re.url)||cg(Re,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(Y!=="opening"||!z)return;if(!S){le("open");return}Q(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(!0),le("open")})});return()=>cancelAnimationFrame(g)},[Y,z,S]),a.useEffect(()=>{if(Y!=="closing")return;const g=setTimeout(()=>y(),$n);return()=>clearTimeout(g)},[Y,y]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&re.current===(D==null?void 0:D.url)||(Pe(),ae.current=null,se(null),Me(null),Se(null),oe(0),G(0),qe(!1),ge(!1),Ie(!1),x.current=0,U.current=0,h.current="none",E.current=!1,P.current=null,A.current=!1,M.current=null,Lt(),Ae.current=n,re.current=D==null?void 0:D.url)},[n,D==null?void 0:D.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Z.current;g!==null&&(Z.current=null,requestAnimationFrame(()=>{q.current(g)}))},[n,m,D==null?void 0:D.url]),a.useLayoutEffect(()=>{if(Y==="opening"){me.current=!1,pe(!1);return}if(Y!=="open"||me.current)return;if(!De&&!it){me.current=!0;return}pe(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe(!0),me.current=!0})});return()=>cancelAnimationFrame(g)},[Y,De==null?void 0:De.url,it==null?void 0:it.url]),a.useEffect(()=>{if(Y!=="open")return;const g=()=>{const Ve=nt=>{nt.stopPropagation(),nt.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},de=Ve=>{const nt=Ve<0?1:-1;Pe(),Ge(nt),ae.current=nt,se(nt),qe(!0),en()},Ee=Ve=>{if(Math.abs(Ve)>Qm&&Ye){de(Ve);return}ae.current=null,se(null),Me(null),Se(null),qe(!0),G(0),gt()},Re=Ve=>{if(Ve.touches.length!==1||j.current)return;const nt=Ve.touches[0];A.current=!0,P.current={x:nt.clientX,y:nt.clientY},h.current="none",U.current=0,E.current=!1},Je=Ve=>{if(!P.current||Ve.touches.length!==1||j.current)return;const nt=Ve.touches[0],Ot=nt.clientX-P.current.x,St=nt.clientY-P.current.y;if(h.current==="none"){if(Math.abs(Ot)<10&&Math.abs(St)<10)return;if(Math.abs(Ot)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){E.current=!0,Ie(!0),U.current=Ot,G(Ot),Ve.preventDefault();return}h.current==="vertical"&&(E.current=!0,Ie(!0),x.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!P.current)return;const Ve=h.current,nt=E.current;if(nt&&Ve==="horizontal")Ee(U.current),g();else if(nt&&Ve==="vertical"){const Ot=x.current;if(et&&Ot>Zm){const St=window.innerHeight;x.current=St,ge(!0),oe(St),le("closing")}else x.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(U.current)>0&&(Ee(U.current),g());P.current=null,h.current="none",U.current=0,E.current=!1,Ie(!1)};return document.addEventListener("touchstart",Re,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Re),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[Y,Ye,qe,gt,Pe,et,en,Ge]);const je=a.useCallback(()=>{const g=(C==null?void 0:C())??S??null;g&&z&&(te(g),Q(!0)),le("closing")},[C,S,z]);a.useEffect(()=>{const g=Re=>{if(Re.key==="Escape"){if(l&&d||Y==="closing")return;Rt(),je();return}if(Re.key!=="ArrowLeft"&&Re.key!=="ArrowRight"||Y!=="open"||!Ye)return;Re.preventDefault();const Je=Re.key==="ArrowLeft"?-1:1;Re.repeat&&N.current===Je||Kt(Je)},de=Re=>{if(Re.key!=="ArrowLeft"&&Re.key!=="ArrowRight")return;const Je=Re.key==="ArrowLeft"?-1:1;N.current===Je&&Rt()},Ee=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",de),window.addEventListener("blur",Ee),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",de),window.removeEventListener("blur",Ee),Rt()}},[Y,l,d,je,Ye,Kt,Rt]),a.useEffect(()=>{Y!=="open"&&Rt()},[Y,Rt]);const Ke=()=>{Y==="closing"||s||je()},He=Y==="open",Be=Y==="closing",dt=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Ze=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!j.current)){if(ae.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=Y==="closing"?W??S:S,Wt=tt&&z&&(Y==="opening"||Be)?ig(tt,z):void 0,Ct=We&&D?kt(D,"center"):$e>0?`translateY(${$e}px)`:Wt,at=z?Fo(z,_):null,Ht=!!(tt&&z),At=Ht&&(Y==="closing"||Y==="open"&&B),Vt={position:"absolute",top:at==null?void 0:at.top,left:at==null?void 0:at.left,width:at==null?void 0:at.width,height:at==null?void 0:at.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Ht?1:Y==="opening"||Be?0:1,transition:fe&&!he?"none":he?`transform ${qi}ms ${pn}`:ee?`transform ${$n}ms ${pn}, opacity ${$n}ms ${pn}`:At?`transform ${$n}ms ${pn}`:Y==="opening"||Be?`opacity ${$n}ms ${pn}`:"none",pointerEvents:Oe&&He&&!We?"auto":"none",touchAction:Oe&&He?"none":void 0,zIndex:1,overflow:Oe?"hidden":void 0},Bt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:He&&!We?"auto":"none"},Pt=(g,de,Ee="adjacent")=>{const Re=Tt(g);if(!Re)return{display:"none"};const Je=Ee==="far"?de==="left"?"far-left":"far-right":de==="left"?"left-adjacent":"right-adjacent",{start:Et}=ce!==null?Yl(Re,Je,ce,_):{start:Ee==="far"?ir(Re,de,_):Pi(Re,de,_)},Ve=Fo(Et,_),nt=kt(g,Je),Ot=!We&&Ee==="adjacent"&&He&&!ie?gg(Re,de,_):null,St=Ee==="far"&&We&&ce===(de==="left"?-1:1),ln=fe&&!he?!1:he,un=Ee==="adjacent"&&He&&ie&&!We;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:nt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ee==="far"?He&&St?1:0:He?1:0,transition:ln?Ee==="far"?`transform ${qi}ms ${pn}`:`transform ${qi}ms ${pn}, opacity ${$n}ms ${pn}`:un?`transform ${$n}ms ${pn}`:Y==="opening"||Be?`opacity ${$n}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(g,de)=>{const Ee=Tt(g);return Ee?pg(Pi(Ee,de,_),de,_):null},wt=g=>de=>{if(!s){if(A.current){A.current=!1;return}de.stopPropagation(),bt(g)}},Gt=De?Qt(De,"left"):null,ut=it?Qt(it,"right"):null,Ft=Gt?Fo(Gt,_):null,zt=ut?Fo(ut,_):null;return r.jsxs("div",{ref:T,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Y==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:He?dt:0,transition:fe?"none":`opacity ${$n}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:He?1:0,transition:fe?"none":`opacity ${$n}ms ${pn}`,pointerEvents:"none"},children:r.jsx(Kl,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:Ke})})]}),He&&Mt&&r.jsx(Wo,{media:Mt,style:Pt(Mt,"left","far"),onMeasure:Qe,onTransitionEnd:Ze},`far-prev-${Mt.url}`),He&&De&&r.jsxs(r.Fragment,{children:[r.jsx(Wo,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Ze},`prev-${De.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:s||fe?"default":"pointer",pointerEvents:s||fe?"none":"auto",zIndex:3},onClick:wt(-1)})]}),He&&it&&r.jsxs(r.Fragment,{children:[r.jsx(Wo,{media:it,style:Pt(it,"right"),onMeasure:Qe,onTransitionEnd:Ze},`next-${it.url}`),zt&&r.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:s||fe?"default":"pointer",pointerEvents:s||fe?"none":"auto",zIndex:3},onClick:wt(1)})]}),He&&_t&&r.jsx(Wo,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Ze},`far-next-${_t.url}`),z&&D&&(Oe?r.jsx(vg,{src:D.url,phase:Y,onMediaElement:Zt,wrapperStyle:Vt,videoStyle:Bt,onLoadedMetadata:ft,onTransitionEnd:Ze},`${n}-${D.url}`):r.jsx("img",{ref:Zt,src:D.url,alt:D.name,onLoad:ft,onTransitionEnd:Ze,style:Vt},`${n}-${D.url}`))]})}function bg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=v.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:b}=e,S=(b==null?void 0:b.display)==="cover",C=(b==null?void 0:b.ratioValue)??"1:1",y=(b==null?void 0:b.reversed)??!1,[w,$]=C.split(":").map(Number),M=`${y?$:w} / ${y?w:$}`,H=c.entryWidth??.2,F=c.columnsCount,V=v.scalingValue(H,n),P=v.scalingValue(c.horizontalGap??0,n),x=V,U=V,h={width:x,...S?{aspectRatio:M,height:"auto",overflow:"hidden"}:{height:"auto"}},E=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),[j,X]=a.useState(!1),[ae,Z]=a.useState([]),[q,N]=a.useState(0),[L,k]=a.useState(0),[K,z]=a.useState(null),[ne,_]=a.useState({title1:"",title2:"",title3:""}),ye=(()=>{const we={},Se=A.current?getComputedStyle(A.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(we["--cntrl-article-width"]=Se),we})(),f=!n||i||o,ve=a.useMemo(()=>Jm(d),[d]),Y=t??[],le=Y.length%F||F,$e=le<F&&Y.length>0,oe=Y.length-le,xe=$e?Math.floor((F-le)/2)+1:1,G=a.useMemo(()=>rg(Y),[Y]),he=a.useMemo(()=>dg(Y),[Y]),be=(we,Se,B)=>{if(n&&!o&&!i)return;const Q=G.findIndex(te=>te.gridIndex===we);if(Q<0)return;const W=G[Q];k(Q),Z(W.items),N(Se),_(W.entry),z(B??null),X(!0)},ce=a.useCallback(()=>{X(!1),z(null)},[]),se=a.useCallback(()=>{const we=G[L];return!we||!A.current?K:og(A.current,we.gridIndex,S?"cover":"contain")??K},[G,L,K,S]),Le=a.useCallback(we=>{if(G.length>1){const Se=G.length,B=(L+we+Se)%Se,Q=G[B],W=Math.min(q,Q.items.length-1);k(B),Z(Q.items),N(W),_(Q.entry);return}N(Se=>(Se+we+ae.length)%ae.length)},[G,L,q,ae.length]),Me=G.length>1||ae.length>1;return a.useEffect(()=>{if(!j||typeof document>"u")return;const we=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=we}},[j]),a.useEffect(()=>{!n||o||i||X(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ve}}),r.jsx(ug,{mediaList:he}),r.jsx("div",{ref:A,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${F}, ${V})`,rowGap:0,columnGap:P,width:v.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:v.scalingValue(u??0,n)},children:Y.map((we,Se)=>{const B=Oa(we.gallery),Q=ja(B),W=Q.filter(Ie=>Ie.lightboxMedia).map(Ie=>Ie.lightboxMedia),te=Math.floor(Se/F)===Math.ceil(Y.length/F)-1,ie=$e&&Se>=oe?`${xe+(Se-oe)}`:void 0,pe=Q[0],me=pe!=null&&pe.lightboxMedia?W.findIndex(Ie=>Ie.url===pe.lightboxMedia.url):-1,fe=r.jsx("div",{className:`${d}-item-image-wrapper`,style:h,children:Q.length>0&&r.jsx(yg,{media:pe.displayMedia,gridIndex:Se,className:`${d}-item-${Di(pe.displayMedia)?"video":"image"}`.trim(),style:E,onMediaClick:f&&me>=0?Ie=>be(Se,me,Ul(Ie.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`,te?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:V,...ie?{gridColumn:ie}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:U}})}),r.jsx("a",{className:`${d}-item-image-link`,children:fe}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:U}})})]})},Se)})}),j&&typeof document<"u"&&(()=>{const we=(s?document.getElementById(s):null)??document.body;return mi.createPortal(r.jsx("div",{style:ye,"data-selection":"none",children:r.jsx(xg,{prefix:d,items:ae,index:q,entry:ne,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:Me,lightboxEntries:G,entryIdx:L,layoutId:l,sourceRect:K,resolveCloseSourceRect:se,onClose:ce,onPrev:()=>Le(-1),onNext:()=>Le(1)})}),we)})()]})}const wg=`import { CommonComponentProps } from '../props';
|
|
6186
6222
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
6187
6223
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6188
6224
|
import { createPortal } from 'react-dom';
|
|
@@ -8536,11 +8572,11 @@ export function Hive({
|
|
|
8536
8572
|
</>
|
|
8537
8573
|
);
|
|
8538
8574
|
}
|
|
8539
|
-
`,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>'),ii={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 vg(e){const t={};return t[Be(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSettings")]={...ii.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSize")]={...ii.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Be(e,"lineHeight")]={...ii.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Be(e,"letterSpacing")]={...ii.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Be(e,"wordSpacing")]={...ii.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Be(e,"textAlign")]={...ii.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Be(e,"textAppearance")]={...ii.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ai=Kn.filter(e=>e!=="count"),xg=Ai.reduce((e,t)=>({...e,...vg(t)}),{}),bg=Ai.reduce((e,t)=>({...e,[Be(t,"fontFamily")]:"Arial",[Be(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Be(t,"letterSpacing")]:0,[Be(t,"wordSpacing")]:0,[Be(t,"textAlign")]:"left",[Be(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function zr(e){return Ai.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Be(n,"fontSize")]=i),o!==void 0&&(t[Be(n,"lineHeight")]=o),t},{})}const wg={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ai.map(e=>[Fa[e],_a(e)]))},Sg={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},$g=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Sg,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Cg={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:$g},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"}},...xg},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",...bg},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,...zr({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,...zr({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,...zr({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:[wg]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Tg={element:hg,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:[...Ai.map(e=>({path:`${Be(e,"fontFamily")}`}))]},fontRelations:{...Ai.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Be(t,"fontFamily")}`}),{})},schema:Cg,sourceCode:fg},Ls=12;function Lg(e,t="50%"){const n={position:"absolute",width:Ls,height:Ls,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function nn({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:Lg(n,i)})})}function Ig(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 Rg({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 Xo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Eg(e){return String(e??"").trim().length>0}function Is(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 Rs(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 Es(e,t,n,i,o,s,l){const d=E.scalingValue(s,l),c=E.scalingValue(0,l),u=e===0,m=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!m||i?d:c}}function Mg(e,t,n){const i=E.scalingValue(t,n),o=E.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ms=10;function kg(e){return`
|
|
8575
|
+
`,Sg="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>'),ii={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 $g(e){const t={};return t[ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ze(e,"fontSettings")]={...ii.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ze(e,"fontSize")]={...ii.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ze(e,"lineHeight")]={...ii.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ze(e,"letterSpacing")]={...ii.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ze(e,"wordSpacing")]={...ii.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ze(e,"textAlign")]={...ii.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ze(e,"textAppearance")]={...ii.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ai=Kn.filter(e=>e!=="count"),Cg=Ai.reduce((e,t)=>({...e,...$g(t)}),{}),Tg=Ai.reduce((e,t)=>({...e,[ze(t,"fontFamily")]:"Arial",[ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ze(t,"letterSpacing")]:0,[ze(t,"wordSpacing")]:0,[ze(t,"textAlign")]:"left",[ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function jr(e){return Ai.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ze(n,"fontSize")]=i),o!==void 0&&(t[ze(n,"lineHeight")]=o),t},{})}const Lg={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ai.map(e=>[Ha[e],Na(e)]))},Ig={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Rg=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Ig,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Eg={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:Rg},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"}},...Cg},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Sg,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Tg},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,...jr({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,...jr({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,...jr({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:[Lg]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Mg={element:bg,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:[...Ai.map(e=>({path:`${ze(e,"fontFamily")}`}))]},fontRelations:{...Ai.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ze(t,"fontFamily")}`}),{})},schema:Eg,sourceCode:wg},Rs=12;function kg(e,t="50%"){const n={position:"absolute",width:Rs,height:Rs,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function nn({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:kg(n,i)})})}function Pg(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 Ag({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 l=o.play();l&&l.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 Br(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Fg(e){return String(e??"").trim().length>0}function Es(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 Ms(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 ks(e,t,n,i,o,l,s){const d=v.scalingValue(l,s),c=v.scalingValue(0,s),u=e===0,m=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!m||i?d:c}}function Wg(e,t,n){const i=v.scalingValue(t,n),o=v.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ps=10;function _g(e){return`
|
|
8540
8576
|
.${e}-wrapper {
|
|
8541
8577
|
display: grid;
|
|
8542
8578
|
align-items: start;
|
|
8543
|
-
min-height: ${
|
|
8579
|
+
min-height: ${Br(48)};
|
|
8544
8580
|
position: relative;
|
|
8545
8581
|
overflow: visible;
|
|
8546
8582
|
box-sizing: border-box;
|
|
@@ -8662,7 +8698,7 @@ a.${e}-list-item {
|
|
|
8662
8698
|
flex-shrink: 0;
|
|
8663
8699
|
overflow: visible;
|
|
8664
8700
|
box-sizing: border-box;
|
|
8665
|
-
min-width: ${
|
|
8701
|
+
min-width: ${Br(50)};
|
|
8666
8702
|
position: relative;
|
|
8667
8703
|
display: flex;
|
|
8668
8704
|
align-items: flex-start;
|
|
@@ -8670,7 +8706,7 @@ a.${e}-list-item {
|
|
|
8670
8706
|
|
|
8671
8707
|
.${e}-list-col-last {
|
|
8672
8708
|
flex: 1 1 auto;
|
|
8673
|
-
min-width: ${
|
|
8709
|
+
min-width: ${Br(50)};
|
|
8674
8710
|
}
|
|
8675
8711
|
|
|
8676
8712
|
.${e}-list-col-title {
|
|
@@ -8967,7 +9003,7 @@ a.${e}-list-item {
|
|
|
8967
9003
|
overflow-wrap: anywhere;
|
|
8968
9004
|
word-break: break-word;
|
|
8969
9005
|
}
|
|
8970
|
-
`}const Un=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Oa=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",uo=[...Oa,An],Sr=["A","B","C","D","E"];function Xl(e){return`${e}ColumnVerticalAlign`}const la=["Top","Center","Bottom"];function ja(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Sr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Pg(e){const t=ja(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Ag(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Sr.includes(n)?n:null}function Yl(e,t,n){const i=Ag(e);return i?i===t?!1:Pg(n[Xl(i)]):!0}function po(e){const t=ja(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Sr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Wg(e,t,n){if(Jl(e,t,n))return po(e);const i=po(e);return i.kind==="baseline"?{kind:"top"}:i}function Fg(e){const t=po(e);return t.kind==="baseline"?{kind:"top"}:t}function Jl(e,t,n){return Yl(e,n,t)?po(e).kind==="baseline":!1}function _g(e){const t={};let n=!1;for(const i of Sr){const o=Xl(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}Yl(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Hg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Ng(e){const t=po(e).kind;return t==="baseline"?"center":t}function Og(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function ks(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function jg(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 Br(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=jg(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 zg(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 Bg(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Dg={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function vt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Vg={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Gg(e){return[vt(e,"textFontFamily"),vt(e,"textFontSettings"),{type:"row",items:[vt(e,"textFontSize"),vt(e,"textLineHeight"),vt(e,"textLetterSpacing"),vt(e,"textWordSpacing")]},vt(e,"textTextAlign"),vt(e,"textTextAppearance"),`${e}VerticalAlign`]}function qg(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(uo.map(e=>[Vg[e],Gg(e)]))}}function rr(e,t){const n=i=>{const o=vt(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 Ps(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 hn(Qt(n,t))}function As(e,t,n,i){const o=rr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Ws(e,t,n,i){const o=rr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((s-l)/2,i)}}const yn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Wi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Fi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],_i=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Kg={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Ug=["hover","focus","filled","success","error"],Fs=.004,wi=.004,Dr=wi,za=50,mo=1440,go=za/mo;function Zl(e){const t=typeof e=="number"&&e>0?e:mo;return za/t}function Xg(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 mo}const Ql={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function eo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Yg(e,t=1){const n=t/e;return Object.fromEntries(yn.map(i=>[i,n]))}function Jg(){return Object.fromEntries([...Wi.map(e=>[e,0]),...Fi.map(e=>[e,0])])}function Zg(){return Object.fromEntries(_i.map(e=>[e,0]))}function _o(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:Ql[t]]))}function ec(e,t,n){const i=e-go,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 Yo(e,t,n){const i=Ba(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 Qg(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Wi[o],l=Fi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=ec(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Ba(e,t,n){if(e<=0)return[];const i=yn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,m)=>u+m,0)+go;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 m=d[u]-go;if(m<=0)continue;const v=Math.min(c,m);d[u]-=v,c-=v}return[...d,i[e-1]]}function eh(e,t,n){if(e<=1)return{};const i=Ba(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=yn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function _s(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Un]}function th(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function nh(e,t,n,i){const o=Math.min(i,e.length,yn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=yn[c],m=Wi[c],v=Fi[c],b=_i[c],S=yn[l],y=Wi[l],w=Fi[l],C=_i[l],L=n[u],k=n[m],A=n[v],O=n[b];typeof L=="number"&&(s[S]=L),typeof k=="number"&&(s[y]=k),typeof A=="number"&&(s[w]=A),typeof O=="number"&&(s[C]=O)}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 ih(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=eo(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Yg(n,o),...Jg()};if(s)for(const d of _i)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Zg());return tc(e,l)?l:e}function oh(e,t,n){const i=_g(e);i&&(e={...e,...i});const o=Zl(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=eo(e),c=eo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof s=="number"?s:typeof l=="number"?l:Un.length,v=A=>{if(u)return A;const O=_o({...t,...A}),P=eo(A),D=Yo(m,P,O),R=Qg(m,D,{...t,...A});return Object.keys(R).length===0?A:{...A,...R}};if(typeof s=="number"&&s!==l)return e;const b=_s(e),S=_s(t);if(!th(b,S))return v({...e,...nh(b,S,t,m)});if(d<c&&typeof m=="number"&&!u){const A=_o({...t,...e});return v({...e,...eh(m,d,A)})}if(u){const A=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,O=Math.max(0,(d-o)/2);return A>O?{...e,textPaddingLR:O}:e}const y=_o({...t,...e}),w=Yo(m,c,_o(t)),L=Yo(m,d,y).some((A,O)=>A<(w[O]??A)),k=yn.some(A=>{const O=e[A],P=t[A];return typeof O=="number"&&typeof P=="number"&&O!==P});return L||k?v(e):e}function rh(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(go,i-o-s-go)}function ah(e,t){return Math.random()*(t-e)+e}function sh(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:Ql[t]]))}function Vr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function lh(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Wi[d],u=Fi[d],m=_i[d];return{key:l,textPrefix:Dg[l],widthKey:yn[d],width:n[yn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[m]}})}function ch({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=E.useScopedStyles(),u=!!o,{columns:m,type:v,wrapperWidth:b,entriesCount:S,cellMinHeight:y,dividerWidth:w,showVisibility:C,cut:L,showCut:k,cutCellMinHeight:A,cutLabel:O,imageSize:P,imageOnHover:D,entryHoverEffect:R,entryHoverShowOption:x,rowPaddingTop:U,rowPaddingBottom:h,rowPaddingTopB:I,columnsOrder:W,textPaddingLR:V,textColor:Y,backgroundColor:ae,dividerColor:Z,textHoverColor:G,backgroundHoverColor:H,dividerHoverColor:$}=e,[M,q]=a.useState(void 0),[B,ee]=a.useState(null),_=D==="on"&&(!n||i),ye=(L??0)>0,f=v==="b",ve=a.useRef(null),K=a.useRef(null),[le,$e]=a.useState(null),[oe,fe]=a.useState(mo),X=Zl(oe),be=Math.max(0,((b??0)-X)/2),xe=Math.min(V??0,be),pe=Math.max(xe,wi),se=((b??0)+X)/2;a.useLayoutEffect(()=>{if(!n){fe(mo);return}const Ce=()=>{fe(Xg(ve.current))};Ce();const je=ve.current;if(!je)return;const Ke=new ResizeObserver(Ce);Ke.observe(je);let He=je;for(;He&&!He.style.getPropertyValue("--cntrl-article-width");)He=He.parentElement;return He&&Ke.observe(He),()=>Ke.disconnect()},[n,l]),a.useEffect(()=>{q(void 0)},[L,k,t,S]),a.useEffect(()=>{n&&!i&&q(void 0)},[n,i]);const Re=E.buildColorVars(c,{textColor:Y,backgroundColor:ae,dividerColor:Z,textHoverColor:G,backgroundHoverColor:H,dividerHoverColor:$},Kg,Ug),ke=s&&s!=="default"?`${c}-state-${s}`:"",Se=`${!n||i?R==="default"?`${c}-entry-hover-default`:R==="blinds"?`${c}-entry-hover-blinds`:R==="reveal"?`${c}-entry-hover-reveal`:"":""} ${ke}`.trim(),z=R==="reveal"&&(!n||i),re=(C==null?void 0:C[0])??!1,F=(C==null?void 0:C[1])??!1,te=a.useRef(e),ne=a.useRef(l);a.useEffect(()=>{if(!d||!n){te.current=e,ne.current=l;return}if(ne.current!==l){te.current=e,ne.current=l;return}const Ce=te.current;if(!(Ce!==e))return;if(typeof Ce.columns=="number"&&typeof e.columns=="number"&&Ce.columns!==e.columns){te.current=e;return}const Ke=oh(e,Ce,{designWidth:oe});te.current=e,tc(e,Ke)&&d(Ke)},[e,d,n,l,oe]);const ue=a.useMemo(()=>sh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),me=a.useMemo(()=>Vr(e,Wi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),he=a.useMemo(()=>Vr(e,Fi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Le=a.useMemo(()=>Vr(e,_i),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Q=a.useMemo(()=>Array.isArray(W)&&W.length>0?W:[...Un],[W]),ge=a.useMemo(()=>lh(Q,m,ue,me,he,Le),[Q,m,ue,me,he,Le]),Ae=eo(e),ie=a.useMemo(()=>yn.slice(0,m).map(Ce=>ue[Ce]),[m,ue]),j=a.useMemo(()=>Ba(m,Ae,ue),[m,Ae,ue]),Oe=a.useMemo(()=>Yo(m,Ae,ue),[m,Ae,ue]),Fe=a.useMemo(()=>ge.map((Ce,je)=>ec(Oe[je]??0,Ce.paddingLeft,Ce.paddingRight)),[ge,Oe]),et=a.useMemo(()=>{const Ce=S===0?1/0:S;return(t??[]).slice(0,Ce).map((Ke,He)=>({id:He,cells:Object.fromEntries(Un.map(ze=>[ze,Ke[ze]??""])),image:Ke.image,link:Ke.link}))},[t,S]),Ye=ye?M??L:et.length,at=a.useMemo(()=>ye?et.slice(0,Ye):et,[et,ye,Ye]),mt=ye&&Ye<et.length,De=at.length>1||mt,it=[re?`${c}-divider-top`:"",F||De?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,ot=()=>{if(!$t)return;const Ce=M??L;if(!k){q(et.length);return}q(Math.min(Ce+k,et.length))},Ue=Ce=>E.scalingValue(Ce,n??!1),ht=f?I??0:U??0,xt=h??0,ct=y??0,Mt=ht+ct/2,_t=Math.max(xt,Dr),Qe=Es(0,at.length,re,F,mt,w??0,n??!1).borderTopWidth,Tt=le!=null?`${le}px`:`calc(${Qe} + ${Ue(Mt)})`,Lt=f?"rowPaddingTopB":"rowPaddingTop",Ge=ge[0],qe=ge[ge.length-1],Pe=Fe[0],gt=Fe[Fe.length-1],It=Ge&&Pe?Math.max(Pe.paddingLeft,wi):0,kt=qe&>?Math.max(gt.paddingRight,wi):0,Dt=Ae,en=Ce=>{const je=ve.current;if(!je)return{x:0,y:0};const Ke=je.getBoundingClientRect();return{x:Ce.clientX-Ke.left+Ms,y:Ce.clientY-Ke.top+Ms}},on=(Ce,je)=>{if(!_)return;const Ke=Ce.image;if(!(Ke!=null&&Ke.url)){ee(null);return}const{x:He,y:ze}=en(je),dt=(P==null?void 0:P.min)??80,_e=(P==null?void 0:P.max)??320,Ze=(B==null?void 0:B.rowId)===Ce.id?B.widthPx:ah(dt,_e);ee({rowId:Ce.id,url:Ke.url,objectFit:"contain",isVideo:Ig(Ke),widthPx:Ze,x:He,y:ze})},bt=Ce=>{if(!_||!B)return;const{x:je,y:Ke}=en(Ce);ee(He=>!He||He.x===je&&He.y===Ke?He:{...He,x:je,y:Ke})},Rt=()=>{ee(null)},Ut=Ce=>{z&&Is(Ce,c),_&&ee(null)},Kt=Ce=>{z&&Rs(Ce,c)};a.useLayoutEffect(()=>{if(!u||f){$e(null);return}const Ce=K.current,je=Ce==null?void 0:Ce.parentElement;if(!Ce||!je){$e(null);return}const Ke=()=>{const ze=Ce.querySelector("[data-list-row]");if(!ze){$e(null);return}const dt=je.getBoundingClientRect(),_e=ze.getBoundingClientRect();$e(_e.top-dt.top+_e.height/2)};Ke();const He=new ResizeObserver(Ke);return He.observe(Ce),He.observe(je),()=>He.disconnect()},[u,f,at,ht,xt,ct,t,e,ge,Oe,oe,w,re,F,mt]);const ft=a.useMemo(()=>!f&&Oa.some(Ce=>{const je=Ce.charAt(0),Ke=e[`${Ce}VerticalAlign`];return Jl(Ke,e,je)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ze;const Ce=ve.current;if(!Ce)return;const je=()=>{Ce.querySelectorAll("[data-list-col]").forEach(tt=>{tt.style.transform="";const Ft=tt.querySelector(`.${c}-list-col`);Ft&&(Ft.style.minHeight="",Ft.style.height="");const Ct=tt.querySelector(`.${c}-list-col-title`);Ct&&(Ct.style.transform="")})};if(f||!ft){je();return}const Ke=()=>{const tt=Array.from(Ce.querySelectorAll("[data-list-row]")),Ft=`${c}-list-col`,Ct=`${c}-baseline-probe`;tt.forEach(st=>{st.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const At=Ht.querySelector(`.${Ft}`);At&&(At.style.minHeight="",At.style.height="");const Vt=Ht.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})}),tt.forEach(st=>{const Ht=Array.from(st.querySelectorAll("[data-list-col]"));zg(st,Ht,Ft)}),Ce.offsetHeight,tt.forEach(st=>{const Ht=Array.from(st.querySelectorAll("[data-list-col]")),At=st.getBoundingClientRect().top,Vt=new Map,zt=Ht.map(wt=>{const Gt=wt.querySelector(`.${c}-list-col-title`),ut={el:wt,titleEl:Gt,letter:wt.getAttribute("data-col-letter")??"",kind:wt.getAttribute("data-valign")??"top",anchor:wt.getAttribute("data-valign-anchor")};return Vt.set(ut.letter,ut),ut}),Pt=new Map,Zt=(wt,Gt)=>{const ut=Pt.get(wt.letter);if(ut!==void 0)return ut;const Wt=wt.anchor?Vt.get(wt.anchor):void 0;if(wt.kind!=="baseline"||!Wt||Gt.has(wt.letter)){const Ie=Br(wt,At,Ft,Ct);return Pt.set(wt.letter,Ie),Ie}Gt.add(wt.letter);const Bt=Zt(Wt,Gt);Gt.delete(wt.letter);const g=Br(wt,At,Ft,Ct),ce=Bt-g;Bg(wt.titleEl,ce);const Ee=Br(wt,At,Ft,Ct);return Pt.set(wt.letter,Ee),Ee};zt.forEach(wt=>Zt(wt,new Set))})};let He=null;const ze=()=>{He===null&&(He=requestAnimationFrame(()=>{He=null,Ke()}))};Ke();const dt=new ResizeObserver(()=>ze());dt.observe(Ce);let _e=!1;return typeof document<"u"&&((Ze=document.fonts)!=null&&Ze.ready)&&document.fonts.ready.then(()=>{_e||ze()}),()=>{_e=!0,He!==null&&(cancelAnimationFrame(He),He=null),dt.disconnect(),je()}},[ft,f,e,t,oe,at,Oe]);const Jt=a.useMemo(()=>kg(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Jt}}),r.jsx("div",{style:Re,children:r.jsxs("div",{ref:ve,className:`${c}-wrapper ${Se}${it?` ${it}`:""}${f?` ${c}-type-b`:""}`.trim(),style:{width:E.scalingValue(b??0,n),...!f&&u?{[`--${c}-first-entry-handle-top`]:Tt}:{}},onMouseMove:_?bt:void 0,onMouseLeave:_?Rt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[at.map((Ce,je)=>{var dt;const Ke=(((dt=Ce.link)==null?void 0:dt.length)??0)>0,He=Ke&&(!n||i)?"a":"div",ze=Es(je,at.length,re,F,mt,w??0,n??!1);return r.jsxs(He,{ref:je===0?_e=>{K.current=_e}:void 0,className:`${c}-list-item${Ke||x==="always"?` ${c}-list-item-has-link`:""}`,...Ke?{href:Ce.link,target:"_blank"}:{},style:ze,onMouseEnter:_e=>{z&&(Ke||x==="always")&&Is(_e,c),_&&on(Ce,_e)},onMouseLeave:_e=>{z&&(Ke||x==="always")&&Rs(_e,c)},children:[ht>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(ht)}}),r.jsxs("div",{className:`${c}-list-cols-row${f?"":` ${c}-list-cols-row-h`}${u&&je===0&&f?` ${c}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Ue(ct)},children:[ge.map((_e,Ze)=>{const tt=Ze===ge.length-1,Ft=Fe[Ze],Ct=_e.paddingBottom,st=Eg(Ce.cells[_e.key]),Ht=f&&st&&Ct>0,At=f?{minHeight:Ue(ct)}:{width:Ue(Oe[Ze])},Vt=f?{paddingLeft:Ue(xe),paddingRight:Ue(xe)}:{paddingLeft:Ue(Ft.paddingLeft),paddingRight:Ue(Ft.paddingRight)},zt=_e.textPrefix.charAt(0),Pt=f?Fg(e[`${_e.textPrefix}VerticalAlign`]):Wg(e[`${_e.textPrefix}VerticalAlign`],e,zt),Zt=f&&st&&u&&je===0;return r.jsxs("div",{className:f?`${c}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":zt,"data-valign":Pt.kind,...Pt.kind==="baseline"?{"data-valign-anchor":Pt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${tt?` ${c}-list-col-last`:""}`,style:{...Vt,...At,...f?{justifyContent:ks(Pt.kind)}:{}},"data-test":_e.width,children:r.jsx("span",{className:As(e,_e.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Ps(rr(e,_e.textPrefix),n),...Ws(e,_e.textPrefix,c,n),...f?{}:Hg(Pt.kind)},children:Ce.cells[_e.key]??null})}),Ht&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(Ct)}}),Zt&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(Math.max(Ct,Dr))}})]},_e.key)}),u&&je===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(se),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Ue(pe),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(se),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Ue(Math.max(pe,Ae-pe)),width:Ue(pe),height:"100%"}})]})]}),!f&&xt>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(xt)}}),u&&je===0&&!f&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(_t)}})]},Ce.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Lt,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Qe,left:0,width:"100%",height:Ue(Math.max(ht,Dr))}})},"row-padding-handles"),u&&!f&&Ge&&qe&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ge.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Oe[0]-((Pe==null?void 0:Pe.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Ue(It),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":qe.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Oe[ge.length-1]-((gt==null?void 0:gt.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Dt-kt),width:Ue(kt),height:"100%"}})]},"column-edge-padding-handles"),u&&!f&&ge.slice(0,-1).map((Ce,je)=>{const Ke=ge[je+1],He=j.slice(0,je+1).reduce((tt,Ft)=>tt+Ft,0),ze=Fe[je],dt=Fe[je+1],_e=Math.max(ze.paddingRight,wi),Ze=Math.max(dt.paddingLeft,wi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ce.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Oe[je]-ze.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(He-_e),width:Ue(_e),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ke.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Oe[je+1]-dt.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(He),width:Ue(Ze),height:"100%"}})]},`${Ce.paddingRightKey}-padding`)}),u&&!f&&ge.slice(0,-1).map((Ce,je)=>{const Ke=rh(je,j,ie,Ae),ze=j.slice(0,je+1).reduce((dt,_e)=>dt+_e,0)-Fs/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Ce.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(za),"data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ue(ze),width:Ue(Fs),height:"calc(100%)",pointerEvents:"auto"}})},`${Ce.widthKey}-junction`)})]}),mt&&(()=>{const Ce=rr(e,An),je=Ng(e.cutLabelVerticalAlign),Ke=Ce.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ue(A??0),cursor:$t?"pointer":"default",...Mg(F,w??0,n??!1)},onClick:$t?ot:void 0,onMouseEnter:z||_?Ut:void 0,onMouseLeave:z?Kt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...f?{paddingLeft:Ue(xe),paddingRight:Ue(xe)}:{},justifyContent:Og(Ce.textTextAlign),alignItems:ks(je)},children:r.jsx("span",{className:As(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Ps(Ce,n),...Ws(e,An,c,n),...Ke?{width:"100%"}:{}},children:O})})})})(),_&&B&&(()=>{const Ce=Xo(B.widthPx),je={width:Ce,height:"auto",maxHeight:Ce,objectFit:"contain",left:B.x,top:B.y,position:"absolute"};return r.jsx(Rg,{media:B,className:B.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:je},`${B.rowId}-${B.url}`)})()]})})]})}const dh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
9006
|
+
`}const Un=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ba=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",uo=[...Ba,An],wr=["A","B","C","D","E"];function Zl(e){return`${e}ColumnVerticalAlign`}const da=["Top","Center","Bottom"];function za(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return wr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Hg(e){const t=za(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Ng(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return wr.includes(n)?n:null}function Ql(e,t,n){const i=Ng(e);return i?i===t?!1:Hg(n[Zl(i)]):!0}function po(e){const t=za(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return wr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Og(e,t,n){if(ec(e,t,n))return po(e);const i=po(e);return i.kind==="baseline"?{kind:"top"}:i}function jg(e){const t=po(e);return t.kind==="baseline"?{kind:"top"}:t}function ec(e,t,n){return Ql(e,n,t)?po(e).kind==="baseline":!1}function Bg(e){const t={};let n=!1;for(const i of wr){const o=Zl(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Ql(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function zg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Dg(e){const t=po(e).kind;return t==="baseline"?"center":t}function Vg(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function As(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Gg(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(),l=o-i;return n.remove(),l}function zr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=Gg(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.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+s}function qg(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function Kg(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Ug={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function vt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Xg={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Yg(e){return[vt(e,"textFontFamily"),vt(e,"textFontSettings"),{type:"row",items:[vt(e,"textFontSize"),vt(e,"textLineHeight"),vt(e,"textLetterSpacing"),vt(e,"textWordSpacing")]},vt(e,"textTextAlign"),vt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Jg(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(uo.map(e=>[Xg[e],Yg(e)]))}}function or(e,t){const n=i=>{const o=vt(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 Fs(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 cn(Jt(n,t))}function Ws(e,t,n,i){const o=or(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function _s(e,t,n,i){const o=or(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:v.scalingValue((l-s)/2,i)}}const yn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Fi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Wi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],_i=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Zg={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Qg=["hover","focus","filled","success","error"],Hs=.004,wi=.004,Dr=wi,Da=50,mo=1440,go=Da/mo;function tc(e){const t=typeof e=="number"&&e>0?e:mo;return Da/t}function eh(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 mo}const nc={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function eo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function th(e,t=1){const n=t/e;return Object.fromEntries(yn.map(i=>[i,n]))}function nh(){return Object.fromEntries([...Fi.map(e=>[e,0]),...Wi.map(e=>[e,0])])}function ih(){return Object.fromEntries(_i.map(e=>[e,0]))}function _o(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:nc[t]]))}function ic(e,t,n){const i=e-go,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Xo(e,t,n){const i=Va(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function oh(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Fi[o],s=Wi[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=ic(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function Va(e,t,n){if(e<=0)return[];const i=yn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+go;if(t>=s)return i;const d=[...o];let c=s-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const m=d[u]-go;if(m<=0)continue;const b=Math.min(c,m);d[u]-=b,c-=b}return[...d,i[e-1]]}function rh(e,t,n){if(e<=1)return{};const i=Va(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=yn[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function Ns(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Un]}function ah(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function sh(e,t,n,i){const o=Math.min(i,e.length,yn.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=yn[c],m=Fi[c],b=Wi[c],S=_i[c],C=yn[s],y=Fi[s],w=Wi[s],$=_i[s],T=n[u],R=n[m],M=n[b],H=n[S];typeof T=="number"&&(l[C]=T),typeof R=="number"&&(l[y]=R),typeof M=="number"&&(l[w]=M),typeof H=="number"&&(l[$]=H)}return l}function oc(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 lh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=eo(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...th(n,o),...nh()};if(l)for(const d of _i)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,ih());return oc(e,s)?s:e}function ch(e,t,n){const i=Bg(e);i&&(e={...e,...i});const o=tc(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=eo(e),c=eo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:Un.length,b=M=>{if(u)return M;const H=_o({...t,...M}),F=eo(M),V=Xo(m,F,H),P=oh(m,V,{...t,...M});return Object.keys(P).length===0?M:{...M,...P}};if(typeof l=="number"&&l!==s)return e;const S=Ns(e),C=Ns(t);if(!ah(S,C))return b({...e,...sh(S,C,t,m)});if(d<c&&typeof m=="number"&&!u){const M=_o({...t,...e});return b({...e,...rh(m,d,M)})}if(u){const M=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return M>H?{...e,textPaddingLR:H}:e}const y=_o({...t,...e}),w=Xo(m,c,_o(t)),T=Xo(m,d,y).some((M,H)=>M<(w[H]??M)),R=yn.some(M=>{const H=e[M],F=t[M];return typeof H=="number"&&typeof F=="number"&&H!==F});return T||R?b(e):e}function dh(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(go,i-o-l-go)}function uh(e,t){return Math.random()*(t-e)+e}function ph(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:nc[t]]))}function Vr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function mh(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=Fi[d],u=Wi[d],m=_i[d];return{key:s,textPrefix:Ug[s],widthKey:yn[d],width:n[yn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[m]}})}function gh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=v.useScopedStyles(),u=!!o,{columns:m,type:b,wrapperWidth:S,entriesCount:C,cellMinHeight:y,dividerWidth:w,showVisibility:$,cut:T,showCut:R,cutCellMinHeight:M,cutLabel:H,imageSize:F,imageOnHover:V,entryHoverEffect:P,entryHoverShowOption:x,rowPaddingTop:U,rowPaddingBottom:h,rowPaddingTopB:E,columnsOrder:A,textPaddingLR:j,textColor:X,backgroundColor:ae,dividerColor:Z,textHoverColor:q,backgroundHoverColor:N,dividerHoverColor:L}=e,[k,K]=a.useState(void 0),[z,ne]=a.useState(null),_=V==="on"&&(!n||i),ye=(T??0)>0,f=b==="b",ve=a.useRef(null),Y=a.useRef(null),[le,$e]=a.useState(null),[oe,xe]=a.useState(mo),G=tc(oe),he=Math.max(0,((S??0)-G)/2),be=Math.min(j??0,he),ce=Math.max(be,wi),se=((S??0)+G)/2;a.useLayoutEffect(()=>{if(!n){xe(mo);return}const Ce=()=>{xe(eh(ve.current))};Ce();const je=ve.current;if(!je)return;const Ke=new ResizeObserver(Ce);Ke.observe(je);let He=je;for(;He&&!He.style.getPropertyValue("--cntrl-article-width");)He=He.parentElement;return He&&Ke.observe(He),()=>Ke.disconnect()},[n,s]),a.useEffect(()=>{K(void 0)},[T,R,t,C]),a.useEffect(()=>{n&&!i&&K(void 0)},[n,i]);const Le=v.buildColorVars(c,{textColor:X,backgroundColor:ae,dividerColor:Z,textHoverColor:q,backgroundHoverColor:N,dividerHoverColor:L},Zg,Qg),Me=l&&l!=="default"?`${c}-state-${l}`:"",Se=`${!n||i?P==="default"?`${c}-entry-hover-default`:P==="blinds"?`${c}-entry-hover-blinds`:P==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Me}`.trim(),B=P==="reveal"&&(!n||i),Q=($==null?void 0:$[0])??!1,W=($==null?void 0:$[1])??!1,te=a.useRef(e),ie=a.useRef(s);a.useEffect(()=>{if(!d||!n){te.current=e,ie.current=s;return}if(ie.current!==s){te.current=e,ie.current=s;return}const Ce=te.current;if(!(Ce!==e))return;if(typeof Ce.columns=="number"&&typeof e.columns=="number"&&Ce.columns!==e.columns){te.current=e;return}const Ke=ch(e,Ce,{designWidth:oe});te.current=e,oc(e,Ke)&&d(Ke)},[e,d,n,s,oe]);const pe=a.useMemo(()=>ph(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),me=a.useMemo(()=>Vr(e,Fi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),fe=a.useMemo(()=>Vr(e,Wi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ie=a.useMemo(()=>Vr(e,_i),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ee=a.useMemo(()=>Array.isArray(A)&&A.length>0?A:[...Un],[A]),ge=a.useMemo(()=>mh(ee,m,pe,me,fe,Ie),[ee,m,pe,me,fe,Ie]),Ae=eo(e),re=a.useMemo(()=>yn.slice(0,m).map(Ce=>pe[Ce]),[m,pe]),D=a.useMemo(()=>Va(m,Ae,pe),[m,Ae,pe]),Oe=a.useMemo(()=>Xo(m,Ae,pe),[m,Ae,pe]),We=a.useMemo(()=>ge.map((Ce,je)=>ic(Oe[je]??0,Ce.paddingLeft,Ce.paddingRight)),[ge,Oe]),et=a.useMemo(()=>{const Ce=C===0?1/0:C;return(t??[]).slice(0,Ce).map((Ke,He)=>({id:He,cells:Object.fromEntries(Un.map(Be=>[Be,Ke[Be]??""])),image:Ke.image,link:Ke.link}))},[t,C]),Ye=ye?k??T:et.length,st=a.useMemo(()=>ye?et.slice(0,Ye):et,[et,ye,Ye]),mt=ye&&Ye<et.length,De=st.length>1||mt,it=[Q?`${c}-divider-top`:"",W||De?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,ot=()=>{if(!$t)return;const Ce=k??T;if(!R){K(et.length);return}K(Math.min(Ce+R,et.length))},Ue=Ce=>v.scalingValue(Ce,n??!1),ht=f?E??0:U??0,xt=h??0,ct=y??0,Mt=ht+ct/2,_t=Math.max(xt,Dr),Qe=ks(0,st.length,Q,W,mt,w??0,n??!1).borderTopWidth,Tt=le!=null?`${le}px`:`calc(${Qe} + ${Ue(Mt)})`,Lt=f?"rowPaddingTopB":"rowPaddingTop",Ge=ge[0],qe=ge[ge.length-1],Pe=We[0],gt=We[We.length-1],It=Ge&&Pe?Math.max(Pe.paddingLeft,wi):0,kt=qe&>?Math.max(gt.paddingRight,wi):0,Dt=Ae,en=Ce=>{const je=ve.current;if(!je)return{x:0,y:0};const Ke=je.getBoundingClientRect();return{x:Ce.clientX-Ke.left+Ps,y:Ce.clientY-Ke.top+Ps}},on=(Ce,je)=>{if(!_)return;const Ke=Ce.image;if(!(Ke!=null&&Ke.url)){ne(null);return}const{x:He,y:Be}=en(je),dt=(F==null?void 0:F.min)??80,_e=(F==null?void 0:F.max)??320,Ze=(z==null?void 0:z.rowId)===Ce.id?z.widthPx:uh(dt,_e);ne({rowId:Ce.id,url:Ke.url,objectFit:"contain",isVideo:Pg(Ke),widthPx:Ze,x:He,y:Be})},bt=Ce=>{if(!_||!z)return;const{x:je,y:Ke}=en(Ce);ne(He=>!He||He.x===je&&He.y===Ke?He:{...He,x:je,y:Ke})},Rt=()=>{ne(null)},Ut=Ce=>{B&&Es(Ce,c),_&&ne(null)},Kt=Ce=>{B&&Ms(Ce,c)};a.useLayoutEffect(()=>{if(!u||f){$e(null);return}const Ce=Y.current,je=Ce==null?void 0:Ce.parentElement;if(!Ce||!je){$e(null);return}const Ke=()=>{const Be=Ce.querySelector("[data-list-row]");if(!Be){$e(null);return}const dt=je.getBoundingClientRect(),_e=Be.getBoundingClientRect();$e(_e.top-dt.top+_e.height/2)};Ke();const He=new ResizeObserver(Ke);return He.observe(Ce),He.observe(je),()=>He.disconnect()},[u,f,st,ht,xt,ct,t,e,ge,Oe,oe,w,Q,W,mt]);const ft=a.useMemo(()=>!f&&Ba.some(Ce=>{const je=Ce.charAt(0),Ke=e[`${Ce}VerticalAlign`];return ec(Ke,e,je)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ze;const Ce=ve.current;if(!Ce)return;const je=()=>{Ce.querySelectorAll("[data-list-col]").forEach(tt=>{tt.style.transform="";const Wt=tt.querySelector(`.${c}-list-col`);Wt&&(Wt.style.minHeight="",Wt.style.height="");const Ct=tt.querySelector(`.${c}-list-col-title`);Ct&&(Ct.style.transform="")})};if(f||!ft){je();return}const Ke=()=>{const tt=Array.from(Ce.querySelectorAll("[data-list-row]")),Wt=`${c}-list-col`,Ct=`${c}-baseline-probe`;tt.forEach(at=>{at.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const At=Ht.querySelector(`.${Wt}`);At&&(At.style.minHeight="",At.style.height="");const Vt=Ht.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})}),tt.forEach(at=>{const Ht=Array.from(at.querySelectorAll("[data-list-col]"));qg(at,Ht,Wt)}),Ce.offsetHeight,tt.forEach(at=>{const Ht=Array.from(at.querySelectorAll("[data-list-col]")),At=at.getBoundingClientRect().top,Vt=new Map,Bt=Ht.map(wt=>{const Gt=wt.querySelector(`.${c}-list-col-title`),ut={el:wt,titleEl:Gt,letter:wt.getAttribute("data-col-letter")??"",kind:wt.getAttribute("data-valign")??"top",anchor:wt.getAttribute("data-valign-anchor")};return Vt.set(ut.letter,ut),ut}),Pt=new Map,Qt=(wt,Gt)=>{const ut=Pt.get(wt.letter);if(ut!==void 0)return ut;const Ft=wt.anchor?Vt.get(wt.anchor):void 0;if(wt.kind!=="baseline"||!Ft||Gt.has(wt.letter)){const Re=zr(wt,At,Wt,Ct);return Pt.set(wt.letter,Re),Re}Gt.add(wt.letter);const zt=Qt(Ft,Gt);Gt.delete(wt.letter);const g=zr(wt,At,Wt,Ct),de=zt-g;Kg(wt.titleEl,de);const Ee=zr(wt,At,Wt,Ct);return Pt.set(wt.letter,Ee),Ee};Bt.forEach(wt=>Qt(wt,new Set))})};let He=null;const Be=()=>{He===null&&(He=requestAnimationFrame(()=>{He=null,Ke()}))};Ke();const dt=new ResizeObserver(()=>Be());dt.observe(Ce);let _e=!1;return typeof document<"u"&&((Ze=document.fonts)!=null&&Ze.ready)&&document.fonts.ready.then(()=>{_e||Be()}),()=>{_e=!0,He!==null&&(cancelAnimationFrame(He),He=null),dt.disconnect(),je()}},[ft,f,e,t,oe,st,Oe]);const Zt=a.useMemo(()=>_g(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Zt}}),r.jsx("div",{style:Le,children:r.jsxs("div",{ref:ve,className:`${c}-wrapper ${Se}${it?` ${it}`:""}${f?` ${c}-type-b`:""}`.trim(),style:{width:v.scalingValue(S??0,n),...!f&&u?{[`--${c}-first-entry-handle-top`]:Tt}:{}},onMouseMove:_?bt:void 0,onMouseLeave:_?Rt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[st.map((Ce,je)=>{var dt;const Ke=(((dt=Ce.link)==null?void 0:dt.length)??0)>0,He=Ke&&(!n||i)?"a":"div",Be=ks(je,st.length,Q,W,mt,w??0,n??!1);return r.jsxs(He,{ref:je===0?_e=>{Y.current=_e}:void 0,className:`${c}-list-item${Ke||x==="always"?` ${c}-list-item-has-link`:""}`,...Ke?{href:Ce.link,target:"_blank"}:{},style:Be,onMouseEnter:_e=>{B&&(Ke||x==="always")&&Es(_e,c),_&&on(Ce,_e)},onMouseLeave:_e=>{B&&(Ke||x==="always")&&Ms(_e,c)},children:[ht>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(ht)}}),r.jsxs("div",{className:`${c}-list-cols-row${f?"":` ${c}-list-cols-row-h`}${u&&je===0&&f?` ${c}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Ue(ct)},children:[ge.map((_e,Ze)=>{const tt=Ze===ge.length-1,Wt=We[Ze],Ct=_e.paddingBottom,at=Fg(Ce.cells[_e.key]),Ht=f&&at&&Ct>0,At=f?{minHeight:Ue(ct)}:{width:Ue(Oe[Ze])},Vt=f?{paddingLeft:Ue(be),paddingRight:Ue(be)}:{paddingLeft:Ue(Wt.paddingLeft),paddingRight:Ue(Wt.paddingRight)},Bt=_e.textPrefix.charAt(0),Pt=f?jg(e[`${_e.textPrefix}VerticalAlign`]):Og(e[`${_e.textPrefix}VerticalAlign`],e,Bt),Qt=f&&at&&u&&je===0;return f&&!at?null:r.jsxs("div",{className:f?`${c}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":Bt,"data-valign":Pt.kind,...Pt.kind==="baseline"?{"data-valign-anchor":Pt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${tt?` ${c}-list-col-last`:""}`,style:{...Vt,...At,...f?{justifyContent:As(Pt.kind)}:{}},"data-test":_e.width,children:r.jsx("span",{className:Ws(e,_e.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Fs(or(e,_e.textPrefix),n),..._s(e,_e.textPrefix,c,n),...f?{}:zg(Pt.kind)},children:Ce.cells[_e.key]??null})}),Ht&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(Ct)}}),Qt&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(Math.max(Ct,Dr))}})]},_e.key)}),u&&je===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(se),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Ue(ce),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(se),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Ue(Math.max(ce,Ae-ce)),width:Ue(ce),height:"100%"}})]})]}),!f&&xt>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(xt)}}),u&&je===0&&!f&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(_t)}})]},Ce.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Lt,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Qe,left:0,width:"100%",height:Ue(Math.max(ht,Dr))}})},"row-padding-handles"),u&&!f&&Ge&&qe&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ge.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Oe[0]-((Pe==null?void 0:Pe.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Ue(It),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":qe.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Oe[ge.length-1]-((gt==null?void 0:gt.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Dt-kt),width:Ue(kt),height:"100%"}})]},"column-edge-padding-handles"),u&&!f&&ge.slice(0,-1).map((Ce,je)=>{const Ke=ge[je+1],He=D.slice(0,je+1).reduce((tt,Wt)=>tt+Wt,0),Be=We[je],dt=We[je+1],_e=Math.max(Be.paddingRight,wi),Ze=Math.max(dt.paddingLeft,wi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ce.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Oe[je]-Be.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(He-_e),width:Ue(_e),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ke.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Oe[je+1]-dt.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(He),width:Ue(Ze),height:"100%"}})]},`${Ce.paddingRightKey}-padding`)}),u&&!f&&ge.slice(0,-1).map((Ce,je)=>{const Ke=dh(je,D,re,Ae),Be=D.slice(0,je+1).reduce((dt,_e)=>dt+_e,0)-Hs/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Ce.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Da),"data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ue(Be),width:Ue(Hs),height:"calc(100%)",pointerEvents:"auto"}})},`${Ce.widthKey}-junction`)})]}),mt&&(()=>{const Ce=or(e,An),je=Dg(e.cutLabelVerticalAlign),Ke=Ce.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ue(M??0),cursor:$t?"pointer":"default",...Wg(W,w??0,n??!1)},onClick:$t?ot:void 0,onMouseEnter:B||_?Ut:void 0,onMouseLeave:B?Kt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...f?{paddingLeft:Ue(be),paddingRight:Ue(be)}:{},justifyContent:Vg(Ce.textTextAlign),alignItems:As(je)},children:r.jsx("span",{className:Ws(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Fs(Ce,n),..._s(e,An,c,n),...Ke?{width:"100%"}:{}},children:H})})})})(),_&&z&&(()=>{const Ce=`${z.widthPx}px`,je={width:Ce,height:"auto",maxHeight:Ce,objectFit:"contain",left:z.x,top:z.y,position:"absolute"};return r.jsx(Ag,{media:z,className:z.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:je},`${z.rowId}-${z.url}`)})()]})})]})}const hh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
8971
9007
|
import { CommonComponentProps } from '../props';
|
|
8972
9008
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
8973
9009
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -11540,6 +11576,10 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11540
11576
|
&& showControls
|
|
11541
11577
|
&& rowIdx === 0;
|
|
11542
11578
|
|
|
11579
|
+
if (isVerticalLayout && !hasColumnText) {
|
|
11580
|
+
return null;
|
|
11581
|
+
}
|
|
11582
|
+
|
|
11543
11583
|
return (
|
|
11544
11584
|
<div
|
|
11545
11585
|
key={col.key}
|
|
@@ -11899,7 +11939,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11899
11939
|
);
|
|
11900
11940
|
})()}
|
|
11901
11941
|
{showHoverImage && hoverImage && (() => {
|
|
11902
|
-
const hoverSize =
|
|
11942
|
+
const hoverSize = \`\${hoverImage.widthPx}px\`;
|
|
11903
11943
|
const hoverMediaStyle: React.CSSProperties = {
|
|
11904
11944
|
width: hoverSize,
|
|
11905
11945
|
height: 'auto',
|
|
@@ -11924,7 +11964,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11924
11964
|
</>
|
|
11925
11965
|
);
|
|
11926
11966
|
}
|
|
11927
|
-
`,Vi=["A","B","C","D","E"],Hs=[...la,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function uh(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Ho(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function ph(){return Object.fromEntries(Vi.map((e,t)=>{const n=Un[t],i=`${e} column`;return[n,uh(i)]}))}function mh(){const e={};for(const t of Vi)e[`${t}ColumnWidth`]=Ho(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Ho(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Ho(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Ho(`${t} column padding bottom`);return e}function Ns(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Un]};for(const s of Vi)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 gh(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...la]},enum:[...la]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Hs],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Hs]}}return t[vt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[vt(e,"textFontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[vt(e,"textFontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[vt(e,"textLineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[vt(e,"textLetterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[vt(e,"textWordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[vt(e,"textTextAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[vt(e,"textTextAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const hh=uo.reduce((e,t)=>({...e,...gh(t)}),{});function fh(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 yh(e,t={}){var n;return{...fh(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Os=new Set(["textFontFamily","textFontSettings"]);function vh(e,t,n){const i=s=>n===void 0?!0:n==="common"?Os.has(s):!Os.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=ja(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[vt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[vt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[vt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[vt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[vt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[vt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[vt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[vt(e,"textTextAppearance")]=t.textTextAppearance),o}function Jo(e={},t){return uo.reduce((n,i)=>({...n,...vh(i,yh(i,e),t)}),{})}const xh=Jo(),bh=qg();function nc(e){return[vt(e,"textFontFamily"),vt(e,"textFontSettings"),vt(e,"textFontSize"),vt(e,"textLineHeight"),vt(e,"textLetterSpacing"),vt(e,"textWordSpacing"),vt(e,"textTextAlign"),vt(e,"textTextAppearance"),`${e}VerticalAlign`]}function wh(){const e=[];return Oa.forEach((t,n)=>{const i=Un[n],o=nc(t);for(let s=1;s<Un.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 Sh=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];nc(An);const $h=[...Vi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ri=[{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"}],Ch=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ri[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ri[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ri[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ri[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ri[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ri[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ri[6],link:""}],Th=[...Vi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Lh={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:{...ph(),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:Ch},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"}},...mh(),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"}},...hh,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",...xh,...Jo({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Ns({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},...Jo({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Ns({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},...Jo({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...wh(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...$h.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}},...Vi.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",...Th]},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__",bh]}],paletteBookmark:{items:[...Sh],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Ih={element:ch,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>ih(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...uo.map(e=>({path:`${vt(e,"textFontFamily")}`}))]},fontRelations:{...uo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${vt(t,"textFontFamily")}`}),{})},schema:Lh,sourceCode:dh},js=300,Hn=.004,Rh={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"},Eh=["hover","focus","filled","success","error"];function Mh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Bs(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:E.scalingValue((o-t)/2,i)}}function kh(e){return`
|
|
11967
|
+
`,Vi=["A","B","C","D","E"],Os=[...da,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function fh(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Ho(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function yh(){return Object.fromEntries(Vi.map((e,t)=>{const n=Un[t],i=`${e} column`;return[n,fh(i)]}))}function vh(){const e={};for(const t of Vi)e[`${t}ColumnWidth`]=Ho(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Ho(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Ho(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Ho(`${t} column padding bottom`);return e}function js(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Un]};for(const l of Vi)i[`${l}ColumnWidth`]=l==="A"?.0798:.32,i[`${l}ColumnPaddingLeft`]=0,i[`${l}ColumnPaddingRight`]=0,i[`${l}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function xh(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...da]},enum:[...da]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Os],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Os]}}return t[vt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[vt(e,"textFontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[vt(e,"textFontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[vt(e,"textLineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[vt(e,"textLetterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[vt(e,"textWordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[vt(e,"textTextAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[vt(e,"textTextAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const bh=uo.reduce((e,t)=>({...e,...xh(t)}),{});function wh(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 Sh(e,t={}){var n;return{...wh(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Bs=new Set(["textFontFamily","textFontSettings"]);function $h(e,t,n){const i=l=>n===void 0?!0:n==="common"?Bs.has(l):!Bs.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=za(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[vt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[vt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[vt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[vt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[vt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[vt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[vt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[vt(e,"textTextAppearance")]=t.textTextAppearance),o}function Yo(e={},t){return uo.reduce((n,i)=>({...n,...$h(i,Sh(i,e),t)}),{})}const Ch=Yo(),Th=Jg();function rc(e){return[vt(e,"textFontFamily"),vt(e,"textFontSettings"),vt(e,"textFontSize"),vt(e,"textLineHeight"),vt(e,"textLetterSpacing"),vt(e,"textWordSpacing"),vt(e,"textTextAlign"),vt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Lh(){const e=[];return Ba.forEach((t,n)=>{const i=Un[n],o=rc(t);for(let l=1;l<Un.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const Ih=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];rc(An);const Rh=[...Vi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ri=[{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"}],Eh=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ri[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ri[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ri[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ri[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ri[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ri[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ri[6],link:""}],Mh=[...Vi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],kh={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:{...yh(),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:Eh},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"}},...vh(),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"}},...bh,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",...Ch,...Yo({},"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},...Yo({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},...Yo({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Lh(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Rh.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}},...Vi.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",...Mh]},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__",Th]}],paletteBookmark:{items:[...Ih],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Ph={element:gh,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>lh(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...uo.map(e=>({path:`${vt(e,"textFontFamily")}`}))]},fontRelations:{...uo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${vt(t,"textFontFamily")}`}),{})},schema:kh,sourceCode:hh},zs=300,Hn=.004,Ah={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"},Fh=["hover","focus","filled","success","error"];function Wh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ds(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Vs(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 _h(e){return`
|
|
11928
11968
|
.${e}-wrapper {
|
|
11929
11969
|
box-sizing: border-box;
|
|
11930
11970
|
display: flex;
|
|
@@ -11986,7 +12026,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11986
12026
|
display: flex;
|
|
11987
12027
|
align-items: center;
|
|
11988
12028
|
justify-content: space-between;
|
|
11989
|
-
gap: ${
|
|
12029
|
+
gap: ${Wh(20)};
|
|
11990
12030
|
width: 100%;
|
|
11991
12031
|
min-width: 0;
|
|
11992
12032
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -12014,7 +12054,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12014
12054
|
width: var(--${e}-icon-max-width);
|
|
12015
12055
|
height: var(--${e}-icon-max-width);
|
|
12016
12056
|
position: relative;
|
|
12017
|
-
transition: transform ${
|
|
12057
|
+
transition: transform ${zs}ms ease;
|
|
12018
12058
|
}
|
|
12019
12059
|
.${e}-icon-custom {
|
|
12020
12060
|
display: flex;
|
|
@@ -12049,7 +12089,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12049
12089
|
.${e}-panel {
|
|
12050
12090
|
display: grid;
|
|
12051
12091
|
grid-template-rows: 0fr;
|
|
12052
|
-
transition: grid-template-rows ${
|
|
12092
|
+
transition: grid-template-rows ${zs}ms ease;
|
|
12053
12093
|
}
|
|
12054
12094
|
.${e}-item-open .${e}-panel {
|
|
12055
12095
|
grid-template-rows: 1fr;
|
|
@@ -12117,7 +12157,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12117
12157
|
left: 20px;
|
|
12118
12158
|
transform: translateY(-50%);
|
|
12119
12159
|
}
|
|
12120
|
-
`}function
|
|
12160
|
+
`}function Gs(e,t,n,i,o,l,s,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:l??0,textAppearance:s,color:d??"#000000"}}function Hh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l}){const{prefix:s}=v.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:m=694e-6,dividerStyle:b="solid",entryHoverEffect:S="default",autoclose:C="off",icon:y,iconMaxWidth:w=.00833,iconPaddingRight:$=0,iconAnimation:T="rotate 45",questionColor:R="#000000",answerColor:M="#000000",dividerColor:H="#0000001F",iconColor:F="#000000",questionHoverColor:V="#666666",iconHoverColor:P="#666666",iconActiveColor:x="#000000",dividerHoverColor:U="#000000",questionFontFamily:h,questionFontSettings:E,questionFontSize:A,questionLineHeight:j,questionLetterSpacing:X,questionWordSpacing:ae,questionTextAppearance:Z,answerFontFamily:q,answerFontSettings:N,answerFontSize:L,answerLineHeight:k,answerLetterSpacing:K,answerWordSpacing:z,answerTextAppearance:ne,questionPaddingLeft:_=0,questionPaddingTop:ye=0,questionPaddingBottom:f=0,answerPaddingLeft:ve=0,answerPaddingRight:Y=0,answerPaddingTop:le=0,answerPaddingBottom:$e=0}=e,oe=t??[],[xe,G]=a.useState(()=>new Set),he=!n||i;a.useEffect(()=>{G(new Set)},[C]),a.useEffect(()=>{n&&!o&&!i&&G(new Set)},[n,o,i]);const be=Ue=>v.scalingValue(Ue,n??!1),ce=Math.max(_,Hn),se=Math.max(ye,Hn),Le=Math.max(f,Hn),Me=Math.max(ve,Hn),we=Math.max(Y,Hn),Se=Math.max(le,Hn),B=Math.max($e,Hn),Q=Math.max(0,(c??1)-$-w),W=Math.max(0,(c??1)-Y),te=Math.max(0,(c??1)-ve),ie=Math.max($,Hn),pe=Math.max(0,(c??1)-_-w),me=a.useMemo(()=>xe.size===0?0:Math.min(...xe),[xe]),fe=a.useCallback(Ue=>xe.has(Ue),[xe]),Ie=he&&S==="default"?`${s}-entry-hover-default`:"",ee=y??"",ge=ee!=="",Ae=T.replace(/^rotate /,""),re=`${s}-icon-anim-${Ae}`,D=cn(Jt(Gs(h,E,A,j,X,ae,Z,R),n)),Oe=cn(Jt(Gs(q,N,L,k,K,z,ne,M),n)),We=Ds(A,j,`${s}-question`,`${s}-text-tight-leading`),et=Ds(L,k,`${s}-answer-text`,`${s}-text-tight-leading`),Ye=Vs(A,j,s,n),st=Vs(L,k,s,n),mt=v.buildColorVars(s,{questionColor:R,answerColor:M,dividerColor:H,iconColor:F,questionHoverColor:V,iconHoverColor:P,iconActiveColor:x,dividerHoverColor:U},Ah,Fh),De=l&&l!=="default"?`${s}-state-${l}`:"",it=a.useCallback(Ue=>{he&&G(ht=>{if(ht.has(Ue)){const ct=new Set(ht);return ct.delete(Ue),ct}if(C==="on")return new Set([Ue]);const xt=new Set(ht);return xt.add(Ue),xt})},[he,C]),$t=a.useMemo(()=>_h(s),[s]),ot={[`--${s}-divider-width`]:v.scalingValue(m,n??!1),[`--${s}-divider-style`]:b,[`--${s}-icon-max-width`]:v.scalingValue(w,n??!1),...u>0?{[`--${s}-question-min-height`]:v.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$t}}),r.jsx("div",{style:mt,children:r.jsx("div",{className:pt(`${s}-wrapper`,n&&!i&&`${s}-editor`,Ie,De),style:{width:v.scalingValue(c,n??!1),maxWidth:"100%",...ot},children:oe.map((Ue,ht)=>{var Tt;const xt=fe(ht),ct=((Tt=Ue.question)==null?void 0:Tt.trim())??"",Mt=Ue.answer,_t=((Mt==null?void 0:Mt.length)??0)>0,Qe=d&&ht===me;return r.jsxs("div",{className:pt(`${s}-item`,xt&&`${s}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${s}-question-controls`,children:[Qe&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:be(se),zIndex:2}}),r.jsx(nn,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Q),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:be(ce),height:"100%",zIndex:2}}),r.jsx(nn,{"data-controls":"iconPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(pe),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:be(ie),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${s}-question-button`,"aria-expanded":xt,style:{...D,...Ye,paddingLeft:be(_),paddingRight:be($)},onClick:()=>it(ht),children:[ye>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:be(ye)},"aria-hidden":"true"}),r.jsxs("span",{className:`${s}-question-row`,children:[r.jsx("span",{className:We,children:ct}),_t&&(ge?r.jsx("span",{className:`${s}-icon ${s}-icon-custom ${re}`,"aria-hidden":"true",children:r.jsx(dn,{url:ee,fill:F,hoverFill:P,className:`${s}-icon-image`})}):r.jsx("span",{className:`${s}-icon ${s}-icon-default ${re}`,"aria-hidden":"true"}))]}),f>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:be(f)},"aria-hidden":"true"})]}),Qe&&r.jsx(nn,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:be(Le),zIndex:2}})]}),_t&&Mt&&r.jsx("div",{className:`${s}-panel`,"aria-hidden":!xt,children:r.jsx("div",{className:`${s}-panel-inner`,children:r.jsxs("div",{className:`${s}-answer-controls`,children:[Qe&&xt&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:be(Se),zIndex:2}}),r.jsx(nn,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(W),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:be(Me),height:"100%",zIndex:2}}),r.jsx(nn,{"data-controls":"answerPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(te),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:be(we),height:"100%",zIndex:2}})]}),le>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:be(le)}}),r.jsx("div",{className:`${s}-answer`,style:{...Oe,...st,paddingLeft:be(ve),paddingRight:be(Y)},children:r.jsx("div",{className:et,children:r.jsx(Ei,{content:Mt})})}),$e>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:be($e)}}),Qe&&xt&&r.jsx(nn,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:be(B),zIndex:2}})]})})})]},ht)})})})]})}const Nh=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12121
12161
|
import cn from 'classnames';
|
|
12122
12162
|
import { CommonComponentProps } from '../props';
|
|
12123
12163
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -12914,7 +12954,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
12914
12954
|
</>
|
|
12915
12955
|
);
|
|
12916
12956
|
}
|
|
12917
|
-
`;function Nn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Vs={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Wh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Fh={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:Nn("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:{...Vs.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:{...Vs.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:Nn("Question Padding Left"),questionPaddingTop:Nn("Question Padding Top"),questionPaddingBottom:Nn("Question Padding Bottom"),answerPaddingLeft:Nn("Answer Padding Left"),answerPaddingRight:Nn("Answer Padding Right"),answerPaddingTop:Nn("Answer Padding Top"),answerPaddingBottom:Nn("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:[...Wh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},_h={element:Ph,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:Fh,sourceCode:Ah},Wn=e=>e.display==="cover",$r=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Gs=100,Hh=.2,qs=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 m=a.useMemo(()=>typeof window>"u"?Gs:Math.max(Gs,window.innerHeight*Hh),[]),v=a.useCallback(h=>Math.max(0,1-h/(m*1.5)),[m]),b=a.useCallback(h=>Math.max(0,1-h/(m*.45)),[m]),S=a.useCallback(h=>{const I=typeof window<"u"?window.innerHeight:800,W=Math.max(.88,1-h/I*.12);return`translateY(${h}px) scale(${W})`},[]),y=a.useCallback(()=>{c.current=null},[]),w=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),y()},[n,y]),C=a.useCallback(()=>{const h=typeof window<"u"?window.innerHeight:800;d(!0),s(h),window.setTimeout(()=>{t(),y(),d(!1)},Math.min(n,200))},[n,t,y]),L=a.useCallback(h=>{!e||l||h.pointerType==="touch"&&(i!=null&&i(h.target)||(c.current={startX:h.clientX,startY:h.clientY,isLocked:null,pointerId:h.pointerId}))},[e,l,i]),k=a.useCallback(h=>{const I=c.current;if(!e||!I||h.pointerType!=="touch"||I.pointerId!==h.pointerId)return;const W=h.clientX-I.startX,V=h.clientY-I.startY;if(I.isLocked===null){if(Math.abs(W)<qs&&Math.abs(V)<qs)return;if(V>0&&V>Math.abs(W))I.isLocked=!0,h.currentTarget.setPointerCapture(h.pointerId);else{I.isLocked=!1,y();return}}if(!I.isLocked)return;h.preventDefault();const Y=Math.max(0,V);u.current=Y,s(Y)},[e,y]),A=a.useCallback(h=>{const I=c.current;if(!e||!I||h.pointerType!=="touch"||I.pointerId!==h.pointerId)return;const W=I.isLocked===!0;if(h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId),!W){y();return}h.clientY-I.startY>=m?C():w()},[m,C,e,y,w]),O=a.useCallback(h=>{A(h)},[A]),P=a.useCallback(h=>{A(h)},[A]),D=o>0,R=l?`transform ${n}ms ease`:"none",x=l?`opacity ${n}ms ease`:"none",U=o>0||l;return{isSwipeDragging:D,backdropStyle:{opacity:v(o),transition:x},mediaAreaStyle:{transform:S(o),transition:R,touchAction:D?"none":void 0,willChange:D?"transform":void 0},overlayContentStyle:U?{opacity:b(o),transition:x}:void 0,swipeHandlers:e?{onPointerDown:L,onPointerMove:k,onPointerUp:O,onPointerCancel:P}:{},dismissAreaStyle:e?{touchAction:D?"none":"pan-x"}:void 0}},Nh="[data-lightbox-scrollable]",oc=()=>{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(Nh)||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(0,e)}},[])},Oh=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},jh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},zh=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Bh=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(y,w)=>{jh(t),e.scrollLeft=y,w&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,v=0;const b=()=>{t.removeEventListener("transitionend",S),clearTimeout(v)},S=y=>{y.target!==t||y.propertyName!=="transform"||m||(m=!0,b(),u(n,!0))};return t.addEventListener("transitionend",S),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,v=window.setTimeout(()=>{m||(m=!0,b(),u(n,!0))},i+64),()=>{m||(m=!0,b(),u(l-zh(t),!1))}},to=300,Dh=900,Vh=1500,Gh="cubic-bezier(0.16, 1, 0.3, 1)",qh=3e3,Kh=2,Uh=16,Xh=.05,Yh=1,No=.3,Jh=50,Zh=20,vi=.004,Hi=["title1","title2","title3"],Qh={title1:"1",title2:"2",title3:"3"},ef={title1:"title1Color",title2:"title2Color",title3:"title3Color"},tf={title1:.02,title2:.02,title3:.02},Oo=e=>`max(${e}, ${Zh}px)`,nf=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]}},of=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=nf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Nt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,rf=e=>[Nt(e,"fontFamily"),Nt(e,"fontSettings"),{type:"row",items:[Nt(e,"fontSize"),Nt(e,"lineHeight"),Nt(e,"letterSpacing"),Nt(e,"wordSpacing")]},Nt(e,"textAlign"),Nt(e,"textAppearance")],af=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Hi.map(e=>[Qh[e],rf(e)]))}),Da=(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},rc=(e,t)=>Da(e,t),jo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Ks=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Da(e.length,n),effective:rc(e.length,n)}},sf=(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},Gr=(e,t)=>{const n=i=>{const o=Nt(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[ef[t]]}},lf=(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),qr=(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??tf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},cf=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:v,closeIcon:b,closeIconMaxWidth:S,closeIconColor:y,closeIconHoverColor:w,thumbnailTrigger:C,thumbnailVisibility:L,thumbnailObjectFit:k,thumbnailActive:A,thumbnailActiveColor:O,title1Width:P,title2Width:D,title3Width:R,title1MarginLeft:x=0,title2MarginLeft:U=0,title3MarginLeft:h=0,titleRowMarginBottom:I=0,titleHeaderLayout:W="desktop",contentMarginTop:V,iconMarginLeft:Y}=n,ae=p=>E.scalingValue(p,i??!1),Z=c??n.thumnailSize??.03,G=ae(Z),H=ae(u),$=ae(m??.02),M=ae(v??0),q=ae(V??0),B=Oo(q),ee=ae(Y??0),[_,ye]=a.useState(0),f=a.useRef(_);f.current=_;const ve=t[_],{title1:K,title2:le,title3:$e}=of(ve),oe=qr("title1",Gr(n,"title1"),i),fe=qr("title2",Gr(n,"title2"),i),X=qr("title3",Gr(n,"title3"),i),be=W==="mobile",xe=!o&&(!i||s),pe=xe,se=xe,Re=xe,ke=Wn(k),we=ke?{"--image-aspect-ratio":$r(k)}:void 0,Se=!!(K||le||$e),z=a.useMemo(()=>sf(e,K,le,$e,oe,fe,X),[e,_,K,le,$e,oe,fe,X]),re=a.useMemo(()=>({title1Width:P,title2Width:D,title3Width:R}),[P,D,R]),F=a.useMemo(()=>z.map(p=>re[p.widthKey]),[z,re]),te=a.useMemo(()=>Da(z.length,F),[z.length,F]),ne=a.useMemo(()=>rc(z.length,F),[z.length,F]),ue=a.useMemo(()=>z.filter(p=>p.prefix==="title1"),[z]),me=a.useMemo(()=>z.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[z]),he=a.useMemo(()=>Ks(ue,re),[ue,re]),Le=a.useMemo(()=>Ks(me,re),[me,re]),Q=a.useCallback((p,T)=>{const N=z.indexOf(p);if(!be||T==="single-row")return{effectiveWidth:ne[N]??0,resolvedWidth:te[N]??0,maxWidth:jo(N,te)};if(T==="two-row-top"){const Te=ue.indexOf(p);return{effectiveWidth:he.effective[Te]??0,resolvedWidth:he.resolved[Te]??0,maxWidth:jo(Te,he.resolved)}}const de=me.indexOf(p);return{effectiveWidth:Le.effective[de]??0,resolvedWidth:Le.resolved[de]??0,maxWidth:jo(de,Le.resolved)}},[me,Le,ne,te,z,ue,he,be]),ge=a.useCallback(p=>E.scalingValue(p,i??!1),[i]),Ae=ge(I??0),ie=a.useMemo(()=>({title1MarginLeft:x,title2MarginLeft:U,title3MarginLeft:h}),[x,U,h]),j=a.useCallback(p=>z.slice(0,p+1).reduce((T,N,de)=>T+(N!=null&&N.marginLeftKey?ie[N.marginLeftKey]??0:0)+(te[de]??0),0)+(be?0:x??0),[z,ie,te,be,x]),Oe=a.useCallback(()=>be?0:x??0,[be,x]),Fe=a.useCallback(p=>me.slice(0,p).reduce((T,N,de)=>T+(N.marginLeftKey?ie[N.marginLeftKey]??0:0)+(Le.resolved[de]??0),0),[me,Le.resolved,ie]),et=a.useCallback(p=>{const T=me[p];return Fe(p)+(T.marginLeftKey?ie[T.marginLeftKey]??0:0)+(Le.resolved[p]??0)},[me,Le.resolved,Fe,ie]),Ye=(p,T)=>{const N=p.marginLeftKey?ie[p.marginLeftKey]??0:0,{effectiveWidth:de,resolvedWidth:Te,maxWidth:Ne}=Q(p,T),rt=o&&T==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...T==="single-row"?{gridArea:p.prefix}:{},width:ge(de),...N>0?{marginLeft:ge(N)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),rt&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:ge(-N),width:`max(${ge(N)}, 10px)`,height:"100%",pointerEvents:"auto"}}),rt&&r.jsx("div",{"data-controls":p.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:ge(-vi/2),width:ge(vi),height:"100%",pointerEvents:"auto"}})]},p.className)},at=()=>{const p=be?-1:z.findIndex(de=>de.prefix==="title1"),T=!be&&(o||(x??0)>0)?(()=>{const de=x??0,Te=p>=0?te[p]:P??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:0,width:`max(${ge(de)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,N=z.flatMap((de,Te)=>{if(!de.marginLeftKey)return[];const Ne=ie[de.marginLeftKey]??0,rt=lf(z,te,ie,Te)+Oe();return r.jsx("div",{"data-controls":de.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(te[Te]),style:{position:"absolute",top:0,left:ge(rt),width:`max(${ge(Ne)}, 10px)`,height:"100%",pointerEvents:"auto"}},de.marginLeftKey)});return T?[T,...N]:N},mt=()=>z.map((p,T)=>{const N=jo(T,te),Te=j(T)-vi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(N),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ge(Te),width:ge(vi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),De=()=>me.flatMap((p,T)=>{if(!p.marginLeftKey)return[];const N=ie[p.marginLeftKey]??0,de=Fe(T),{resolvedWidth:Te}=Q(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:ge(de),width:`max(${ge(N)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),it=()=>me.map((p,T)=>{const{maxWidth:N}=Q(p,"two-row-bottom"),Te=et(T)-vi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(N),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ge(Te),width:ge(vi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),$t=a.useRef(null),ot=a.useRef(null),Ue=a.useRef(null),ht=a.useRef(null),xt=a.useRef([]),ct=a.useRef([]),Mt=a.useRef(0),_t=a.useRef(null),Qe=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Tt=a.useRef(null),Lt=a.useRef(null),Ge=a.useRef(0),qe=a.useRef("forward"),Pe=a.useRef(0),gt=a.useRef(null),It=a.useRef(!1),kt=t.length>1&&(!o||!!s),Dt=kt?3:1,en=a.useMemo(()=>Array.from({length:Dt},()=>t).flat(),[t,Dt]),[on,bt]=a.useState(!1),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState(!0),Jt=a.useRef(null),Ce=a.useRef(null),je=a.useRef(!1),Ke=a.useRef(!1),He=a.useRef(null),ze=a.useRef(null),dt=pe&&!Kt,_e=a.useCallback(()=>{pe&&(ft(!0),ze.current&&clearTimeout(ze.current),ze.current=setTimeout(()=>{Qe.current.isActive||ft(!1)},qh))},[pe]),Ze=a.useCallback(()=>{o||Ke.current||(Ke.current=!0,Ut(!1),He.current=setTimeout(()=>{l()},to))},[o,l]),tt=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":dt?"true":"false",style:{width:E.scalingValue(S??0,i),height:E.scalingValue(S??0,i),marginRight:ee,"--close-icon-hover-color":w},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ze,"aria-label":"Close",children:r.jsx(fn,{url:b,fill:y,hoverFill:i&&!s?y:w,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:ee,height:"100%",pointerEvents:"auto"}})]}),Ft=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ge(x??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),Ct=()=>{const p=z.find(de=>de.prefix==="title1"),T=z.filter(de=>de.prefix==="title2"||de.prefix==="title3"),N=T.length>0||o||(I??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(x??0)>0||o?Ft():null,p&&Ye(p,"two-row-top"),b&&tt()]}),N?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[T.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[T.map(de=>Ye(de,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[De(),it()]})]}):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:Ae,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},st=()=>r.jsxs(r.Fragment,{children:[(x??0)>0||o?Ft("single-row"):null,z.map(p=>Ye(p,"single-row")),o?r.jsxs(r.Fragment,{children:[at(),mt()]}):null,b?tt():null]}),Ht=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:At,backdropStyle:Vt,mediaAreaStyle:zt,overlayContentStyle:Pt,swipeHandlers:Zt,dismissAreaStyle:wt}=ic({enabled:xe??!1,onClose:Ze,animMs:to,isBlockedTarget:Ht}),Gt=()=>{if(!kt||t.length===0)return Mt.current=0,0;const p=ct.current[0],T=ct.current[t.length];if(!p||!T)return Mt.current;const N=T.offsetLeft-p.offsetLeft;return N>0&&(Mt.current=N),Mt.current},ut=(p=!1)=>{if(!kt)return;const T=ot.current,N=Gt();!T||N<=0||N<T.clientWidth*.25||(T.scrollLeft<=0?(T.scrollLeft+=N,p&&(Qe.current.scrollLeft+=N),It.current&&(Pe.current+=N)):T.scrollLeft>=N*2&&(T.scrollLeft-=N,p&&(Qe.current.scrollLeft-=N),It.current&&(Pe.current-=N)))},Wt=(p,T=(N=>(N=ot.current)==null?void 0:N.scrollLeft)()??0)=>{if(!kt)return p;let de=t.length+p,Te=1/0;for(let Ne=0;Ne<Dt;Ne++){const rt=Ne*t.length+p,yt=ct.current[rt];if(!yt)continue;const tn=Math.abs(yt.offsetLeft-T);tn<Te&&(Te=tn,de=rt)}return de},Bt=p=>{const T=ot.current;return!p||!T?!1:p.offsetWidth>T.clientWidth+1},g=p=>{const T=ot.current;if(!p||!T||!Bt(p))return!1;const N=p.offsetLeft,de=N+p.offsetWidth;return T.scrollLeft>=N-1&&T.scrollLeft+T.clientWidth<=de+1},ce=(p=(T=>(T=ot.current)==null?void 0:T.scrollLeft)()??0)=>{for(let de=0;de<ct.current.length;de+=1){const Te=ct.current[de];if(Te&&g(Te))return de}let N={flatIndex:0,distance:1/0};return ct.current.forEach((de,Te)=>{if(!de)return;const Ne=Math.abs(de.offsetLeft-p);Ne<N.distance&&(N={flatIndex:Te,distance:Ne})}),N.flatIndex},Ee=p=>{ot.current&&ct.current.forEach(T=>{T&&(T.style.scrollSnapAlign=Bt(T)&&p==="backward"?"end":"start")})},Ie=(p,T,N)=>{const de=p-T,Te=ce(T),Ne=ct.current[Te];if(g(Ne))return ce(p)%t.length;const rt=ct.current[Te+1],yt=Ne?rt?rt.offsetLeft-Ne.offsetLeft:Ne.offsetWidth:0,tn=yt>0?de>yt*No?1:de<-yt*No?-1:0:0;return tn===0?N:kt?(N+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,N+tn))},Je=a.useCallback((p=!1)=>{if(L!=="on"||o)return;const T=ht.current,N=f.current,de=xt.current[N];if(!T||!de||T.scrollWidth<=T.clientWidth)return;const Te=T.scrollLeft,Ne=Te+T.clientWidth,rt=de.offsetLeft,yt=rt+de.offsetWidth;if(rt>=Te&&yt<=Ne)return;const tn=T.scrollWidth-T.clientWidth;let Xt=Te;if(!p&&Jt.current===null){const fi=xt.current[N-1],Gi=xt.current[N+1],Io=fi?de.offsetLeft-fi.offsetLeft:Gi?Gi.offsetLeft-de.offsetLeft:de.offsetWidth;yt>Ne?Xt+=Io:rt<Te&&(Xt-=Io)}else yt>Ne?Xt=yt-T.clientWidth:Xt=rt;T.scrollLeft=Math.max(0,Math.min(tn,Xt))},[o,L]),Et=a.useCallback((p=!1)=>{p&&(je.current=!0),Ce.current===null&&(Ce.current=requestAnimationFrame(()=>{Ce.current=null;const T=je.current;je.current=!1,Je(T)}))},[Je]),Ve=a.useCallback(p=>{if(p===f.current)return;const T=f.current;f.current=p;const N=Math.abs(p-T)>1,de=kt&&t.length>1&&(T===t.length-1&&p===0||T===0&&p===t.length-1);ye(p),Et(N||de)},[t.length,kt,Et]),nt=()=>{if(!ot.current||t.length===0||Jt.current!==null||Qe.current.isActive&&Qe.current.hasMoved)return;const p=ot.current.scrollLeft,T=ce(p)%t.length;T!==f.current&&Ve(T)},Ot=()=>{Jt.current=null},St=p=>{const T=ot.current;T&&(T.style.scrollSnapType=p?"":"none")},ln=()=>{var p;(p=Lt.current)==null||p.call(Lt),Lt.current=null},cn=()=>{gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null),It.current=!1},Zn=()=>{const p=ot.current;if(!p){gt.current=null,It.current=!1;return}const T=Pe.current-p.scrollLeft;if(Math.abs(T)<.5){p.scrollLeft=Pe.current,ut(),nt(),gt.current=null,It.current=!1;return}p.scrollLeft+=T*Xh,ut(),nt(),_e(),gt.current=requestAnimationFrame(Zn)},Qn=()=>{const p=Ue.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},$o=(p,T,N,de)=>{Qn(),p.scrollLeft=T,Ge.current=p.scrollLeft,ut(),N!==void 0?(f.current=N,ye(N)):nt(),St(!0),de==null||de()},Co=(p,{behavior:T="smooth",activeIndex:N,onComplete:de}={})=>{const Te=ot.current,Ne=Ue.current;if(!Te||!Ne)return;if(cn(),ln(),St(!1),T==="auto"){$o(Te,p,N,de);return}const rt=Math.abs(p-Te.scrollLeft),yt=Oh(rt,Dh,Vh,Te.clientWidth*.55);Lt.current=Bh(Te,Ne,p,{duration:yt,easing:Gh,onComplete:()=>{Lt.current=null,$o(Te,p,N,de)}})},Tr=(p="smooth")=>{const T=ot.current;if(!T||t.length===0)return;const N=ce()%t.length,de=Wt(N,T.scrollLeft),Te=ct.current[de];Te&&Co(Te.offsetLeft,{behavior:p,activeIndex:N})},Lr=(p,T="smooth",N,de)=>{const Te=ot.current;if(!Te||t.length===0)return;const Ne=(de??Te.scrollLeft)-p,rt=ce(p),yt=ct.current[rt];if(g(yt)){St(!0),nt();return}const tn=ct.current[rt+1],Xt=yt?tn?tn.offsetLeft-yt.offsetLeft:yt.offsetWidth:0;if((Xt>0?Ne>Xt*No?1:Ne<-Xt*No?-1:0:0)!==0){const uc=N??rt%t.length,pc=Ie(de??Te.scrollLeft,p,uc);Sn(pc,T);return}const Gi=de??Te.scrollLeft,Io=ce(Gi),Va=ct.current[Io];if(Va&&Math.abs(Va.offsetLeft-Gi)<1){St(!0),nt();return}Tr("auto")},Sn=(p,T="smooth")=>{const N=ot.current;if(!N||t.length===0)return;const de=Wt(p,N.scrollLeft),Te=ct.current[de];Te&&(T==="smooth"?Jt.current=p:Jt.current=null,f.current=p,ye(p),Et(!0),Co(Te.offsetLeft,{behavior:T,activeIndex:p,onComplete:T==="smooth"?Ot:void 0}))},hi=()=>{Tt.current&&(window.removeEventListener("pointerup",Tt.current),window.removeEventListener("pointercancel",Tt.current),Tt.current=null)},To=(p,T,N,de,Te)=>{const Ne=N-p,rt=de-T,yt=Math.abs(Ne),tn=Math.abs(rt);if(yt<Jh||yt<=tn)return!1;const Xt=Ne<0?1:-1,fi=kt?(Te+Xt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Te+Xt));return fi===Te?!1:(Sn(fi),!0)},ei=p=>{if(!Qe.current.isActive)return;hi();const T=ot.current;if(!T)return;const{scrollLeft:N,startActiveIndex:de,hasMoved:Te}=Qe.current,Ne=T.scrollLeft;ut(!0),Qe.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},bt(!1),p!==void 0&&T.hasPointerCapture(p)&&T.releasePointerCapture(p),Te?Lr(N,"smooth",de,Ne):(St(!0),nt()),_e()},Lo=(p,T)=>{const N=_t.current;_t.current=null,N&&(To(N.startX,N.startY,p,T,N.startActiveIndex),_e())},Ir=p=>{if(!se)return;if(p.pointerType==="touch"){if(cn(),St(!0),Ht(p.target))return;_t.current={startX:p.clientX,startY:p.clientY,startActiveIndex:f.current};return}if(p.pointerType!=="mouse"||p.button!==0||Ht(p.target))return;const T=ot.current;if(!T)return;cn(),ln(),Qn(),Jt.current=null,Qe.current={isActive:!0,startX:p.clientX,scrollLeft:T.scrollLeft,startActiveIndex:f.current,hasMoved:!1},St(!1),_e(),T.setPointerCapture(p.pointerId),hi();const N=de=>{de.pointerType==="mouse"&&ei(de.pointerId)};Tt.current=N,window.addEventListener("pointerup",N),window.addEventListener("pointercancel",N)},Rr=p=>{if(!se||p.pointerType!=="mouse")return;const T=ot.current;if(!T||!Qe.current.isActive)return;if(p.buttons===0){ei(p.pointerId);return}const N=p.clientX-Qe.current.startX;Math.abs(N)>Yh&&(Qe.current.hasMoved=!0,bt(!0)),Qe.current.hasMoved&&(p.preventDefault(),T.scrollLeft=Qe.current.scrollLeft-N,ut(!0),nt(),_e())},J=p=>{if(se){if(p.pointerType==="touch"){p.type==="pointerup"?Lo(p.clientX,p.clientY):_t.current=null;return}p.pointerType==="mouse"&&ei(p.pointerId)}},Me=p=>{!se||p.pointerType!=="mouse"||ei(p.pointerId)};return oc(),a.useEffect(()=>{const p=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(p),ln(),hi(),Ce.current!==null&&(cancelAnimationFrame(Ce.current),Ce.current=null),He.current&&clearTimeout(He.current),ze.current&&clearTimeout(ze.current)}},[]),a.useEffect(()=>{if(!pe){ft(!0);return}_e();const p=$t.current;if(!p)return;const T=()=>_e();return p.addEventListener("pointermove",T),p.addEventListener("pointerdown",T),()=>{p.removeEventListener("pointermove",T),p.removeEventListener("pointerdown",T),ze.current&&clearTimeout(ze.current)}},[pe,_e]),a.useEffect(()=>{const p=T=>{T.key==="Escape"&&Ze()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Ze]),a.useLayoutEffect(()=>{Gt()},[M,t.length,kt]),a.useLayoutEffect(()=>{o||Sn(f.current,"auto")},[M,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,kt]),a.useEffect(()=>{const p=ot.current;if(!p||o||!xe)return;const T=N=>{if(N.preventDefault(),Math.abs(N.deltaY)<=Math.abs(N.deltaX))return;const de=N.deltaMode===1?Uh:N.deltaMode===2?p.clientHeight:1,Te=N.deltaY*de*Kh;if(Te!==0){if(ln(),It.current||(It.current=!0,Pe.current=p.scrollLeft,Jt.current=null,St(!1)),Pe.current+=Te,!kt){const Ne=p.scrollWidth-p.clientWidth;Pe.current=Math.max(0,Math.min(Ne,Pe.current))}_e(),gt.current===null&&(gt.current=requestAnimationFrame(Zn))}};return p.addEventListener("wheel",T,{passive:!1}),()=>{p.removeEventListener("wheel",T),cn()}},[o,xe,kt]),a.useEffect(()=>{const p=ot.current;if(!p)return;const T=()=>{ut(Qe.current.isActive);const de=p.scrollLeft,Te=de-Ge.current;Ge.current=de;const Ne=Mt.current>0?Mt.current*.5:1/0;if(Te!==0&&Math.abs(Te)<Ne){const rt=Te>0?"forward":"backward";rt!==qe.current&&(qe.current=rt,Ee(rt))}Qe.current.isActive&&Qe.current.hasMoved||nt()};p.addEventListener("scroll",T,{passive:!0});const N=new ResizeObserver(()=>{Gt(),ut(Qe.current.isActive),Ee(qe.current),nt()});return N.observe(p),()=>{ln(),p.removeEventListener("scroll",T),N.disconnect()}},[t.length,kt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{At||Ze()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Rt?1:0,transition:`opacity ${to}ms ease`,pointerEvents:Rt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),r.jsxs("div",{ref:$t,className:`${e}-lightbox-dismiss-area`,style:wt,...Zt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:zt,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:ot,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":se&&t.length>0?"true":"false","data-mouse-dragging":on?"true":"false",onPointerDown:Ir,onPointerMove:Rr,onPointerUp:J,onPointerCancel:J,onLostPointerCapture:Me,children:r.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:M},children:en.map((p,T)=>{const N=p.image.objectFit??"contain",de=T%t.length,Te=Math.floor(T/t.length),Ne=Oo(M),rt=`calc(-0.5 * (${Ne} + ${M}))`;return r.jsxs("div",{ref:yt=>ct.current[T]=yt,className:`${e}-strip-item`,style:{height:W==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:N}}),o&&de<t.length-1&&Te===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:rt,width:Ne,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Te}-${p.image.url}-${de}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":dt?"true":"false",style:Pt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:q,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:B,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${be?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||b)&&r.jsx("div",{className:`${e}-header ${be?`${e}-header-two-row`:`${e}-header-single-row`}`,children:be?Ct():Se||b?st():null})})})]}),t.length>1&&L==="on"&&(()=>{const p=Oo($),T=`calc(-0.5 * (${$} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:$},children:r.jsx("div",{ref:ht,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:N=>N.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":A,style:{gap:H,"--thumbnail-active-color":O},children:[t.map((N,de)=>{const Te=Oo(H),Ne=`calc(-0.5 * (${Te} + ${H}))`;return r.jsxs("div",{ref:rt=>{xt.current[de]=rt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":_===de?"true":"false",onClick:()=>xe&&C==="click"&&Sn(de),onMouseEnter:()=>Re&&C==="hover"&&Sn(de),"aria-label":N.image.name?`View ${N.image.name}`:`View image ${de+1}`,"aria-current":_===de?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ke?` ${e}-thumb-image-cover`:""}`,src:N.image.url,alt:"",draggable:!1,style:{...we,maxWidth:G,maxHeight:G,width:k.display==="cover"?"auto":"100%",height:"auto",objectFit:k.display==="cover"?"cover":"contain"}})}),o&&de<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ne,width:Te,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${N.image.url}-${de}`)}),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:T,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function df(e){return`
|
|
12957
|
+
`;function Nn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const qs={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Oh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],jh={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:Nn("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:{...qs.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:{...qs.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:Nn("Question Padding Left"),questionPaddingTop:Nn("Question Padding Top"),questionPaddingBottom:Nn("Question Padding Bottom"),answerPaddingLeft:Nn("Answer Padding Left"),answerPaddingRight:Nn("Answer Padding Right"),answerPaddingTop:Nn("Answer Padding Top"),answerPaddingBottom:Nn("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:[...Oh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Bh={element:Hh,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:jh,sourceCode:Nh},Fn=e=>e.display==="cover",Sr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Ks=100,zh=.2,Us=8,ac=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=a.useState(0),[s,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const m=a.useMemo(()=>typeof window>"u"?Ks:Math.max(Ks,window.innerHeight*zh),[]),b=a.useCallback(h=>Math.max(0,1-h/(m*1.5)),[m]),S=a.useCallback(h=>Math.max(0,1-h/(m*.45)),[m]),C=a.useCallback(h=>{const E=typeof window<"u"?window.innerHeight:800,A=Math.max(.88,1-h/E*.12);return`translateY(${h}px) scale(${A})`},[]),y=a.useCallback(()=>{c.current=null},[]),w=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),y()},[n,y]),$=a.useCallback(()=>{const h=typeof window<"u"?window.innerHeight:800;d(!0),l(h),window.setTimeout(()=>{t(),y(),d(!1)},Math.min(n,200))},[n,t,y]),T=a.useCallback(h=>{!e||s||h.pointerType==="touch"&&(i!=null&&i(h.target)||(c.current={startX:h.clientX,startY:h.clientY,isLocked:null,pointerId:h.pointerId}))},[e,s,i]),R=a.useCallback(h=>{const E=c.current;if(!e||!E||h.pointerType!=="touch"||E.pointerId!==h.pointerId)return;const A=h.clientX-E.startX,j=h.clientY-E.startY;if(E.isLocked===null){if(Math.abs(A)<Us&&Math.abs(j)<Us)return;if(j>0&&j>Math.abs(A))E.isLocked=!0,h.currentTarget.setPointerCapture(h.pointerId);else{E.isLocked=!1,y();return}}if(!E.isLocked)return;h.preventDefault();const X=Math.max(0,j);u.current=X,l(X)},[e,y]),M=a.useCallback(h=>{const E=c.current;if(!e||!E||h.pointerType!=="touch"||E.pointerId!==h.pointerId)return;const A=E.isLocked===!0;if(h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId),!A){y();return}h.clientY-E.startY>=m?$():w()},[m,$,e,y,w]),H=a.useCallback(h=>{M(h)},[M]),F=a.useCallback(h=>{M(h)},[M]),V=o>0,P=s?`transform ${n}ms ease`:"none",x=s?`opacity ${n}ms ease`:"none",U=o>0||s;return{isSwipeDragging:V,backdropStyle:{opacity:b(o),transition:x},mediaAreaStyle:{transform:C(o),transition:P,touchAction:V?"none":void 0,willChange:V?"transform":void 0},overlayContentStyle:U?{opacity:S(o),transition:x}:void 0,swipeHandlers:e?{onPointerDown:T,onPointerMove:R,onPointerUp:H,onPointerCancel:F}:{},dismissAreaStyle:e?{touchAction:V?"none":"pan-x"}:void 0}},Dh="[data-lightbox-scrollable]",sc=()=>{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,l=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 s=d=>{const c=d.target;c instanceof Element&&c.closest(Dh)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},Vh=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Gh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},qh=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Kh=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(y,w)=>{Gh(t),e.scrollLeft=y,w&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,b=0;const S=()=>{t.removeEventListener("transitionend",C),clearTimeout(b)},C=y=>{y.target!==t||y.propertyName!=="transform"||m||(m=!0,S(),u(n,!0))};return t.addEventListener("transitionend",C),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(()=>{m||(m=!0,S(),u(n,!0))},i+64),()=>{m||(m=!0,S(),u(s-qh(t),!1))}},to=300,Uh=900,Xh=1500,Yh="cubic-bezier(0.16, 1, 0.3, 1)",Jh=3e3,Zh=2,Qh=16,ef=.05,tf=1,No=.3,nf=50,of=20,vi=.004,Hi=["title1","title2","title3"],rf={title1:"1",title2:"2",title3:"3"},af={title1:"title1Color",title2:"title2Color",title3:"title3Color"},sf={title1:.02,title2:.02,title3:.02},Oo=e=>`max(${e}, ${of}px)`,lf=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]}},cf=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=lf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Nt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,df=e=>[Nt(e,"fontFamily"),Nt(e,"fontSettings"),{type:"row",items:[Nt(e,"fontSize"),Nt(e,"lineHeight"),Nt(e,"letterSpacing"),Nt(e,"wordSpacing")]},Nt(e,"textAlign"),Nt(e,"textAppearance")],uf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Hi.map(e=>[rf[e],df(e)]))}),Ga=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},lc=(e,t)=>Ga(e,t),jo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Xs=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ga(e.length,n),effective:lc(e.length,n)}},pf=(e,t,n,i,o,l,s)=>{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:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d},Gr=(e,t)=>{const n=i=>{const o=Nt(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]]}},mf=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),qr=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??sf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Jt(i,n)},gf=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:b,closeIcon:S,closeIconMaxWidth:C,closeIconColor:y,closeIconHoverColor:w,thumbnailTrigger:$,thumbnailVisibility:T,thumbnailObjectFit:R,thumbnailActive:M,thumbnailActiveColor:H,title1Width:F,title2Width:V,title3Width:P,title1MarginLeft:x=0,title2MarginLeft:U=0,title3MarginLeft:h=0,titleRowMarginBottom:E=0,titleHeaderLayout:A="desktop",contentMarginTop:j,iconMarginLeft:X}=n,ae=p=>v.scalingValue(p,i??!1),Z=c??n.thumnailSize??.03,q=ae(Z),N=ae(u),L=ae(m??.02),k=ae(b??0),K=ae(j??0),z=Oo(K),ne=ae(X??0),[_,ye]=a.useState(0),f=a.useRef(_);f.current=_;const ve=t[_],{title1:Y,title2:le,title3:$e}=cf(ve),oe=qr("title1",Gr(n,"title1"),i),xe=qr("title2",Gr(n,"title2"),i),G=qr("title3",Gr(n,"title3"),i),he=A==="mobile",be=!o&&(!i||l),ce=be,se=be,Le=be,Me=Fn(R),we=Me?{"--image-aspect-ratio":Sr(R)}:void 0,Se=!!(Y||le||$e),B=a.useMemo(()=>pf(e,Y,le,$e,oe,xe,G),[e,_,Y,le,$e,oe,xe,G]),Q=a.useMemo(()=>({title1Width:F,title2Width:V,title3Width:P}),[F,V,P]),W=a.useMemo(()=>B.map(p=>Q[p.widthKey]),[B,Q]),te=a.useMemo(()=>Ga(B.length,W),[B.length,W]),ie=a.useMemo(()=>lc(B.length,W),[B.length,W]),pe=a.useMemo(()=>B.filter(p=>p.prefix==="title1"),[B]),me=a.useMemo(()=>B.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[B]),fe=a.useMemo(()=>Xs(pe,Q),[pe,Q]),Ie=a.useMemo(()=>Xs(me,Q),[me,Q]),ee=a.useCallback((p,I)=>{const O=B.indexOf(p);if(!he||I==="single-row")return{effectiveWidth:ie[O]??0,resolvedWidth:te[O]??0,maxWidth:jo(O,te)};if(I==="two-row-top"){const Te=pe.indexOf(p);return{effectiveWidth:fe.effective[Te]??0,resolvedWidth:fe.resolved[Te]??0,maxWidth:jo(Te,fe.resolved)}}const ue=me.indexOf(p);return{effectiveWidth:Ie.effective[ue]??0,resolvedWidth:Ie.resolved[ue]??0,maxWidth:jo(ue,Ie.resolved)}},[me,Ie,ie,te,B,pe,fe,he]),ge=a.useCallback(p=>v.scalingValue(p,i??!1),[i]),Ae=ge(E??0),re=a.useMemo(()=>({title1MarginLeft:x,title2MarginLeft:U,title3MarginLeft:h}),[x,U,h]),D=a.useCallback(p=>B.slice(0,p+1).reduce((I,O,ue)=>I+(O!=null&&O.marginLeftKey?re[O.marginLeftKey]??0:0)+(te[ue]??0),0)+(he?0:x??0),[B,re,te,he,x]),Oe=a.useCallback(()=>he?0:x??0,[he,x]),We=a.useCallback(p=>me.slice(0,p).reduce((I,O,ue)=>I+(O.marginLeftKey?re[O.marginLeftKey]??0:0)+(Ie.resolved[ue]??0),0),[me,Ie.resolved,re]),et=a.useCallback(p=>{const I=me[p];return We(p)+(I.marginLeftKey?re[I.marginLeftKey]??0:0)+(Ie.resolved[p]??0)},[me,Ie.resolved,We,re]),Ye=(p,I)=>{const O=p.marginLeftKey?re[p.marginLeftKey]??0:0,{effectiveWidth:ue,resolvedWidth:Te,maxWidth:Ne}=ee(p,I),rt=o&&I==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...I==="single-row"?{gridArea:p.prefix}:{},width:ge(ue),...O>0?{marginLeft:ge(O)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),rt&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:ge(-O),width:`max(${ge(O)}, 10px)`,height:"100%",pointerEvents:"auto"}}),rt&&r.jsx("div",{"data-controls":p.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:ge(-vi/2),width:ge(vi),height:"100%",pointerEvents:"auto"}})]},p.className)},st=()=>{const p=he?-1:B.findIndex(ue=>ue.prefix==="title1"),I=!he&&(o||(x??0)>0)?(()=>{const ue=x??0,Te=p>=0?te[p]:F??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:0,width:`max(${ge(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,O=B.flatMap((ue,Te)=>{if(!ue.marginLeftKey)return[];const Ne=re[ue.marginLeftKey]??0,rt=mf(B,te,re,Te)+Oe();return r.jsx("div",{"data-controls":ue.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(te[Te]),style:{position:"absolute",top:0,left:ge(rt),width:`max(${ge(Ne)}, 10px)`,height:"100%",pointerEvents:"auto"}},ue.marginLeftKey)});return I?[I,...O]:O},mt=()=>B.map((p,I)=>{const O=jo(I,te),Te=D(I)-vi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(O),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ge(Te),width:ge(vi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),De=()=>me.flatMap((p,I)=>{if(!p.marginLeftKey)return[];const O=re[p.marginLeftKey]??0,ue=We(I),{resolvedWidth:Te}=ee(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:ge(ue),width:`max(${ge(O)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),it=()=>me.map((p,I)=>{const{maxWidth:O}=ee(p,"two-row-bottom"),Te=et(I)-vi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(O),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ge(Te),width:ge(vi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),$t=a.useRef(null),ot=a.useRef(null),Ue=a.useRef(null),ht=a.useRef(null),xt=a.useRef([]),ct=a.useRef([]),Mt=a.useRef(0),_t=a.useRef(null),Qe=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Tt=a.useRef(null),Lt=a.useRef(null),Ge=a.useRef(0),qe=a.useRef("forward"),Pe=a.useRef(0),gt=a.useRef(null),It=a.useRef(!1),kt=t.length>1&&(!o||!!l),Dt=kt?3:1,en=a.useMemo(()=>Array.from({length:Dt},()=>t).flat(),[t,Dt]),[on,bt]=a.useState(!1),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState(!0),Zt=a.useRef(null),Ce=a.useRef(null),je=a.useRef(!1),Ke=a.useRef(!1),He=a.useRef(null),Be=a.useRef(null),dt=ce&&!Kt,_e=a.useCallback(()=>{ce&&(ft(!0),Be.current&&clearTimeout(Be.current),Be.current=setTimeout(()=>{Qe.current.isActive||ft(!1)},Jh))},[ce]),Ze=a.useCallback(()=>{o||Ke.current||(Ke.current=!0,Ut(!1),He.current=setTimeout(()=>{s()},to))},[o,s]),tt=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":dt?"true":"false",style:{width:v.scalingValue(C??0,i),height:v.scalingValue(C??0,i),marginRight:ne,"--close-icon-hover-color":w},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ze,"aria-label":"Close",children:r.jsx(dn,{url:S,fill:y,hoverFill:i&&!l?y:w,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:ne,height:"100%",pointerEvents:"auto"}})]}),Wt=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ge(x??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),Ct=()=>{const p=B.find(ue=>ue.prefix==="title1"),I=B.filter(ue=>ue.prefix==="title2"||ue.prefix==="title3"),O=I.length>0||o||(E??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(x??0)>0||o?Wt():null,p&&Ye(p,"two-row-top"),S&&tt()]}),O?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[I.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[I.map(ue=>Ye(ue,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[De(),it()]})]}):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:Ae,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},at=()=>r.jsxs(r.Fragment,{children:[(x??0)>0||o?Wt("single-row"):null,B.map(p=>Ye(p,"single-row")),o?r.jsxs(r.Fragment,{children:[st(),mt()]}):null,S?tt():null]}),Ht=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:At,backdropStyle:Vt,mediaAreaStyle:Bt,overlayContentStyle:Pt,swipeHandlers:Qt,dismissAreaStyle:wt}=ac({enabled:be??!1,onClose:Ze,animMs:to,isBlockedTarget:Ht}),Gt=()=>{if(!kt||t.length===0)return Mt.current=0,0;const p=ct.current[0],I=ct.current[t.length];if(!p||!I)return Mt.current;const O=I.offsetLeft-p.offsetLeft;return O>0&&(Mt.current=O),Mt.current},ut=(p=!1)=>{if(!kt)return;const I=ot.current,O=Gt();!I||O<=0||O<I.clientWidth*.25||(I.scrollLeft<=0?(I.scrollLeft+=O,p&&(Qe.current.scrollLeft+=O),It.current&&(Pe.current+=O)):I.scrollLeft>=O*2&&(I.scrollLeft-=O,p&&(Qe.current.scrollLeft-=O),It.current&&(Pe.current-=O)))},Ft=(p,I=(O=>(O=ot.current)==null?void 0:O.scrollLeft)()??0)=>{if(!kt)return p;let ue=t.length+p,Te=1/0;for(let Ne=0;Ne<Dt;Ne++){const rt=Ne*t.length+p,yt=ct.current[rt];if(!yt)continue;const tn=Math.abs(yt.offsetLeft-I);tn<Te&&(Te=tn,ue=rt)}return ue},zt=p=>{const I=ot.current;return!p||!I?!1:p.offsetWidth>I.clientWidth+1},g=p=>{const I=ot.current;if(!p||!I||!zt(p))return!1;const O=p.offsetLeft,ue=O+p.offsetWidth;return I.scrollLeft>=O-1&&I.scrollLeft+I.clientWidth<=ue+1},de=(p=(I=>(I=ot.current)==null?void 0:I.scrollLeft)()??0)=>{for(let ue=0;ue<ct.current.length;ue+=1){const Te=ct.current[ue];if(Te&&g(Te))return ue}let O={flatIndex:0,distance:1/0};return ct.current.forEach((ue,Te)=>{if(!ue)return;const Ne=Math.abs(ue.offsetLeft-p);Ne<O.distance&&(O={flatIndex:Te,distance:Ne})}),O.flatIndex},Ee=p=>{ot.current&&ct.current.forEach(I=>{I&&(I.style.scrollSnapAlign=zt(I)&&p==="backward"?"end":"start")})},Re=(p,I,O)=>{const ue=p-I,Te=de(I),Ne=ct.current[Te];if(g(Ne))return de(p)%t.length;const rt=ct.current[Te+1],yt=Ne?rt?rt.offsetLeft-Ne.offsetLeft:Ne.offsetWidth:0,tn=yt>0?ue>yt*No?1:ue<-yt*No?-1:0:0;return tn===0?O:kt?(O+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,O+tn))},Je=a.useCallback((p=!1)=>{if(T!=="on"||o)return;const I=ht.current,O=f.current,ue=xt.current[O];if(!I||!ue||I.scrollWidth<=I.clientWidth)return;const Te=I.scrollLeft,Ne=Te+I.clientWidth,rt=ue.offsetLeft,yt=rt+ue.offsetWidth;if(rt>=Te&&yt<=Ne)return;const tn=I.scrollWidth-I.clientWidth;let Xt=Te;if(!p&&Zt.current===null){const fi=xt.current[O-1],Gi=xt.current[O+1],Io=fi?ue.offsetLeft-fi.offsetLeft:Gi?Gi.offsetLeft-ue.offsetLeft:ue.offsetWidth;yt>Ne?Xt+=Io:rt<Te&&(Xt-=Io)}else yt>Ne?Xt=yt-I.clientWidth:Xt=rt;I.scrollLeft=Math.max(0,Math.min(tn,Xt))},[o,T]),Et=a.useCallback((p=!1)=>{p&&(je.current=!0),Ce.current===null&&(Ce.current=requestAnimationFrame(()=>{Ce.current=null;const I=je.current;je.current=!1,Je(I)}))},[Je]),Ve=a.useCallback(p=>{if(p===f.current)return;const I=f.current;f.current=p;const O=Math.abs(p-I)>1,ue=kt&&t.length>1&&(I===t.length-1&&p===0||I===0&&p===t.length-1);ye(p),Et(O||ue)},[t.length,kt,Et]),nt=()=>{if(!ot.current||t.length===0||Zt.current!==null||Qe.current.isActive&&Qe.current.hasMoved)return;const p=ot.current.scrollLeft,I=de(p)%t.length;I!==f.current&&Ve(I)},Ot=()=>{Zt.current=null},St=p=>{const I=ot.current;I&&(I.style.scrollSnapType=p?"":"none")},ln=()=>{var p;(p=Lt.current)==null||p.call(Lt),Lt.current=null},un=()=>{gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null),It.current=!1},Zn=()=>{const p=ot.current;if(!p){gt.current=null,It.current=!1;return}const I=Pe.current-p.scrollLeft;if(Math.abs(I)<.5){p.scrollLeft=Pe.current,ut(),nt(),gt.current=null,It.current=!1;return}p.scrollLeft+=I*ef,ut(),nt(),_e(),gt.current=requestAnimationFrame(Zn)},Qn=()=>{const p=Ue.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},$o=(p,I,O,ue)=>{Qn(),p.scrollLeft=I,Ge.current=p.scrollLeft,ut(),O!==void 0?(f.current=O,ye(O)):nt(),St(!0),ue==null||ue()},Co=(p,{behavior:I="smooth",activeIndex:O,onComplete:ue}={})=>{const Te=ot.current,Ne=Ue.current;if(!Te||!Ne)return;if(un(),ln(),St(!1),I==="auto"){$o(Te,p,O,ue);return}const rt=Math.abs(p-Te.scrollLeft),yt=Vh(rt,Uh,Xh,Te.clientWidth*.55);Lt.current=Kh(Te,Ne,p,{duration:yt,easing:Yh,onComplete:()=>{Lt.current=null,$o(Te,p,O,ue)}})},Cr=(p="smooth")=>{const I=ot.current;if(!I||t.length===0)return;const O=de()%t.length,ue=Ft(O,I.scrollLeft),Te=ct.current[ue];Te&&Co(Te.offsetLeft,{behavior:p,activeIndex:O})},Tr=(p,I="smooth",O,ue)=>{const Te=ot.current;if(!Te||t.length===0)return;const Ne=(ue??Te.scrollLeft)-p,rt=de(p),yt=ct.current[rt];if(g(yt)){St(!0),nt();return}const tn=ct.current[rt+1],Xt=yt?tn?tn.offsetLeft-yt.offsetLeft:yt.offsetWidth:0;if((Xt>0?Ne>Xt*No?1:Ne<-Xt*No?-1:0:0)!==0){const gc=O??rt%t.length,hc=Re(ue??Te.scrollLeft,p,gc);Sn(hc,I);return}const Gi=ue??Te.scrollLeft,Io=de(Gi),qa=ct.current[Io];if(qa&&Math.abs(qa.offsetLeft-Gi)<1){St(!0),nt();return}Cr("auto")},Sn=(p,I="smooth")=>{const O=ot.current;if(!O||t.length===0)return;const ue=Ft(p,O.scrollLeft),Te=ct.current[ue];Te&&(I==="smooth"?Zt.current=p:Zt.current=null,f.current=p,ye(p),Et(!0),Co(Te.offsetLeft,{behavior:I,activeIndex:p,onComplete:I==="smooth"?Ot:void 0}))},hi=()=>{Tt.current&&(window.removeEventListener("pointerup",Tt.current),window.removeEventListener("pointercancel",Tt.current),Tt.current=null)},To=(p,I,O,ue,Te)=>{const Ne=O-p,rt=ue-I,yt=Math.abs(Ne),tn=Math.abs(rt);if(yt<nf||yt<=tn)return!1;const Xt=Ne<0?1:-1,fi=kt?(Te+Xt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Te+Xt));return fi===Te?!1:(Sn(fi),!0)},ei=p=>{if(!Qe.current.isActive)return;hi();const I=ot.current;if(!I)return;const{scrollLeft:O,startActiveIndex:ue,hasMoved:Te}=Qe.current,Ne=I.scrollLeft;ut(!0),Qe.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},bt(!1),p!==void 0&&I.hasPointerCapture(p)&&I.releasePointerCapture(p),Te?Tr(O,"smooth",ue,Ne):(St(!0),nt()),_e()},Lo=(p,I)=>{const O=_t.current;_t.current=null,O&&(To(O.startX,O.startY,p,I,O.startActiveIndex),_e())},Lr=p=>{if(!se)return;if(p.pointerType==="touch"){if(un(),St(!0),Ht(p.target))return;_t.current={startX:p.clientX,startY:p.clientY,startActiveIndex:f.current};return}if(p.pointerType!=="mouse"||p.button!==0||Ht(p.target))return;const I=ot.current;if(!I)return;un(),ln(),Qn(),Zt.current=null,Qe.current={isActive:!0,startX:p.clientX,scrollLeft:I.scrollLeft,startActiveIndex:f.current,hasMoved:!1},St(!1),_e(),I.setPointerCapture(p.pointerId),hi();const O=ue=>{ue.pointerType==="mouse"&&ei(ue.pointerId)};Tt.current=O,window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)},Ir=p=>{if(!se||p.pointerType!=="mouse")return;const I=ot.current;if(!I||!Qe.current.isActive)return;if(p.buttons===0){ei(p.pointerId);return}const O=p.clientX-Qe.current.startX;Math.abs(O)>tf&&(Qe.current.hasMoved=!0,bt(!0)),Qe.current.hasMoved&&(p.preventDefault(),I.scrollLeft=Qe.current.scrollLeft-O,ut(!0),nt(),_e())},J=p=>{if(se){if(p.pointerType==="touch"){p.type==="pointerup"?Lo(p.clientX,p.clientY):_t.current=null;return}p.pointerType==="mouse"&&ei(p.pointerId)}},ke=p=>{!se||p.pointerType!=="mouse"||ei(p.pointerId)};return sc(),a.useEffect(()=>{const p=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(p),ln(),hi(),Ce.current!==null&&(cancelAnimationFrame(Ce.current),Ce.current=null),He.current&&clearTimeout(He.current),Be.current&&clearTimeout(Be.current)}},[]),a.useEffect(()=>{if(!ce){ft(!0);return}_e();const p=$t.current;if(!p)return;const I=()=>_e();return p.addEventListener("pointermove",I),p.addEventListener("pointerdown",I),()=>{p.removeEventListener("pointermove",I),p.removeEventListener("pointerdown",I),Be.current&&clearTimeout(Be.current)}},[ce,_e]),a.useEffect(()=>{const p=I=>{I.key==="Escape"&&Ze()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Ze]),a.useLayoutEffect(()=>{Gt()},[k,t.length,kt]),a.useLayoutEffect(()=>{o||Sn(f.current,"auto")},[k,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,kt]),a.useEffect(()=>{const p=ot.current;if(!p||o||!be)return;const I=O=>{if(O.preventDefault(),Math.abs(O.deltaY)<=Math.abs(O.deltaX))return;const ue=O.deltaMode===1?Qh:O.deltaMode===2?p.clientHeight:1,Te=O.deltaY*ue*Zh;if(Te!==0){if(ln(),It.current||(It.current=!0,Pe.current=p.scrollLeft,Zt.current=null,St(!1)),Pe.current+=Te,!kt){const Ne=p.scrollWidth-p.clientWidth;Pe.current=Math.max(0,Math.min(Ne,Pe.current))}_e(),gt.current===null&&(gt.current=requestAnimationFrame(Zn))}};return p.addEventListener("wheel",I,{passive:!1}),()=>{p.removeEventListener("wheel",I),un()}},[o,be,kt]),a.useEffect(()=>{const p=ot.current;if(!p)return;const I=()=>{ut(Qe.current.isActive);const ue=p.scrollLeft,Te=ue-Ge.current;Ge.current=ue;const Ne=Mt.current>0?Mt.current*.5:1/0;if(Te!==0&&Math.abs(Te)<Ne){const rt=Te>0?"forward":"backward";rt!==qe.current&&(qe.current=rt,Ee(rt))}Qe.current.isActive&&Qe.current.hasMoved||nt()};p.addEventListener("scroll",I,{passive:!0});const O=new ResizeObserver(()=>{Gt(),ut(Qe.current.isActive),Ee(qe.current),nt()});return O.observe(p),()=>{ln(),p.removeEventListener("scroll",I),O.disconnect()}},[t.length,kt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{At||Ze()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Rt?1:0,transition:`opacity ${to}ms ease`,pointerEvents:Rt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),r.jsxs("div",{ref:$t,className:`${e}-lightbox-dismiss-area`,style:wt,...Qt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Bt,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:ot,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":se&&t.length>0?"true":"false","data-mouse-dragging":on?"true":"false",onPointerDown:Lr,onPointerMove:Ir,onPointerUp:J,onPointerCancel:J,onLostPointerCapture:ke,children:r.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:k},children:en.map((p,I)=>{const O=p.image.objectFit??"contain",ue=I%t.length,Te=Math.floor(I/t.length),Ne=Oo(k),rt=`calc(-0.5 * (${Ne} + ${k}))`;return r.jsxs("div",{ref:yt=>ct.current[I]=yt,className:`${e}-strip-item`,style:{height:A==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:O}}),o&&ue<t.length-1&&Te===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:rt,width:Ne,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Te}-${p.image.url}-${ue}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":dt?"true":"false",style:Pt,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${he?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||S)&&r.jsx("div",{className:`${e}-header ${he?`${e}-header-two-row`:`${e}-header-single-row`}`,children:he?Ct():Se||S?at():null})})})]}),t.length>1&&T==="on"&&(()=>{const p=Oo(L),I=`calc(-0.5 * (${L} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:r.jsx("div",{ref:ht,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:O=>O.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":M,style:{gap:N,"--thumbnail-active-color":H},children:[t.map((O,ue)=>{const Te=Oo(N),Ne=`calc(-0.5 * (${Te} + ${N}))`;return r.jsxs("div",{ref:rt=>{xt.current[ue]=rt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":_===ue?"true":"false",onClick:()=>be&&$==="click"&&Sn(ue),onMouseEnter:()=>Le&&$==="hover"&&Sn(ue),"aria-label":O.image.name?`View ${O.image.name}`:`View image ${ue+1}`,"aria-current":_===ue?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Me?` ${e}-thumb-image-cover`:""}`,src:O.image.url,alt:"",draggable:!1,style:{...we,maxWidth:q,maxHeight:q,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&ue<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ne,width:Te,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${O.image.url}-${ue}`)}),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:I,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function hf(e){return`
|
|
12918
12958
|
.${e}-wrapper {
|
|
12919
12959
|
position: relative;
|
|
12920
12960
|
width: 100%;
|
|
@@ -13311,7 +13351,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
13311
13351
|
pointer-events: auto;
|
|
13312
13352
|
z-index: 10;
|
|
13313
13353
|
}
|
|
13314
|
-
`}const
|
|
13354
|
+
`}const ff=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=v.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[m,b]=a.useState(!1),S=t??[],C=m&&S.length>0,y=()=>{S.length!==0&&b(!0)};return a.useEffect(()=>{!n||i||o||b(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:hf(s)}}),d&&r.jsx("div",{className:`${s}-cover ${Fn(c)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:()=>y(),style:{...Fn(c)?{"--image-aspect-ratio":Sr(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${Fn(c)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})})]}),C&&typeof document<"u"&&(()=>{const w=(l?document.getElementById(l):null)??document.body;return mi.createPortal(r.jsx(gf,{prefix:s,images:S,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>b(!1)}),w)})()]})},yf=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
13315
13355
|
import { createPortal } from 'react-dom';
|
|
13316
13356
|
import { CommonComponentProps } from '../props';
|
|
13317
13357
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -13869,7 +13909,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
13869
13909
|
</>
|
|
13870
13910
|
);
|
|
13871
13911
|
};
|
|
13872
|
-
`,mf="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>'),ai={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 gf(e){const t={};return t[Nt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Nt(e,"fontSettings")]={...ai.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Nt(e,"fontSize")]={...ai.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Nt(e,"lineHeight")]={...ai.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Nt(e,"letterSpacing")]={...ai.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Nt(e,"wordSpacing")]={...ai.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Nt(e,"textAlign")]={...ai.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Nt(e,"textAppearance")]={...ai.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const hf=Hi.reduce((e,t)=>({...e,...gf(t)}),{}),ff=Hi.reduce((e,t)=>({...e,[Nt(t,"fontFamily")]:"Goudy Bookletter 1911",[Nt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Nt(t,"letterSpacing")]:0,[Nt(t,"wordSpacing")]:0,[Nt(t,"textAlign")]:"left",[Nt(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[Nt(n,"fontSize")]=i),o!==void 0&&(t[Nt(n,"lineHeight")]=o),t},{})}const yf=af(),vf={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:"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"}},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:"common",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...hf,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:mf,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...ff},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Kr({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,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Kr({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,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Kr({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:[yf]}],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"}]}},xf={element:uf,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:vf,sourceCode:pf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Hi.map(e=>({path:`${Nt(e,"fontFamily")}`}))]},fontRelations:{...Hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Nt(t,"fontFamily")}`}),{})}},bf=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:v,coverFit:b,backgroundColor:S,imageGap:y,maxWidth:w,maxHeight:C,textTransition:L,title1Width:k,title2Width:A,title3Width:O,title1MarginLeft:P=0,title2MarginLeft:D=0,title3MarginLeft:R=0,titleRowMarginBottom:x=0,titleHeaderLayout:U="single-row",countCloseGap:h=0,closeIcon:I,closeIconMaxWidth:W,closeIconColor:V,closeIconHoverColor:Y,contentMarginTop:ae=0,iconMarginRight:Z=0}=n,G=a.useCallback(J=>E.scalingValue(J,i??!1),[i]),H=G(y??0),$=`${w}%`,M=`${C}%`,q=G(h),B=G(ae),ee=G(Z),_=ci("title1",li(n,"title1"),i),ye=ci("title2",li(n,"title2"),i),f=ci("title3",li(n,"title3"),i),ve=ci("count",li(n,"count"),i),K=U==="mobile",le=!i||!!s,$e=!o&&(!i||!!s),oe=a.useMemo(()=>Uo(t,v),[t,v]),[fe,X]=a.useState(l),be=oe[fe],xe=be==null?void 0:be.entry,[pe,se]=a.useState(!1),[Re,ke]=a.useState(null),[we,Se]=a.useState(!1),[z,re]=a.useState(null),[F,te]=a.useState(!1),[ne,ue]=a.useState(0),[me,he]=a.useState(),[Le,Q]=a.useState(),[ge,Ae]=a.useState(null),ie=a.useRef(null),j=a.useRef(0),Oe=a.useRef(0),Fe=a.useRef(0),et=a.useRef(!1),Ye=a.useRef(null),at=a.useRef(null),mt=a.useRef(null),De=a.useRef(null),it=a.useRef(null),$t=a.useRef(null),ot=a.useRef(null),Ue=a.useCallback(()=>{const J=at.current;if(!J)return;const Me=J.closest(`.${e}-lightbox-content-area`);if(!Me)return J.getBoundingClientRect().width;const p=Array.from(Me.children).reduce((T,N)=>!(N instanceof HTMLElement)||N.contains(J)?T:T+N.getBoundingClientRect().width,0);return Me.getBoundingClientRect().width-p},[e]),ht=a.useCallback(()=>{ie.current&&(clearTimeout(ie.current),ie.current=null)},[]),xt=a.useCallback(J=>{J===j.current&&(re(null),te(!1))},[]),ct=a.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),se(!1),Ye.current=setTimeout(()=>{m()},300))},[o,u,m]),Mt=a.useCallback(J=>!!(J.closest("[data-controls]")||J.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:_t,backdropStyle:Qe,mediaAreaStyle:Tt,overlayContentStyle:Lt,swipeHandlers:Ge,dismissAreaStyle:qe}=ic({enabled:$e,onClose:ct,animMs:300,isBlockedTarget:Mt}),Pe=a.useCallback(J=>{d&&Ol(J+1,c,!0)},[d,c]),gt=a.useCallback(J=>{if(J)return J.getBoundingClientRect().height},[]),It=a.useCallback(J=>{if(oe.length===0)return;const Me=(J%oe.length+oe.length)%oe.length;if(Me===fe)return;const p=oe[fe],T=oe[Me];j.current+=1;const N=j.current,de=L==="fade"&&Ss(p==null?void 0:p.entry)!==Ss(T==null?void 0:T.entry),Te=gt(mt.current),Ne=de?(()=>{const yt=Ue();mi.flushSync(()=>{Ae(T.entry)}),mt.current&&yt&&(mt.current.style.width=`${yt}px`);const tn=gt(mt.current);return mt.current&&(mt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:yt}})():void 0,rt=Math.max(Te??0,(Ne==null?void 0:Ne.measuredIncomingTitlesHeight)??0)||void 0;ue(N),re(fe),te(!0),X(Me),Pe(Me),Fe.current=Me,de?(ht(),rt&&he(rt),Ne!=null&&Ne.incomingTitlesMeasureWidth&&Q(Ne.incomingTitlesMeasureWidth),ke((p==null?void 0:p.entryIndex)??null),Se(!0),Oe.current=T.entryIndex,ie.current=setTimeout(()=>{ke(null),Se(!1),he(void 0),Q(void 0),Ae(null),ie.current=null},400)):(ht(),ke(null),Se(!1),he(void 0),Q(void 0),Ae(null),Oe.current=T.entryIndex)},[fe,ht,Ue,gt,oe,Pe,L]),kt=a.useCallback(()=>{ot.current=null},[]),Dt=a.useCallback(J=>{!le||oe.length<=1||J.pointerType==="mouse"&&J.button!==0||J.target.closest("[data-controls]")||(ot.current={startX:J.clientX,startY:J.clientY,pointerId:J.pointerId})},[le,oe.length]),en=a.useCallback(J=>{var yt;if(!le||oe.length<=1||J.pointerType==="mouse"&&J.button!==0)return;if(_t){kt();return}const Me=ot.current;if(!Me||Me.pointerId!==J.pointerId||(kt(),J.target.closest("[data-controls]")))return;const T=J.clientX-Me.startX,N=J.clientY-Me.startY,de=Math.abs(T),Te=Math.abs(N);if(de>=Am&&de>Te){It(T>0?fe-1:fe+1);return}if(de>vs||Te>vs)return;const Ne=(yt=De.current)==null?void 0:yt.getBoundingClientRect(),rt=Ne?Ne.left+Ne.width/2:window.innerWidth/2;It(J.clientX<rt?fe-1:fe+1)},[fe,le,It,_t,kt,oe.length]),on=a.useCallback(J=>{const Me=ot.current;(Me==null?void 0:Me.pointerId)===J.pointerId&&kt()},[kt]);oc(),a.useEffect(()=>{$t.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const J=requestAnimationFrame(()=>{se(!0),requestAnimationFrame(()=>{it.current?it.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(J),Ye.current&&clearTimeout(Ye.current),ie.current&&clearTimeout(ie.current);const Me=$t.current;Me&&document.contains(Me)&&Me.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var J;L!=="fade"&&(Oe.current=((J=oe[fe])==null?void 0:J.entryIndex)??0,ht(),ke(null),Se(!1),he(void 0),Q(void 0))},[fe,ht,oe,L]),a.useEffect(()=>{const J=Me=>{if(Me.key==="Escape"){ct();return}if(Me.key==="ArrowLeft"&&oe.length>1){It(fe-1);return}if(Me.key==="ArrowRight"&&oe.length>1){It(fe+1);return}if(Me.key==="Tab"&&De.current){const p=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),T=Array.from(p).filter(Ne=>!Ne.closest('[aria-hidden="true"]'));if(T.length===0)return;const N=T[0],de=T[T.length-1],Te=document.activeElement;Me.shiftKey?(Te===N||!De.current.contains(Te))&&(Me.preventDefault(),de.focus()):(Te===de||!De.current.contains(Te))&&(Me.preventDefault(),N.focus())}};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[It,ct,fe,oe.length]),a.useLayoutEffect(()=>{ht(),j.current=0,ue(0),re(null),te(!1),ke(null),Se(!1),he(void 0),Q(void 0),Ae(null),X(J=>{const Me=Math.max(0,oe.length-1);return Math.min(J,Me)})},[ht,t.length,v,oe.length]),a.useLayoutEffect(()=>{var p;const J=Math.max(0,oe.length-1),Me=Math.min(Math.max(0,l),J);Fe.current=Me,Oe.current=((p=oe[Me])==null?void 0:p.entryIndex)??0,X(Me)},[l]);const bt=Re!==null?t[Re]:null,Rt=z!==null?oe[z]:null,Ut=(xe==null?void 0:xe.title1)||(xe==null?void 0:xe.title2)||(xe==null?void 0:xe.title3)||(bt==null?void 0:bt.title1)||(bt==null?void 0:bt.title2)||(bt==null?void 0:bt.title3),Kt=zm(v,oe,t),ft=I!==null,Jt=Ut||Kt||ft,Ce=Kt&&ft?{gap:q}:void 0,je=`${e}-titles-stack${K?` ${e}-titles-stack-stacked`:""}`,Ke=`${e}-titles-layer-out${K?` ${e}-titles-layer-out-stacked`:""}`,He=`${e}-titles-layer-out`,ze=(P??0)>0||o,dt=G(x),_e=a.useMemo(()=>({title1Width:k??Ti.title1Width,title2Width:A??Ti.title2Width,title3Width:O??Ti.title3Width}),[k,A,O]),Ze=a.useMemo(()=>({title2MarginLeft:D,title3MarginLeft:R}),[D,R]),tt=a.useMemo(()=>xe?Dn(e,xe,_,ye,f):[],[e,xe,_,ye,f]),Ft=a.useMemo(()=>tt.map(J=>_e[J.widthKey]),[tt,_e]),Ct=a.useMemo(()=>ki(tt.length,Ft),[tt.length,Ft]),st=a.useMemo(()=>co(tt.length,Ft),[tt.length,Ft]),Ht=a.useMemo(()=>tt.filter(J=>J.prefix==="title1"),[tt]),At=a.useMemo(()=>tt.filter(J=>J.prefix==="title2"||J.prefix==="title3"),[tt]),Vt=a.useMemo(()=>Vn(Ht,_e),[Ht,_e]),zt=a.useMemo(()=>Vn(At,_e),[At,_e]),Pt=a.useCallback((J,Me)=>{const p=tt.findIndex(N=>N.prefix===J.prefix);if(!K||Me==="single-row")return{effectiveWidth:st[p]??0,resolvedWidth:Ct[p]??0,maxWidth:an(p,Ct)};if(Me==="two-row-top"){const N=Ht.findIndex(de=>de.prefix===J.prefix);return{effectiveWidth:Vt.effective[N]??0,resolvedWidth:Vt.resolved[N]??0,maxWidth:an(N,Vt.resolved)}}const T=At.findIndex(N=>N.prefix===J.prefix);return{effectiveWidth:zt.effective[T]??0,resolvedWidth:zt.resolved[T]??0,maxWidth:an(T,zt.resolved)}},[tt,At,zt,st,Ct,Ht,Vt,K]),Zt=a.useCallback(J=>Dl(tt,Ct,Ze,J)+(K?0:P??0),[tt,Ct,Ze,K,P]),wt=a.useCallback(()=>K?0:P??0,[K,P]),Gt=a.useCallback(J=>At.slice(0,J).reduce((Me,p,T)=>Me+(p.marginLeftKey?Ze[p.marginLeftKey]??0:0)+(zt.resolved[T]??0),0),[At,zt.resolved,Ze]),ut=a.useCallback(J=>{const Me=At[J];return Gt(J)+(Me.marginLeftKey?Ze[Me.marginLeftKey]??0:0)+(zt.resolved[J]??0)},[At,zt.resolved,Gt,Ze]),Wt=a.useCallback((J,Me,p)=>{if(!K||p==="single-row"){const Ne=J.findIndex(Xt=>Xt.prefix===Me.prefix),rt=J.map(Xt=>_e[Xt.widthKey]),yt=ki(J.length,rt);return{effectiveWidth:co(J.length,rt)[Ne]??0,resolvedWidth:yt[Ne]??0,maxWidth:an(Ne,yt)}}if(p==="two-row-top"){const Ne=J.filter(Xt=>Xt.prefix==="title1"),rt=Ne.findIndex(Xt=>Xt.prefix===Me.prefix),{resolved:yt,effective:tn}=Vn(Ne,_e);return{effectiveWidth:tn[rt]??0,resolvedWidth:yt[rt]??0,maxWidth:an(rt,yt)}}const T=J.filter(Ne=>Ne.prefix==="title2"||Ne.prefix==="title3"),N=T.findIndex(Ne=>Ne.prefix===Me.prefix),{resolved:de,effective:Te}=Vn(T,_e);return{effectiveWidth:Te[N]??0,resolvedWidth:de[N]??0,maxWidth:an(N,de)}},[_e,K]),Bt=(J,Me,p)=>{const T=J.marginLeftKey?Ze[J.marginLeftKey]??0:0,{effectiveWidth:N,resolvedWidth:de,maxWidth:Te}=p??Pt(J,Me),Ne=Math.max(T,Bn),rt=o&&Me==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":J.prefix,style:{width:G(N),...T>0?{marginLeft:G(T)}:{}},children:[r.jsx("p",{className:J.className,style:J.style,children:J.text}),rt&&J.marginLeftKey?r.jsx("div",{"data-controls":J.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(de),style:{position:"absolute",top:0,left:G(-T),width:G(Ne),height:"100%",pointerEvents:"auto"}}):null,rt?r.jsx("div",{"data-controls":J.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Te),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:G(-mn/2),width:G(mn),height:"100%",pointerEvents:"auto"}}):null]},J.className)},g=(J="two-row")=>{const Me=tt.findIndex(N=>N.prefix==="title1"),p=Me>=0?Ct[Me]:_e.title1Width,T=J==="two-row"&&o;return r.jsx("div",{...T?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:G(P??0),flexShrink:0,alignSelf:"stretch",...T?{pointerEvents:"auto"}:{}}})},ce=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:_,"aria-hidden":"true",children:" "}),Ee=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ve,"aria-live":"polite","aria-atomic":"true",children:jm(oe,fe,v,t)}),Ie=()=>Kt?o&&ft?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ee(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Or(q)} + ${q}))`,width:Or(q),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ee():null,Je=()=>!Kt&&!ft?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ce,children:[Ie(),ft?nt():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?ce():null,ze?g("single-row"):null,St(xe),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Je(),Sn()]}),Ve=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?ce():null,ze?g("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:we&&me?{minHeight:me}:void 0,children:[r.jsx("div",{ref:mt,className:je,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Qn(ge||xe)}),r.jsxs("div",{ref:at,className:je,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%",...we&&Le?{width:Le,maxWidth:"100%"}:void 0},children:[bt&&we?r.jsx("div",{className:`${Ke} ${e}-titles-fade-out`,children:Qn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Qn(xe)})]})]}),Je(),Sn()]}),nt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(W??0,i),height:E.scalingValue(W??0,i),marginRight:ee,"--close-icon-hover-color":Y},children:[r.jsx("button",{ref:it,type:"button",className:`${e}-close-icon-inner`,onClick:ct,"aria-label":"Close",children:r.jsx(fn,{url:I??"",fill:V,hoverFill:i&&!s?V: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:ee,height:"100%",pointerEvents:"auto"}})]}),Ot=(J,Me)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Kt||Ut?ce():null,ze?g("two-row"):null,Me!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Me},children:J}):r.jsxs(r.Fragment,{children:[J,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Je()]}),St=J=>{if(!J)return null;const Me=Dn(e,J,_,ye,f);return r.jsx(r.Fragment,{children:Me.map(p=>Bt(p,"single-row",Wt(Me,p,"single-row")))})},ln=J=>{if(!J)return null;const Me=Dn(e,J,_,ye,f),p=Me.find(T=>T.prefix==="title1");return p?Bt(p,"two-row-top",Wt(Me,p,"two-row-top")):null},cn=(J,Me=!1)=>{const p=J?Dn(e,J,_,ye,f):[],T=p.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),N=o&&Me;return T.length>0||N||(x??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[T.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[T.map(Te=>Bt(Te,"two-row-bottom",Wt(p,Te,"two-row-bottom"))),Me&&o?r.jsxs(r.Fragment,{children:[Tr(),Lr()]}):null]}):null,(x??0)>0||N?r.jsx("div",{"data-controls":N?"titleRowMarginBottom":void 0,"data-controls-axis":N?"y":void 0,"data-controls-reverse":N?"":void 0,className:N?`${e}-control`:void 0,style:{height:dt,width:"100%",flexShrink:0,pointerEvents:N?"auto":"none"}}):null]}):null},Zn=(J,Me=!1)=>r.jsxs(r.Fragment,{children:[Ot(ln(J)),cn(J,Me)]}),Qn=J=>K?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Zn(J)}):J?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:St(J)}):null,$o=()=>{const J=K?-1:tt.findIndex(T=>T.prefix==="title1"),Me=!K&&(o||(P??0)>0)?(()=>{const T=P??0,N=J>=0?Ct[J]:_e.title1Width,de=Math.max(T,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(N),style:{position:"absolute",top:0,left:0,width:G(de),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=tt.flatMap((T,N)=>{if(!T.marginLeftKey)return[];const de=Ze[T.marginLeftKey]??0,Te=Bl(tt,Ct,Ze,N)+wt(),Ne=Math.max(de,Bn);return r.jsx("div",{"data-controls":T.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ct[N]),style:{position:"absolute",top:0,left:G(Te),width:G(Ne),height:"100%",pointerEvents:"auto"}},T.marginLeftKey)});return Me?[Me,...p]:p},Co=()=>tt.map((J,Me)=>{const p=an(Me,Ct),N=Zt(Me)-mn/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(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(N),width:G(mn),height:"100%",pointerEvents:"auto"}})},`${J.widthKey}-junction`)}),Tr=()=>At.flatMap((J,Me)=>{if(!J.marginLeftKey)return[];const p=Ze[J.marginLeftKey]??0,T=Gt(Me),N=Math.max(p,Bn),{resolvedWidth:de}=Pt(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(de),style:{position:"absolute",top:0,left:G(T),width:G(N),height:"100%",pointerEvents:"auto"}},J.marginLeftKey)}),Lr=()=>At.map((J,Me)=>{const{maxWidth:p}=Pt(J,"two-row-bottom"),N=ut(Me)-mn/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(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(N),width:G(mn),height:"100%",pointerEvents:"auto"}})},`${J.widthKey}-junction`)}),Sn=()=>!o||K?null:r.jsxs(r.Fragment,{children:[$o(),Co()]}),hi=J=>{const Me=!J.objectFit&&Wn(b);return{className:`${e}-slide-image-cell${Me?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:$,maxHeight:M,...Me?{"--image-aspect-ratio":$r(b)}:{}}}},To=J=>J.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":J.objectFit}}:Wn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ei=J=>{if(J.length===0)return null;const Me=J.length>1,p=Or(H),T=`calc(-0.5 * (${p} + ${H}))`;if(J.length===1){const N=J[0];return r.jsx("div",{...hi(N),children:r.jsx("img",{...To(N),src:N.url,alt:N.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Me?{gap:H}:void 0,children:J.map((N,de)=>r.jsxs("div",{...hi(N),children:[r.jsx("img",{...To(N),src:N.url,alt:N.name??"",draggable:!1}),o&&Me&&de<J.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:T,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${N.url}-${de}`))})},Lo=!!(xe!=null&&xe.title2||xe!=null&&xe.title3||bt!=null&&bt.title2||bt!=null&&bt.title3||(x??0)>0||o),Ir=()=>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:mt,className:je,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Zn(ge||xe)}),r.jsxs("div",{ref:at,className:`${e}-titles-row-two-row`,style:{...we&&me?{minHeight:me}:void 0,...we&&Le?{width:Le,maxWidth:"100%"}:void 0},children:[Ot(r.jsxs("div",{className:je,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%"},children:[bt&&we?r.jsx("div",{className:`${He} ${e}-titles-fade-out`,children:ln(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ln(xe)})]}),we&&me?me:void 0),Lo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[bt&&we?r.jsx("div",{className:`${Ke} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:cn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${K?` ${e}-titles-layer-in-stacked`:""}`,children:cn(xe,!0)})]}):null]})]}),Rr=()=>{const J=Lo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...J?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:J?void 0:{flex:"0 0 auto",height:"auto"},children:Zn(xe,!0)}),Sn()]})};return r.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{_t||ct()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:ft?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:S,...Qe}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...Ge,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Tt,onClick:J=>J.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":le&&oe.length>1?"true":"false",onPointerDown:le?Dt:void 0,onPointerUp:le?en:void 0,onPointerCancel:le?on:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Rt&&F?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:J=>{J.target===J.currentTarget&&xt(ne)},children:r.jsx("div",{className:`${e}-slide-area`,children:ei(Rt.images)})},`slide-out-${ne}`):null,r.jsx("div",{className:`${e}-slide-layer-in${F?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:be?ei(be.images):null})},`slide-in-${ne}-${fe}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Lt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:B,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...K?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${K?` ${e}-lightbox-content-area-stacked`:""}`,children:Jt&&r.jsx("div",{className:`${e}-text-bar-cell${K?` ${e}-text-bar-cell-stacked`:""}`,style:K?void 0:{flex:1,minWidth:0,width:"100%"},children:K?L==="fade"?Ir():Rr():L==="fade"?Ve():Et()})})})]})]})]})};function wf(e){return`
|
|
13912
|
+
`,vf="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>'),ai={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 xf(e){const t={};return t[Nt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Nt(e,"fontSettings")]={...ai.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Nt(e,"fontSize")]={...ai.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Nt(e,"lineHeight")]={...ai.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Nt(e,"letterSpacing")]={...ai.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Nt(e,"wordSpacing")]={...ai.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Nt(e,"textAlign")]={...ai.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Nt(e,"textAppearance")]={...ai.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const bf=Hi.reduce((e,t)=>({...e,...xf(t)}),{}),wf=Hi.reduce((e,t)=>({...e,[Nt(t,"fontFamily")]:"Goudy Bookletter 1911",[Nt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Nt(t,"letterSpacing")]:0,[Nt(t,"wordSpacing")]:0,[Nt(t,"textAlign")]:"left",[Nt(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[Nt(n,"fontSize")]=i),o!==void 0&&(t[Nt(n,"lineHeight")]=o),t},{})}const Sf=uf(),$f={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"}},...bf,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:vf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...wf},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,...Kr({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,...Kr({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,...Kr({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:[Sf]}],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"}]}},Cf={element:ff,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:$f,sourceCode:yf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Hi.map(e=>({path:`${Nt(e,"fontFamily")}`}))]},fontRelations:{...Hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Nt(t,"fontFamily")}`}),{})}},Tf=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:b,coverFit:S,backgroundColor:C,imageGap:y,maxWidth:w,maxHeight:$,textTransition:T,title1Width:R,title2Width:M,title3Width:H,title1MarginLeft:F=0,title2MarginLeft:V=0,title3MarginLeft:P=0,titleRowMarginBottom:x=0,titleHeaderLayout:U="single-row",countCloseGap:h=0,closeIcon:E,closeIconMaxWidth:A,closeIconColor:j,closeIconHoverColor:X,contentMarginTop:ae=0,iconMarginRight:Z=0}=n,q=a.useCallback(J=>v.scalingValue(J,i??!1),[i]),N=q(y??0),L=`${w}%`,k=`${$}%`,K=q(h),z=q(ae),ne=q(Z),_=ci("title1",li(n,"title1"),i),ye=ci("title2",li(n,"title2"),i),f=ci("title3",li(n,"title3"),i),ve=ci("count",li(n,"count"),i),Y=U==="mobile",le=!i||!!l,$e=!o&&(!i||!!l),oe=a.useMemo(()=>Uo(t,b),[t,b]),[xe,G]=a.useState(s),he=oe[xe],be=he==null?void 0:he.entry,[ce,se]=a.useState(!1),[Le,Me]=a.useState(null),[we,Se]=a.useState(!1),[B,Q]=a.useState(null),[W,te]=a.useState(!1),[ie,pe]=a.useState(0),[me,fe]=a.useState(),[Ie,ee]=a.useState(),[ge,Ae]=a.useState(null),re=a.useRef(null),D=a.useRef(0),Oe=a.useRef(0),We=a.useRef(0),et=a.useRef(!1),Ye=a.useRef(null),st=a.useRef(null),mt=a.useRef(null),De=a.useRef(null),it=a.useRef(null),$t=a.useRef(null),ot=a.useRef(null),Ue=a.useCallback(()=>{const J=st.current;if(!J)return;const ke=J.closest(`.${e}-lightbox-content-area`);if(!ke)return J.getBoundingClientRect().width;const p=Array.from(ke.children).reduce((I,O)=>!(O instanceof HTMLElement)||O.contains(J)?I:I+O.getBoundingClientRect().width,0);return ke.getBoundingClientRect().width-p},[e]),ht=a.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=null)},[]),xt=a.useCallback(J=>{J===D.current&&(Q(null),te(!1))},[]),ct=a.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),se(!1),Ye.current=setTimeout(()=>{m()},300))},[o,u,m]),Mt=a.useCallback(J=>!!(J.closest("[data-controls]")||J.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:_t,backdropStyle:Qe,mediaAreaStyle:Tt,overlayContentStyle:Lt,swipeHandlers:Ge,dismissAreaStyle:qe}=ac({enabled:$e,onClose:ct,animMs:300,isBlockedTarget:Mt}),Pe=a.useCallback(J=>{d&&zl(J+1,c,!0)},[d,c]),gt=a.useCallback(J=>{if(J)return J.getBoundingClientRect().height},[]),It=a.useCallback(J=>{if(oe.length===0)return;const ke=(J%oe.length+oe.length)%oe.length;if(ke===xe)return;const p=oe[xe],I=oe[ke];D.current+=1;const O=D.current,ue=T==="fade"&&Cs(p==null?void 0:p.entry)!==Cs(I==null?void 0:I.entry),Te=gt(mt.current),Ne=ue?(()=>{const yt=Ue();mi.flushSync(()=>{Ae(I.entry)}),mt.current&&yt&&(mt.current.style.width=`${yt}px`);const tn=gt(mt.current);return mt.current&&(mt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:yt}})():void 0,rt=Math.max(Te??0,(Ne==null?void 0:Ne.measuredIncomingTitlesHeight)??0)||void 0;pe(O),Q(xe),te(!0),G(ke),Pe(ke),We.current=ke,ue?(ht(),rt&&fe(rt),Ne!=null&&Ne.incomingTitlesMeasureWidth&&ee(Ne.incomingTitlesMeasureWidth),Me((p==null?void 0:p.entryIndex)??null),Se(!0),Oe.current=I.entryIndex,re.current=setTimeout(()=>{Me(null),Se(!1),fe(void 0),ee(void 0),Ae(null),re.current=null},400)):(ht(),Me(null),Se(!1),fe(void 0),ee(void 0),Ae(null),Oe.current=I.entryIndex)},[xe,ht,Ue,gt,oe,Pe,T]),kt=a.useCallback(()=>{ot.current=null},[]),Dt=a.useCallback(J=>{!le||oe.length<=1||J.pointerType==="mouse"&&J.button!==0||J.target.closest("[data-controls]")||(ot.current={startX:J.clientX,startY:J.clientY,pointerId:J.pointerId})},[le,oe.length]),en=a.useCallback(J=>{var yt;if(!le||oe.length<=1||J.pointerType==="mouse"&&J.button!==0)return;if(_t){kt();return}const ke=ot.current;if(!ke||ke.pointerId!==J.pointerId||(kt(),J.target.closest("[data-controls]")))return;const I=J.clientX-ke.startX,O=J.clientY-ke.startY,ue=Math.abs(I),Te=Math.abs(O);if(ue>=Nm&&ue>Te){It(I>0?xe-1:xe+1);return}if(ue>bs||Te>bs)return;const Ne=(yt=De.current)==null?void 0:yt.getBoundingClientRect(),rt=Ne?Ne.left+Ne.width/2:window.innerWidth/2;It(J.clientX<rt?xe-1:xe+1)},[xe,le,It,_t,kt,oe.length]),on=a.useCallback(J=>{const ke=ot.current;(ke==null?void 0:ke.pointerId)===J.pointerId&&kt()},[kt]);sc(),a.useEffect(()=>{$t.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const J=requestAnimationFrame(()=>{se(!0),requestAnimationFrame(()=>{it.current?it.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(J),Ye.current&&clearTimeout(Ye.current),re.current&&clearTimeout(re.current);const ke=$t.current;ke&&document.contains(ke)&&ke.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var J;T!=="fade"&&(Oe.current=((J=oe[xe])==null?void 0:J.entryIndex)??0,ht(),Me(null),Se(!1),fe(void 0),ee(void 0))},[xe,ht,oe,T]),a.useEffect(()=>{const J=ke=>{if(ke.key==="Escape"){ct();return}if(ke.key==="ArrowLeft"&&oe.length>1){It(xe-1);return}if(ke.key==="ArrowRight"&&oe.length>1){It(xe+1);return}if(ke.key==="Tab"&&De.current){const p=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),I=Array.from(p).filter(Ne=>!Ne.closest('[aria-hidden="true"]'));if(I.length===0)return;const O=I[0],ue=I[I.length-1],Te=document.activeElement;ke.shiftKey?(Te===O||!De.current.contains(Te))&&(ke.preventDefault(),ue.focus()):(Te===ue||!De.current.contains(Te))&&(ke.preventDefault(),O.focus())}};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[It,ct,xe,oe.length]),a.useLayoutEffect(()=>{ht(),D.current=0,pe(0),Q(null),te(!1),Me(null),Se(!1),fe(void 0),ee(void 0),Ae(null),G(J=>{const ke=Math.max(0,oe.length-1);return Math.min(J,ke)})},[ht,t.length,b,oe.length]),a.useLayoutEffect(()=>{var p;const J=Math.max(0,oe.length-1),ke=Math.min(Math.max(0,s),J);We.current=ke,Oe.current=((p=oe[ke])==null?void 0:p.entryIndex)??0,G(ke)},[s]);const bt=Le!==null?t[Le]:null,Rt=B!==null?oe[B]:null,Ut=(be==null?void 0:be.title1)||(be==null?void 0:be.title2)||(be==null?void 0:be.title3)||(bt==null?void 0:bt.title1)||(bt==null?void 0:bt.title2)||(bt==null?void 0:bt.title3),Kt=qm(b,oe,t),ft=E!==null,Zt=Ut||Kt||ft,Ce=Kt&&ft?{gap:K}:void 0,je=`${e}-titles-stack${Y?` ${e}-titles-stack-stacked`:""}`,Ke=`${e}-titles-layer-out${Y?` ${e}-titles-layer-out-stacked`:""}`,He=`${e}-titles-layer-out`,Be=(F??0)>0||o,dt=q(x),_e=a.useMemo(()=>({title1Width:R??Ti.title1Width,title2Width:M??Ti.title2Width,title3Width:H??Ti.title3Width}),[R,M,H]),Ze=a.useMemo(()=>({title2MarginLeft:V,title3MarginLeft:P}),[V,P]),tt=a.useMemo(()=>be?Dn(e,be,_,ye,f):[],[e,be,_,ye,f]),Wt=a.useMemo(()=>tt.map(J=>_e[J.widthKey]),[tt,_e]),Ct=a.useMemo(()=>ki(tt.length,Wt),[tt.length,Wt]),at=a.useMemo(()=>co(tt.length,Wt),[tt.length,Wt]),Ht=a.useMemo(()=>tt.filter(J=>J.prefix==="title1"),[tt]),At=a.useMemo(()=>tt.filter(J=>J.prefix==="title2"||J.prefix==="title3"),[tt]),Vt=a.useMemo(()=>Vn(Ht,_e),[Ht,_e]),Bt=a.useMemo(()=>Vn(At,_e),[At,_e]),Pt=a.useCallback((J,ke)=>{const p=tt.findIndex(O=>O.prefix===J.prefix);if(!Y||ke==="single-row")return{effectiveWidth:at[p]??0,resolvedWidth:Ct[p]??0,maxWidth:an(p,Ct)};if(ke==="two-row-top"){const O=Ht.findIndex(ue=>ue.prefix===J.prefix);return{effectiveWidth:Vt.effective[O]??0,resolvedWidth:Vt.resolved[O]??0,maxWidth:an(O,Vt.resolved)}}const I=At.findIndex(O=>O.prefix===J.prefix);return{effectiveWidth:Bt.effective[I]??0,resolvedWidth:Bt.resolved[I]??0,maxWidth:an(I,Bt.resolved)}},[tt,At,Bt,at,Ct,Ht,Vt,Y]),Qt=a.useCallback(J=>ql(tt,Ct,Ze,J)+(Y?0:F??0),[tt,Ct,Ze,Y,F]),wt=a.useCallback(()=>Y?0:F??0,[Y,F]),Gt=a.useCallback(J=>At.slice(0,J).reduce((ke,p,I)=>ke+(p.marginLeftKey?Ze[p.marginLeftKey]??0:0)+(Bt.resolved[I]??0),0),[At,Bt.resolved,Ze]),ut=a.useCallback(J=>{const ke=At[J];return Gt(J)+(ke.marginLeftKey?Ze[ke.marginLeftKey]??0:0)+(Bt.resolved[J]??0)},[At,Bt.resolved,Gt,Ze]),Ft=a.useCallback((J,ke,p)=>{if(!Y||p==="single-row"){const Ne=J.findIndex(Xt=>Xt.prefix===ke.prefix),rt=J.map(Xt=>_e[Xt.widthKey]),yt=ki(J.length,rt);return{effectiveWidth:co(J.length,rt)[Ne]??0,resolvedWidth:yt[Ne]??0,maxWidth:an(Ne,yt)}}if(p==="two-row-top"){const Ne=J.filter(Xt=>Xt.prefix==="title1"),rt=Ne.findIndex(Xt=>Xt.prefix===ke.prefix),{resolved:yt,effective:tn}=Vn(Ne,_e);return{effectiveWidth:tn[rt]??0,resolvedWidth:yt[rt]??0,maxWidth:an(rt,yt)}}const I=J.filter(Ne=>Ne.prefix==="title2"||Ne.prefix==="title3"),O=I.findIndex(Ne=>Ne.prefix===ke.prefix),{resolved:ue,effective:Te}=Vn(I,_e);return{effectiveWidth:Te[O]??0,resolvedWidth:ue[O]??0,maxWidth:an(O,ue)}},[_e,Y]),zt=(J,ke,p)=>{const I=J.marginLeftKey?Ze[J.marginLeftKey]??0:0,{effectiveWidth:O,resolvedWidth:ue,maxWidth:Te}=p??Pt(J,ke),Ne=Math.max(I,zn),rt=o&&ke==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":J.prefix,style:{width:q(O),...I>0?{marginLeft:q(I)}:{}},children:[r.jsx("p",{className:J.className,style:J.style,children:J.text}),rt&&J.marginLeftKey?r.jsx("div",{"data-controls":J.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ue),style:{position:"absolute",top:0,left:q(-I),width:q(Ne),height:"100%",pointerEvents:"auto"}}):null,rt?r.jsx("div",{"data-controls":J.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Te),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:q(-hn/2),width:q(hn),height:"100%",pointerEvents:"auto"}}):null]},J.className)},g=(J="two-row")=>{const ke=tt.findIndex(O=>O.prefix==="title1"),p=ke>=0?Ct[ke]:_e.title1Width,I=J==="two-row"&&o;return r.jsx("div",{...I?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:q(F??0),flexShrink:0,alignSelf:"stretch",...I?{pointerEvents:"auto"}:{}}})},de=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:_,"aria-hidden":"true",children:" "}),Ee=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ve,"aria-live":"polite","aria-atomic":"true",children:Gm(oe,xe,b,t)}),Re=()=>Kt?o&&ft?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ee(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Nr(K)} + ${K}))`,width:Nr(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ee():null,Je=()=>!Kt&&!ft?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ce,children:[Re(),ft?nt():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?de():null,Be?g("single-row"):null,St(be),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Je(),Sn()]}),Ve=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?de():null,Be?g("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:we&&me?{minHeight:me}:void 0,children:[r.jsx("div",{ref:mt,className:je,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Qn(ge||be)}),r.jsxs("div",{ref:st,className:je,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%",...we&&Ie?{width:Ie,maxWidth:"100%"}:void 0},children:[bt&&we?r.jsx("div",{className:`${Ke} ${e}-titles-fade-out`,children:Qn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Qn(be)})]})]}),Je(),Sn()]}),nt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:v.scalingValue(A??0,i),height:v.scalingValue(A??0,i),marginRight:ne,"--close-icon-hover-color":X},children:[r.jsx("button",{ref:it,type:"button",className:`${e}-close-icon-inner`,onClick:ct,"aria-label":"Close",children:r.jsx(dn,{url:E??"",fill:j,hoverFill:i&&!l?j:X,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ne,height:"100%",pointerEvents:"auto"}})]}),Ot=(J,ke)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Kt||Ut?de():null,Be?g("two-row"):null,ke!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:ke},children:J}):r.jsxs(r.Fragment,{children:[J,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Je()]}),St=J=>{if(!J)return null;const ke=Dn(e,J,_,ye,f);return r.jsx(r.Fragment,{children:ke.map(p=>zt(p,"single-row",Ft(ke,p,"single-row")))})},ln=J=>{if(!J)return null;const ke=Dn(e,J,_,ye,f),p=ke.find(I=>I.prefix==="title1");return p?zt(p,"two-row-top",Ft(ke,p,"two-row-top")):null},un=(J,ke=!1)=>{const p=J?Dn(e,J,_,ye,f):[],I=p.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),O=o&&ke;return I.length>0||O||(x??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[I.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[I.map(Te=>zt(Te,"two-row-bottom",Ft(p,Te,"two-row-bottom"))),ke&&o?r.jsxs(r.Fragment,{children:[Cr(),Tr()]}):null]}):null,(x??0)>0||O?r.jsx("div",{"data-controls":O?"titleRowMarginBottom":void 0,"data-controls-axis":O?"y":void 0,"data-controls-reverse":O?"":void 0,className:O?`${e}-control`:void 0,style:{height:dt,width:"100%",flexShrink:0,pointerEvents:O?"auto":"none"}}):null]}):null},Zn=(J,ke=!1)=>r.jsxs(r.Fragment,{children:[Ot(ln(J)),un(J,ke)]}),Qn=J=>Y?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Zn(J)}):J?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:St(J)}):null,$o=()=>{const J=Y?-1:tt.findIndex(I=>I.prefix==="title1"),ke=!Y&&(o||(F??0)>0)?(()=>{const I=F??0,O=J>=0?Ct[J]:_e.title1Width,ue=Math.max(I,zn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(O),style:{position:"absolute",top:0,left:0,width:q(ue),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=tt.flatMap((I,O)=>{if(!I.marginLeftKey)return[];const ue=Ze[I.marginLeftKey]??0,Te=Gl(tt,Ct,Ze,O)+wt(),Ne=Math.max(ue,zn);return r.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ct[O]),style:{position:"absolute",top:0,left:q(Te),width:q(Ne),height:"100%",pointerEvents:"auto"}},I.marginLeftKey)});return ke?[ke,...p]:p},Co=()=>tt.map((J,ke)=>{const p=an(ke,Ct),O=Qt(ke)-hn/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(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:q(O),width:q(hn),height:"100%",pointerEvents:"auto"}})},`${J.widthKey}-junction`)}),Cr=()=>At.flatMap((J,ke)=>{if(!J.marginLeftKey)return[];const p=Ze[J.marginLeftKey]??0,I=Gt(ke),O=Math.max(p,zn),{resolvedWidth:ue}=Pt(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(ue),style:{position:"absolute",top:0,left:q(I),width:q(O),height:"100%",pointerEvents:"auto"}},J.marginLeftKey)}),Tr=()=>At.map((J,ke)=>{const{maxWidth:p}=Pt(J,"two-row-bottom"),O=ut(ke)-hn/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(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:q(O),width:q(hn),height:"100%",pointerEvents:"auto"}})},`${J.widthKey}-junction`)}),Sn=()=>!o||Y?null:r.jsxs(r.Fragment,{children:[$o(),Co()]}),hi=J=>{const ke=!J.objectFit&&Fn(S);return{className:`${e}-slide-image-cell${ke?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:k,...ke?{"--image-aspect-ratio":Sr(S)}:{}}}},To=J=>J.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":J.objectFit}}:Fn(S)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ei=J=>{if(J.length===0)return null;const ke=J.length>1,p=Nr(N),I=`calc(-0.5 * (${p} + ${N}))`;if(J.length===1){const O=J[0];return r.jsx("div",{...hi(O),children:r.jsx("img",{...To(O),src:O.url,alt:O.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:ke?{gap:N}:void 0,children:J.map((O,ue)=>r.jsxs("div",{...hi(O),children:[r.jsx("img",{...To(O),src:O.url,alt:O.name??"",draggable:!1}),o&&ke&&ue<J.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:I,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${O.url}-${ue}`))})},Lo=!!(be!=null&&be.title2||be!=null&&be.title3||bt!=null&&bt.title2||bt!=null&&bt.title3||(x??0)>0||o),Lr=()=>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:mt,className:je,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Zn(ge||be)}),r.jsxs("div",{ref:st,className:`${e}-titles-row-two-row`,style:{...we&&me?{minHeight:me}:void 0,...we&&Ie?{width:Ie,maxWidth:"100%"}:void 0},children:[Ot(r.jsxs("div",{className:je,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%"},children:[bt&&we?r.jsx("div",{className:`${He} ${e}-titles-fade-out`,children:ln(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ln(be)})]}),we&&me?me:void 0),Lo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[bt&&we?r.jsx("div",{className:`${Ke} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Y?` ${e}-titles-layer-in-stacked`:""}`,children:un(be,!0)})]}):null]})]}),Ir=()=>{const J=Lo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...J?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:J?void 0:{flex:"0 0 auto",height:"auto"},children:Zn(be,!0)}),Sn()]})};return r.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{_t||ct()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:ft?void 0:-1,style:{opacity:ce?1:0,transition:"opacity 300ms ease",pointerEvents:ce?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:C,...Qe}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...Ge,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Tt,onClick:J=>J.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":le&&oe.length>1?"true":"false",onPointerDown:le?Dt:void 0,onPointerUp:le?en:void 0,onPointerCancel:le?on:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Rt&&W?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:J=>{J.target===J.currentTarget&&xt(ie)},children:r.jsx("div",{className:`${e}-slide-area`,children:ei(Rt.images)})},`slide-out-${ie}`):null,r.jsx("div",{className:`${e}-slide-layer-in${W?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:he?ei(he.images):null})},`slide-in-${ie}-${xe}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Lt,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%",...Y?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${Y?` ${e}-lightbox-content-area-stacked`:""}`,children:Zt&&r.jsx("div",{className:`${e}-text-bar-cell${Y?` ${e}-text-bar-cell-stacked`:""}`,style:Y?void 0:{flex:1,minWidth:0,width:"100%"},children:Y?T==="fade"?Lr():Ir():T==="fade"?Ve():Et()})})})]})]})]})};function Lf(e){return`
|
|
13873
13913
|
.${e}-wrapper {
|
|
13874
13914
|
position: relative;
|
|
13875
13915
|
width: 100%;
|
|
@@ -14403,7 +14443,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
14403
14443
|
pointer-events: auto;
|
|
14404
14444
|
z-index: 10;
|
|
14405
14445
|
}
|
|
14406
|
-
`}const
|
|
14446
|
+
`}const If=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=v.useScopedStyles(),c=(s==null?void 0:s.itemId)??null,{cover:u,coverFit:m,type:b}=e,S=a.useRef(null),[C,y]=a.useState(!1),[w,$]=a.useState(0),T=a.useRef(!1),R=a.useRef(!1),M=a.useRef(!1),H=a.useMemo(()=>(t??[]).filter(h=>Mi(h).length>0),[t]),F=C&&H.length>0,V=!n,P=a.useCallback(()=>{V&&(M.current=!0,jm(R.current,c),R.current=!1)},[V,c]),x=(h=0)=>{if(H.length===0||n&&!i&&!o)return;const E=Uo(H,b),A=Math.max(0,Math.min(h,E.length-1));if($(A),V){const j=Dl();zl(A+1,c,j),R.current=!j}y(!0)},U=a.useCallback(()=>{y(!1),M.current=!1},[]);return a.useEffect(()=>{!n||i||o||y(!1)},[n,i,o]),a.useEffect(()=>{if(!V||T.current)return;T.current=!0;const h=Ss(c);if(!h)return;const E=$s(h,Uo(H,b).length);E<0||($(E),y(!0))},[H,c,V,b]),a.useEffect(()=>{if(!V)return;const h=()=>{if(M.current){M.current=!1,y(!1);return}const E=Ss(c);if(!E){y(!1);return}const A=$s(E,Uo(H,b).length);if(A<0){y(!1);return}R.current=!1,$(A),y(!0)};return window.addEventListener("popstate",h),()=>window.removeEventListener("popstate",h)},[H,c,V,b]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:S,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Lf(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(m)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>x(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(m)?{"--image-aspect-ratio":Sr(m)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(m)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),F&&typeof document<"u"&&(()=>{const h=(l?document.getElementById(l):null)??document.body;return mi.createPortal(r.jsx(Tf,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:w,enableUrlSync:V,journalItemId:c,onBeforeClose:P,onClose:U}),h)})()]})},Rf=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
14407
14447
|
import { createPortal } from 'react-dom';
|
|
14408
14448
|
import { CommonComponentProps } from '../props';
|
|
14409
14449
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15171,7 +15211,7 @@ export type LightboxJournalSettings = {
|
|
|
15171
15211
|
closeIconColor: string;
|
|
15172
15212
|
closeIconHoverColor: string;
|
|
15173
15213
|
};
|
|
15174
|
-
`,Cf="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 Tf(e){const t={};return t[Be(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Be(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Be(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Be(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Be(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Be(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Lf=Kn.reduce((e,t)=>({...e,...Tf(t)}),{}),If=Kn.reduce((e,t)=>({...e,[Be(t,"fontFamily")]:"Goudy Bookletter 1911",[Be(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Be(t,"letterSpacing")]:0,[Be(t,"wordSpacing")]:0,[Be(t,"textAlign")]:"left",[Be(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ur(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Be(n,"fontSize")]=i),o!==void 0&&(t[Be(n,"lineHeight")]=o),t},{})}const Rf=Bm(),Ef={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"}},...Lf,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:Cf,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...If,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:.005,...Ur({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,...Ur({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,...Ur({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:[Rf]}],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"}]}]}},Mf={element:Sf,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:Ef,sourceCode:$f,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Be(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Be(t,"fontFamily")}`}),{})}},kf={sizeType:"custom",value:700,min:400,max:700};function ar(e,t){return{widthPx:e,heightPx:e*t}}function ca(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 Us(e,t,n,i){const{heightPx:o}=ar(n,i);return ca(e/2,t/2,e,t,n,o)}function ac(e,t,n){for(const i of n){const{heightPx:o}=ar(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 Pf(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":ac(e,t,n)||s==="area"?l??"none":d??"none"}function Xs(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 Af(e){return`
|
|
15214
|
+
`,Ef="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 Mf(e){const t={};return t[ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ze(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ze(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ze(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ze(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ze(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ze(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ze(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const kf=Kn.reduce((e,t)=>({...e,...Mf(t)}),{}),Pf=Kn.reduce((e,t)=>({...e,[ze(t,"fontFamily")]:"Goudy Bookletter 1911",[ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ze(t,"letterSpacing")]:0,[ze(t,"wordSpacing")]:0,[ze(t,"textAlign")]:"left",[ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ur(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ze(n,"fontSize")]=i),o!==void 0&&(t[ze(n,"lineHeight")]=o),t},{})}const Af=Km(),Ff={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"}},...kf,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:Ef,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Pf,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,...Ur({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,...Ur({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,...Ur({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:[Af]}],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"}]}]}},Wf={element:If,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:Ff,sourceCode:Rf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${ze(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ze(t,"fontFamily")}`}),{})}},_f={sizeType:"custom",value:700,min:400,max:700};function rr(e,t){return{widthPx:e,heightPx:e*t}}function ua(e,t,n,i,o,l){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,l/2),i-l/2)}}function Ys(e,t,n,i){const{heightPx:o}=rr(n,i);return ua(e/2,t/2,e,t,n,o)}function cc(e,t,n){for(const i of n){const{heightPx:o}=rr(i.widthPx,i.aspectRatio),l=i.widthPx/2,s=o/2;if(e>=i.x-l&&e<=i.x+l&&t>=i.y-s&&t<=i.y+s)return!0}return!1}function Hf(e,t,n,i,o,l,s,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":cc(e,t,n)||l==="area"?s??"none":d??"none"}function Js(e,t,n){var d;const{sizeType:i,value:o,min:l,max:s}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(s-l)+l)}function Nf(e){return`
|
|
15175
15215
|
.${e}-root {
|
|
15176
15216
|
position: absolute;
|
|
15177
15217
|
top: 0;
|
|
@@ -15206,7 +15246,7 @@ export type LightboxJournalSettings = {
|
|
|
15206
15246
|
width: 32px;
|
|
15207
15247
|
height: 32px;
|
|
15208
15248
|
}
|
|
15209
|
-
`}function
|
|
15249
|
+
`}function Of(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 jf(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Of(i)]));return new Map(n)}function Bf({settings:e,content:t=[],isEditor:n}){const{prefix:i}=v.useScopedStyles(),[o,l]=a.useState(null),[s,d]=a.useState([]),[c,u]=a.useState(0),m=a.useRef(0),[b,S]=a.useState({x:0,y:0}),[C,y]=a.useState("none"),w=a.useRef({x:0,y:0}),[$,T]=a.useState(!1),[R,M]=a.useState(!1),H=a.useRef(new Map),{imageSize:F=_f,cursor:V="system",target:P="area",position:x="random",visible:U="all",defaultCursor:h=null,hoverCursor:E=null}=e,A=a.useMemo(()=>Nf(i),[i]),j=a.useCallback((N,L,k=s)=>{if(!o)return;const K=o.getBoundingClientRect(),z=N-K.left,ne=L-K.top;S({x:z,y:ne}),y(Hf(z,ne,k,o,V,P,E,h))},[o,s,V,P,E,h]);a.useEffect(()=>{const N=[...t.map(k=>k.image.url),h,E].filter(k=>!!k);if(N.length===0){H.current=new Map,M(!0);return}let L=!1;return M(!1),jf(N).then(k=>{L||(H.current=k,M(!0))}),()=>{L=!0}},[t,h,E]),a.useEffect(()=>{if(!o)return;const N=k=>{k.stopPropagation(),w.current={x:k.clientX,y:k.clientY},j(k.clientX,k.clientY)},L=()=>{$&&j(w.current.x,w.current.y)};return o.addEventListener("mousemove",N),window.addEventListener("scroll",L,!0),()=>{o.removeEventListener("mousemove",N),window.removeEventListener("scroll",L,!0)}},[o,$,j]),a.useEffect(()=>{!o||!$||j(w.current.x,w.current.y)},[s,o,$,j]),a.useEffect(()=>{$||y("none")},[$]);const X=(N,L,k,K={})=>{var ve;const z=((ve=H.current.get(N.image.url))==null?void 0:ve.aspectRatio)??1,ne=Js(N.image.url,F,H.current),{heightPx:_}=rr(ne,z);let ye=0,f=0;return x==="same"?{x:ye,y:f}=Ys(L,k,ne,z):(ye=K.x??Math.random()*L,f=K.y??Math.random()*k,{x:ye,y:f}=ua(ye,f,L,k,ne,_)),{id:m.current++,url:N.image.url,link:N.link,name:N.image.name,x:ye,y:f,xRatio:ye/L,yRatio:f/k,aspectRatio:z,widthPx:ne}},ae=()=>{if(!o)return;const N=o.getBoundingClientRect(),L=N.width,k=N.height;L===0||k===0||d(K=>K.length===0?K:K.map(z=>{const ne=F.sizeType==="random"?z.widthPx:Js(z.url,F,H.current),{heightPx:_}=rr(ne,z.aspectRatio);if(x==="same"){const{x:ve,y:Y}=Ys(L,k,ne,z.aspectRatio);return{...z,x:ve,y:Y,widthPx:ne}}const{x:ye,y:f}=ua(z.xRatio*L,z.yRatio*k,L,k,ne,_);return{...z,x:ye,y:f,widthPx:ne}}))};a.useEffect(()=>{if(!o||t.length===0||!R)return;const N=o.getBoundingClientRect(),L=N.width,k=N.height,K=X(t[0],L,k);d([K]),u(1)},[F,x,o,t,R]),a.useEffect(()=>{if(!o)return;ae();const N=new ResizeObserver(ae);return N.observe(o),window.addEventListener("resize",ae),()=>{N.disconnect(),window.removeEventListener("resize",ae)}},[o,x,F,s.length]),a.useEffect(()=>{U==="last One"&&d(N=>N.length>0?[N[N.length-1]]:[])},[U]);const Z=N=>{if(!o||t.length===0||!R)return;const L=o.getBoundingClientRect(),k=N.clientX-L.left,K=N.clientY-L.top;if(P==="image"&&!cc(k,K,s))return;let z=0,ne=0;x==="on Click"?(z=k,ne=K):x==="same"?(z=L.width/2,ne=L.height/2):(z=Math.random()*L.width,ne=Math.random()*L.height);const _=t[c],ye=X(_,L.width,L.height,{x:z,y:ne}),f=U==="all"?[...s,ye]:[ye];d(f),u(ve=>ve>=t.length-1?0:ve+1),j(N.clientX,N.clientY,f)},q=V==="custom"&&C!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:A}}),r.jsxs("div",{ref:l,onClick:Z,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),className:`${i}-root`,style:{cursor:q?"none":"default"},children:[s.map(N=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${N.y}px`,left:`${N.x}px`,width:`${N.widthPx}px`,cursor:q?"none":"default"},children:P==="area"&&N.link?r.jsx("a",{href:N.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:N.url,alt:N.name,className:`${i}-image`})}):r.jsx("img",{src:N.url,alt:N.name,className:`${i}-image`})},N.id)),$&&q&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${C}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const zf=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15210
15250
|
import { CommonComponentProps } from '../props';
|
|
15211
15251
|
import { useScopedStyles } from '../utils/index';
|
|
15212
15252
|
|
|
@@ -15727,7 +15767,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15727
15767
|
</>
|
|
15728
15768
|
);
|
|
15729
15769
|
}
|
|
15730
|
-
`,
|
|
15770
|
+
`,Df={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"]}]}]},Vf={element:Bf,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:Df,sourceCode:zf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},Gf=100,qf=70,On="cubic-bezier(0.86, 0, 0.07, 1)";function Kf(e){return`
|
|
15731
15771
|
.${e}-wrapper {
|
|
15732
15772
|
position: relative;
|
|
15733
15773
|
width: 100%;
|
|
@@ -15837,7 +15877,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15837
15877
|
display: block;
|
|
15838
15878
|
pointer-events: none;
|
|
15839
15879
|
}
|
|
15840
|
-
`}function
|
|
15880
|
+
`}function Uf(e){return e==="blur"?qf:e==="greyscale"?Gf:0}function Ki(e,t=1,n=1){const i=Uf(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 Zs(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Xf(e,t){return t<=1?0:(e-1+t)%t}function Yf(e,t=1){return!e||e.height===0?t:e.width/e.height}function Jf(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const l=e*i/100,s=t*o/100;let d=l,c=d/n;return c>s&&(c=s,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function Qs(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 dc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function el(e,t,n){return{...dc(e),[`--${n}-stage-scale`]:t}}function Zf(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 Qf({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Se,B,Q,W,te,ie,pe;const{prefix:o}=v.useScopedStyles(),l=a.useMemo(()=>Kf(o),[o]),{imageSize:s,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:m="greyscale"}=e,b=t??[],S=Zs(b.length),[C,y]=a.useState(S.activeIndex),[w,$]=a.useState(S.backgroundIndex),[T,R]=a.useState(!1),[M,H]=a.useState(!1),[F,V]=a.useState(null),[P,x]=a.useState(null),[U,h]=a.useState(0),[E,A]=a.useState(1),[j,X]=a.useState("none"),[ae,Z]=a.useState("next"),[q,N]=a.useState({}),[L,k]=a.useState({width:0,height:0}),K=a.useRef(null),z=a.useRef(null),ne=!n||!!i,_=s??60,ye=Math.max(10,Math.min(100,d??_)),f=Math.max(10,Math.min(100,c??_)),ve=Math.max(100,u),Y=Ki(m),le=a.useCallback(me=>{const fe=Yf(me?q[me]:void 0);return Jf(L.width,L.height,fe,ye,f)},[L.height,L.width,q,f,ye]);a.useEffect(()=>{const me=z.current;if(!me)return;const fe=new ResizeObserver(([Ie])=>{const{width:ee,height:ge}=Ie.contentRect;k({width:ee,height:ge})});return fe.observe(me),()=>fe.disconnect()},[]),a.useEffect(()=>{const me=(t??[]).map(fe=>{var Ie;return(Ie=fe.image)==null?void 0:Ie.url}).filter(fe=>!!fe);Zf(me,(fe,Ie)=>{N(ee=>{var ge,Ae;return((ge=ee[fe])==null?void 0:ge.width)===Ie.width&&((Ae=ee[fe])==null?void 0:Ae.height)===Ie.height?ee:{...ee,[fe]:Ie}})})},[t]),a.useEffect(()=>{const{backgroundIndex:me,activeIndex:fe}=Zs(b.length);y(fe),$(me),R(!1),H(!1),V(null),x(null),h(0),A(1),X("none"),Z("next")},[b.length,t]),a.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const $e=a.useCallback(me=>{var re,D,Oe,We;if(!ne||T||b.length<=1)return;const fe=me==="next"?(C+1)%b.length:(C-1+b.length)%b.length,Ie=le((D=(re=b[C])==null?void 0:re.image)==null?void 0:D.url),ee=le((We=(Oe=b[fe])==null?void 0:Oe.image)==null?void 0:We.url),ge=Qs(L.width,L.height,Ie),Ae=Qs(L.width,L.height,ee);K.current&&clearTimeout(K.current),Z(me),H(!0),R(!0),me==="next"?(V(C),x(fe),h(0),A(1),X(Ki(m,0,1))):($(Xf(fe,b.length)),V(fe),x(C),h(1),A(Ae),X(Ki(m,1,Ae))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{me==="next"?(h(1),A(ge),X(Ki(m,1,ge))):(h(0),A(1),X(Ki(m,0,1)))})}),K.current=setTimeout(()=>{me==="next"&&$(C),y(fe),V(null),x(null),R(!1)},ve)},[C,m,L.height,L.width,le,T,ne,b,ve]),oe=b[C],xe=w!==null?b[w]:null,G=F!==null?b[F]:null,he=P!==null?b[P]:null,be=b.length<=1?0:(C-1+b.length)%b.length,ce=b.length<=1?0:(C+1)%b.length,se=le((Se=oe==null?void 0:oe.image)==null?void 0:Se.url),Le=le((B=G==null?void 0:G.image)==null?void 0:B.url),Me=le((Q=he==null?void 0:he.image)==null?void 0:Q.url),we={[`--${o}-transition-ms`]:`${ve}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsxs("div",{ref:z,className:pt(`${o}-wrapper`,M&&`${o}-snap`,n&&!i&&`${o}-editor`),style:we,"aria-label":"Zoom gallery",children:[((W=xe==null?void 0:xe.image)==null?void 0:W.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:xe.image.url,alt:"",style:{filter:Y}})}),T&&((te=G==null?void 0:G.image)==null?void 0:te.url)&&r.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${ae}`),style:el(Le,E,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:G.image.url,alt:"",style:{filter:j}})}),T&&((ie=he==null?void 0:he.image)==null?void 0:ie.url)&&r.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${ae}`),style:el(Me,U,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:he.image.url,alt:""})}),!T&&((pe=oe==null?void 0:oe.image)==null?void 0:pe.url)&&r.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:dc(se),children:r.jsx("img",{className:`${o}-image`,src:oe.image.url,alt:oe.image.name??""})}),ne&&b.length>1&&!T&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>$e("prev"),"aria-label":`Show previous image (${be+1} of ${b.length})`}),r.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>$e("next"),"aria-label":`Show next image (${ce+1} of ${b.length})`})]})]})]})}const ey=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15841
15881
|
import cn from 'classnames';
|
|
15842
15882
|
import { CommonComponentProps } from '../props';
|
|
15843
15883
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16356,183 +16396,1041 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16356
16396
|
</>
|
|
16357
16397
|
);
|
|
16358
16398
|
}
|
|
16359
|
-
`,
|
|
16360
|
-
.${e}-
|
|
16361
|
-
|
|
16362
|
-
|
|
16363
|
-
|
|
16364
|
-
|
|
16399
|
+
`,ty={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:""}}]}},ny={element:Qf,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:ty,sourceCode:ey,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},iy={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},oy=["hover","active"],Xr={left:"flex-start",center:"center",right:"flex-end"};function ry(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 sy(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))`,l=`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))`,s=`${o}, ${l}`,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}`,m=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`;return`
|
|
16400
|
+
.${e}-root {
|
|
16401
|
+
line-height: 0;
|
|
16402
|
+
}
|
|
16403
|
+
.${e}-wrapper {
|
|
16404
|
+
display: inline-flex;
|
|
16405
|
+
vertical-align: top;
|
|
16365
16406
|
pointer-events: none;
|
|
16407
|
+
}
|
|
16408
|
+
.${e}-button {
|
|
16409
|
+
display: inline-flex;
|
|
16410
|
+
align-items: center;
|
|
16411
|
+
box-sizing: border-box;
|
|
16412
|
+
border-style: solid;
|
|
16413
|
+
border-color: var(--${e}-border-color);
|
|
16414
|
+
background-color: var(--${e}-background-color);
|
|
16415
|
+
color: var(--${e}-text-color);
|
|
16416
|
+
cursor: pointer;
|
|
16417
|
+
font: inherit;
|
|
16418
|
+
white-space: pre-wrap;
|
|
16419
|
+
overflow-wrap: anywhere;
|
|
16366
16420
|
word-break: break-word;
|
|
16367
|
-
|
|
16368
|
-
|
|
16369
|
-
|
|
16370
|
-
|
|
16421
|
+
user-select: none;
|
|
16422
|
+
pointer-events: auto;
|
|
16423
|
+
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
|
|
16424
|
+
box-shadow: ${i};
|
|
16371
16425
|
}
|
|
16372
|
-
.${e}-
|
|
16373
|
-
|
|
16374
|
-
align-items: baseline;
|
|
16426
|
+
.${e}-wrapper.${e}-editing .${e}-button {
|
|
16427
|
+
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms;
|
|
16375
16428
|
}
|
|
16376
|
-
.${e}-
|
|
16377
|
-
|
|
16378
|
-
|
|
16379
|
-
|
|
16380
|
-
flex-shrink: 0;
|
|
16429
|
+
.${e}-hover-effect-scale-up:hover,
|
|
16430
|
+
.${e}-hover-effect-scale-up:focus-visible,
|
|
16431
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-scale-up {
|
|
16432
|
+
transform: scale(1.05);
|
|
16381
16433
|
}
|
|
16382
|
-
.${e}-
|
|
16434
|
+
.${e}-hover-effect-lift:hover,
|
|
16435
|
+
.${e}-hover-effect-lift:focus-visible,
|
|
16436
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-lift {
|
|
16437
|
+
transform: translateY(-2px);
|
|
16438
|
+
box-shadow: ${m};
|
|
16439
|
+
}
|
|
16440
|
+
.${e}-hover-effect-reveal,
|
|
16441
|
+
.${e}-hover-effect-swipe {
|
|
16383
16442
|
position: relative;
|
|
16384
|
-
|
|
16385
|
-
align-self: center;
|
|
16386
|
-
pointer-events: auto;
|
|
16387
|
-
z-index: 2;
|
|
16388
|
-
display: flex;
|
|
16389
|
-
align-items: center;
|
|
16390
|
-
justify-content: center;
|
|
16391
|
-
border: none;
|
|
16392
|
-
background-color: transparent;
|
|
16393
|
-
padding: 0;
|
|
16443
|
+
overflow: hidden;
|
|
16394
16444
|
}
|
|
16395
|
-
.${e}-
|
|
16396
|
-
|
|
16445
|
+
.${e}-hover-effect-reveal .${e}-button-inner,
|
|
16446
|
+
.${e}-hover-effect-reveal .${e}-text,
|
|
16447
|
+
.${e}-hover-effect-reveal .${e}-icon,
|
|
16448
|
+
.${e}-hover-effect-swipe .${e}-button-inner,
|
|
16449
|
+
.${e}-hover-effect-swipe .${e}-text,
|
|
16450
|
+
.${e}-hover-effect-swipe .${e}-icon {
|
|
16397
16451
|
position: relative;
|
|
16398
|
-
|
|
16399
|
-
width: 100%;
|
|
16400
|
-
height: 100%;
|
|
16401
|
-
pointer-events: auto;
|
|
16452
|
+
z-index: 1;
|
|
16402
16453
|
}
|
|
16403
|
-
.${e}-
|
|
16454
|
+
.${e}-hover-effect-reveal::before {
|
|
16455
|
+
content: '';
|
|
16404
16456
|
position: absolute;
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
transform: translate(-50%, -50%);
|
|
16408
|
-
}
|
|
16409
|
-
.${e}-titles-baseline-strut {
|
|
16410
|
-
width: 0;
|
|
16411
|
-
overflow: hidden;
|
|
16412
|
-
flex-shrink: 0;
|
|
16457
|
+
inset: 0;
|
|
16458
|
+
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
16413
16459
|
pointer-events: none;
|
|
16414
|
-
|
|
16460
|
+
z-index: 0;
|
|
16461
|
+
transform: scaleY(0);
|
|
16462
|
+
transform-origin: bottom center;
|
|
16463
|
+
transition: transform 120ms;
|
|
16415
16464
|
}
|
|
16416
|
-
.${e}-
|
|
16465
|
+
.${e}-hover-effect-reveal:hover::before,
|
|
16466
|
+
.${e}-hover-effect-reveal:focus-visible::before,
|
|
16467
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal::before {
|
|
16468
|
+
transform: scaleY(1);
|
|
16469
|
+
transform-origin: top center;
|
|
16470
|
+
}
|
|
16471
|
+
.${e}-hover-effect-reveal.${e}-reveal-from-bottom::before {
|
|
16472
|
+
transform-origin: top center;
|
|
16473
|
+
}
|
|
16474
|
+
.${e}-hover-effect-reveal.${e}-reveal-from-bottom:hover::before,
|
|
16475
|
+
.${e}-hover-effect-reveal.${e}-reveal-from-bottom:focus-visible::before,
|
|
16476
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal.${e}-reveal-from-bottom::before {
|
|
16477
|
+
transform-origin: bottom center;
|
|
16478
|
+
}
|
|
16479
|
+
.${e}-hover-effect-swipe::before {
|
|
16480
|
+
content: '';
|
|
16481
|
+
position: absolute;
|
|
16482
|
+
inset: 0;
|
|
16483
|
+
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
16484
|
+
pointer-events: none;
|
|
16485
|
+
z-index: 0;
|
|
16486
|
+
transform: translateX(-100%);
|
|
16487
|
+
transition: transform 250ms;
|
|
16488
|
+
}
|
|
16489
|
+
.${e}-hover-effect-swipe:hover::before,
|
|
16490
|
+
.${e}-hover-effect-swipe:focus-visible::before,
|
|
16491
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe::before {
|
|
16492
|
+
transform: translateX(0);
|
|
16493
|
+
}
|
|
16494
|
+
.${e}-hover-effect-reveal:hover,
|
|
16495
|
+
.${e}-hover-effect-reveal:focus-visible,
|
|
16496
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal,
|
|
16497
|
+
.${e}-hover-effect-swipe:hover,
|
|
16498
|
+
.${e}-hover-effect-swipe:focus-visible,
|
|
16499
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe {
|
|
16500
|
+
background-color: var(--${e}-background-color);
|
|
16501
|
+
}
|
|
16502
|
+
.${e}-hover-effect-content-roll {
|
|
16417
16503
|
position: relative;
|
|
16418
|
-
|
|
16419
|
-
|
|
16420
|
-
align-self: flex-start;
|
|
16504
|
+
overflow: hidden;
|
|
16505
|
+
align-items: stretch;
|
|
16421
16506
|
}
|
|
16422
|
-
.${e}-
|
|
16507
|
+
.${e}-content-roll-wrap {
|
|
16423
16508
|
position: relative;
|
|
16424
|
-
|
|
16425
|
-
flex-direction: row;
|
|
16426
|
-
align-items: baseline;
|
|
16427
|
-
align-self: flex-start;
|
|
16509
|
+
align-self: stretch;
|
|
16428
16510
|
min-width: 0;
|
|
16429
16511
|
}
|
|
16430
|
-
.${e}-
|
|
16431
|
-
display: flex;
|
|
16512
|
+
.${e}-content-roll-wrap.${e}-icon-text-roll {
|
|
16432
16513
|
flex: 1;
|
|
16433
|
-
height: 100%;
|
|
16434
|
-
min-height: 0;
|
|
16435
|
-
align-self: stretch;
|
|
16436
|
-
flex-direction: column;
|
|
16437
16514
|
width: 100%;
|
|
16438
16515
|
}
|
|
16439
|
-
.${e}-
|
|
16440
|
-
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
width: 100%;
|
|
16444
|
-
flex-shrink: 0;
|
|
16445
|
-
margin-bottom: 0;
|
|
16516
|
+
.${e}-content-roll-wrap.${e}-icon-roll,
|
|
16517
|
+
.${e}-content-roll-wrap.${e}-label-roll {
|
|
16518
|
+
display: inline-block;
|
|
16519
|
+
flex: 1;
|
|
16446
16520
|
}
|
|
16447
|
-
.${e}-
|
|
16448
|
-
|
|
16449
|
-
|
|
16521
|
+
.${e}-content-roll-spacer {
|
|
16522
|
+
visibility: hidden;
|
|
16523
|
+
pointer-events: none;
|
|
16450
16524
|
}
|
|
16451
|
-
.${e}-
|
|
16452
|
-
|
|
16453
|
-
|
|
16454
|
-
|
|
16455
|
-
margin-top: auto;
|
|
16456
|
-
flex-shrink: 0;
|
|
16525
|
+
.${e}-content-roll-viewport {
|
|
16526
|
+
position: absolute;
|
|
16527
|
+
inset: 0;
|
|
16528
|
+
pointer-events: none;
|
|
16457
16529
|
}
|
|
16458
|
-
.${e}-
|
|
16459
|
-
position:
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16463
|
-
|
|
16464
|
-
|
|
16530
|
+
.${e}-content-roll-layer {
|
|
16531
|
+
position: absolute;
|
|
16532
|
+
left: 0;
|
|
16533
|
+
right: 0;
|
|
16534
|
+
top: 50%;
|
|
16535
|
+
transform: translateY(-50%);
|
|
16536
|
+
transition: transform 250ms ease, opacity 250ms ease, top 250ms ease;
|
|
16537
|
+
opacity: 1;
|
|
16538
|
+
pointer-events: none;
|
|
16465
16539
|
}
|
|
16466
|
-
.${e}-
|
|
16467
|
-
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
align-items: flex-end;
|
|
16471
|
-
width: 100%;
|
|
16540
|
+
.${e}-content-roll-layer-hover {
|
|
16541
|
+
top: 0;
|
|
16542
|
+
transform: translateY(-100%);
|
|
16543
|
+
opacity: 0;
|
|
16472
16544
|
}
|
|
16473
|
-
.${e}-
|
|
16474
|
-
|
|
16545
|
+
.${e}-hover-effect-content-roll:hover .${e}-content-roll-layer:not(.${e}-content-roll-layer-hover),
|
|
16546
|
+
.${e}-hover-effect-content-roll:focus-visible .${e}-content-roll-layer:not(.${e}-content-roll-layer-hover),
|
|
16547
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-content-roll .${e}-content-roll-layer:not(.${e}-content-roll-layer-hover) {
|
|
16548
|
+
top: 100%;
|
|
16549
|
+
transform: translateY(0);
|
|
16550
|
+
opacity: 0;
|
|
16475
16551
|
}
|
|
16476
|
-
.${e}-
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
|
|
16552
|
+
.${e}-hover-effect-content-roll:hover .${e}-content-roll-layer-hover,
|
|
16553
|
+
.${e}-hover-effect-content-roll:focus-visible .${e}-content-roll-layer-hover,
|
|
16554
|
+
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover {
|
|
16555
|
+
top: 50%;
|
|
16556
|
+
transform: translateY(-50%);
|
|
16557
|
+
opacity: 1;
|
|
16481
16558
|
}
|
|
16482
|
-
.${e}-
|
|
16483
|
-
|
|
16484
|
-
|
|
16485
|
-
|
|
16486
|
-
|
|
16487
|
-
|
|
16559
|
+
.${e}-button:hover,
|
|
16560
|
+
.${e}-button:focus-visible {
|
|
16561
|
+
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
16562
|
+
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
16563
|
+
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
16564
|
+
box-shadow: ${s};
|
|
16488
16565
|
}
|
|
16489
|
-
.${e}-
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16566
|
+
.${e}-wrapper.${e}-state-hover .${e}-button {
|
|
16567
|
+
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
16568
|
+
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
16569
|
+
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
16570
|
+
box-shadow: ${s};
|
|
16494
16571
|
}
|
|
16495
|
-
.${e}-
|
|
16496
|
-
|
|
16572
|
+
.${e}-button:focus,
|
|
16573
|
+
.${e}-button:focus-visible {
|
|
16574
|
+
outline: none;
|
|
16497
16575
|
}
|
|
16498
|
-
.${e}-
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
overflow: hidden;
|
|
16576
|
+
.${e}-button:active {
|
|
16577
|
+
background-color: var(--${e}-active-background-color, var(--${e}-background-color));
|
|
16578
|
+
color: var(--${e}-active-text-color, var(--${e}-text-color));
|
|
16579
|
+
border-color: var(--${e}-active-border-color, var(--${e}-border-color));
|
|
16580
|
+
box-shadow: ${u};
|
|
16504
16581
|
}
|
|
16505
|
-
.${e}-
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
16582
|
+
.${e}-wrapper.${e}-state-active .${e}-button {
|
|
16583
|
+
background-color: var(--${e}-active-background-color, var(--${e}-background-color));
|
|
16584
|
+
color: var(--${e}-active-text-color, var(--${e}-text-color));
|
|
16585
|
+
border-color: var(--${e}-active-border-color, var(--${e}-border-color));
|
|
16586
|
+
box-shadow: ${u};
|
|
16511
16587
|
}
|
|
16512
|
-
.${e}-
|
|
16513
|
-
|
|
16588
|
+
.${e}-text {
|
|
16589
|
+
display: block;
|
|
16590
|
+
flex: 1;
|
|
16591
|
+
min-width: 0;
|
|
16514
16592
|
}
|
|
16515
|
-
.${e}-
|
|
16593
|
+
.${e}-icon {
|
|
16594
|
+
display: block;
|
|
16595
|
+
flex-shrink: 0;
|
|
16516
16596
|
position: relative;
|
|
16597
|
+
}
|
|
16598
|
+
.${e}-icon-image {
|
|
16599
|
+
transition: background-color 250ms;
|
|
16600
|
+
}
|
|
16601
|
+
.${e}-button:hover .${e}-icon-image,
|
|
16602
|
+
.${e}-button:focus-visible .${e}-icon-image,
|
|
16603
|
+
.${e}-wrapper.${e}-state-hover .${e}-icon-image {
|
|
16604
|
+
--fill: var(--${e}-hover-icon-color, var(--${e}-icon-color)) !important;
|
|
16605
|
+
--hover-fill: var(--${e}-hover-icon-color, var(--${e}-icon-color)) !important;
|
|
16606
|
+
}
|
|
16607
|
+
.${e}-button:active .${e}-icon-image,
|
|
16608
|
+
.${e}-wrapper.${e}-state-active .${e}-icon-image {
|
|
16609
|
+
--fill: var(--${e}-active-icon-color, var(--${e}-icon-color)) !important;
|
|
16610
|
+
--hover-fill: var(--${e}-active-icon-color, var(--${e}-icon-color)) !important;
|
|
16611
|
+
}
|
|
16612
|
+
.${e}-icon .${e}-icon-image {
|
|
16517
16613
|
width: 100%;
|
|
16518
16614
|
height: 100%;
|
|
16519
16615
|
}
|
|
16520
|
-
.${e}-
|
|
16521
|
-
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
pointer-events: none;
|
|
16525
|
-
display: flex;
|
|
16526
|
-
flex-direction: column;
|
|
16527
|
-
isolation: isolate;
|
|
16616
|
+
.${e}-icon-fill {
|
|
16617
|
+
max-width: 100%;
|
|
16618
|
+
width: 100%;
|
|
16619
|
+
height: auto;
|
|
16528
16620
|
}
|
|
16529
|
-
.${e}-
|
|
16621
|
+
.${e}-icon-fill .${e}-icon-image {
|
|
16530
16622
|
position: relative;
|
|
16531
|
-
|
|
16532
|
-
|
|
16533
|
-
|
|
16534
|
-
|
|
16535
|
-
|
|
16623
|
+
top: auto;
|
|
16624
|
+
left: auto;
|
|
16625
|
+
transform: none;
|
|
16626
|
+
width: 100%;
|
|
16627
|
+
height: auto;
|
|
16628
|
+
}
|
|
16629
|
+
.${e}-icon-inline {
|
|
16630
|
+
display: inline-block;
|
|
16631
|
+
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
16632
|
+
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
16633
|
+
}
|
|
16634
|
+
`}function Yr(e,t,n="",i,o){const l=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:l}),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 tl(e,t,n="fill",i=100,o=0,l){if(!t)return null;const s=r.jsx(dn,{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:s});if(n==="fixed"&&o>0){const d=v.scalingValue(o,l);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:s})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:s})}function ly({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i}){const{prefix:o}=v.useScopedStyles(),l=a.useMemo(()=>sy(o),[o]),{type:s="a",label:d="Button",icon:c,alignment:u="center",alignA:m,order:b="text-icon",gap:S=0,iconSize:C=0,iconWidthC:y=0,dimensions:w=!1,padding:$={top:0,right:0,bottom:0,left:0},cornerRadius:T={top:0,right:0,bottom:0,left:0},boxShadow:R={top:0,left:0,right:0,bottom:0},boxShadowColor:M="rgba(0, 0, 0, 0)",innerBoxShadow:H={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:F="rgba(0, 0, 0, 0)",stroke:V=0,backgroundColor:P="#000000",textColor:x="#ffffff",borderColor:U="#ffffff",iconColor:h="#ffffff",hoverEffect:E="none",fontFamily:A,fontSettings:j,fontSize:X,lineHeight:ae,letterSpacing:Z=0,wordSpacing:q=0,textAppearance:N,stateOverrides:L,minWidth:k=0,minHeight:K=0,width:z=0,height:ne=0}=e,_=v.buildColorVars(o,{backgroundColor:P,textColor:x,borderColor:U,iconColor:h,boxShadowColor:M,innerBoxShadowColor:F},iy,oy,L),ye=i&&i!=="default"?`${o}-state-${i}`:"",f=t&&!n?`${o}-editing`:"",ve=E!=="none"&&(!t||n||i==="hover")?`${o}-hover-effect-${E}`:"",Y=E==="reveal"||E==="swipe",le=E==="content-roll",$e=E==="reveal"&&(!t||n),oe=w===!0,G=s==="a"?m??u:u,he=s==="c",be=s!=="b",ce={fontSettings:{fontFamily:A,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:X??.01,lineHeight:ae,letterSpacing:Z,wordSpacing:q,textAppearance:N,color:x},Le={...be?cn(Jt(ce,t)):{},[`--${o}-box-shadow-x`]:v.scalingValue(R.left,t),[`--${o}-box-shadow-y`]:v.scalingValue(R.top,t),[`--${o}-box-shadow-blur`]:v.scalingValue(R.right,t),[`--${o}-box-shadow-spread`]:v.scalingValue(R.bottom,t),[`--${o}-inner-box-shadow-x`]:v.scalingValue(H.left,t),[`--${o}-inner-box-shadow-y`]:v.scalingValue(H.top,t),[`--${o}-inner-box-shadow-blur`]:v.scalingValue(H.right,t),[`--${o}-inner-box-shadow-spread`]:v.scalingValue(H.bottom,t),paddingTop:v.scalingValue($.top,t),paddingRight:v.scalingValue($.right,t),paddingBottom:v.scalingValue($.bottom,t),paddingLeft:v.scalingValue($.left,t),borderTopLeftRadius:v.scalingValue(T.top,t),borderTopRightRadius:v.scalingValue(T.right,t),borderBottomRightRadius:v.scalingValue(T.bottom,t),borderBottomLeftRadius:v.scalingValue(T.left,t),borderWidth:v.scalingValue(V,t),...he?{}:{justifyContent:Xr[G],textAlign:G},...he&&!le?{gap:v.scalingValue(S,t)}:{},...oe?{width:v.scalingValue(z,t),height:v.scalingValue(ne,t)}:{minWidth:v.scalingValue(k,t),minHeight:v.scalingValue(K,t),...he?{width:"100%"}:{}}};let Me;const we={display:"inline-flex",alignItems:"center",justifyContent:he?Xr[G]:Xr[s==="a"?G:"center"],gap:he?v.scalingValue(S,t):void 0,width:"100%",height:"100%",...s==="a"?{textAlign:G}:{}};if(s==="b"){const Q=()=>tl(o,c,C>0?"fixed":"fill",100,C,t);Me=le?Yr(o,Q,`${o}-icon-roll`,void 0,we):Q()}else if(s==="c"){const Q=()=>{const W=r.jsx("span",{className:`${o}-text`,style:{textAlign:G},children:d}),te=tl(o,c,y>0?"fixed":"fill",100,y,t);return b==="icon-text"?r.jsxs(r.Fragment,{children:[te,W]}):r.jsxs(r.Fragment,{children:[W,te]})};Me=le?Yr(o,Q,`${o}-icon-text-roll`,void 0,we):Q()}else Me=le?Yr(o,()=>d,`${o}-label-roll`,void 0,we):Y?r.jsx("span",{className:`${o}-button-inner`,children:d}):d;const Se=$e?Q=>ry(Q,o):void 0,B=$e?Q=>ay(Q,o):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${o}-root`,style:_,children:r.jsx("div",{className:`${o}-wrapper ${ye} ${f}`.trim(),children:r.jsx("div",{className:`${o}-button ${ve}`.trim(),style:Le,onMouseEnter:Se,onMouseLeave:B,role:"button",children:Me})})})]})}const cy=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
16635
|
+
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
16636
|
+
import { CommonComponentProps } from '../props';
|
|
16637
|
+
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
16638
|
+
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
16639
|
+
|
|
16640
|
+
type Padding = {
|
|
16641
|
+
top: number;
|
|
16642
|
+
right: number;
|
|
16643
|
+
bottom: number;
|
|
16644
|
+
left: number;
|
|
16645
|
+
};
|
|
16646
|
+
|
|
16647
|
+
type CornerRadius = {
|
|
16648
|
+
top: number;
|
|
16649
|
+
right: number;
|
|
16650
|
+
bottom: number;
|
|
16651
|
+
left: number;
|
|
16652
|
+
};
|
|
16653
|
+
|
|
16654
|
+
type BoxShadow = {
|
|
16655
|
+
top: number;
|
|
16656
|
+
left: number;
|
|
16657
|
+
right: number;
|
|
16658
|
+
bottom: number;
|
|
16659
|
+
};
|
|
16660
|
+
|
|
16661
|
+
type HoverEffect = 'none' | 'scale-up' | 'lift' | 'reveal' | 'swipe' | 'content-roll';
|
|
16662
|
+
|
|
16663
|
+
type SimpleButtonSettings = {
|
|
16664
|
+
type?: 'a' | 'b' | 'c';
|
|
16665
|
+
label?: string;
|
|
16666
|
+
icon?: string | null;
|
|
16667
|
+
alignment?: 'left' | 'center' | 'right';
|
|
16668
|
+
alignA?: 'left' | 'center' | 'right';
|
|
16669
|
+
order?: 'text-icon' | 'icon-text';
|
|
16670
|
+
gap?: number;
|
|
16671
|
+
iconSize?: number;
|
|
16672
|
+
iconWidthC?: number;
|
|
16673
|
+
iconColor?: string;
|
|
16674
|
+
dimensions?: boolean;
|
|
16675
|
+
padding?: Padding;
|
|
16676
|
+
cornerRadius?: CornerRadius;
|
|
16677
|
+
boxShadow?: BoxShadow;
|
|
16678
|
+
boxShadowColor?: string;
|
|
16679
|
+
innerBoxShadow?: BoxShadow;
|
|
16680
|
+
innerBoxShadowColor?: string;
|
|
16681
|
+
stroke?: number;
|
|
16682
|
+
backgroundColor?: string;
|
|
16683
|
+
textColor?: string;
|
|
16684
|
+
borderColor?: string;
|
|
16685
|
+
hoverEffect?: HoverEffect;
|
|
16686
|
+
fontFamily?: string;
|
|
16687
|
+
fontSettings?: {
|
|
16688
|
+
fontWeight?: number;
|
|
16689
|
+
fontStyle?: string;
|
|
16690
|
+
};
|
|
16691
|
+
fontSize?: number;
|
|
16692
|
+
lineHeight?: number;
|
|
16693
|
+
letterSpacing?: number;
|
|
16694
|
+
wordSpacing?: number;
|
|
16695
|
+
textAppearance?: {
|
|
16696
|
+
textTransform?: string;
|
|
16697
|
+
textDecoration?: string;
|
|
16698
|
+
fontVariant?: string;
|
|
16699
|
+
};
|
|
16700
|
+
stateOverrides?: Record<string, Partial<Record<ColorKeys, string>>>;
|
|
16701
|
+
minWidth?: number;
|
|
16702
|
+
minHeight?: number;
|
|
16703
|
+
width?: number;
|
|
16704
|
+
height?: number;
|
|
16705
|
+
};
|
|
16706
|
+
|
|
16707
|
+
type ColorKeys = 'backgroundColor' | 'textColor' | 'borderColor' | 'iconColor' | 'boxShadowColor' | 'innerBoxShadowColor';
|
|
16708
|
+
|
|
16709
|
+
type SimpleButtonProps = {
|
|
16710
|
+
settings: SimpleButtonSettings;
|
|
16711
|
+
isEditor?: boolean;
|
|
16712
|
+
isPreviewMode?: boolean;
|
|
16713
|
+
activeEvent?: string;
|
|
16714
|
+
} & CommonComponentProps;
|
|
16715
|
+
|
|
16716
|
+
const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
16717
|
+
backgroundColor: 'background-color',
|
|
16718
|
+
textColor: 'text-color',
|
|
16719
|
+
borderColor: 'border-color',
|
|
16720
|
+
iconColor: 'icon-color',
|
|
16721
|
+
boxShadowColor: 'box-shadow-color',
|
|
16722
|
+
innerBoxShadowColor: 'inner-box-shadow-color',
|
|
16723
|
+
};
|
|
16724
|
+
|
|
16725
|
+
const STATE_KEYS = ['hover', 'active'] as const;
|
|
16726
|
+
|
|
16727
|
+
const ALIGNMENT_MAP = {
|
|
16728
|
+
left: 'flex-start',
|
|
16729
|
+
center: 'center',
|
|
16730
|
+
right: 'flex-end',
|
|
16731
|
+
} as const;
|
|
16732
|
+
|
|
16733
|
+
function setRevealOpenDirectionFromMouseEnter(event: MouseEvent<HTMLElement>, prefix: string): void {
|
|
16734
|
+
const el = event.currentTarget;
|
|
16735
|
+
const rect = el.getBoundingClientRect();
|
|
16736
|
+
const fromBottom = event.clientY - rect.top > rect.height / 2;
|
|
16737
|
+
el.classList.toggle(\`\${prefix}-reveal-from-bottom\`, fromBottom);
|
|
16738
|
+
}
|
|
16739
|
+
|
|
16740
|
+
function setRevealCloseDirectionFromMouseLeave(event: MouseEvent<HTMLElement>, prefix: string): void {
|
|
16741
|
+
const el = event.currentTarget;
|
|
16742
|
+
const rect = el.getBoundingClientRect();
|
|
16743
|
+
const exitToTop = event.clientY < rect.top + rect.height / 2;
|
|
16744
|
+
el.classList.toggle(\`\${prefix}-reveal-from-bottom\`, exitToTop);
|
|
16745
|
+
}
|
|
16746
|
+
|
|
16747
|
+
function getCSS(P: string): string {
|
|
16748
|
+
const outerShadow = \`var(--\${P}-box-shadow-x, 0) var(--\${P}-box-shadow-y, 0) var(--\${P}-box-shadow-blur, 0) var(--\${P}-box-shadow-spread, 0) var(--\${P}-box-shadow-color, transparent)\`;
|
|
16749
|
+
const innerShadow = \`inset var(--\${P}-inner-box-shadow-x, 0) var(--\${P}-inner-box-shadow-y, 0) var(--\${P}-inner-box-shadow-blur, 0) var(--\${P}-inner-box-shadow-spread, 0) var(--\${P}-inner-box-shadow-color, transparent)\`;
|
|
16750
|
+
const boxShadow = \`\${outerShadow}, \${innerShadow}\`;
|
|
16751
|
+
const hoverOuterShadow = \`var(--\${P}-box-shadow-x, 0) var(--\${P}-box-shadow-y, 0) var(--\${P}-box-shadow-blur, 0) var(--\${P}-box-shadow-spread, 0) var(--\${P}-hover-box-shadow-color, var(--\${P}-box-shadow-color, transparent))\`;
|
|
16752
|
+
const hoverInnerShadow = \`inset var(--\${P}-inner-box-shadow-x, 0) var(--\${P}-inner-box-shadow-y, 0) var(--\${P}-inner-box-shadow-blur, 0) var(--\${P}-inner-box-shadow-spread, 0) var(--\${P}-hover-inner-box-shadow-color, var(--\${P}-inner-box-shadow-color, transparent))\`;
|
|
16753
|
+
const hoverBoxShadow = \`\${hoverOuterShadow}, \${hoverInnerShadow}\`;
|
|
16754
|
+
const activeOuterShadow = \`var(--\${P}-box-shadow-x, 0) var(--\${P}-box-shadow-y, 0) var(--\${P}-box-shadow-blur, 0) var(--\${P}-box-shadow-spread, 0) var(--\${P}-active-box-shadow-color, var(--\${P}-box-shadow-color, transparent))\`;
|
|
16755
|
+
const activeInnerShadow = \`inset var(--\${P}-inner-box-shadow-x, 0) var(--\${P}-inner-box-shadow-y, 0) var(--\${P}-inner-box-shadow-blur, 0) var(--\${P}-inner-box-shadow-spread, 0) var(--\${P}-active-inner-box-shadow-color, var(--\${P}-inner-box-shadow-color, transparent))\`;
|
|
16756
|
+
const activeBoxShadow = \`\${activeOuterShadow}, \${activeInnerShadow}\`;
|
|
16757
|
+
const liftBoxShadow = \`0 4px 12px rgba(0, 0, 0, 0.15), \${innerShadow}\`;
|
|
16758
|
+
|
|
16759
|
+
return \`
|
|
16760
|
+
.\${P}-root {
|
|
16761
|
+
line-height: 0;
|
|
16762
|
+
}
|
|
16763
|
+
.\${P}-wrapper {
|
|
16764
|
+
display: inline-flex;
|
|
16765
|
+
vertical-align: top;
|
|
16766
|
+
pointer-events: none;
|
|
16767
|
+
}
|
|
16768
|
+
.\${P}-button {
|
|
16769
|
+
display: inline-flex;
|
|
16770
|
+
align-items: center;
|
|
16771
|
+
box-sizing: border-box;
|
|
16772
|
+
border-style: solid;
|
|
16773
|
+
border-color: var(--\${P}-border-color);
|
|
16774
|
+
background-color: var(--\${P}-background-color);
|
|
16775
|
+
color: var(--\${P}-text-color);
|
|
16776
|
+
cursor: pointer;
|
|
16777
|
+
font: inherit;
|
|
16778
|
+
white-space: pre-wrap;
|
|
16779
|
+
overflow-wrap: anywhere;
|
|
16780
|
+
word-break: break-word;
|
|
16781
|
+
user-select: none;
|
|
16782
|
+
pointer-events: auto;
|
|
16783
|
+
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
|
|
16784
|
+
box-shadow: \${boxShadow};
|
|
16785
|
+
}
|
|
16786
|
+
.\${P}-wrapper.\${P}-editing .\${P}-button {
|
|
16787
|
+
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms;
|
|
16788
|
+
}
|
|
16789
|
+
.\${P}-hover-effect-scale-up:hover,
|
|
16790
|
+
.\${P}-hover-effect-scale-up:focus-visible,
|
|
16791
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-scale-up {
|
|
16792
|
+
transform: scale(1.05);
|
|
16793
|
+
}
|
|
16794
|
+
.\${P}-hover-effect-lift:hover,
|
|
16795
|
+
.\${P}-hover-effect-lift:focus-visible,
|
|
16796
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-lift {
|
|
16797
|
+
transform: translateY(-2px);
|
|
16798
|
+
box-shadow: \${liftBoxShadow};
|
|
16799
|
+
}
|
|
16800
|
+
.\${P}-hover-effect-reveal,
|
|
16801
|
+
.\${P}-hover-effect-swipe {
|
|
16802
|
+
position: relative;
|
|
16803
|
+
overflow: hidden;
|
|
16804
|
+
}
|
|
16805
|
+
.\${P}-hover-effect-reveal .\${P}-button-inner,
|
|
16806
|
+
.\${P}-hover-effect-reveal .\${P}-text,
|
|
16807
|
+
.\${P}-hover-effect-reveal .\${P}-icon,
|
|
16808
|
+
.\${P}-hover-effect-swipe .\${P}-button-inner,
|
|
16809
|
+
.\${P}-hover-effect-swipe .\${P}-text,
|
|
16810
|
+
.\${P}-hover-effect-swipe .\${P}-icon {
|
|
16811
|
+
position: relative;
|
|
16812
|
+
z-index: 1;
|
|
16813
|
+
}
|
|
16814
|
+
.\${P}-hover-effect-reveal::before {
|
|
16815
|
+
content: '';
|
|
16816
|
+
position: absolute;
|
|
16817
|
+
inset: 0;
|
|
16818
|
+
background-color: var(--\${P}-hover-background-color, var(--\${P}-background-color));
|
|
16819
|
+
pointer-events: none;
|
|
16820
|
+
z-index: 0;
|
|
16821
|
+
transform: scaleY(0);
|
|
16822
|
+
transform-origin: bottom center;
|
|
16823
|
+
transition: transform 120ms;
|
|
16824
|
+
}
|
|
16825
|
+
.\${P}-hover-effect-reveal:hover::before,
|
|
16826
|
+
.\${P}-hover-effect-reveal:focus-visible::before,
|
|
16827
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-reveal::before {
|
|
16828
|
+
transform: scaleY(1);
|
|
16829
|
+
transform-origin: top center;
|
|
16830
|
+
}
|
|
16831
|
+
.\${P}-hover-effect-reveal.\${P}-reveal-from-bottom::before {
|
|
16832
|
+
transform-origin: top center;
|
|
16833
|
+
}
|
|
16834
|
+
.\${P}-hover-effect-reveal.\${P}-reveal-from-bottom:hover::before,
|
|
16835
|
+
.\${P}-hover-effect-reveal.\${P}-reveal-from-bottom:focus-visible::before,
|
|
16836
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-reveal.\${P}-reveal-from-bottom::before {
|
|
16837
|
+
transform-origin: bottom center;
|
|
16838
|
+
}
|
|
16839
|
+
.\${P}-hover-effect-swipe::before {
|
|
16840
|
+
content: '';
|
|
16841
|
+
position: absolute;
|
|
16842
|
+
inset: 0;
|
|
16843
|
+
background-color: var(--\${P}-hover-background-color, var(--\${P}-background-color));
|
|
16844
|
+
pointer-events: none;
|
|
16845
|
+
z-index: 0;
|
|
16846
|
+
transform: translateX(-100%);
|
|
16847
|
+
transition: transform 250ms;
|
|
16848
|
+
}
|
|
16849
|
+
.\${P}-hover-effect-swipe:hover::before,
|
|
16850
|
+
.\${P}-hover-effect-swipe:focus-visible::before,
|
|
16851
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-swipe::before {
|
|
16852
|
+
transform: translateX(0);
|
|
16853
|
+
}
|
|
16854
|
+
.\${P}-hover-effect-reveal:hover,
|
|
16855
|
+
.\${P}-hover-effect-reveal:focus-visible,
|
|
16856
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-reveal,
|
|
16857
|
+
.\${P}-hover-effect-swipe:hover,
|
|
16858
|
+
.\${P}-hover-effect-swipe:focus-visible,
|
|
16859
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-swipe {
|
|
16860
|
+
background-color: var(--\${P}-background-color);
|
|
16861
|
+
}
|
|
16862
|
+
.\${P}-hover-effect-content-roll {
|
|
16863
|
+
position: relative;
|
|
16864
|
+
overflow: hidden;
|
|
16865
|
+
align-items: stretch;
|
|
16866
|
+
}
|
|
16867
|
+
.\${P}-content-roll-wrap {
|
|
16868
|
+
position: relative;
|
|
16869
|
+
align-self: stretch;
|
|
16870
|
+
min-width: 0;
|
|
16871
|
+
}
|
|
16872
|
+
.\${P}-content-roll-wrap.\${P}-icon-text-roll {
|
|
16873
|
+
flex: 1;
|
|
16874
|
+
width: 100%;
|
|
16875
|
+
}
|
|
16876
|
+
.\${P}-content-roll-wrap.\${P}-icon-roll,
|
|
16877
|
+
.\${P}-content-roll-wrap.\${P}-label-roll {
|
|
16878
|
+
display: inline-block;
|
|
16879
|
+
flex: 1;
|
|
16880
|
+
}
|
|
16881
|
+
.\${P}-content-roll-spacer {
|
|
16882
|
+
visibility: hidden;
|
|
16883
|
+
pointer-events: none;
|
|
16884
|
+
}
|
|
16885
|
+
.\${P}-content-roll-viewport {
|
|
16886
|
+
position: absolute;
|
|
16887
|
+
inset: 0;
|
|
16888
|
+
pointer-events: none;
|
|
16889
|
+
}
|
|
16890
|
+
.\${P}-content-roll-layer {
|
|
16891
|
+
position: absolute;
|
|
16892
|
+
left: 0;
|
|
16893
|
+
right: 0;
|
|
16894
|
+
top: 50%;
|
|
16895
|
+
transform: translateY(-50%);
|
|
16896
|
+
transition: transform 250ms ease, opacity 250ms ease, top 250ms ease;
|
|
16897
|
+
opacity: 1;
|
|
16898
|
+
pointer-events: none;
|
|
16899
|
+
}
|
|
16900
|
+
.\${P}-content-roll-layer-hover {
|
|
16901
|
+
top: 0;
|
|
16902
|
+
transform: translateY(-100%);
|
|
16903
|
+
opacity: 0;
|
|
16904
|
+
}
|
|
16905
|
+
.\${P}-hover-effect-content-roll:hover .\${P}-content-roll-layer:not(.\${P}-content-roll-layer-hover),
|
|
16906
|
+
.\${P}-hover-effect-content-roll:focus-visible .\${P}-content-roll-layer:not(.\${P}-content-roll-layer-hover),
|
|
16907
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-content-roll .\${P}-content-roll-layer:not(.\${P}-content-roll-layer-hover) {
|
|
16908
|
+
top: 100%;
|
|
16909
|
+
transform: translateY(0);
|
|
16910
|
+
opacity: 0;
|
|
16911
|
+
}
|
|
16912
|
+
.\${P}-hover-effect-content-roll:hover .\${P}-content-roll-layer-hover,
|
|
16913
|
+
.\${P}-hover-effect-content-roll:focus-visible .\${P}-content-roll-layer-hover,
|
|
16914
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-hover-effect-content-roll .\${P}-content-roll-layer-hover {
|
|
16915
|
+
top: 50%;
|
|
16916
|
+
transform: translateY(-50%);
|
|
16917
|
+
opacity: 1;
|
|
16918
|
+
}
|
|
16919
|
+
.\${P}-button:hover,
|
|
16920
|
+
.\${P}-button:focus-visible {
|
|
16921
|
+
background-color: var(--\${P}-hover-background-color, var(--\${P}-background-color));
|
|
16922
|
+
color: var(--\${P}-hover-text-color, var(--\${P}-text-color));
|
|
16923
|
+
border-color: var(--\${P}-hover-border-color, var(--\${P}-border-color));
|
|
16924
|
+
box-shadow: \${hoverBoxShadow};
|
|
16925
|
+
}
|
|
16926
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-button {
|
|
16927
|
+
background-color: var(--\${P}-hover-background-color, var(--\${P}-background-color));
|
|
16928
|
+
color: var(--\${P}-hover-text-color, var(--\${P}-text-color));
|
|
16929
|
+
border-color: var(--\${P}-hover-border-color, var(--\${P}-border-color));
|
|
16930
|
+
box-shadow: \${hoverBoxShadow};
|
|
16931
|
+
}
|
|
16932
|
+
.\${P}-button:focus,
|
|
16933
|
+
.\${P}-button:focus-visible {
|
|
16934
|
+
outline: none;
|
|
16935
|
+
}
|
|
16936
|
+
.\${P}-button:active {
|
|
16937
|
+
background-color: var(--\${P}-active-background-color, var(--\${P}-background-color));
|
|
16938
|
+
color: var(--\${P}-active-text-color, var(--\${P}-text-color));
|
|
16939
|
+
border-color: var(--\${P}-active-border-color, var(--\${P}-border-color));
|
|
16940
|
+
box-shadow: \${activeBoxShadow};
|
|
16941
|
+
}
|
|
16942
|
+
.\${P}-wrapper.\${P}-state-active .\${P}-button {
|
|
16943
|
+
background-color: var(--\${P}-active-background-color, var(--\${P}-background-color));
|
|
16944
|
+
color: var(--\${P}-active-text-color, var(--\${P}-text-color));
|
|
16945
|
+
border-color: var(--\${P}-active-border-color, var(--\${P}-border-color));
|
|
16946
|
+
box-shadow: \${activeBoxShadow};
|
|
16947
|
+
}
|
|
16948
|
+
.\${P}-text {
|
|
16949
|
+
display: block;
|
|
16950
|
+
flex: 1;
|
|
16951
|
+
min-width: 0;
|
|
16952
|
+
}
|
|
16953
|
+
.\${P}-icon {
|
|
16954
|
+
display: block;
|
|
16955
|
+
flex-shrink: 0;
|
|
16956
|
+
position: relative;
|
|
16957
|
+
}
|
|
16958
|
+
.\${P}-icon-image {
|
|
16959
|
+
transition: background-color 250ms;
|
|
16960
|
+
}
|
|
16961
|
+
.\${P}-button:hover .\${P}-icon-image,
|
|
16962
|
+
.\${P}-button:focus-visible .\${P}-icon-image,
|
|
16963
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-icon-image {
|
|
16964
|
+
--fill: var(--\${P}-hover-icon-color, var(--\${P}-icon-color)) !important;
|
|
16965
|
+
--hover-fill: var(--\${P}-hover-icon-color, var(--\${P}-icon-color)) !important;
|
|
16966
|
+
}
|
|
16967
|
+
.\${P}-button:active .\${P}-icon-image,
|
|
16968
|
+
.\${P}-wrapper.\${P}-state-active .\${P}-icon-image {
|
|
16969
|
+
--fill: var(--\${P}-active-icon-color, var(--\${P}-icon-color)) !important;
|
|
16970
|
+
--hover-fill: var(--\${P}-active-icon-color, var(--\${P}-icon-color)) !important;
|
|
16971
|
+
}
|
|
16972
|
+
.\${P}-icon .\${P}-icon-image {
|
|
16973
|
+
width: 100%;
|
|
16974
|
+
height: 100%;
|
|
16975
|
+
}
|
|
16976
|
+
.\${P}-icon-fill {
|
|
16977
|
+
max-width: 100%;
|
|
16978
|
+
width: 100%;
|
|
16979
|
+
height: auto;
|
|
16980
|
+
}
|
|
16981
|
+
.\${P}-icon-fill .\${P}-icon-image {
|
|
16982
|
+
position: relative;
|
|
16983
|
+
top: auto;
|
|
16984
|
+
left: auto;
|
|
16985
|
+
transform: none;
|
|
16986
|
+
width: 100%;
|
|
16987
|
+
height: auto;
|
|
16988
|
+
}
|
|
16989
|
+
.\${P}-icon-inline {
|
|
16990
|
+
display: inline-block;
|
|
16991
|
+
height: calc(1em * var(--\${P}-icon-scale, 1));
|
|
16992
|
+
width: calc(1em * var(--\${P}-icon-scale, 1));
|
|
16993
|
+
}
|
|
16994
|
+
\`;
|
|
16995
|
+
}
|
|
16996
|
+
|
|
16997
|
+
function renderContentRoll(
|
|
16998
|
+
P: string,
|
|
16999
|
+
renderContent: () => ReactNode,
|
|
17000
|
+
className = '',
|
|
17001
|
+
wrapStyle?: CSSProperties,
|
|
17002
|
+
layerStyle?: CSSProperties,
|
|
17003
|
+
) {
|
|
17004
|
+
const spacerContent = renderContent();
|
|
17005
|
+
|
|
17006
|
+
return (
|
|
17007
|
+
<span className={\`\${P}-content-roll-wrap \${className}\`.trim()} style={wrapStyle}>
|
|
17008
|
+
<span className={\`\${P}-content-roll-spacer\`} aria-hidden="true" style={layerStyle}>{spacerContent}</span>
|
|
17009
|
+
<span className={\`\${P}-content-roll-viewport\`}>
|
|
17010
|
+
<span className={\`\${P}-content-roll-layer\`} style={layerStyle}>{renderContent()}</span>
|
|
17011
|
+
<span className={\`\${P}-content-roll-layer \${P}-content-roll-layer-hover\`} aria-hidden="true" style={layerStyle}>{renderContent()}</span>
|
|
17012
|
+
</span>
|
|
17013
|
+
</span>
|
|
17014
|
+
);
|
|
17015
|
+
}
|
|
17016
|
+
|
|
17017
|
+
function renderIcon(
|
|
17018
|
+
P: string,
|
|
17019
|
+
icon?: string | null,
|
|
17020
|
+
variant: 'fill' | 'inline' | 'fixed' = 'fill',
|
|
17021
|
+
iconScale = 100,
|
|
17022
|
+
iconSize = 0,
|
|
17023
|
+
isEditor?: boolean,
|
|
17024
|
+
) {
|
|
17025
|
+
if (!icon) return null;
|
|
17026
|
+
|
|
17027
|
+
const svgImage = (
|
|
17028
|
+
<SvgImage
|
|
17029
|
+
url={icon}
|
|
17030
|
+
fill={\`var(--\${P}-icon-color)\`}
|
|
17031
|
+
hoverFill={\`var(--\${P}-icon-color)\`}
|
|
17032
|
+
className={\`\${P}-icon-image\`}
|
|
17033
|
+
/>
|
|
17034
|
+
);
|
|
17035
|
+
|
|
17036
|
+
if (variant === 'inline') {
|
|
17037
|
+
return (
|
|
17038
|
+
<span
|
|
17039
|
+
className={\`\${P}-icon \${P}-icon-inline\`}
|
|
17040
|
+
style={{ [\`--\${P}-icon-scale\`]: iconScale / 100 }}
|
|
17041
|
+
aria-hidden="true"
|
|
17042
|
+
>
|
|
17043
|
+
{svgImage}
|
|
17044
|
+
</span>
|
|
17045
|
+
);
|
|
17046
|
+
}
|
|
17047
|
+
|
|
17048
|
+
if (variant === 'fixed' && iconSize > 0) {
|
|
17049
|
+
const size = scalingValue(iconSize, isEditor);
|
|
17050
|
+
return (
|
|
17051
|
+
<span className={\`\${P}-icon\`} style={{ width: size, height: size }} aria-hidden="true">
|
|
17052
|
+
{svgImage}
|
|
17053
|
+
</span>
|
|
17054
|
+
);
|
|
17055
|
+
}
|
|
17056
|
+
|
|
17057
|
+
return (
|
|
17058
|
+
<span className={\`\${P}-icon \${P}-icon-fill\`} aria-hidden="true">
|
|
17059
|
+
{svgImage}
|
|
17060
|
+
</span>
|
|
17061
|
+
);
|
|
17062
|
+
}
|
|
17063
|
+
|
|
17064
|
+
export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent }: SimpleButtonProps) {
|
|
17065
|
+
const { prefix: P } = useScopedStyles();
|
|
17066
|
+
const scopedCss = useMemo(() => getCSS(P), [P]);
|
|
17067
|
+
|
|
17068
|
+
const {
|
|
17069
|
+
type = 'a',
|
|
17070
|
+
label = 'Button',
|
|
17071
|
+
icon,
|
|
17072
|
+
alignment = 'center',
|
|
17073
|
+
alignA,
|
|
17074
|
+
order = 'text-icon',
|
|
17075
|
+
gap = 0,
|
|
17076
|
+
iconSize = 0,
|
|
17077
|
+
iconWidthC = 0,
|
|
17078
|
+
dimensions = false,
|
|
17079
|
+
padding = { top: 0, right: 0, bottom: 0, left: 0 },
|
|
17080
|
+
cornerRadius = { top: 0, right: 0, bottom: 0, left: 0 },
|
|
17081
|
+
boxShadow = { top: 0, left: 0, right: 0, bottom: 0 },
|
|
17082
|
+
boxShadowColor = 'rgba(0, 0, 0, 0)',
|
|
17083
|
+
innerBoxShadow = { top: 0, left: 0, right: 0, bottom: 0 },
|
|
17084
|
+
innerBoxShadowColor = 'rgba(0, 0, 0, 0)',
|
|
17085
|
+
stroke = 0,
|
|
17086
|
+
backgroundColor = '#000000',
|
|
17087
|
+
textColor = '#ffffff',
|
|
17088
|
+
borderColor = '#ffffff',
|
|
17089
|
+
iconColor = '#ffffff',
|
|
17090
|
+
hoverEffect = 'none',
|
|
17091
|
+
fontFamily,
|
|
17092
|
+
fontSettings,
|
|
17093
|
+
fontSize,
|
|
17094
|
+
lineHeight,
|
|
17095
|
+
letterSpacing = 0,
|
|
17096
|
+
wordSpacing = 0,
|
|
17097
|
+
textAppearance,
|
|
17098
|
+
stateOverrides,
|
|
17099
|
+
minWidth = 0,
|
|
17100
|
+
minHeight = 0,
|
|
17101
|
+
width = 0,
|
|
17102
|
+
height = 0,
|
|
17103
|
+
} = settings;
|
|
17104
|
+
|
|
17105
|
+
const colorVars = buildColorVars(P, {
|
|
17106
|
+
backgroundColor,
|
|
17107
|
+
textColor,
|
|
17108
|
+
borderColor,
|
|
17109
|
+
iconColor,
|
|
17110
|
+
boxShadowColor,
|
|
17111
|
+
innerBoxShadowColor,
|
|
17112
|
+
}, COLOR_VAR_MAP, STATE_KEYS, stateOverrides);
|
|
17113
|
+
|
|
17114
|
+
const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
|
|
17115
|
+
const editingClass = isEditor && !isPreviewMode ? \`\${P}-editing\` : '';
|
|
17116
|
+
const hoverEffectClass = hoverEffect !== 'none' && (!isEditor || isPreviewMode || activeEvent === 'hover')
|
|
17117
|
+
? \`\${P}-hover-effect-\${hoverEffect}\`
|
|
17118
|
+
: '';
|
|
17119
|
+
const useHoverOverlay = hoverEffect === 'reveal' || hoverEffect === 'swipe';
|
|
17120
|
+
const useContentRoll = hoverEffect === 'content-roll';
|
|
17121
|
+
const revealHoverActive = hoverEffect === 'reveal' && (!isEditor || isPreviewMode);
|
|
17122
|
+
|
|
17123
|
+
const isFixedDimensions = dimensions === true;
|
|
17124
|
+
const resolvedAlignment = type === 'a' ? (alignA ?? alignment) : alignment;
|
|
17125
|
+
const effectiveAlignment = resolvedAlignment;
|
|
17126
|
+
|
|
17127
|
+
const isIconTextType = type === 'c';
|
|
17128
|
+
const hasText = type !== 'b';
|
|
17129
|
+
|
|
17130
|
+
const resolvedTextStyle: TextStyles = {
|
|
17131
|
+
fontSettings: {
|
|
17132
|
+
fontFamily,
|
|
17133
|
+
fontWeight: fontSettings?.fontWeight ?? 400,
|
|
17134
|
+
fontStyle: fontSettings?.fontStyle ?? 'normal',
|
|
17135
|
+
},
|
|
17136
|
+
fontSize: fontSize ?? 0.01,
|
|
17137
|
+
lineHeight,
|
|
17138
|
+
letterSpacing,
|
|
17139
|
+
wordSpacing,
|
|
17140
|
+
textAppearance,
|
|
17141
|
+
color: textColor,
|
|
17142
|
+
};
|
|
17143
|
+
|
|
17144
|
+
const typographyCss = hasText
|
|
17145
|
+
? omitTextColors(textStylesToCss(resolvedTextStyle, isEditor))
|
|
17146
|
+
: {};
|
|
17147
|
+
|
|
17148
|
+
const buttonStyle = {
|
|
17149
|
+
...typographyCss,
|
|
17150
|
+
[\`--\${P}-box-shadow-x\`]: scalingValue(boxShadow.left, isEditor),
|
|
17151
|
+
[\`--\${P}-box-shadow-y\`]: scalingValue(boxShadow.top, isEditor),
|
|
17152
|
+
[\`--\${P}-box-shadow-blur\`]: scalingValue(boxShadow.right, isEditor),
|
|
17153
|
+
[\`--\${P}-box-shadow-spread\`]: scalingValue(boxShadow.bottom, isEditor),
|
|
17154
|
+
[\`--\${P}-inner-box-shadow-x\`]: scalingValue(innerBoxShadow.left, isEditor),
|
|
17155
|
+
[\`--\${P}-inner-box-shadow-y\`]: scalingValue(innerBoxShadow.top, isEditor),
|
|
17156
|
+
[\`--\${P}-inner-box-shadow-blur\`]: scalingValue(innerBoxShadow.right, isEditor),
|
|
17157
|
+
[\`--\${P}-inner-box-shadow-spread\`]: scalingValue(innerBoxShadow.bottom, isEditor),
|
|
17158
|
+
paddingTop: scalingValue(padding.top, isEditor),
|
|
17159
|
+
paddingRight: scalingValue(padding.right, isEditor),
|
|
17160
|
+
paddingBottom: scalingValue(padding.bottom, isEditor),
|
|
17161
|
+
paddingLeft: scalingValue(padding.left, isEditor),
|
|
17162
|
+
borderTopLeftRadius: scalingValue(cornerRadius.top, isEditor),
|
|
17163
|
+
borderTopRightRadius: scalingValue(cornerRadius.right, isEditor),
|
|
17164
|
+
borderBottomRightRadius: scalingValue(cornerRadius.bottom, isEditor),
|
|
17165
|
+
borderBottomLeftRadius: scalingValue(cornerRadius.left, isEditor),
|
|
17166
|
+
borderWidth: scalingValue(stroke, isEditor),
|
|
17167
|
+
...(!isIconTextType ? {
|
|
17168
|
+
justifyContent: ALIGNMENT_MAP[effectiveAlignment],
|
|
17169
|
+
textAlign: effectiveAlignment,
|
|
17170
|
+
} : {}),
|
|
17171
|
+
...(isIconTextType && !useContentRoll ? { gap: scalingValue(gap, isEditor) } : {}),
|
|
17172
|
+
...(isFixedDimensions
|
|
17173
|
+
? {
|
|
17174
|
+
width: scalingValue(width, isEditor),
|
|
17175
|
+
height: scalingValue(height, isEditor),
|
|
17176
|
+
}
|
|
17177
|
+
: {
|
|
17178
|
+
minWidth: scalingValue(minWidth, isEditor),
|
|
17179
|
+
minHeight: scalingValue(minHeight, isEditor),
|
|
17180
|
+
...(isIconTextType ? { width: '100%' } : {}),
|
|
17181
|
+
}),
|
|
17182
|
+
};
|
|
17183
|
+
|
|
17184
|
+
let buttonContent: ReactNode;
|
|
17185
|
+
|
|
17186
|
+
const rollLayerStyle: CSSProperties = {
|
|
17187
|
+
display: 'inline-flex',
|
|
17188
|
+
alignItems: 'center',
|
|
17189
|
+
justifyContent: isIconTextType
|
|
17190
|
+
? ALIGNMENT_MAP[effectiveAlignment]
|
|
17191
|
+
: ALIGNMENT_MAP[type === 'a' ? effectiveAlignment : 'center'],
|
|
17192
|
+
gap: isIconTextType ? scalingValue(gap, isEditor) : undefined,
|
|
17193
|
+
width: '100%',
|
|
17194
|
+
height: '100%',
|
|
17195
|
+
...(type === 'a' ? { textAlign: effectiveAlignment } : {}),
|
|
17196
|
+
};
|
|
17197
|
+
|
|
17198
|
+
if (type === 'b') {
|
|
17199
|
+
const renderIconContent = () => renderIcon(P, icon, iconSize > 0 ? 'fixed' : 'fill', 100, iconSize, isEditor);
|
|
17200
|
+
buttonContent = useContentRoll
|
|
17201
|
+
? renderContentRoll(P, renderIconContent, \`\${P}-icon-roll\`, undefined, rollLayerStyle)
|
|
17202
|
+
: renderIconContent();
|
|
17203
|
+
} else if (type === 'c') {
|
|
17204
|
+
const renderIconTextContent = () => {
|
|
17205
|
+
const textNode = (
|
|
17206
|
+
<span
|
|
17207
|
+
className={\`\${P}-text\`}
|
|
17208
|
+
style={{ textAlign: effectiveAlignment }}
|
|
17209
|
+
>
|
|
17210
|
+
{label}
|
|
17211
|
+
</span>
|
|
17212
|
+
);
|
|
17213
|
+
const iconNode = renderIcon(P, icon, iconWidthC > 0 ? 'fixed' : 'fill', 100, iconWidthC, isEditor);
|
|
17214
|
+
return order === 'icon-text'
|
|
17215
|
+
? <>{iconNode}{textNode}</>
|
|
17216
|
+
: <>{textNode}{iconNode}</>;
|
|
17217
|
+
};
|
|
17218
|
+
|
|
17219
|
+
buttonContent = useContentRoll
|
|
17220
|
+
? renderContentRoll(P, renderIconTextContent, \`\${P}-icon-text-roll\`, undefined, rollLayerStyle)
|
|
17221
|
+
: renderIconTextContent();
|
|
17222
|
+
} else {
|
|
17223
|
+
const renderLabelContent = () => label;
|
|
17224
|
+
buttonContent = useContentRoll
|
|
17225
|
+
? renderContentRoll(P, renderLabelContent, \`\${P}-label-roll\`, undefined, rollLayerStyle)
|
|
17226
|
+
: useHoverOverlay
|
|
17227
|
+
? <span className={\`\${P}-button-inner\`}>{label}</span>
|
|
17228
|
+
: label;
|
|
17229
|
+
}
|
|
17230
|
+
|
|
17231
|
+
const handleRevealMouseEnter = revealHoverActive
|
|
17232
|
+
? (event: MouseEvent<HTMLDivElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
|
|
17233
|
+
: undefined;
|
|
17234
|
+
const handleRevealMouseLeave = revealHoverActive
|
|
17235
|
+
? (event: MouseEvent<HTMLDivElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
|
|
17236
|
+
: undefined;
|
|
17237
|
+
|
|
17238
|
+
return (
|
|
17239
|
+
<>
|
|
17240
|
+
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
17241
|
+
<div className={\`\${P}-root\`} style={colorVars}>
|
|
17242
|
+
<div className={\`\${P}-wrapper \${stateClass} \${editingClass}\`.trim()}>
|
|
17243
|
+
<div
|
|
17244
|
+
className={\`\${P}-button \${hoverEffectClass}\`.trim()}
|
|
17245
|
+
style={buttonStyle}
|
|
17246
|
+
onMouseEnter={handleRevealMouseEnter}
|
|
17247
|
+
onMouseLeave={handleRevealMouseLeave}
|
|
17248
|
+
role="button"
|
|
17249
|
+
>
|
|
17250
|
+
{buttonContent}
|
|
17251
|
+
</div>
|
|
17252
|
+
</div>
|
|
17253
|
+
</div>
|
|
17254
|
+
</>
|
|
17255
|
+
);
|
|
17256
|
+
}
|
|
17257
|
+
`,dy={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},uy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],py={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:"object",scope:"layout",title:"Corner radius",display:{type:"padding-controls"}},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:{...dy.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:{top:20/375,right:20/375,bottom:20/375,left: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:{top:20/768,right:20/768,bottom:20/768,left: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:{top:20/1440,right:20/1440,bottom:20/1440,left: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:[...uy],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"]},my={element:ly,id:"simple-button",name:"Simple Button",category:"dev",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:py,sourceCode:cy,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function gy(e){return`
|
|
17258
|
+
.${e}-titles-row {
|
|
17259
|
+
position: relative;
|
|
17260
|
+
flex: 0 1 auto;
|
|
17261
|
+
z-index: 2;
|
|
17262
|
+
box-sizing: border-box;
|
|
17263
|
+
pointer-events: none;
|
|
17264
|
+
word-break: break-word;
|
|
17265
|
+
min-width: 0;
|
|
17266
|
+
display: flex;
|
|
17267
|
+
flex-direction: row;
|
|
17268
|
+
align-items: baseline;
|
|
17269
|
+
}
|
|
17270
|
+
.${e}-titles-row-header {
|
|
17271
|
+
flex: 1;
|
|
17272
|
+
align-items: baseline;
|
|
17273
|
+
}
|
|
17274
|
+
.${e}-titles-row-header-controls {
|
|
17275
|
+
display: flex;
|
|
17276
|
+
flex-direction: row;
|
|
17277
|
+
align-items: baseline;
|
|
17278
|
+
flex-shrink: 0;
|
|
17279
|
+
}
|
|
17280
|
+
.${e}-close-icon {
|
|
17281
|
+
position: relative;
|
|
17282
|
+
flex-shrink: 0;
|
|
17283
|
+
align-self: center;
|
|
17284
|
+
pointer-events: auto;
|
|
17285
|
+
z-index: 2;
|
|
17286
|
+
display: flex;
|
|
17287
|
+
align-items: center;
|
|
17288
|
+
justify-content: center;
|
|
17289
|
+
border: none;
|
|
17290
|
+
background-color: transparent;
|
|
17291
|
+
padding: 0;
|
|
17292
|
+
}
|
|
17293
|
+
.${e}-close-icon-inner {
|
|
17294
|
+
all: unset;
|
|
17295
|
+
position: relative;
|
|
17296
|
+
cursor: pointer;
|
|
17297
|
+
width: 100%;
|
|
17298
|
+
height: 100%;
|
|
17299
|
+
pointer-events: auto;
|
|
17300
|
+
}
|
|
17301
|
+
.${e}-close-icon-img {
|
|
17302
|
+
position: absolute;
|
|
17303
|
+
top: 50%;
|
|
17304
|
+
left: 50%;
|
|
17305
|
+
transform: translate(-50%, -50%);
|
|
17306
|
+
}
|
|
17307
|
+
.${e}-titles-baseline-strut {
|
|
17308
|
+
width: 0;
|
|
17309
|
+
overflow: hidden;
|
|
17310
|
+
flex-shrink: 0;
|
|
17311
|
+
pointer-events: none;
|
|
17312
|
+
white-space: nowrap;
|
|
17313
|
+
}
|
|
17314
|
+
.${e}-titles-row-titles {
|
|
17315
|
+
position: relative;
|
|
17316
|
+
flex: 1;
|
|
17317
|
+
min-width: 0;
|
|
17318
|
+
align-self: flex-start;
|
|
17319
|
+
}
|
|
17320
|
+
.${e}-titles-stack {
|
|
17321
|
+
position: relative;
|
|
17322
|
+
display: flex;
|
|
17323
|
+
flex-direction: row;
|
|
17324
|
+
align-items: baseline;
|
|
17325
|
+
align-self: flex-start;
|
|
17326
|
+
min-width: 0;
|
|
17327
|
+
}
|
|
17328
|
+
.${e}-titles-row-two-row {
|
|
17329
|
+
display: flex;
|
|
17330
|
+
flex: 1;
|
|
17331
|
+
height: 100%;
|
|
17332
|
+
min-height: 0;
|
|
17333
|
+
align-self: stretch;
|
|
17334
|
+
flex-direction: column;
|
|
17335
|
+
width: 100%;
|
|
17336
|
+
}
|
|
17337
|
+
.${e}-titles-row-top {
|
|
17338
|
+
display: flex;
|
|
17339
|
+
flex-direction: row;
|
|
17340
|
+
align-items: baseline;
|
|
17341
|
+
width: 100%;
|
|
17342
|
+
flex-shrink: 0;
|
|
17343
|
+
margin-bottom: 0;
|
|
17344
|
+
}
|
|
17345
|
+
.${e}-titles-row-top .${e}-title-cell[data-title="title1"] {
|
|
17346
|
+
flex: 0 0 auto;
|
|
17347
|
+
min-width: 0;
|
|
17348
|
+
}
|
|
17349
|
+
.${e}-titles-row-bottom-wrap {
|
|
17350
|
+
display: flex;
|
|
17351
|
+
flex-direction: column;
|
|
17352
|
+
width: 100%;
|
|
17353
|
+
margin-top: auto;
|
|
17354
|
+
flex-shrink: 0;
|
|
17355
|
+
}
|
|
17356
|
+
.${e}-titles-row-bottom-area {
|
|
17357
|
+
position: relative;
|
|
17358
|
+
flex: 1;
|
|
17359
|
+
min-height: 0;
|
|
17360
|
+
display: flex;
|
|
17361
|
+
flex-direction: column;
|
|
17362
|
+
width: 100%;
|
|
17363
|
+
}
|
|
17364
|
+
.${e}-titles-row-bottom {
|
|
17365
|
+
position: relative;
|
|
17366
|
+
display: flex;
|
|
17367
|
+
flex-direction: row;
|
|
17368
|
+
align-items: flex-end;
|
|
17369
|
+
width: 100%;
|
|
17370
|
+
}
|
|
17371
|
+
.${e}-titles-row-bottom .${e}-title-cell {
|
|
17372
|
+
flex: 0 0 auto;
|
|
17373
|
+
}
|
|
17374
|
+
.${e}-title-cell {
|
|
17375
|
+
position: relative;
|
|
17376
|
+
flex: 0 0 auto;
|
|
17377
|
+
min-width: 0;
|
|
17378
|
+
box-sizing: border-box;
|
|
17379
|
+
}
|
|
17380
|
+
.${e}-text-bar-cell {
|
|
17381
|
+
position: relative;
|
|
17382
|
+
flex: 0 1 auto;
|
|
17383
|
+
min-width: 0;
|
|
17384
|
+
display: flex;
|
|
17385
|
+
align-items: baseline;
|
|
17386
|
+
}
|
|
17387
|
+
.${e}-title1,
|
|
17388
|
+
.${e}-title2,
|
|
17389
|
+
.${e}-title3 {
|
|
17390
|
+
margin: 0;
|
|
17391
|
+
min-width: 0;
|
|
17392
|
+
}
|
|
17393
|
+
.${e}-title-resize-handle {
|
|
17394
|
+
background: transparent;
|
|
17395
|
+
}
|
|
17396
|
+
.${e}-lightbox {
|
|
17397
|
+
position: fixed;
|
|
17398
|
+
inset: 0;
|
|
17399
|
+
z-index: 9997;
|
|
17400
|
+
overscroll-behavior: none;
|
|
17401
|
+
overflow: hidden;
|
|
17402
|
+
}
|
|
17403
|
+
.${e}-lightbox-editor {
|
|
17404
|
+
inset: auto;
|
|
17405
|
+
top: var(--cntrl-article-top, 0);
|
|
17406
|
+
left: var(--cntrl-article-left, 0);
|
|
17407
|
+
width: var(--cntrl-article-width, 100vw) !important;
|
|
17408
|
+
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
17409
|
+
}
|
|
17410
|
+
.${e}-lightbox-edit-mode {
|
|
17411
|
+
z-index: 1;
|
|
17412
|
+
}
|
|
17413
|
+
.${e}-lightbox-dismiss-area {
|
|
17414
|
+
position: relative;
|
|
17415
|
+
width: 100%;
|
|
17416
|
+
height: 100%;
|
|
17417
|
+
}
|
|
17418
|
+
.${e}-lightbox-overlay-content {
|
|
17419
|
+
position: absolute;
|
|
17420
|
+
inset: 0;
|
|
17421
|
+
z-index: 3;
|
|
17422
|
+
pointer-events: none;
|
|
17423
|
+
display: flex;
|
|
17424
|
+
flex-direction: column;
|
|
17425
|
+
isolation: isolate;
|
|
17426
|
+
}
|
|
17427
|
+
.${e}-lightbox-content-area {
|
|
17428
|
+
position: relative;
|
|
17429
|
+
display: flex;
|
|
17430
|
+
flex-direction: row;
|
|
17431
|
+
align-items: flex-start;
|
|
17432
|
+
flex: 1;
|
|
17433
|
+
min-width: 0;
|
|
16536
17434
|
min-height: 0;
|
|
16537
17435
|
}
|
|
16538
17436
|
.${e}-lightbox-content-area-stacked {
|
|
@@ -16554,7 +17452,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16554
17452
|
pointer-events: auto;
|
|
16555
17453
|
flex-shrink: 0;
|
|
16556
17454
|
}
|
|
16557
|
-
`}const Cn=500,Ui=650,un="cubic-bezier(0.22, 1, 0.36, 1)",Qf=72,ey=50,ty=1e4,ny=650,iy=500;function oy(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 lc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=ir(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 ry(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?lc(i,n):null}function ay(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 Yi(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 Qs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Yi(e,i,n)}const sy=.03;function cc(e){return e.width*sy}const Xr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function zo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function el(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function ly(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function da(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 cy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:da(e,t.width,t.height)}function dy(e,t){if(Cr(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 uy(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 py({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=>Cr(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=cc(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 sr(e,t,n){const i=Ni(e,t,n);return{...i,left:2*i.left-e.left}}function my(e,t,n){const{left:i,width:o}=n,s=cc(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 dc(e,t,n,i){const o=Ni(e,"left",i),s=Ni(e,"right",i),l=sr(e,"left",i),d=sr(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 gy(e,t,n,i){const{start:o,end:s}=dc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function hy(e,t,n){const i=Ni(e,t,n),o=sr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Cr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function fy({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 Bo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Cr(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 yy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:v,sourceRect:b,resolveCloseSourceRect:S,onClose:y,onPrev:w,onNext:C}){const L=a.useRef(null),k=a.useRef(null),A=a.useRef(null),O=a.useRef(new Map),[P,D]=a.useState(0),R=a.useRef(null),x=a.useRef(0),U=a.useRef(0),h=a.useRef("none"),I=a.useRef(!1),W=a.useRef(!1),V=a.useRef(!1),Y=a.useRef(null),ae=a.useRef(null),Z=a.useRef(null),G=a.useRef(()=>{}),H=a.useRef(null),$=a.useRef(null),M=a.useRef(null),q=a.useRef(!1),[B,ee]=a.useState(null),[_,ye]=a.useState(Xr),[f,ve]=a.useState(0),[K,le]=a.useState("opening"),[$e,oe]=a.useState(0),[fe,X]=a.useState(0),[be,xe]=a.useState(!1),[pe,se]=a.useState(null),[Re,ke]=a.useState(null),[we,Se]=a.useState(null),[z,re]=a.useState(!1),[F,te]=a.useState(null),[ne,ue]=a.useState(!1),me=a.useRef(!1),[he,Le]=a.useState(!1),[Q,ge]=a.useState(!1),Ae=a.useRef(n),ie=a.useRef(void 0),j=t[n],Oe=j?Cr(j):!1,Fe=fe!==0||be,et=!l&&(!s||!!d),Ye=c&&!l,at=u.length>1,mt=a.useCallback((g,ce)=>t.length<=1?null:t[(g+ce+t.length)%t.length]??null,[t]),De=at?Yi(u,m,-1):mt(n,-1),it=at?Yi(u,m,1):mt(n,1),$t=pe===-1&&Fe?at&&Re!==null?Yi(u,Re,-1):we!==null?mt(we,-1):null:null,ot=pe===1&&Fe?at&&Re!==null?Yi(u,Re,1):we!==null?mt(we,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=ot&&ot.url!==(it==null?void 0:it.url)?ot:null,xt=De&&Ye?(()=>{const g=at?Qs(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,ct=it&&Ye?(()=>{const g=at?Qs(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==it.url?g:null})():null,Mt=Ue??xt,_t=ht??ct,Qe=a.useCallback((g,ce,Ee)=>{if(!g||!ce||!Ee)return;const Ie=O.current,Je=Ie.get(g);(Je==null?void 0:Je.width)===ce&&(Je==null?void 0:Je.height)===Ee||(Ie.set(g,{width:ce,height:Ee}),D(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ce=O.current.get(g.url);return cy(k.current,ce)},[P,f]),Lt=a.useCallback(()=>{if(!j)return;const g=Tt(j);if(g){ee(g);return}const ce=k.current;ce&&ee(el(ce))},[j,Tt]),Ge=a.useCallback(g=>{if(at){const ce=u.length;ke((m+g+ce)%ce),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),ke(null))},[at,u.length,m,t.length,n]),qe=a.useCallback(g=>{V.current=g,xe(g)},[]),Pe=a.useCallback(()=>{Y.current!==null&&(window.clearTimeout(Y.current),Y.current=null)},[]),gt=a.useCallback(()=>{Pe(),Y.current=window.setTimeout(()=>{Pe(),qe(!1)},Ui+32)},[Pe,qe]),It=a.useCallback(()=>{const g=L.current;if(!g){ye({left:0,top:0,width:typeof window<"u"?window.innerWidth:Xr.width,height:typeof window<"u"?window.innerHeight:Xr.height});return}const ce=g.getBoundingClientRect();ye({left:ce.left,top:ce.top,width:ce.width,height:ce.height})},[]),kt=a.useCallback((g,ce)=>{if(Fe){if(he&&!be)return`translate(${fe}px, 0px)`;if(be&&pe!==null){const Ee=Tt(g);if(!Ee)return;const{x:Ie,y:Je}=gy(Ee,ce,pe,_);return`translate(${Ie}px, ${Je}px)`}if(be)return"translate(0px, 0px)"}},[Fe,he,be,fe,pe,_,Tt]),Dt=a.useCallback(()=>{const g=ae.current;ae.current=null,Pe(),qe(!1),se(null),ke(null),Se(null),X(0),Le(!1),I.current=!1,U.current=0,h.current="none",g===-1?w():g===1&&C()},[Pe,qe,w,C]),en=a.useCallback(()=>{Pe(),Y.current=window.setTimeout(()=>{ae.current!==null&&Dt()},Ui+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),ae.current=null,qe(!1),se(null),ke(null),Se(null),X(0),Le(!1),I.current=!1,U.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!B)){if(V.current){if(ae.current===g){Z.current=g,Dt();return}on()}Pe(),Ge(g),ae.current=g,se(g),qe(!0),en()}},[Ye,B,Dt,on,Pe,Ge,qe,en]);G.current=bt;const Rt=a.useCallback(()=>{H.current=null,q.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Ut=a.useCallback(g=>{$.current!==null&&window.clearInterval($.current);const ce=q.current?iy:ny;$.current=window.setInterval(()=>{G.current(g)},ce)},[]),Kt=a.useCallback(g=>{H.current!==g&&(Rt(),H.current=g,q.current=!1,G.current(g),Ut(g),M.current=window.setTimeout(()=>{M.current=null,H.current===g&&(q.current=!0,Ut(g))},ty))},[Rt,Ut]),ft=a.useCallback(()=>{const g=k.current;if(!g)return;const ce=j==null?void 0:j.url,Ee=ce?O.current.get(ce):void 0;if(Ee!=null&&Ee.width&&(Ee!=null&&Ee.height)){ee(da(g,Ee.width,Ee.height));return}const Ie=A.current;if(Ie&&ce&&(Ie.src===ce||Ie.currentSrc===ce)){const{width:Et,height:Ve}=ly(Ie);if(Et&&Ve){Qe(ce,Et,Ve),ee(da(g,Et,Ve));return}}const Je=el(g);!Je.width||!Je.height||ee(Je)},[j==null?void 0:j.url,Qe]),Jt=a.useCallback(g=>{if(A.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Ce=a.useCallback(()=>{It(),ft(),ve(g=>g+1)},[It,ft]);a.useEffect(()=>{Ce();const g=k.current,ce=L.current,Ee=new ResizeObserver(()=>Ce());return g&&Ee.observe(g),ce&&Ee.observe(ce),window.addEventListener("resize",Ce),()=>{Ee.disconnect(),window.removeEventListener("resize",Ce)}},[Ce,n,v]),a.useLayoutEffect(()=>{if(!j)return;const g=A.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[j==null?void 0:j.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,P]),a.useEffect(()=>{const g=new Set,ce=[],Ee=Ie=>{!(Ie!=null&&Ie.url)||g.has(Ie.url)||(g.add(Ie.url),ce.push(Ie))};t.forEach(Ee),u.forEach(Ie=>Ie.items.forEach(Ee)),ce.forEach(Ie=>{O.current.has(Ie.url)||dy(Ie,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(K!=="opening"||!B)return;if(!b){le("open");return}re(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),le("open")})});return()=>cancelAnimationFrame(g)},[K,B,b]),a.useEffect(()=>{if(K!=="closing")return;const g=setTimeout(()=>y(),Cn);return()=>clearTimeout(g)},[K,y]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&ie.current===(j==null?void 0:j.url)||(Pe(),ae.current=null,se(null),ke(null),Se(null),oe(0),X(0),qe(!1),ge(!1),Le(!1),x.current=0,U.current=0,h.current="none",I.current=!1,R.current=null,W.current=!1,A.current=null,Lt(),Ae.current=n,ie.current=j==null?void 0:j.url)},[n,j==null?void 0:j.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Z.current;g!==null&&(Z.current=null,requestAnimationFrame(()=>{G.current(g)}))},[n,m,j==null?void 0:j.url]),a.useLayoutEffect(()=>{if(K==="opening"){me.current=!1,ue(!1);return}if(K!=="open"||me.current)return;if(!De&&!it){me.current=!0;return}ue(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ue(!0),me.current=!0})});return()=>cancelAnimationFrame(g)},[K,De==null?void 0:De.url,it==null?void 0:it.url]),a.useEffect(()=>{if(K!=="open")return;const g=()=>{const Ve=nt=>{nt.stopPropagation(),nt.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},ce=Ve=>{const nt=Ve<0?1:-1;Pe(),Ge(nt),ae.current=nt,se(nt),qe(!0),en()},Ee=Ve=>{if(Math.abs(Ve)>ey&&Ye){ce(Ve);return}ae.current=null,se(null),ke(null),Se(null),qe(!0),X(0),gt()},Ie=Ve=>{if(Ve.touches.length!==1||V.current)return;const nt=Ve.touches[0];W.current=!0,R.current={x:nt.clientX,y:nt.clientY},h.current="none",U.current=0,I.current=!1},Je=Ve=>{if(!R.current||Ve.touches.length!==1||V.current)return;const nt=Ve.touches[0],Ot=nt.clientX-R.current.x,St=nt.clientY-R.current.y;if(h.current==="none"){if(Math.abs(Ot)<10&&Math.abs(St)<10)return;if(Math.abs(Ot)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){I.current=!0,Le(!0),U.current=Ot,X(Ot),Ve.preventDefault();return}h.current==="vertical"&&(I.current=!0,Le(!0),x.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!R.current)return;const Ve=h.current,nt=I.current;if(nt&&Ve==="horizontal")Ee(U.current),g();else if(nt&&Ve==="vertical"){const Ot=x.current;if(et&&Ot>Qf){const St=window.innerHeight;x.current=St,ge(!0),oe(St),le("closing")}else x.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(U.current)>0&&(Ee(U.current),g());R.current=null,h.current="none",U.current=0,I.current=!1,Le(!1)};return document.addEventListener("touchstart",Ie,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ie),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[K,Ye,qe,gt,Pe,et,en,Ge]);const je=a.useCallback(()=>{const g=(S==null?void 0:S())??b??null;g&&B&&(te(g),re(!0)),le("closing")},[S,b,B]);a.useEffect(()=>{const g=Ie=>{if(Ie.key==="Escape"){if(s&&d||K==="closing")return;Rt(),je();return}if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight"||K!=="open"||!Ye)return;Ie.preventDefault();const Je=Ie.key==="ArrowLeft"?-1:1;Ie.repeat&&H.current===Je||Kt(Je)},ce=Ie=>{if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight")return;const Je=Ie.key==="ArrowLeft"?-1:1;H.current===Je&&Rt()},Ee=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ce),window.addEventListener("blur",Ee),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ce),window.removeEventListener("blur",Ee),Rt()}},[K,s,d,je,Ye,Kt,Rt]),a.useEffect(()=>{K!=="open"&&Rt()},[K,Rt]);const Ke=()=>{K==="closing"||l||je()},He=K==="open",ze=K==="closing",dt=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Ze=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!V.current)){if(ae.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=K==="closing"?F??b:b,Ft=tt&&B&&(K==="opening"||ze)?oy(tt,B):void 0,Ct=Fe&&j?kt(j,"center"):$e>0?`translateY(${$e}px)`:Ft,st=B?zo(B,_):null,Ht=!!(tt&&B),At=Ht&&(K==="closing"||K==="open"&&z),Vt={position:"absolute",top:st==null?void 0:st.top,left:st==null?void 0:st.left,width:st==null?void 0:st.width,height:st==null?void 0:st.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Ht?1:K==="opening"||ze?0:1,transition:he&&!be?"none":be?`transform ${Ui}ms ${un}`:Q?`transform ${Cn}ms ${un}, opacity ${Cn}ms ${un}`:At?`transform ${Cn}ms ${un}`:K==="opening"||ze?`opacity ${Cn}ms ${un}`:"none",pointerEvents:Oe&&He&&!Fe?"auto":"none",touchAction:Oe&&He?"none":void 0,zIndex:1,overflow:Oe?"hidden":void 0},zt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:He&&!Fe?"auto":"none"},Pt=(g,ce,Ee="adjacent")=>{const Ie=Tt(g);if(!Ie)return{display:"none"};const Je=Ee==="far"?ce==="left"?"far-left":"far-right":ce==="left"?"left-adjacent":"right-adjacent",{start:Et}=pe!==null?dc(Ie,Je,pe,_):{start:Ee==="far"?sr(Ie,ce,_):Ni(Ie,ce,_)},Ve=zo(Et,_),nt=kt(g,Je),Ot=!Fe&&Ee==="adjacent"&&He&&!ne?hy(Ie,ce,_):null,St=Ee==="far"&&Fe&&pe===(ce==="left"?-1:1),ln=he&&!be?!1:be,cn=Ee==="adjacent"&&He&&ne&&!Fe;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:nt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ee==="far"?He&&St?1:0:He?1:0,transition:ln?Ee==="far"?`transform ${Ui}ms ${un}`:`transform ${Ui}ms ${un}, opacity ${Cn}ms ${un}`:cn?`transform ${Cn}ms ${un}`:K==="opening"||ze?`opacity ${Cn}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},Zt=(g,ce)=>{const Ee=Tt(g);return Ee?my(Ni(Ee,ce,_),ce,_):null},wt=g=>ce=>{if(!l){if(W.current){W.current=!1;return}ce.stopPropagation(),bt(g)}},Gt=De?Zt(De,"left"):null,ut=it?Zt(it,"right"):null,Wt=Gt?zo(Gt,_):null,Bt=ut?zo(ut,_):null;return r.jsxs("div",{ref:L,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:K==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:He?dt:0,transition:he?"none":`opacity ${Cn}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:k,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:He?1:0,transition:he?"none":`opacity ${Cn}ms ${un}`,pointerEvents:"none"},children:r.jsx(Vl,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Ke})})]}),He&&Mt&&r.jsx(Bo,{media:Mt,style:Pt(Mt,"left","far"),onMeasure:Qe,onTransitionEnd:Ze},`far-prev-${Mt.url}`),He&&De&&r.jsxs(r.Fragment,{children:[r.jsx(Bo,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Ze},`prev-${De.url}`),Wt&&r.jsx("div",{style:{position:"absolute",top:Wt.top,left:Wt.left,width:Wt.width,height:Wt.height,cursor:l||he?"default":"pointer",pointerEvents:l||he?"none":"auto",zIndex:3},onClick:wt(-1)})]}),He&&it&&r.jsxs(r.Fragment,{children:[r.jsx(Bo,{media:it,style:Pt(it,"right"),onMeasure:Qe,onTransitionEnd:Ze},`next-${it.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||he?"default":"pointer",pointerEvents:l||he?"none":"auto",zIndex:3},onClick:wt(1)})]}),He&&_t&&r.jsx(Bo,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Ze},`far-next-${_t.url}`),B&&j&&(Oe?r.jsx(fy,{src:j.url,phase:K,onMediaElement:Jt,wrapperStyle:Vt,videoStyle:zt,onLoadedMetadata:ft,onTransitionEnd:Ze},`${n}-${j.url}`):r.jsx("img",{ref:Jt,src:j.url,alt:j.name,onLoad:ft,onTransitionEnd:Ze,style:Vt},`${n}-${j.url}`))]})}const vy=20,xy=.18;function by(e){return`
|
|
17455
|
+
`}const Cn=500,Ui=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",hy=72,fy=50,yy=1e4,vy=650,xy=500;function by(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function uc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=nr(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 wy(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?uc(i,n):null}function Sy(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 Yi(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 nl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Yi(e,i,n)}const $y=.03;function pc(e){return e.width*$y}const Jr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Bo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function il(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Cy(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function pa(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function Ty(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:pa(e,t.width,t.height)}function Ly(e,t){if($r(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 Iy(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 Ry({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=>$r(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:l}=e,{left:s,width:d}=n,c=pc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function ar(e,t,n){const i=Ni(e,t,n);return{...i,left:2*i.left-e.left}}function Ey(e,t,n){const{left:i,width:o}=n,l=pc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function mc(e,t,n,i){const o=Ni(e,"left",i),l=Ni(e,"right",i),s=ar(e,"left",i),d=ar(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function My(e,t,n,i){const{start:o,end:l}=mc(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function ky(e,t,n){const i=Ni(e,t,n),o=ar(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function $r(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Py({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){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:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function zo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return $r(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Ay({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:b,sourceRect:S,resolveCloseSourceRect:C,onClose:y,onPrev:w,onNext:$}){const T=a.useRef(null),R=a.useRef(null),M=a.useRef(null),H=a.useRef(new Map),[F,V]=a.useState(0),P=a.useRef(null),x=a.useRef(0),U=a.useRef(0),h=a.useRef("none"),E=a.useRef(!1),A=a.useRef(!1),j=a.useRef(!1),X=a.useRef(null),ae=a.useRef(null),Z=a.useRef(null),q=a.useRef(()=>{}),N=a.useRef(null),L=a.useRef(null),k=a.useRef(null),K=a.useRef(!1),[z,ne]=a.useState(null),[_,ye]=a.useState(Jr),[f,ve]=a.useState(0),[Y,le]=a.useState("opening"),[$e,oe]=a.useState(0),[xe,G]=a.useState(0),[he,be]=a.useState(!1),[ce,se]=a.useState(null),[Le,Me]=a.useState(null),[we,Se]=a.useState(null),[B,Q]=a.useState(!1),[W,te]=a.useState(null),[ie,pe]=a.useState(!1),me=a.useRef(!1),[fe,Ie]=a.useState(!1),[ee,ge]=a.useState(!1),Ae=a.useRef(n),re=a.useRef(void 0),D=t[n],Oe=D?$r(D):!1,We=xe!==0||he,et=!s&&(!l||!!d),Ye=c&&!s,st=u.length>1,mt=a.useCallback((g,de)=>t.length<=1?null:t[(g+de+t.length)%t.length]??null,[t]),De=st?Yi(u,m,-1):mt(n,-1),it=st?Yi(u,m,1):mt(n,1),$t=ce===-1&&We?st&&Le!==null?Yi(u,Le,-1):we!==null?mt(we,-1):null:null,ot=ce===1&&We?st&&Le!==null?Yi(u,Le,1):we!==null?mt(we,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=ot&&ot.url!==(it==null?void 0:it.url)?ot:null,xt=De&&Ye?(()=>{const g=st?nl(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,ct=it&&Ye?(()=>{const g=st?nl(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==it.url?g:null})():null,Mt=Ue??xt,_t=ht??ct,Qe=a.useCallback((g,de,Ee)=>{if(!g||!de||!Ee)return;const Re=H.current,Je=Re.get(g);(Je==null?void 0:Je.width)===de&&(Je==null?void 0:Je.height)===Ee||(Re.set(g,{width:de,height:Ee}),V(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const de=H.current.get(g.url);return Ty(R.current,de)},[F,f]),Lt=a.useCallback(()=>{if(!D)return;const g=Tt(D);if(g){ne(g);return}const de=R.current;de&&ne(il(de))},[D,Tt]),Ge=a.useCallback(g=>{if(st){const de=u.length;Me((m+g+de)%de),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),Me(null))},[st,u.length,m,t.length,n]),qe=a.useCallback(g=>{j.current=g,be(g)},[]),Pe=a.useCallback(()=>{X.current!==null&&(window.clearTimeout(X.current),X.current=null)},[]),gt=a.useCallback(()=>{Pe(),X.current=window.setTimeout(()=>{Pe(),qe(!1)},Ui+32)},[Pe,qe]),It=a.useCallback(()=>{const g=T.current;if(!g){ye({left:0,top:0,width:typeof window<"u"?window.innerWidth:Jr.width,height:typeof window<"u"?window.innerHeight:Jr.height});return}const de=g.getBoundingClientRect();ye({left:de.left,top:de.top,width:de.width,height:de.height})},[]),kt=a.useCallback((g,de)=>{if(We){if(fe&&!he)return`translate(${xe}px, 0px)`;if(he&&ce!==null){const Ee=Tt(g);if(!Ee)return;const{x:Re,y:Je}=My(Ee,de,ce,_);return`translate(${Re}px, ${Je}px)`}if(he)return"translate(0px, 0px)"}},[We,fe,he,xe,ce,_,Tt]),Dt=a.useCallback(()=>{const g=ae.current;ae.current=null,Pe(),qe(!1),se(null),Me(null),Se(null),G(0),Ie(!1),E.current=!1,U.current=0,h.current="none",g===-1?w():g===1&&$()},[Pe,qe,w,$]),en=a.useCallback(()=>{Pe(),X.current=window.setTimeout(()=>{ae.current!==null&&Dt()},Ui+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),ae.current=null,qe(!1),se(null),Me(null),Se(null),G(0),Ie(!1),E.current=!1,U.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!z)){if(j.current){if(ae.current===g){Z.current=g,Dt();return}on()}Pe(),Ge(g),ae.current=g,se(g),qe(!0),en()}},[Ye,z,Dt,on,Pe,Ge,qe,en]);q.current=bt;const Rt=a.useCallback(()=>{N.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),Ut=a.useCallback(g=>{L.current!==null&&window.clearInterval(L.current);const de=K.current?xy:vy;L.current=window.setInterval(()=>{q.current(g)},de)},[]),Kt=a.useCallback(g=>{N.current!==g&&(Rt(),N.current=g,K.current=!1,q.current(g),Ut(g),k.current=window.setTimeout(()=>{k.current=null,N.current===g&&(K.current=!0,Ut(g))},yy))},[Rt,Ut]),ft=a.useCallback(()=>{const g=R.current;if(!g)return;const de=D==null?void 0:D.url,Ee=de?H.current.get(de):void 0;if(Ee!=null&&Ee.width&&(Ee!=null&&Ee.height)){ne(pa(g,Ee.width,Ee.height));return}const Re=M.current;if(Re&&de&&(Re.src===de||Re.currentSrc===de)){const{width:Et,height:Ve}=Cy(Re);if(Et&&Ve){Qe(de,Et,Ve),ne(pa(g,Et,Ve));return}}const Je=il(g);!Je.width||!Je.height||ne(Je)},[D==null?void 0:D.url,Qe]),Zt=a.useCallback(g=>{if(M.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Ce=a.useCallback(()=>{It(),ft(),ve(g=>g+1)},[It,ft]);a.useEffect(()=>{Ce();const g=R.current,de=T.current,Ee=new ResizeObserver(()=>Ce());return g&&Ee.observe(g),de&&Ee.observe(de),window.addEventListener("resize",Ce),()=>{Ee.disconnect(),window.removeEventListener("resize",Ce)}},[Ce,n,b]),a.useLayoutEffect(()=>{if(!D)return;const g=M.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[D==null?void 0:D.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,F]),a.useEffect(()=>{const g=new Set,de=[],Ee=Re=>{!(Re!=null&&Re.url)||g.has(Re.url)||(g.add(Re.url),de.push(Re))};t.forEach(Ee),u.forEach(Re=>Re.items.forEach(Ee)),de.forEach(Re=>{H.current.has(Re.url)||Ly(Re,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(Y!=="opening"||!z)return;if(!S){le("open");return}Q(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(!0),le("open")})});return()=>cancelAnimationFrame(g)},[Y,z,S]),a.useEffect(()=>{if(Y!=="closing")return;const g=setTimeout(()=>y(),Cn);return()=>clearTimeout(g)},[Y,y]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&re.current===(D==null?void 0:D.url)||(Pe(),ae.current=null,se(null),Me(null),Se(null),oe(0),G(0),qe(!1),ge(!1),Ie(!1),x.current=0,U.current=0,h.current="none",E.current=!1,P.current=null,A.current=!1,M.current=null,Lt(),Ae.current=n,re.current=D==null?void 0:D.url)},[n,D==null?void 0:D.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Z.current;g!==null&&(Z.current=null,requestAnimationFrame(()=>{q.current(g)}))},[n,m,D==null?void 0:D.url]),a.useLayoutEffect(()=>{if(Y==="opening"){me.current=!1,pe(!1);return}if(Y!=="open"||me.current)return;if(!De&&!it){me.current=!0;return}pe(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe(!0),me.current=!0})});return()=>cancelAnimationFrame(g)},[Y,De==null?void 0:De.url,it==null?void 0:it.url]),a.useEffect(()=>{if(Y!=="open")return;const g=()=>{const Ve=nt=>{nt.stopPropagation(),nt.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},de=Ve=>{const nt=Ve<0?1:-1;Pe(),Ge(nt),ae.current=nt,se(nt),qe(!0),en()},Ee=Ve=>{if(Math.abs(Ve)>fy&&Ye){de(Ve);return}ae.current=null,se(null),Me(null),Se(null),qe(!0),G(0),gt()},Re=Ve=>{if(Ve.touches.length!==1||j.current)return;const nt=Ve.touches[0];A.current=!0,P.current={x:nt.clientX,y:nt.clientY},h.current="none",U.current=0,E.current=!1},Je=Ve=>{if(!P.current||Ve.touches.length!==1||j.current)return;const nt=Ve.touches[0],Ot=nt.clientX-P.current.x,St=nt.clientY-P.current.y;if(h.current==="none"){if(Math.abs(Ot)<10&&Math.abs(St)<10)return;if(Math.abs(Ot)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){E.current=!0,Ie(!0),U.current=Ot,G(Ot),Ve.preventDefault();return}h.current==="vertical"&&(E.current=!0,Ie(!0),x.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!P.current)return;const Ve=h.current,nt=E.current;if(nt&&Ve==="horizontal")Ee(U.current),g();else if(nt&&Ve==="vertical"){const Ot=x.current;if(et&&Ot>hy){const St=window.innerHeight;x.current=St,ge(!0),oe(St),le("closing")}else x.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(U.current)>0&&(Ee(U.current),g());P.current=null,h.current="none",U.current=0,E.current=!1,Ie(!1)};return document.addEventListener("touchstart",Re,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Re),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[Y,Ye,qe,gt,Pe,et,en,Ge]);const je=a.useCallback(()=>{const g=(C==null?void 0:C())??S??null;g&&z&&(te(g),Q(!0)),le("closing")},[C,S,z]);a.useEffect(()=>{const g=Re=>{if(Re.key==="Escape"){if(l&&d||Y==="closing")return;Rt(),je();return}if(Re.key!=="ArrowLeft"&&Re.key!=="ArrowRight"||Y!=="open"||!Ye)return;Re.preventDefault();const Je=Re.key==="ArrowLeft"?-1:1;Re.repeat&&N.current===Je||Kt(Je)},de=Re=>{if(Re.key!=="ArrowLeft"&&Re.key!=="ArrowRight")return;const Je=Re.key==="ArrowLeft"?-1:1;N.current===Je&&Rt()},Ee=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",de),window.addEventListener("blur",Ee),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",de),window.removeEventListener("blur",Ee),Rt()}},[Y,l,d,je,Ye,Kt,Rt]),a.useEffect(()=>{Y!=="open"&&Rt()},[Y,Rt]);const Ke=()=>{Y==="closing"||s||je()},He=Y==="open",Be=Y==="closing",dt=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Ze=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!j.current)){if(ae.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=Y==="closing"?W??S:S,Wt=tt&&z&&(Y==="opening"||Be)?by(tt,z):void 0,Ct=We&&D?kt(D,"center"):$e>0?`translateY(${$e}px)`:Wt,at=z?Bo(z,_):null,Ht=!!(tt&&z),At=Ht&&(Y==="closing"||Y==="open"&&B),Vt={position:"absolute",top:at==null?void 0:at.top,left:at==null?void 0:at.left,width:at==null?void 0:at.width,height:at==null?void 0:at.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Ht?1:Y==="opening"||Be?0:1,transition:fe&&!he?"none":he?`transform ${Ui}ms ${mn}`:ee?`transform ${Cn}ms ${mn}, opacity ${Cn}ms ${mn}`:At?`transform ${Cn}ms ${mn}`:Y==="opening"||Be?`opacity ${Cn}ms ${mn}`:"none",pointerEvents:Oe&&He&&!We?"auto":"none",touchAction:Oe&&He?"none":void 0,zIndex:1,overflow:Oe?"hidden":void 0},Bt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:He&&!We?"auto":"none"},Pt=(g,de,Ee="adjacent")=>{const Re=Tt(g);if(!Re)return{display:"none"};const Je=Ee==="far"?de==="left"?"far-left":"far-right":de==="left"?"left-adjacent":"right-adjacent",{start:Et}=ce!==null?mc(Re,Je,ce,_):{start:Ee==="far"?ar(Re,de,_):Ni(Re,de,_)},Ve=Bo(Et,_),nt=kt(g,Je),Ot=!We&&Ee==="adjacent"&&He&&!ie?ky(Re,de,_):null,St=Ee==="far"&&We&&ce===(de==="left"?-1:1),ln=fe&&!he?!1:he,un=Ee==="adjacent"&&He&&ie&&!We;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:nt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ee==="far"?He&&St?1:0:He?1:0,transition:ln?Ee==="far"?`transform ${Ui}ms ${mn}`:`transform ${Ui}ms ${mn}, opacity ${Cn}ms ${mn}`:un?`transform ${Cn}ms ${mn}`:Y==="opening"||Be?`opacity ${Cn}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(g,de)=>{const Ee=Tt(g);return Ee?Ey(Ni(Ee,de,_),de,_):null},wt=g=>de=>{if(!s){if(A.current){A.current=!1;return}de.stopPropagation(),bt(g)}},Gt=De?Qt(De,"left"):null,ut=it?Qt(it,"right"):null,Ft=Gt?Bo(Gt,_):null,zt=ut?Bo(ut,_):null;return r.jsxs("div",{ref:T,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Y==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:He?dt:0,transition:fe?"none":`opacity ${Cn}ms ${mn}`,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:He?1:0,transition:fe?"none":`opacity ${Cn}ms ${mn}`,pointerEvents:"none"},children:r.jsx(Kl,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:Ke})})]}),He&&Mt&&r.jsx(zo,{media:Mt,style:Pt(Mt,"left","far"),onMeasure:Qe,onTransitionEnd:Ze},`far-prev-${Mt.url}`),He&&De&&r.jsxs(r.Fragment,{children:[r.jsx(zo,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Ze},`prev-${De.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:s||fe?"default":"pointer",pointerEvents:s||fe?"none":"auto",zIndex:3},onClick:wt(-1)})]}),He&&it&&r.jsxs(r.Fragment,{children:[r.jsx(zo,{media:it,style:Pt(it,"right"),onMeasure:Qe,onTransitionEnd:Ze},`next-${it.url}`),zt&&r.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:s||fe?"default":"pointer",pointerEvents:s||fe?"none":"auto",zIndex:3},onClick:wt(1)})]}),He&&_t&&r.jsx(zo,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Ze},`far-next-${_t.url}`),z&&D&&(Oe?r.jsx(Py,{src:D.url,phase:Y,onMediaElement:Zt,wrapperStyle:Vt,videoStyle:Bt,onLoadedMetadata:ft,onTransitionEnd:Ze},`${n}-${D.url}`):r.jsx("img",{ref:Zt,src:D.url,alt:D.name,onLoad:ft,onTransitionEnd:Ze,style:Vt},`${n}-${D.url}`))]})}const Fy=20,Wy=.18;function _y(e){return`
|
|
16558
17456
|
.${e}-wrapper {
|
|
16559
17457
|
box-sizing: border-box;
|
|
16560
17458
|
max-width: 100%;
|
|
@@ -16578,39 +17476,45 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16578
17476
|
vertical-align: baseline;
|
|
16579
17477
|
position: relative;
|
|
16580
17478
|
z-index: 1;
|
|
16581
|
-
height:
|
|
16582
|
-
|
|
16583
|
-
margin
|
|
16584
|
-
margin-bottom: 0;
|
|
16585
|
-
margin-left: var(--${e}-image-inline-gap);
|
|
16586
|
-
margin-right: var(--${e}-image-inline-gap);
|
|
17479
|
+
height: 0;
|
|
17480
|
+
width: calc(1cap * var(--${e}-image-aspect));
|
|
17481
|
+
margin: 0 var(--${e}-image-inline-gap);
|
|
16587
17482
|
}
|
|
16588
17483
|
.${e}-item-image img,
|
|
16589
17484
|
.${e}-item-image video {
|
|
17485
|
+
position: absolute;
|
|
17486
|
+
left: 0;
|
|
17487
|
+
bottom: 0;
|
|
16590
17488
|
display: block;
|
|
16591
|
-
height:
|
|
16592
|
-
|
|
17489
|
+
height: 1cap;
|
|
17490
|
+
width: 100%;
|
|
17491
|
+
max-height: none;
|
|
17492
|
+
object-position: bottom;
|
|
16593
17493
|
}
|
|
16594
|
-
.${e}-item-
|
|
16595
|
-
.${e}-item-
|
|
17494
|
+
.${e}-item-hover-scale .${e}-item-image img,
|
|
17495
|
+
.${e}-item-hover-scale .${e}-item-image video {
|
|
17496
|
+
transform-origin: center center;
|
|
16596
17497
|
transition: transform 0.3s ease;
|
|
16597
17498
|
}
|
|
16598
|
-
.${e}-item-
|
|
16599
|
-
|
|
16600
|
-
transform: scale(1.15);
|
|
17499
|
+
.${e}-item-hover-scale:hover .${e}-item-image {
|
|
17500
|
+
z-index: 10;
|
|
16601
17501
|
}
|
|
16602
|
-
.${e}-item-
|
|
16603
|
-
.${e}-item-
|
|
17502
|
+
.${e}-item-hover-scale:hover .${e}-item-image img,
|
|
17503
|
+
.${e}-item-hover-scale:hover .${e}-item-image video {
|
|
17504
|
+
transform: scale(var(--${e}-image-hover-scale, 1.2));
|
|
17505
|
+
}
|
|
17506
|
+
.${e}-item-hover-saturate .${e}-item-image img,
|
|
17507
|
+
.${e}-item-hover-saturate .${e}-item-image video {
|
|
16604
17508
|
filter: grayscale(100%);
|
|
16605
17509
|
transition: filter 0.3s ease;
|
|
16606
17510
|
}
|
|
16607
|
-
.${e}-item-
|
|
16608
|
-
.${e}-item-
|
|
17511
|
+
.${e}-item-hover-saturate:hover .${e}-item-image img,
|
|
17512
|
+
.${e}-item-hover-saturate:hover .${e}-item-image video {
|
|
16609
17513
|
filter: grayscale(0%);
|
|
16610
17514
|
}
|
|
16611
17515
|
.${e}-item-gap-host {
|
|
16612
17516
|
display: inline-block;
|
|
16613
|
-
vertical-align:
|
|
17517
|
+
vertical-align: top;
|
|
16614
17518
|
height: var(--${e}-line-height);
|
|
16615
17519
|
position: relative;
|
|
16616
17520
|
flex-shrink: 0;
|
|
@@ -16621,8 +17525,8 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16621
17525
|
z-index: 2;
|
|
16622
17526
|
pointer-events: auto;
|
|
16623
17527
|
}
|
|
16624
|
-
${
|
|
16625
|
-
`}function
|
|
17528
|
+
${gy(e)}
|
|
17529
|
+
`}function Hy(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,l]=n.split(":").map(Number),s=i?l:o,d=i?o:l;return d>0?s/d:1}function Ny(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:v.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:v.scalingValue(i*Wy,n??!1),[`--${t}-image-aspect`]:Hy(e)}}function Oy(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 Jt(n,t)}function jy(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 By(e,t,n,i,o,l){if(!(!e||!t))return s=>{var c;const d=((c=s.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(s.currentTarget instanceof HTMLImageElement||s.currentTarget instanceof HTMLVideoElement?s.currentTarget:null);l(n,d?uc(d,o):void 0)}}function zy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=v.useScopedStyles(),c=a.useMemo(()=>_y(d),[d]),u=t??[],m=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,b=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,S=v.scalingValue(b,n??!1),C=`max(${S}, ${Fy}px)`,{objectFitMode:y,imageStyle:w}=jy(e),$=Oy(e,n),T=a.useRef(null),[R,M]=a.useState(!1),[H,F]=a.useState([]),[V,P]=a.useState(0),[x,U]=a.useState(0),[h,E]=a.useState(null),[A,j]=a.useState({title1:"",title2:"",title3:""}),X=(!n||i)&&!R,ae=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},Z=ae.sizeType??"none",q=X&&Z!=="none"?`${d}-item-hover-${Z}`:void 0,N=(ae.value??120)/100,L={width:v.scalingValue(m,n??!1),...$,...Ny(e,d,n),[`--${d}-image-hover-scale`]:String(N)},k=(()=>{const le={},$e=T.current?getComputedStyle(T.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(le["--cntrl-article-width"]=$e),le})(),K=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),z=a.useMemo(()=>Sy(u),[u]),ne=a.useMemo(()=>Iy(u),[u]),_=(le,$e)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const oe=z.findIndex(G=>G.gridIndex===le);if(oe<0)return;const xe=z[oe];U(oe),F(xe.items),P(0),j(xe.entry),E($e??null),M(!0)},ye=a.useCallback(()=>{M(!1),E(null)},[]),f=a.useCallback(()=>{const le=z[x];return!le||!T.current?h:wy(T.current,le.gridIndex,y)??h},[z,x,h,y]),ve=a.useCallback(le=>{if(z.length>1){const $e=z.length,oe=(x+le+$e)%$e,xe=z[oe];U(oe),F(xe.items),P(0),j(xe.entry);return}P($e=>($e+le+H.length)%H.length)},[z,x,H.length]),Y=z.length>1||H.length>1;return a.useEffect(()=>{if(!R||typeof document>"u")return;const le=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=le}},[R]),a.useEffect(()=>{!n||o||i||M(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&M(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(Ry,{mediaList:ne}),r.jsx("div",{ref:T,className:`${d}-wrapper`,style:L,children:u.map((le,$e)=>{var G,he;const oe=!!((G=le.image)!=null&&G.url),xe=By(!!K,oe,$e,d,y,_);return r.jsxs("div",{className:[`${d}-item`,q].filter(Boolean).join(" "),children:[le.title?r.jsx("span",{className:`${d}-item-title`,onClick:xe,style:xe?{cursor:"pointer"}:void 0,children:le.title}):null,(he=le.image)!=null&&he.url?r.jsx("span",{className:`${d}-item-image`,children:le.image.type==="video"?r.jsx("video",{src:le.image.url,"data-waterfall-index":$e,style:w,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:xe}):r.jsx("img",{src:le.image.url,alt:le.image.name??"","data-waterfall-index":$e,style:w,onClick:xe})}):null,$e<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:S},children:o&&!R&&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:C,height:"100%"}})})]},$e)})}),R&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const le=(s?document.getElementById(s):null)??document.body;return mi.createPortal(r.jsx("div",{style:k,"data-selection":"none",children:r.jsx(Ay,{prefix:d,items:H,index:V,entry:A,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:Y,lightboxEntries:z,entryIdx:x,layoutId:l,sourceRect:h,resolveCloseSourceRect:f,onClose:ye,onPrev:()=>ve(-1),onNext:()=>ve(1)})}),le)})()]})}const Dy=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16626
17530
|
import type React from 'react';
|
|
16627
17531
|
import { createPortal } from 'react-dom';
|
|
16628
17532
|
import { CommonComponentProps } from '../props';
|
|
@@ -16664,7 +17568,13 @@ export type WaterfallSettings = {
|
|
|
16664
17568
|
titleWordSpacing?: number;
|
|
16665
17569
|
titleTextAppearance?: TextStyles['textAppearance'];
|
|
16666
17570
|
horizontalGap?: number;
|
|
16667
|
-
imageHoverEffect?:
|
|
17571
|
+
imageHoverEffect?: {
|
|
17572
|
+
sizeType: 'none' | 'scale' | 'saturate';
|
|
17573
|
+
value: number;
|
|
17574
|
+
min?: number;
|
|
17575
|
+
max?: number;
|
|
17576
|
+
};
|
|
17577
|
+
lightbox?: 'on' | 'off';
|
|
16668
17578
|
} & WaterfallLightboxSettings;
|
|
16669
17579
|
|
|
16670
17580
|
type WaterfallProps = {
|
|
@@ -16705,39 +17615,45 @@ function getCSS(P: string): string {
|
|
|
16705
17615
|
vertical-align: baseline;
|
|
16706
17616
|
position: relative;
|
|
16707
17617
|
z-index: 1;
|
|
16708
|
-
height:
|
|
16709
|
-
|
|
16710
|
-
margin
|
|
16711
|
-
margin-bottom: 0;
|
|
16712
|
-
margin-left: var(--\${P}-image-inline-gap);
|
|
16713
|
-
margin-right: var(--\${P}-image-inline-gap);
|
|
17618
|
+
height: 0;
|
|
17619
|
+
width: calc(1cap * var(--\${P}-image-aspect));
|
|
17620
|
+
margin: 0 var(--\${P}-image-inline-gap);
|
|
16714
17621
|
}
|
|
16715
17622
|
.\${P}-item-image img,
|
|
16716
17623
|
.\${P}-item-image video {
|
|
17624
|
+
position: absolute;
|
|
17625
|
+
left: 0;
|
|
17626
|
+
bottom: 0;
|
|
16717
17627
|
display: block;
|
|
16718
|
-
height:
|
|
16719
|
-
|
|
17628
|
+
height: 1cap;
|
|
17629
|
+
width: 100%;
|
|
17630
|
+
max-height: none;
|
|
17631
|
+
object-position: bottom;
|
|
16720
17632
|
}
|
|
16721
|
-
.\${P}-item-
|
|
16722
|
-
.\${P}-item-
|
|
17633
|
+
.\${P}-item-hover-scale .\${P}-item-image img,
|
|
17634
|
+
.\${P}-item-hover-scale .\${P}-item-image video {
|
|
17635
|
+
transform-origin: center center;
|
|
16723
17636
|
transition: transform 0.3s ease;
|
|
16724
17637
|
}
|
|
16725
|
-
.\${P}-item-
|
|
16726
|
-
|
|
16727
|
-
|
|
17638
|
+
.\${P}-item-hover-scale:hover .\${P}-item-image {
|
|
17639
|
+
z-index: 10;
|
|
17640
|
+
}
|
|
17641
|
+
.\${P}-item-hover-scale:hover .\${P}-item-image img,
|
|
17642
|
+
.\${P}-item-hover-scale:hover .\${P}-item-image video {
|
|
17643
|
+
transform: scale(var(--\${P}-image-hover-scale, 1.2));
|
|
16728
17644
|
}
|
|
16729
|
-
.\${P}-item-
|
|
16730
|
-
.\${P}-item-
|
|
17645
|
+
.\${P}-item-hover-saturate .\${P}-item-image img,
|
|
17646
|
+
.\${P}-item-hover-saturate .\${P}-item-image video {
|
|
16731
17647
|
filter: grayscale(100%);
|
|
16732
17648
|
transition: filter 0.3s ease;
|
|
16733
17649
|
}
|
|
16734
|
-
.\${P}-item-
|
|
16735
|
-
.\${P}-item-
|
|
17650
|
+
.\${P}-item-hover-saturate:hover .\${P}-item-image img,
|
|
17651
|
+
.\${P}-item-hover-saturate:hover .\${P}-item-image video {
|
|
16736
17652
|
filter: grayscale(0%);
|
|
16737
17653
|
}
|
|
16738
17654
|
.\${P}-item-gap-host {
|
|
16739
17655
|
display: inline-block;
|
|
16740
|
-
vertical-align:
|
|
17656
|
+
vertical-align: top;
|
|
16741
17657
|
height: var(--\${P}-line-height);
|
|
16742
17658
|
position: relative;
|
|
16743
17659
|
flex-shrink: 0;
|
|
@@ -16752,6 +17668,16 @@ function getCSS(P: string): string {
|
|
|
16752
17668
|
\`;
|
|
16753
17669
|
}
|
|
16754
17670
|
|
|
17671
|
+
function getImageAspectRatio(settings: WaterfallSettings | undefined): number {
|
|
17672
|
+
const { imageDisplay } = settings ?? {};
|
|
17673
|
+
const ratioValue = imageDisplay?.ratioValue ?? '1:1';
|
|
17674
|
+
const ratioReversed = imageDisplay?.reversed ?? false;
|
|
17675
|
+
const [rW, rH] = ratioValue.split(':').map(Number);
|
|
17676
|
+
const effW = ratioReversed ? rH : rW;
|
|
17677
|
+
const effH = ratioReversed ? rW : rH;
|
|
17678
|
+
return effH > 0 ? effW / effH : 1;
|
|
17679
|
+
}
|
|
17680
|
+
|
|
16755
17681
|
function getWaterfallTextMetricsVars(
|
|
16756
17682
|
settings: WaterfallSettings | undefined,
|
|
16757
17683
|
varPrefix: string,
|
|
@@ -16763,6 +17689,7 @@ function getWaterfallTextMetricsVars(
|
|
|
16763
17689
|
return {
|
|
16764
17690
|
[\`--\${varPrefix}-line-height\`]: scalingValue(lineHeight, isEditor ?? false),
|
|
16765
17691
|
[\`--\${varPrefix}-image-inline-gap\`]: scalingValue(fontSize * IMAGE_INLINE_GAP_RATIO, isEditor ?? false),
|
|
17692
|
+
[\`--\${varPrefix}-image-aspect\`]: getImageAspectRatio(settings),
|
|
16766
17693
|
} as React.CSSProperties;
|
|
16767
17694
|
}
|
|
16768
17695
|
|
|
@@ -16784,42 +17711,17 @@ function resolveInlineTitleStyle(settings: WaterfallSettings | undefined, isEdit
|
|
|
16784
17711
|
}
|
|
16785
17712
|
|
|
16786
17713
|
function resolveImageDisplay(settings: WaterfallSettings | undefined) {
|
|
16787
|
-
const
|
|
16788
|
-
const
|
|
16789
|
-
const ratioValue = imageDisplay?.ratioValue ?? '1:1';
|
|
16790
|
-
const ratioReversed = imageDisplay?.reversed ?? false;
|
|
16791
|
-
const [rW, rH] = ratioValue.split(':').map(Number);
|
|
16792
|
-
const effW = ratioReversed ? rH : rW;
|
|
16793
|
-
const effH = ratioReversed ? rW : rH;
|
|
16794
|
-
const aspectRatio = \`\${effW} / \${effH}\`;
|
|
16795
|
-
|
|
16796
|
-
const imageWrapperStyle: React.CSSProperties | undefined = isCover
|
|
16797
|
-
? { aspectRatio, overflow: 'hidden' }
|
|
16798
|
-
: undefined;
|
|
17714
|
+
const isCover = settings?.imageDisplay?.display === 'cover';
|
|
17715
|
+
const lightboxEnabled = (settings?.lightbox ?? 'on') === 'on';
|
|
16799
17716
|
|
|
16800
|
-
const imageStyle: React.CSSProperties =
|
|
16801
|
-
?
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
height: '100%',
|
|
16806
|
-
maxWidth: '100%',
|
|
16807
|
-
cursor: 'pointer',
|
|
16808
|
-
}
|
|
16809
|
-
: {
|
|
16810
|
-
objectFit: 'contain',
|
|
16811
|
-
pointerEvents: 'auto',
|
|
16812
|
-
width: 'auto',
|
|
16813
|
-
height: '100%',
|
|
16814
|
-
maxWidth: '100%',
|
|
16815
|
-
cursor: 'pointer',
|
|
16816
|
-
};
|
|
17717
|
+
const imageStyle: React.CSSProperties = {
|
|
17718
|
+
objectFit: isCover ? 'cover' : 'contain',
|
|
17719
|
+
pointerEvents: 'auto',
|
|
17720
|
+
...(lightboxEnabled ? { cursor: 'pointer' } : null),
|
|
17721
|
+
};
|
|
16817
17722
|
|
|
16818
17723
|
return {
|
|
16819
|
-
isCover,
|
|
16820
|
-
aspectRatio,
|
|
16821
17724
|
objectFitMode: isCover ? 'cover' as const : 'contain' as const,
|
|
16822
|
-
imageWrapperStyle,
|
|
16823
17725
|
imageStyle,
|
|
16824
17726
|
};
|
|
16825
17727
|
}
|
|
@@ -16866,13 +17768,8 @@ export function Waterfall({
|
|
|
16866
17768
|
const horizontalGap = typeof settings?.horizontalGap === 'number' ? settings.horizontalGap : 0;
|
|
16867
17769
|
const horizontalGapScaled = scalingValue(horizontalGap, isEditor ?? false);
|
|
16868
17770
|
const gapControlWidth = \`max(\${horizontalGapScaled}, \${GAP_CONTROL_MIN_PX}px)\`;
|
|
16869
|
-
const { objectFitMode,
|
|
17771
|
+
const { objectFitMode, imageStyle } = resolveImageDisplay(settings);
|
|
16870
17772
|
const inlineTitleStyle = resolveInlineTitleStyle(settings, isEditor);
|
|
16871
|
-
const wrapperStyle = {
|
|
16872
|
-
width: scalingValue(wrapperWidth, isEditor ?? false),
|
|
16873
|
-
...inlineTitleStyle,
|
|
16874
|
-
...getWaterfallTextMetricsVars(settings, P, isEditor),
|
|
16875
|
-
} as React.CSSProperties;
|
|
16876
17773
|
|
|
16877
17774
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
16878
17775
|
const [lightboxOpen, setLightboxOpen] = useState(false);
|
|
@@ -16883,10 +17780,19 @@ export function Waterfall({
|
|
|
16883
17780
|
const [lightboxEntry, setLightboxEntry] = useState({ title1: '', title2: '', title3: '' });
|
|
16884
17781
|
|
|
16885
17782
|
const showImageHoverEffects = (!isEditor || isPreviewMode) && !lightboxOpen;
|
|
16886
|
-
const imageHoverEffect = settings?.imageHoverEffect ?? 'none';
|
|
16887
|
-
const
|
|
16888
|
-
|
|
17783
|
+
const imageHoverEffect = settings?.imageHoverEffect ?? { sizeType: 'none' as const, value: 120 };
|
|
17784
|
+
const imageHoverType = imageHoverEffect.sizeType ?? 'none';
|
|
17785
|
+
const imageHoverClass = showImageHoverEffects && imageHoverType !== 'none'
|
|
17786
|
+
? \`\${P}-item-hover-\${imageHoverType}\`
|
|
16889
17787
|
: undefined;
|
|
17788
|
+
const imageHoverScale = (imageHoverEffect.value ?? 120) / 100;
|
|
17789
|
+
|
|
17790
|
+
const wrapperStyle = {
|
|
17791
|
+
width: scalingValue(wrapperWidth, isEditor ?? false),
|
|
17792
|
+
...inlineTitleStyle,
|
|
17793
|
+
...getWaterfallTextMetricsVars(settings, P, isEditor),
|
|
17794
|
+
[\`--\${P}-image-hover-scale\`]: String(imageHoverScale),
|
|
17795
|
+
} as React.CSSProperties;
|
|
16890
17796
|
|
|
16891
17797
|
const lightboxPortalStyle = (() => {
|
|
16892
17798
|
const style: Record<string, string> = {};
|
|
@@ -16899,11 +17805,12 @@ export function Waterfall({
|
|
|
16899
17805
|
return style as React.CSSProperties;
|
|
16900
17806
|
})();
|
|
16901
17807
|
|
|
16902
|
-
const canOpenLightbox = !isEditor || isPreviewMode || isEditMode;
|
|
17808
|
+
const canOpenLightbox = (settings?.lightbox ?? 'on') === 'on' && (!isEditor || isPreviewMode || isEditMode);
|
|
16903
17809
|
const allLightboxEntries = useMemo(() => buildLightboxEntries(items), [items]);
|
|
16904
17810
|
const allMedia = useMemo(() => collectAllWaterfallMedia(items), [items]);
|
|
16905
17811
|
|
|
16906
17812
|
const openLightbox = (gridIndex: number, sourceRect?: AnimRect) => {
|
|
17813
|
+
if ((settings?.lightbox ?? 'on') === 'off') return;
|
|
16907
17814
|
if (isEditor && !isEditMode && !isPreviewMode) return;
|
|
16908
17815
|
const entryIdx = allLightboxEntries.findIndex((entry) => entry.gridIndex === gridIndex);
|
|
16909
17816
|
if (entryIdx < 0) return;
|
|
@@ -16959,6 +17866,12 @@ export function Waterfall({
|
|
|
16959
17866
|
setLightboxOpen(false);
|
|
16960
17867
|
}, [isEditor, isEditMode, isPreviewMode]);
|
|
16961
17868
|
|
|
17869
|
+
useEffect(() => {
|
|
17870
|
+
if ((settings?.lightbox ?? 'on') === 'off') {
|
|
17871
|
+
setLightboxOpen(false);
|
|
17872
|
+
}
|
|
17873
|
+
}, [settings?.lightbox]);
|
|
17874
|
+
|
|
16962
17875
|
return (
|
|
16963
17876
|
<>
|
|
16964
17877
|
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
@@ -16976,7 +17889,10 @@ export function Waterfall({
|
|
|
16976
17889
|
);
|
|
16977
17890
|
|
|
16978
17891
|
return (
|
|
16979
|
-
<div
|
|
17892
|
+
<div
|
|
17893
|
+
key={index}
|
|
17894
|
+
className={[\`\${P}-item\`, imageHoverClass].filter(Boolean).join(' ')}
|
|
17895
|
+
>
|
|
16980
17896
|
{item.title ? (
|
|
16981
17897
|
<span
|
|
16982
17898
|
className={\`\${P}-item-title\`}
|
|
@@ -16987,13 +17903,7 @@ export function Waterfall({
|
|
|
16987
17903
|
</span>
|
|
16988
17904
|
) : null}
|
|
16989
17905
|
{item.image?.url ? (
|
|
16990
|
-
<span
|
|
16991
|
-
className={[
|
|
16992
|
-
\`\${P}-item-image\`,
|
|
16993
|
-
imageHoverClass,
|
|
16994
|
-
].filter(Boolean).join(' ')}
|
|
16995
|
-
style={isCover ? imageWrapperStyle : undefined}
|
|
16996
|
-
>
|
|
17906
|
+
<span className={\`\${P}-item-image\`}>
|
|
16997
17907
|
{item.image.type === 'video' ? (
|
|
16998
17908
|
<video
|
|
16999
17909
|
src={item.image.url}
|
|
@@ -17041,7 +17951,7 @@ export function Waterfall({
|
|
|
17041
17951
|
);
|
|
17042
17952
|
})}
|
|
17043
17953
|
</div>
|
|
17044
|
-
{lightboxOpen && typeof document !== 'undefined' && settings && (() => {
|
|
17954
|
+
{lightboxOpen && (settings?.lightbox ?? 'on') === 'on' && typeof document !== 'undefined' && settings && (() => {
|
|
17045
17955
|
const portalTarget = (portalId ? document.getElementById(portalId) : null) ?? document.body;
|
|
17046
17956
|
return createPortal(
|
|
17047
17957
|
<div style={lightboxPortalStyle} data-selection="none">
|
|
@@ -17071,4 +17981,4 @@ export function Waterfall({
|
|
|
17071
17981
|
</>
|
|
17072
17982
|
);
|
|
17073
17983
|
}
|
|
17074
|
-
`,Iy="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 Ry(e){const t={};return t[Be(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Be(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Be(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Be(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Be(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Be(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Oi=Kn.filter(e=>e!=="count"),Ey=Oi.reduce((e,t)=>({...e,...Ry(t)}),{}),My=Oi.reduce((e,t)=>({...e,[Be(t,"fontFamily")]:"Arial",[Be(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Be(t,"letterSpacing")]:0,[Be(t,"wordSpacing")]:0,[Be(t,"textAlign")]:"left",[Be(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Yr(e){return Oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Be(n,"fontSize")]=i),o!==void 0&&(t[Be(n,"lineHeight")]=o),t},{})}const ky={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Oi.map(e=>[Fa[e],_a(e)]))},Do={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Py=[{title:"Salton Sea from Above",...Do,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Do,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Do,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Do,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],Ay={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:Py},settings:{sizing:"auto auto",properties:{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"}}},imageHoverEffect:{type:"string",scope:"common",title:"Hover",display:{type:"toggle-cycle",enum:["none","scale-in","saturate"]}},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"]}}},...Ey},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},imageHoverEffect:"none",titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Iy,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...My},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,...Yr({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,...Yr({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,...Yr({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","wrapperWidth","imageDisplay","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__","wrapperWidth",{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:[ky]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Wy={element:Ty,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"},...Oi.map(e=>({path:`${Be(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Be(t,"fontFamily")}`}),{})},schema:Ay,sourceCode:Ly},Fy=[Su,Eu,Of,yp,Lp,_p,Qp,om,um,Pm,Tg,Ih,_h,xf,Mf,Jf,Wy];exports.components=Fy;exports.isSchemaV1=mc;
|
|
17984
|
+
`,Vy="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 Gy(e){const t={};return t[ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ze(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ze(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ze(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ze(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ze(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ze(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ze(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Oi=Kn.filter(e=>e!=="count"),qy=Oi.reduce((e,t)=>({...e,...Gy(t)}),{}),Ky=Oi.reduce((e,t)=>({...e,[ze(t,"fontFamily")]:"Arial",[ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ze(t,"letterSpacing")]:0,[ze(t,"wordSpacing")]:0,[ze(t,"textAlign")]:"left",[ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Zr(e){return Oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ze(n,"fontSize")]=i),o!==void 0&&(t[ze(n,"lineHeight")]=o),t},{})}const Uy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Oi.map(e=>[Ha[e],Na(e)]))},Do={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Xy=[{title:"Salton Sea from Above",...Do,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Do,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Do,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Do,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],Yy={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:Xy},settings:{sizing:"auto auto",properties:{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"]}}},...qy},defaults:{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:Vy,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Ky},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,...Zr({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,...Zr({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,...Zr({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","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:"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:[Uy]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Jy={element:zy,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"},...Oi.map(e=>({path:`${ze(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ze(t,"fontFamily")}`}),{})},schema:Yy,sourceCode:Dy},Zy=[Tu,Pu,Vf,bp,Ep,Op,om,cm,fm,Hm,Mg,Ph,Bh,Cf,Wf,ny,Jy,my];exports.components=Zy;exports.isSchemaV1=fc;
|