@cntrl-site/components 1.0.12-0 → 1.0.12-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/ControlSlider/ControlSlider.d.ts +2 -25
- package/dist/Components/Form/FormComponent.d.ts +3 -9
- package/dist/Components/Grid/Grid.d.ts +61 -0
- package/dist/Components/Grid/GridComponent.d.ts +42 -0
- package/dist/Components/Lightbox/Lightbox.d.ts +2 -25
- package/dist/Components/List/List.d.ts +105 -0
- package/dist/Components/List/ListComponent.d.ts +42 -0
- package/dist/Components/OnelinerForm/OnelinerFormComponent.d.ts +3 -14
- package/dist/Components/utils/getMainFontBaseOnSystem.d.ts +1 -0
- package/dist/index.js +3147 -210
- package/dist/index.mjs +8377 -2889
- package/dist/types/Component.d.ts +1 -0
- package/dist/types/SchemaV1.d.ts +2 -1
- package/dist/types/TextElementStyles.d.ts +24 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),w=require("react"),ye=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),vr=require("react-dom");function br(e){return e.type==="object"&&e.version===1}const xr="ControlSlider-module__wrapper___sHEkd",Sr="ControlSlider-module__hoverArrow___A-dOH",Cr="ControlSlider-module__sliderItem___QQSkR",wr="ControlSlider-module__sliderImage___9hRl-",$r="ControlSlider-module__arrow___05ghY",Tr="ControlSlider-module__arrowVertical___tBfVN",_r="ControlSlider-module__nextArrow___-30Yc",Er="ControlSlider-module__arrowInner___aEra3",Ar="ControlSlider-module__arrowIcon___S4ztF",kr="ControlSlider-module__arrowImg___2dwJW",Lr="ControlSlider-module__mirror___brd6U",Ir="ControlSlider-module__pagination___bicLF",Fr="ControlSlider-module__paginationInner___bT-P-",Pr="ControlSlider-module__paginationVertical___zYqKw",Mr="ControlSlider-module__paginationItem___nTRbk",Rr="ControlSlider-module__dot___p1Qun",Wr="ControlSlider-module__activeDot___LHFaj",Nr="ControlSlider-module__paginationInsideBottom___R3FWn",Vr="ControlSlider-module__paginationInsideTop___V-qb-",Hr="ControlSlider-module__paginationOutsideBottom___14w8D",jr="ControlSlider-module__paginationOutsideTop___SCLqB",zr="ControlSlider-module__paginationInsideLeft___yOBRZ",Or="ControlSlider-module__paginationInsideRight___Rtt3o",Br="ControlSlider-module__paginationOutsideLeft___lahaw",Dr="ControlSlider-module__paginationOutsideRight___EtuQa",qr="ControlSlider-module__imgWrapper___UjEgB",Ur="ControlSlider-module__captionBlock___dJ6-j",Gr="ControlSlider-module__captionTextWrapper___HFlpf",Yr="ControlSlider-module__captionText___uGBVc",Xr="ControlSlider-module__active___WZK4G",Kr="ControlSlider-module__withPointerEvents___t-18M",Zr="ControlSlider-module__topLeftAlignment___zjnGM",Jr="ControlSlider-module__topCenterAlignment___gD1xW",Qr="ControlSlider-module__topRightAlignment___NMapS",ei="ControlSlider-module__middleLeftAlignment___OnUrY",ti="ControlSlider-module__middleCenterAlignment___Tdkl0",ni="ControlSlider-module__middleRightAlignment___wEbfX",oi="ControlSlider-module__bottomLeftAlignment___cTP2-",ri="ControlSlider-module__bottomCenterAlignment___c54fB",ii="ControlSlider-module__bottomRightAlignment___kEwrz",ai="ControlSlider-module__clickOverlay___DZA28",si="ControlSlider-module__contain___pLyq7",li="ControlSlider-module__cover___KdDat",J={wrapper:xr,hoverArrow:Sr,sliderItem:Cr,sliderImage:wr,arrow:$r,arrowVertical:Tr,nextArrow:_r,arrowInner:Er,arrowIcon:Ar,arrowImg:kr,mirror:Lr,pagination:Ir,paginationInner:Fr,paginationVertical:Pr,paginationItem:Mr,dot:Rr,activeDot:Wr,paginationInsideBottom:Nr,paginationInsideTop:Vr,paginationOutsideBottom:Hr,paginationOutsideTop:jr,paginationInsideLeft:zr,paginationInsideRight:Or,paginationOutsideLeft:Br,paginationOutsideRight:Dr,imgWrapper:qr,captionBlock:Ur,captionTextWrapper:Gr,captionText:Yr,active:Xr,withPointerEvents:Kr,topLeftAlignment:Zr,topCenterAlignment:Jr,topRightAlignment:Qr,middleLeftAlignment:ei,middleCenterAlignment:ti,middleRightAlignment:ni,bottomLeftAlignment:oi,bottomCenterAlignment:ri,bottomRightAlignment:ii,clickOverlay:ai,contain:si,cover:li};function ci(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ui(e,t,n){return t&&ci(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var oo="(prefers-reduced-motion: reduce)",mt=1,pi=2,yt=3,xt=4,Rt=5,Kt=6,en=7,di={CREATED:mt,MOUNTED:pi,IDLE:yt,MOVING:xt,SCROLLING:Rt,DRAGGING:Kt,DESTROYED:en};function Ue(e){e.length=0}function Qe(e,t,n){return Array.prototype.slice.call(e,t,n)}function ve(e){return e.bind.apply(e,[null].concat(Qe(arguments,1)))}var Ao=setTimeout,Tn=function(){};function ro(e){return requestAnimationFrame(e)}function an(e,t){return typeof t===e}function Et(e){return!Rn(e)&&an("object",e)}var Mn=Array.isArray,ko=ve(an,"function"),Ze=ve(an,"string"),Wt=ve(an,"undefined");function Rn(e){return e===null}function Lo(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Nt(e){return Mn(e)?e:[e]}function ke(e,t){Nt(e).forEach(t)}function Wn(e,t){return e.indexOf(t)>-1}function Zt(e,t){return e.push.apply(e,Nt(t)),e}function Be(e,t,n){e&&ke(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function We(e,t){Be(e,Ze(t)?t.split(" "):t,!0)}function Vt(e,t){ke(t,e.appendChild.bind(e))}function Nn(e,t){ke(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function At(e,t){return Lo(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Io(e,t){var n=e?Qe(e.children):[];return t?n.filter(function(o){return At(o,t)}):n}function Ht(e,t){return t?Io(e,t)[0]:e.firstElementChild}var kt=Object.keys;function rt(e,t,n){return e&&(n?kt(e).reverse():kt(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function Lt(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){e[o]=t[o]})}),e}function Xe(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){Mn(n)?e[o]=n.slice():Et(n)?e[o]=Xe({},Et(e[o])?e[o]:{},n):e[o]=n})}),e}function io(e,t){ke(t||kt(e),function(n){delete e[n]})}function Ne(e,t){ke(e,function(n){ke(t,function(o){n&&n.removeAttribute(o)})})}function le(e,t,n){Et(t)?rt(t,function(o,r){le(e,r,o)}):ke(e,function(o){Rn(n)||n===""?Ne(o,t):o.setAttribute(t,String(n))})}function gt(e,t,n){var o=document.createElement(e);return t&&(Ze(t)?We(o,t):le(o,t)),n&&Vt(n,o),o}function Ie(e,t,n){if(Wt(n))return getComputedStyle(e)[t];Rn(n)||(e.style[t]=""+n)}function It(e,t){Ie(e,"display",t)}function Fo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Fe(e,t){return e.getAttribute(t)}function ao(e,t){return e&&e.classList.contains(t)}function Ee(e){return e.getBoundingClientRect()}function it(e){ke(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Po(e){return Ht(new DOMParser().parseFromString(e,"text/html").body)}function Oe(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Mo(e,t){return e&&e.querySelector(t)}function Vn(e,t){return t?Qe(e.querySelectorAll(t)):[]}function De(e,t){Be(e,t,!1)}function _n(e){return e.timeStamp}function ot(e){return Ze(e)?e:e?e+"px":""}var jt="splide",Hn="data-"+jt;function Tt(e,t){if(!e)throw new Error("["+jt+"] "+(t||""))}var Je=Math.min,tn=Math.max,nn=Math.floor,Ft=Math.ceil,_e=Math.abs;function Ro(e,t,n){return _e(e-t)<n}function Jt(e,t,n,o){var r=Je(t,n),a=tn(t,n);return o?r<e&&e<a:r<=e&&e<=a}function pt(e,t,n){var o=Je(t,n),r=tn(t,n);return Je(tn(o,e),r)}function En(e){return+(e>0)-+(e<0)}function An(e,t){return ke(t,function(n){e=e.replace("%s",""+n)}),e}function jn(e){return e<10?"0"+e:""+e}var so={};function mi(e){return""+e+jn(so[e]=(so[e]||0)+1)}function Wo(){var e=[];function t(i,u,c,m){r(i,u,function(l,A,S){var g="addEventListener"in l,p=g?l.removeEventListener.bind(l,A,c,m):l.removeListener.bind(l,c);g?l.addEventListener(A,c,m):l.addListener(c),e.push([l,A,S,c,p])})}function n(i,u,c){r(i,u,function(m,l,A){e=e.filter(function(S){return S[0]===m&&S[1]===l&&S[2]===A&&(!c||S[3]===c)?(S[4](),!1):!0})})}function o(i,u,c){var m,l=!0;return typeof CustomEvent=="function"?m=new CustomEvent(u,{bubbles:l,detail:c}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(u,l,!1,c)),i.dispatchEvent(m),m}function r(i,u,c){ke(i,function(m){m&&ke(u,function(l){l.split(" ").forEach(function(A){var S=A.split(".");c(m,S[0],S[1])})})})}function a(){e.forEach(function(i){i[4]()}),Ue(e)}return{bind:t,unbind:n,dispatch:o,destroy:a}}var et="mounted",kn="ready",Ge="move",St="moved",zn="click",No="active",Vo="inactive",Ho="visible",jo="hidden",Se="refresh",Te="updated",vt="resize",sn="resized",zo="drag",Oo="dragging",Bo="dragged",ln="scroll",st="scrolled",gi="overflow",On="destroy",Do="arrows:mounted",qo="arrows:updated",Uo="pagination:mounted",Go="pagination:updated",Bn="navigation:mounted",Dn="autoplay:play",Yo="autoplay:playing",qn="autoplay:pause",Un="lazyload:loaded",Xo="sk",Ko="sh",on="ei";function be(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Wo();function o(a,i){n.bind(t,Nt(a).join(" "),function(u){i.apply(i,Mn(u.detail)?u.detail:[])})}function r(a){n.dispatch(t,a,Qe(arguments,1))}return e&&e.event.on(On,n.destroy),Lt(n,{bus:t,on:o,off:ve(n.unbind,t),emit:r})}function cn(e,t,n,o){var r=Date.now,a,i=0,u,c=!0,m=0;function l(){if(!c){if(i=e?Je((r()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=r(),o&&++m>=o))return S();u=ro(l)}}function A(h){h||p(),a=r()-(h?i*e:0),c=!1,u=ro(l)}function S(){c=!0}function g(){a=r(),i=0,n&&n(i)}function p(){u&&cancelAnimationFrame(u),i=0,u=0,c=!0}function d(h){e=h}function x(){return c}return{start:A,rewind:g,pause:S,cancel:p,set:d,isPaused:x}}function fi(e){var t=e;function n(r){t=r}function o(r){return Wn(Nt(r),t)}return{set:n,is:o}}function hi(e,t){var n=cn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function yi(e,t,n){var o=e.state,r=n.breakpoints||{},a=n.reducedMotion||{},i=Wo(),u=[];function c(){var p=n.mediaQuery==="min";kt(r).sort(function(d,x){return p?+d-+x:+x-+d}).forEach(function(d){l(r[d],"("+(p?"min":"max")+"-width:"+d+"px)")}),l(a,oo),A()}function m(p){p&&i.destroy()}function l(p,d){var x=matchMedia(d);i.bind(x,"change",A),u.push([p,x])}function A(){var p=o.is(en),d=n.direction,x=u.reduce(function(h,y){return Xe(h,y[1].matches?y[0]:{})},{});io(n),g(x),n.destroy?e.destroy(n.destroy==="completely"):p?(m(!0),e.mount()):d!==n.direction&&e.refresh()}function S(p){matchMedia(oo).matches&&(p?Xe(n,a):io(n,kt(a)))}function g(p,d,x){Xe(n,p),d&&Xe(Object.getPrototypeOf(n),p),(x||!o.is(mt))&&e.emit(Te,n)}return{setup:c,destroy:m,reduce:S,set:g}}var un="Arrow",pn=un+"Left",dn=un+"Right",Zo=un+"Up",Jo=un+"Down",lo="rtl",mn="ttb",bn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Zo,dn],ArrowRight:[Jo,pn]};function vi(e,t,n){function o(a,i,u){u=u||n.direction;var c=u===lo&&!i?1:u===mn?0:-1;return bn[a]&&bn[a][c]||a.replace(/width|left|right/i,function(m,l){var A=bn[m.toLowerCase()][c]||m;return l>0?A.charAt(0).toUpperCase()+A.slice(1):A})}function r(a){return a*(n.direction===lo?1:-1)}return{resolve:o,orient:r}}var qe="role",ft="tabindex",bi="disabled",Pe="aria-",zt=Pe+"controls",Qo=Pe+"current",co=Pe+"selected",Ae=Pe+"label",Gn=Pe+"labelledby",er=Pe+"hidden",Yn=Pe+"orientation",Pt=Pe+"roledescription",uo=Pe+"live",po=Pe+"busy",mo=Pe+"atomic",Xn=[qe,ft,bi,zt,Qo,Ae,Gn,er,Yn,Pt],Ve=jt+"__",tt="is-",xn=jt,go=Ve+"track",xi=Ve+"list",gn=Ve+"slide",tr=gn+"--clone",Si=gn+"__container",Kn=Ve+"arrows",fn=Ve+"arrow",nr=fn+"--prev",or=fn+"--next",hn=Ve+"pagination",rr=hn+"__page",Ci=Ve+"progress",wi=Ci+"__bar",$i=Ve+"toggle",Ti=Ve+"spinner",_i=Ve+"sr",Ei=tt+"initialized",at=tt+"active",ir=tt+"prev",ar=tt+"next",Ln=tt+"visible",In=tt+"loading",sr=tt+"focus-in",lr=tt+"overflow",Ai=[at,Ln,ir,ar,In,sr,lr],ki={slide:gn,clone:tr,arrows:Kn,arrow:fn,prev:nr,next:or,pagination:hn,page:rr,spinner:Ti};function Li(e,t){if(ko(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!At(n,t);)n=n.parentElement;return n}var Ii=5,fo=200,cr="touchstart mousedown",Sn="touchmove mousemove",Cn="touchend touchcancel mouseup click";function Fi(e,t,n){var o=be(e),r=o.on,a=o.bind,i=e.root,u=n.i18n,c={},m=[],l=[],A=[],S,g,p;function d(){_(),D(),y()}function x(){r(Se,h),r(Se,d),r(Te,y),a(document,cr+" keydown",function(b){p=b.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Be(i,sr,!!p)})}function h(b){var C=Xn.concat("style");Ue(m),De(i,l),De(S,A),Ne([S,g],C),Ne(i,b?C:["style",Pt])}function y(){De(i,l),De(S,A),l=E(xn),A=E(go),We(i,l),We(S,A),le(i,Ae,n.label),le(i,Gn,n.labelledby)}function _(){S=W("."+go),g=Ht(S,"."+xi),Tt(S&&g,"A track/list element is missing."),Zt(m,Io(g,"."+gn+":not(."+tr+")")),rt({arrows:Kn,pagination:hn,prev:nr,next:or,bar:wi,toggle:$i},function(b,C){c[C]=W("."+b)}),Lt(c,{root:i,track:S,list:g,slides:m})}function D(){var b=i.id||mi(jt),C=n.role;i.id=b,S.id=S.id||b+"-track",g.id=g.id||b+"-list",!Fe(i,qe)&&i.tagName!=="SECTION"&&C&&le(i,qe,C),le(i,Pt,u.carousel),le(g,qe,"presentation")}function W(b){var C=Mo(i,b);return C&&Li(C,"."+xn)===i?C:void 0}function E(b){return[b+"--"+n.type,b+"--"+n.direction,n.drag&&b+"--draggable",n.isNavigation&&b+"--nav",b===xn&&at]}return Lt(c,{setup:d,mount:x,destroy:h})}var bt="slide",Ct="loop",Ot="fade";function Pi(e,t,n,o){var r=be(e),a=r.on,i=r.emit,u=r.bind,c=e.Components,m=e.root,l=e.options,A=l.isNavigation,S=l.updateOnMove,g=l.i18n,p=l.pagination,d=l.slideFocus,x=c.Direction.resolve,h=Fe(o,"style"),y=Fe(o,Ae),_=n>-1,D=Ht(o,"."+Si),W;function E(){_||(o.id=m.id+"-slide"+jn(t+1),le(o,qe,p?"tabpanel":"group"),le(o,Pt,g.slide),le(o,Ae,y||An(g.slideLabel,[t+1,e.length]))),b()}function b(){u(o,"click",ve(i,zn,k)),u(o,"keydown",ve(i,Xo,k)),a([St,Ko,st],M),a(Bn,F),S&&a(Ge,j)}function C(){W=!0,r.destroy(),De(o,Ai),Ne(o,Xn),le(o,"style",h),le(o,Ae,y||"")}function F(){var L=e.splides.map(function(T){var R=T.splide.Components.Slides.getAt(t);return R?R.slide.id:""}).join(" ");le(o,Ae,An(g.slideX,(_?n:t)+1)),le(o,zt,L),le(o,qe,d?"button":""),d&&Ne(o,Pt)}function j(){W||M()}function M(){if(!W){var L=e.index;N(),H(),Be(o,ir,t===L-1),Be(o,ar,t===L+1)}}function N(){var L=U();L!==ao(o,at)&&(Be(o,at,L),le(o,Qo,A&&L||""),i(L?No:Vo,k))}function H(){var L=f(),T=!L&&(!U()||_);if(e.state.is([xt,Rt])||le(o,er,T||""),le(Vn(o,l.focusableNodes||""),ft,T?-1:""),d&&le(o,ft,T?-1:0),L!==ao(o,Ln)&&(Be(o,Ln,L),i(L?Ho:jo,k)),!L&&document.activeElement===o){var R=c.Slides.getAt(e.index);R&&Fo(R.slide)}}function B(L,T,R){Ie(R&&D||o,L,T)}function U(){var L=e.index;return L===t||l.cloneStatus&&L===n}function f(){if(e.is(Ot))return U();var L=Ee(c.Elements.track),T=Ee(o),R=x("left",!0),Z=x("right",!0);return nn(L[R])<=Ft(T[R])&&nn(T[Z])<=Ft(L[Z])}function I(L,T){var R=_e(L-t);return!_&&(l.rewind||e.is(Ct))&&(R=Je(R,e.length-R)),R<=T}var k={index:t,slideIndex:n,slide:o,container:D,isClone:_,mount:E,destroy:C,update:M,style:B,isWithin:I};return k}function Mi(e,t,n){var o=be(e),r=o.on,a=o.emit,i=o.bind,u=t.Elements,c=u.slides,m=u.list,l=[];function A(){S(),r(Se,g),r(Se,S)}function S(){c.forEach(function(M,N){d(M,N,-1)})}function g(){W(function(M){M.destroy()}),Ue(l)}function p(){W(function(M){M.update()})}function d(M,N,H){var B=Pi(e,N,H,M);B.mount(),l.push(B),l.sort(function(U,f){return U.index-f.index})}function x(M){return M?E(function(N){return!N.isClone}):l}function h(M){var N=t.Controller,H=N.toIndex(M),B=N.hasFocus()?1:n.perPage;return E(function(U){return Jt(U.index,H,H+B-1)})}function y(M){return E(M)[0]}function _(M,N){ke(M,function(H){if(Ze(H)&&(H=Po(H)),Lo(H)){var B=c[N];B?Nn(H,B):Vt(m,H),We(H,n.classes.slide),C(H,ve(a,vt))}}),a(Se)}function D(M){it(E(M).map(function(N){return N.slide})),a(Se)}function W(M,N){x(N).forEach(M)}function E(M){return l.filter(ko(M)?M:function(N){return Ze(M)?At(N.slide,M):Wn(Nt(M),N.index)})}function b(M,N,H){W(function(B){B.style(M,N,H)})}function C(M,N){var H=Vn(M,"img"),B=H.length;B?H.forEach(function(U){i(U,"load error",function(){--B||N()})}):N()}function F(M){return M?c.length:l.length}function j(){return l.length>n.perPage}return{mount:A,destroy:g,update:p,register:d,get:x,getIn:h,getAt:y,add:_,remove:D,forEach:W,filter:E,style:b,getLength:F,isEnough:j}}function Ri(e,t,n){var o=be(e),r=o.on,a=o.bind,i=o.emit,u=t.Slides,c=t.Direction.resolve,m=t.Elements,l=m.root,A=m.track,S=m.list,g=u.getAt,p=u.style,d,x,h;function y(){_(),a(window,"resize load",hi(ve(i,vt))),r([Te,Se],_),r(vt,D)}function _(){d=n.direction===mn,Ie(l,"maxWidth",ot(n.width)),Ie(A,c("paddingLeft"),W(!1)),Ie(A,c("paddingRight"),W(!0)),D(!0)}function D(k){var L=Ee(l);(k||x.width!==L.width||x.height!==L.height)&&(Ie(A,"height",E()),p(c("marginRight"),ot(n.gap)),p("width",C()),p("height",F(),!0),x=L,i(sn),h!==(h=I())&&(Be(l,lr,h),i(gi,h)))}function W(k){var L=n.padding,T=c(k?"right":"left");return L&&ot(L[T]||(Et(L)?0:L))||"0px"}function E(){var k="";return d&&(k=b(),Tt(k,"height or heightRatio is missing."),k="calc("+k+" - "+W(!1)+" - "+W(!0)+")"),k}function b(){return ot(n.height||Ee(S).width*n.heightRatio)}function C(){return n.autoWidth?null:ot(n.fixedWidth)||(d?"":j())}function F(){return ot(n.fixedHeight)||(d?n.autoHeight?null:j():b())}function j(){var k=ot(n.gap);return"calc((100%"+(k&&" + "+k)+")/"+(n.perPage||1)+(k&&" - "+k)+")"}function M(){return Ee(S)[c("width")]}function N(k,L){var T=g(k||0);return T?Ee(T.slide)[c("width")]+(L?0:U()):0}function H(k,L){var T=g(k);if(T){var R=Ee(T.slide)[c("right")],Z=Ee(S)[c("left")];return _e(R-Z)+(L?0:U())}return 0}function B(k){return H(e.length-1)-H(0)+N(0,k)}function U(){var k=g(0);return k&&parseFloat(Ie(k.slide,c("marginRight")))||0}function f(k){return parseFloat(Ie(A,c("padding"+(k?"Right":"Left"))))||0}function I(){return e.is(Ot)||B(!0)>M()}return{mount:y,resize:D,listSize:M,slideSize:N,sliderSize:B,totalSize:H,getPadding:f,isOverflow:I}}var Wi=2;function Ni(e,t,n){var o=be(e),r=o.on,a=t.Elements,i=t.Slides,u=t.Direction.resolve,c=[],m;function l(){r(Se,A),r([Te,vt],g),(m=x())&&(p(m),t.Layout.resize(!0))}function A(){S(),l()}function S(){it(c),Ue(c),o.destroy()}function g(){var h=x();m!==h&&(m<h||!h)&&o.emit(Se)}function p(h){var y=i.get().slice(),_=y.length;if(_){for(;y.length<h;)Zt(y,y);Zt(y.slice(-h),y.slice(0,h)).forEach(function(D,W){var E=W<h,b=d(D.slide,W);E?Nn(b,y[0].slide):Vt(a.list,b),Zt(c,b),i.register(b,W-h+(E?0:_),D.index)})}}function d(h,y){var _=h.cloneNode(!0);return We(_,n.classes.clone),_.id=e.root.id+"-clone"+jn(y+1),_}function x(){var h=n.clones;if(!e.is(Ct))h=0;else if(Wt(h)){var y=n[u("fixedWidth")]&&t.Layout.slideSize(0),_=y&&Ft(Ee(a.track)[u("width")]/y);h=_||n[u("autoWidth")]&&e.length||n.perPage*Wi}return h}return{mount:l,destroy:S}}function Vi(e,t,n){var o=be(e),r=o.on,a=o.emit,i=e.state.set,u=t.Layout,c=u.slideSize,m=u.getPadding,l=u.totalSize,A=u.listSize,S=u.sliderSize,g=t.Direction,p=g.resolve,d=g.orient,x=t.Elements,h=x.list,y=x.track,_;function D(){_=t.Transition,r([et,sn,Te,Se],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),b(e.index),t.Slides.update())}function E(T,R,Z,ae){T!==R&&k(T>Z)&&(M(),C(j(B(),T>Z),!0)),i(xt),a(Ge,R,Z,T),_.start(R,function(){i(yt),a(St,R,Z,T),ae&&ae()})}function b(T){C(H(T,!0))}function C(T,R){if(!e.is(Ot)){var Z=R?T:F(T);Ie(h,"transform","translate"+p("X")+"("+Z+"px)"),T!==Z&&a(Ko)}}function F(T){if(e.is(Ct)){var R=N(T),Z=R>t.Controller.getEnd(),ae=R<0;(ae||Z)&&(T=j(T,Z))}return T}function j(T,R){var Z=T-I(R),ae=S();return T-=d(ae*(Ft(_e(Z)/ae)||1))*(R?1:-1),T}function M(){C(B(),!0),_.cancel()}function N(T){for(var R=t.Slides.get(),Z=0,ae=1/0,te=0;te<R.length;te++){var ce=R[te].index,P=_e(H(ce,!0)-T);if(P<=ae)ae=P,Z=ce;else break}return Z}function H(T,R){var Z=d(l(T-1)-f(T));return R?U(Z):Z}function B(){var T=p("left");return Ee(h)[T]-Ee(y)[T]+d(m(!1))}function U(T){return n.trimSpace&&e.is(bt)&&(T=pt(T,0,d(S(!0)-A()))),T}function f(T){var R=n.focus;return R==="center"?(A()-c(T,!0))/2:+R*c(T)||0}function I(T){return H(T?t.Controller.getEnd():0,!!n.trimSpace)}function k(T){var R=d(j(B(),T));return T?R>=0:R<=h[p("scrollWidth")]-Ee(y)[p("width")]}function L(T,R){R=Wt(R)?B():R;var Z=T!==!0&&d(R)<d(I(!1)),ae=T!==!1&&d(R)>d(I(!0));return Z||ae}return{mount:D,move:E,jump:b,translate:C,shift:j,cancel:M,toIndex:N,toPosition:H,getPosition:B,getLimit:I,exceededLimit:L,reposition:W}}function Hi(e,t,n){var o=be(e),r=o.on,a=o.emit,i=t.Move,u=i.getPosition,c=i.getLimit,m=i.toPosition,l=t.Slides,A=l.isEnough,S=l.getLength,g=n.omitEnd,p=e.is(Ct),d=e.is(bt),x=ve(B,!1),h=ve(B,!0),y=n.start||0,_,D=y,W,E,b;function C(){F(),r([Te,Se,on],F),r(sn,j)}function F(){W=S(!0),E=n.perMove,b=n.perPage,_=k();var P=pt(y,0,g?_:W-1);P!==y&&(y=P,i.reposition())}function j(){_!==k()&&a(on)}function M(P,ee,fe){if(!ce()){var de=H(P),ge=I(de);ge>-1&&(ee||ge!==y)&&(Z(ge),i.move(de,ge,D,fe))}}function N(P,ee,fe,de){t.Scroll.scroll(P,ee,fe,function(){var ge=I(i.toIndex(u()));Z(g?Je(ge,_):ge),de&&de()})}function H(P){var ee=y;if(Ze(P)){var fe=P.match(/([+\-<>])(\d+)?/)||[],de=fe[1],ge=fe[2];de==="+"||de==="-"?ee=U(y+ +(""+de+(+ge||1)),y):de===">"?ee=ge?L(+ge):x(!0):de==="<"&&(ee=h(!0))}else ee=p?P:pt(P,0,_);return ee}function B(P,ee){var fe=E||(te()?1:b),de=U(y+fe*(P?-1:1),y,!(E||te()));return de===-1&&d&&!Ro(u(),c(!P),1)?P?0:_:ee?de:I(de)}function U(P,ee,fe){if(A()||te()){var de=f(P);de!==P&&(ee=P,P=de,fe=!1),P<0||P>_?!E&&(Jt(0,P,ee,!0)||Jt(_,ee,P,!0))?P=L(T(P)):p?P=fe?P<0?-(W%b||b):W:P:n.rewind?P=P<0?_:0:P=-1:fe&&P!==ee&&(P=L(T(ee)+(P<ee?-1:1)))}else P=-1;return P}function f(P){if(d&&n.trimSpace==="move"&&P!==y)for(var ee=u();ee===m(P,!0)&&Jt(P,0,e.length-1,!n.rewind);)P<y?--P:++P;return P}function I(P){return p?(P+W)%W||0:P}function k(){for(var P=W-(te()||p&&E?1:b);g&&P-- >0;)if(m(W-1,!0)!==m(P,!0)){P++;break}return pt(P,0,W-1)}function L(P){return pt(te()?P:b*P,0,_)}function T(P){return te()?Je(P,_):nn((P>=_?W-1:P)/b)}function R(P){var ee=i.toIndex(P);return d?pt(ee,0,_):ee}function Z(P){P!==y&&(D=y,y=P)}function ae(P){return P?D:y}function te(){return!Wt(n.focus)||n.isNavigation}function ce(){return e.state.is([xt,Rt])&&!!n.waitForTransition}return{mount:C,go:M,scroll:N,getNext:x,getPrev:h,getAdjacent:B,getEnd:k,setIndex:Z,getIndex:ae,toIndex:L,toPage:T,toDest:R,hasFocus:te,isBusy:ce}}var ji="http://www.w3.org/2000/svg",zi="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",qt=40;function Oi(e,t,n){var o=be(e),r=o.on,a=o.bind,i=o.emit,u=n.classes,c=n.i18n,m=t.Elements,l=t.Controller,A=m.arrows,S=m.track,g=A,p=m.prev,d=m.next,x,h,y={};function _(){W(),r(Te,D)}function D(){E(),_()}function W(){var N=n.arrows;N&&!(p&&d)&&F(),p&&d&&(Lt(y,{prev:p,next:d}),It(g,N?"":"none"),We(g,h=Kn+"--"+n.direction),N&&(b(),M(),le([p,d],zt,S.id),i(Do,p,d)))}function E(){o.destroy(),De(g,h),x?(it(A?[p,d]:g),p=d=null):Ne([p,d],Xn)}function b(){r([et,St,Se,st,on],M),a(d,"click",ve(C,">")),a(p,"click",ve(C,"<"))}function C(N){l.go(N,!0)}function F(){g=A||gt("div",u.arrows),p=j(!0),d=j(!1),x=!0,Vt(g,[p,d]),!A&&Nn(g,S)}function j(N){var H='<button class="'+u.arrow+" "+(N?u.prev:u.next)+'" type="button"><svg xmlns="'+ji+'" viewBox="0 0 '+qt+" "+qt+'" width="'+qt+'" height="'+qt+'" focusable="false"><path d="'+(n.arrowPath||zi)+'" />';return Po(H)}function M(){if(p&&d){var N=e.index,H=l.getPrev(),B=l.getNext(),U=H>-1&&N<H?c.last:c.prev,f=B>-1&&N>B?c.first:c.next;p.disabled=H<0,d.disabled=B<0,le(p,Ae,U),le(d,Ae,f),i(qo,p,d,H,B)}}return{arrows:y,mount:_,destroy:E,update:M}}var Bi=Hn+"-interval";function Di(e,t,n){var o=be(e),r=o.on,a=o.bind,i=o.emit,u=cn(n.interval,e.go.bind(e,">"),b),c=u.isPaused,m=t.Elements,l=t.Elements,A=l.root,S=l.toggle,g=n.autoplay,p,d,x=g==="pause";function h(){g&&(y(),S&&le(S,zt,m.track.id),x||_(),E())}function y(){n.pauseOnHover&&a(A,"mouseenter mouseleave",function(F){p=F.type==="mouseenter",W()}),n.pauseOnFocus&&a(A,"focusin focusout",function(F){d=F.type==="focusin",W()}),S&&a(S,"click",function(){x?_():D(!0)}),r([Ge,ln,Se],u.rewind),r(Ge,C)}function _(){c()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),d=p=x=!1,E(),i(Dn))}function D(F){F===void 0&&(F=!0),x=!!F,E(),c()||(u.pause(),i(qn))}function W(){x||(p||d?D(!1):_())}function E(){S&&(Be(S,at,!x),le(S,Ae,n.i18n[x?"play":"pause"]))}function b(F){var j=m.bar;j&&Ie(j,"width",F*100+"%"),i(Yo,F)}function C(F){var j=t.Slides.getAt(F);u.set(j&&+Fe(j.slide,Bi)||n.interval)}return{mount:h,destroy:u.cancel,play:_,pause:D,isPaused:c}}function qi(e,t,n){var o=be(e),r=o.on;function a(){n.cover&&(r(Un,ve(u,!0)),r([et,Te,Se],ve(i,!0)))}function i(c){t.Slides.forEach(function(m){var l=Ht(m.container||m.slide,"img");l&&l.src&&u(c,l,m)})}function u(c,m,l){l.style("background",c?'center/cover no-repeat url("'+m.src+'")':"",!0),It(m,c?"none":"")}return{mount:a,destroy:ve(i,!1)}}var Ui=10,Gi=600,Yi=.6,Xi=1.5,Ki=800;function Zi(e,t,n){var o=be(e),r=o.on,a=o.emit,i=e.state.set,u=t.Move,c=u.getPosition,m=u.getLimit,l=u.exceededLimit,A=u.translate,S=e.is(bt),g,p,d=1;function x(){r(Ge,D),r([Te,Se],W)}function h(b,C,F,j,M){var N=c();if(D(),F&&(!S||!l())){var H=t.Layout.sliderSize(),B=En(b)*H*nn(_e(b)/H)||0;b=u.toPosition(t.Controller.toDest(b%H))+B}var U=Ro(N,b,1);d=1,C=U?0:C||tn(_e(b-N)/Xi,Ki),p=j,g=cn(C,y,ve(_,N,b,M),1),i(Rt),a(ln),g.start()}function y(){i(yt),p&&p(),a(st)}function _(b,C,F,j){var M=c(),N=b+(C-b)*E(j),H=(N-M)*d;A(M+H),S&&!F&&l()&&(d*=Yi,_e(H)<Ui&&h(m(l(!0)),Gi,!1,p,!0))}function D(){g&&g.cancel()}function W(){g&&!g.isPaused()&&(D(),y())}function E(b){var C=n.easingFunc;return C?C(b):1-Math.pow(1-b,4)}return{mount:x,destroy:D,scroll:h,cancel:W}}var dt={passive:!1,capture:!0};function Ji(e,t,n){var o=be(e),r=o.on,a=o.emit,i=o.bind,u=o.unbind,c=e.state,m=t.Move,l=t.Scroll,A=t.Controller,S=t.Elements.track,g=t.Media.reduce,p=t.Direction,d=p.resolve,x=p.orient,h=m.getPosition,y=m.exceededLimit,_,D,W,E,b,C=!1,F,j,M;function N(){i(S,Sn,Tn,dt),i(S,Cn,Tn,dt),i(S,cr,B,dt),i(S,"click",I,{capture:!0}),i(S,"dragstart",Oe),r([et,Te],H)}function H(){var V=n.drag;me(!V),E=V==="free"}function B(V){if(F=!1,!j){var v=ge(V);de(V.target)&&(v||!V.button)&&(A.isBusy()?Oe(V,!0):(M=v?S:window,b=c.is([xt,Rt]),W=null,i(M,Sn,U,dt),i(M,Cn,f,dt),m.cancel(),l.cancel(),k(V)))}}function U(V){if(c.is(Kt)||(c.set(Kt),a(zo)),V.cancelable)if(b){m.translate(_+fe(te(V)));var v=ce(V)>fo,q=C!==(C=y());(v||q)&&k(V),F=!0,a(Oo),Oe(V)}else R(V)&&(b=T(V),Oe(V))}function f(V){c.is(Kt)&&(c.set(yt),a(Bo)),b&&(L(V),Oe(V)),u(M,Sn,U),u(M,Cn,f),b=!1}function I(V){!j&&F&&Oe(V,!0)}function k(V){W=D,D=V,_=h()}function L(V){var v=Z(V),q=ae(v),K=n.rewind&&n.rewindByDrag;g(!1),E?A.scroll(q,0,n.snap):e.is(Ot)?A.go(x(En(v))<0?K?"<":"-":K?">":"+"):e.is(bt)&&C&&K?A.go(y(!0)?">":"<"):A.go(A.toDest(q),!0),g(!0)}function T(V){var v=n.dragMinThreshold,q=Et(v),K=q&&v.mouse||0,Q=(q?v.touch:+v)||10;return _e(te(V))>(ge(V)?Q:K)}function R(V){return _e(te(V))>_e(te(V,!0))}function Z(V){if(e.is(Ct)||!C){var v=ce(V);if(v&&v<fo)return te(V)/v}return 0}function ae(V){return h()+En(V)*Je(_e(V)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function te(V,v){return ee(V,v)-ee(P(V),v)}function ce(V){return _n(V)-_n(P(V))}function P(V){return D===V&&W||D}function ee(V,v){return(ge(V)?V.changedTouches[0]:V)["page"+d(v?"Y":"X")]}function fe(V){return V/(C&&e.is(bt)?Ii:1)}function de(V){var v=n.noDrag;return!At(V,"."+rr+", ."+fn)&&(!v||!At(V,v))}function ge(V){return typeof TouchEvent<"u"&&V instanceof TouchEvent}function G(){return b}function me(V){j=V}return{mount:N,disable:me,isDragging:G}}var Qi={Spacebar:" ",Right:dn,Left:pn,Up:Zo,Down:Jo};function Zn(e){return e=Ze(e)?e:e.key,Qi[e]||e}var ho="keydown";function ea(e,t,n){var o=be(e),r=o.on,a=o.bind,i=o.unbind,u=e.root,c=t.Direction.resolve,m,l;function A(){S(),r(Te,g),r(Te,S),r(Ge,d)}function S(){var h=n.keyboard;h&&(m=h==="global"?window:u,a(m,ho,x))}function g(){i(m,ho)}function p(h){l=h}function d(){var h=l;l=!0,Ao(function(){l=h})}function x(h){if(!l){var y=Zn(h);y===c(pn)?e.go("<"):y===c(dn)&&e.go(">")}}return{mount:A,destroy:g,disable:p}}var _t=Hn+"-lazy",Qt=_t+"-srcset",ta="["+_t+"], ["+Qt+"]";function na(e,t,n){var o=be(e),r=o.on,a=o.off,i=o.bind,u=o.emit,c=n.lazyLoad==="sequential",m=[St,st],l=[];function A(){n.lazyLoad&&(S(),r(Se,S))}function S(){Ue(l),g(),c?h():(a(m),r(m,p),p())}function g(){t.Slides.forEach(function(y){Vn(y.slide,ta).forEach(function(_){var D=Fe(_,_t),W=Fe(_,Qt);if(D!==_.src||W!==_.srcset){var E=n.classes.spinner,b=_.parentElement,C=Ht(b,"."+E)||gt("span",E,b);l.push([_,y,C]),_.src||It(_,"none")}})})}function p(){l=l.filter(function(y){var _=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,_)?d(y):!0}),l.length||a(m)}function d(y){var _=y[0];We(y[1].slide,In),i(_,"load error",ve(x,y)),le(_,"src",Fe(_,_t)),le(_,"srcset",Fe(_,Qt)),Ne(_,_t),Ne(_,Qt)}function x(y,_){var D=y[0],W=y[1];De(W.slide,In),_.type!=="error"&&(it(y[2]),It(D,""),u(Un,D,W),u(vt)),c&&h()}function h(){l.length&&d(l.shift())}return{mount:A,destroy:ve(Ue,l),check:p}}function oa(e,t,n){var o=be(e),r=o.on,a=o.emit,i=o.bind,u=t.Slides,c=t.Elements,m=t.Controller,l=m.hasFocus,A=m.getIndex,S=m.go,g=t.Direction.resolve,p=c.pagination,d=[],x,h;function y(){_(),r([Te,Se,on],y);var j=n.pagination;p&&It(p,j?"":"none"),j&&(r([Ge,ln,st],F),D(),F(),a(Uo,{list:x,items:d},C(e.index)))}function _(){x&&(it(p?Qe(x.children):x),De(x,h),Ue(d),x=null),o.destroy()}function D(){var j=e.length,M=n.classes,N=n.i18n,H=n.perPage,B=l()?m.getEnd()+1:Ft(j/H);x=p||gt("ul",M.pagination,c.track.parentElement),We(x,h=hn+"--"+b()),le(x,qe,"tablist"),le(x,Ae,N.select),le(x,Yn,b()===mn?"vertical":"");for(var U=0;U<B;U++){var f=gt("li",null,x),I=gt("button",{class:M.page,type:"button"},f),k=u.getIn(U).map(function(T){return T.slide.id}),L=!l()&&H>1?N.pageX:N.slideX;i(I,"click",ve(W,U)),n.paginationKeyboard&&i(I,"keydown",ve(E,U)),le(f,qe,"presentation"),le(I,qe,"tab"),le(I,zt,k.join(" ")),le(I,Ae,An(L,U+1)),le(I,ft,-1),d.push({li:f,button:I,page:U})}}function W(j){S(">"+j,!0)}function E(j,M){var N=d.length,H=Zn(M),B=b(),U=-1;H===g(dn,!1,B)?U=++j%N:H===g(pn,!1,B)?U=(--j+N)%N:H==="Home"?U=0:H==="End"&&(U=N-1);var f=d[U];f&&(Fo(f.button),S(">"+U),Oe(M,!0))}function b(){return n.paginationDirection||n.direction}function C(j){return d[m.toPage(j)]}function F(){var j=C(A(!0)),M=C(A());if(j){var N=j.button;De(N,at),Ne(N,co),le(N,ft,-1)}if(M){var H=M.button;We(H,at),le(H,co,!0),le(H,ft,"")}a(Go,{list:x,items:d},j,M)}return{items:d,mount:y,destroy:_,getAt:C,update:F}}var ra=[" ","Enter"];function ia(e,t,n){var o=n.isNavigation,r=n.slideFocus,a=[];function i(){e.splides.forEach(function(p){p.isParent||(m(e,p.splide),m(p.splide,e))}),o&&l()}function u(){a.forEach(function(p){p.destroy()}),Ue(a)}function c(){u(),i()}function m(p,d){var x=be(p);x.on(Ge,function(h,y,_){d.go(d.is(Ct)?_:h)}),a.push(x)}function l(){var p=be(e),d=p.on;d(zn,S),d(Xo,g),d([et,Te],A),a.push(p),p.emit(Bn,e.splides)}function A(){le(t.Elements.list,Yn,n.direction===mn?"vertical":"")}function S(p){e.go(p.index)}function g(p,d){Wn(ra,Zn(d))&&(S(p),Oe(d))}return{setup:ve(t.Media.set,{slideFocus:Wt(r)?o:r},!0),mount:i,destroy:u,remount:c}}function aa(e,t,n){var o=be(e),r=o.bind,a=0;function i(){n.wheel&&r(t.Elements.track,"wheel",u,dt)}function u(m){if(m.cancelable){var l=m.deltaY,A=l<0,S=_n(m),g=n.wheelMinThreshold||0,p=n.wheelSleep||0;_e(l)>g&&S-a>p&&(e.go(A?"<":">"),a=S),c(A)&&Oe(m)}}function c(m){return!n.releaseWheel||e.state.is(xt)||t.Controller.getAdjacent(m)!==-1}return{mount:i}}var sa=90;function la(e,t,n){var o=be(e),r=o.on,a=t.Elements.track,i=n.live&&!n.isNavigation,u=gt("span",_i),c=cn(sa,ve(l,!1));function m(){i&&(S(!t.Autoplay.isPaused()),le(a,mo,!0),u.textContent="…",r(Dn,ve(S,!0)),r(qn,ve(S,!1)),r([St,st],ve(l,!0)))}function l(g){le(a,po,g),g?(Vt(a,u),c.start()):(it(u),c.cancel())}function A(){Ne(a,[uo,mo,po]),it(u)}function S(g){i&&le(a,uo,g?"off":"polite")}return{mount:m,disable:S,destroy:A}}var ca=Object.freeze({__proto__:null,Media:yi,Direction:vi,Elements:Fi,Slides:Mi,Layout:Ri,Clones:Ni,Move:Vi,Controller:Hi,Arrows:Oi,Autoplay:Di,Cover:qi,Scroll:Zi,Drag:Ji,Keyboard:ea,LazyLoad:na,Pagination:oa,Sync:ia,Wheel:aa,Live:la}),ua={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"},pa={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:ki,i18n:ua,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function da(e,t,n){var o=t.Slides;function r(){be(e).on([et,Se],a)}function a(){o.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function i(u,c){o.style("transition","opacity "+n.speed+"ms "+n.easing),Ao(c)}return{mount:r,start:i,cancel:Tn}}function ma(e,t,n){var o=t.Move,r=t.Controller,a=t.Scroll,i=t.Elements.list,u=ve(Ie,i,"transition"),c;function m(){be(e).bind(i,"transitionend",function(g){g.target===i&&c&&(A(),c())})}function l(g,p){var d=o.toPosition(g,!0),x=o.getPosition(),h=S(g);_e(d-x)>=1&&h>=1?n.useScroll?a.scroll(d,h,!1,p):(u("transform "+h+"ms "+n.easing),o.translate(d,!0),c=p):(o.jump(g),p())}function A(){u(""),a.cancel()}function S(g){var p=n.rewindSpeed;if(e.is(bt)&&p){var d=r.getIndex(!0),x=r.getEnd();if(d===0&&g>=x||d>=x&&g===0)return p}return n.speed}return{mount:m,start:l,cancel:A}}var ga=(function(){function e(n,o){this.event=be(),this.Components={},this.state=fi(mt),this.splides=[],this._o={},this._E={};var r=Ze(n)?Mo(document,n):n;Tt(r,r+" is invalid."),this.root=r,o=Xe({label:Fe(r,Ae)||"",labelledby:Fe(r,Gn)||""},pa,e.defaults,o||{});try{Xe(o,JSON.parse(Fe(r,Hn)))}catch{Tt(!1,"Invalid JSON")}this._o=Object.create(Xe({},o))}var t=e.prototype;return t.mount=function(o,r){var a=this,i=this.state,u=this.Components;Tt(i.is([mt,en]),"Already mounted!"),i.set(mt),this._C=u,this._T=r||this._T||(this.is(Ot)?da:ma),this._E=o||this._E;var c=Lt({},ca,this._E,{Transition:this._T});return rt(c,function(m,l){var A=m(a,u,a._o);u[l]=A,A.setup&&A.setup()}),rt(u,function(m){m.mount&&m.mount()}),this.emit(et),We(this.root,Ei),i.set(yt),this.emit(kn),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,r){return this.event.on(o,r),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var r;return(r=this.event).emit.apply(r,[o].concat(Qe(arguments,1))),this},t.add=function(o,r){return this._C.Slides.add(o,r),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Se),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,a=this.state;return a.is(mt)?be(this).on(kn,this.destroy.bind(this,o)):(rt(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(On),r.destroy(),o&&Ue(this.splides),a.set(en)),this},ui(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Jn=ga;Jn.defaults={};Jn.STATES=di;var yo=[[et,"onMounted"],[kn,"onReady"],[Ge,"onMove"],[St,"onMoved"],[zn,"onClick"],[No,"onActive"],[Vo,"onInactive"],[Ho,"onVisible"],[jo,"onHidden"],[Se,"onRefresh"],[Te,"onUpdated"],[vt,"onResize"],[sn,"onResized"],[zo,"onDrag"],[Oo,"onDragging"],[Bo,"onDragged"],[ln,"onScroll"],[st,"onScrolled"],[On,"onDestroy"],[Do,"onArrowsMounted"],[qo,"onArrowsUpdated"],[Uo,"onPaginationMounted"],[Go,"onPaginationUpdated"],[Bn,"onNavigationMounted"],[Dn,"onAutoplayPlay"],[Yo,"onAutoplayPlaying"],[qn,"onAutoplayPause"],[Un,"onLazyLoadLoaded"]];function Qn(...e){return e.filter(Boolean).join(" ")}function rn(e){return e!==null&&typeof e=="object"}function Fn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Fn(n,t[o]));if(rn(e)&&rn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!Fn(e[r],t[r]))}return e===t}function fa(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function ha(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const r=n[o];if(r!=="__proto__"&&t(e[r],r)===!1)break}}return e}function Pn(e,t){const n=e;return ha(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():rn(o)?n[r]=Pn(rn(n[r])?n[r]:{},o):n[r]=o}),n}var ya=({children:e,className:t,...n})=>w.createElement("div",{className:Qn("splide__track",t),...n},w.createElement("ul",{className:"splide__list"},e)),ur=class extends w.Component{constructor(){super(...arguments),this.splideRef=w.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Jn(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Pn({},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&&!Fn(this.options,e)&&(this.splide.options=e,this.options=Pn({},e));const t=this.getSlides();fa(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){yo.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...r)=>{o(e,...r)})})}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:o,...r}=this.props;return w.createElement(t,{className:Qn("splide",e),ref:this.splideRef,...this.omit(r,["options",...yo.map(a=>a[1])])},n?w.createElement(ya,null,o):o)}},pr=({children:e,className:t,...n})=>w.createElement("li",{className:Qn("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),xt=require("classnames"),S=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),_i=require("react-dom");function Cr(t){return t.type==="object"&&t.version===1}const Sr="ControlSlider-module__wrapper___sHEkd",$r="ControlSlider-module__hoverArrow___A-dOH",wr="ControlSlider-module__sliderItem___QQSkR",Tr="ControlSlider-module__sliderImage___9hRl-",Lr="ControlSlider-module__arrow___05ghY",_r="ControlSlider-module__arrowVertical___tBfVN",Er="ControlSlider-module__nextArrow___-30Yc",Pr="ControlSlider-module__arrowInner___aEra3",Wr="ControlSlider-module__arrowIcon___S4ztF",Fr="ControlSlider-module__arrowImg___2dwJW",Rr="ControlSlider-module__mirror___brd6U",Ir="ControlSlider-module__pagination___bicLF",Ar="ControlSlider-module__paginationInner___bT-P-",kr="ControlSlider-module__paginationVertical___zYqKw",Mr="ControlSlider-module__paginationItem___nTRbk",Or="ControlSlider-module__dot___p1Qun",Nr="ControlSlider-module__activeDot___LHFaj",Hr="ControlSlider-module__paginationInsideBottom___R3FWn",Br="ControlSlider-module__paginationInsideTop___V-qb-",zr="ControlSlider-module__paginationOutsideBottom___14w8D",Dr="ControlSlider-module__paginationOutsideTop___SCLqB",jr="ControlSlider-module__paginationInsideLeft___yOBRZ",Vr="ControlSlider-module__paginationInsideRight___Rtt3o",Kr="ControlSlider-module__paginationOutsideLeft___lahaw",Ur="ControlSlider-module__paginationOutsideRight___EtuQa",Gr="ControlSlider-module__imgWrapper___UjEgB",Yr="ControlSlider-module__captionBlock___dJ6-j",qr="ControlSlider-module__captionTextWrapper___HFlpf",Xr="ControlSlider-module__captionText___uGBVc",Zr="ControlSlider-module__active___WZK4G",Jr="ControlSlider-module__withPointerEvents___t-18M",Qr="ControlSlider-module__topLeftAlignment___zjnGM",ta="ControlSlider-module__topCenterAlignment___gD1xW",ea="ControlSlider-module__topRightAlignment___NMapS",na="ControlSlider-module__middleLeftAlignment___OnUrY",oa="ControlSlider-module__middleCenterAlignment___Tdkl0",ia="ControlSlider-module__middleRightAlignment___wEbfX",ra="ControlSlider-module__bottomLeftAlignment___cTP2-",aa="ControlSlider-module__bottomCenterAlignment___c54fB",sa="ControlSlider-module__bottomRightAlignment___kEwrz",la="ControlSlider-module__clickOverlay___DZA28",ca="ControlSlider-module__contain___pLyq7",da="ControlSlider-module__cover___KdDat",tt={wrapper:Sr,hoverArrow:$r,sliderItem:wr,sliderImage:Tr,arrow:Lr,arrowVertical:_r,nextArrow:Er,arrowInner:Pr,arrowIcon:Wr,arrowImg:Fr,mirror:Rr,pagination:Ir,paginationInner:Ar,paginationVertical:kr,paginationItem:Mr,dot:Or,activeDot:Nr,paginationInsideBottom:Hr,paginationInsideTop:Br,paginationOutsideBottom:zr,paginationOutsideTop:Dr,paginationInsideLeft:jr,paginationInsideRight:Vr,paginationOutsideLeft:Kr,paginationOutsideRight:Ur,imgWrapper:Gr,captionBlock:Yr,captionTextWrapper:qr,captionText:Xr,active:Zr,withPointerEvents:Jr,topLeftAlignment:Qr,topCenterAlignment:ta,topRightAlignment:ea,middleLeftAlignment:na,middleCenterAlignment:oa,middleRightAlignment:ia,bottomLeftAlignment:ra,bottomCenterAlignment:aa,bottomRightAlignment:sa,clickOverlay:la,contain:ca,cover:da};function ua(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function pa(t,e,n){return e&&ua(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Zo="(prefers-reduced-motion: reduce)",Me=1,ma=2,He=3,Ue=4,gn=5,In=6,Bn=7,ga={CREATED:Me,MOUNTED:ma,IDLE:He,MOVING:Ue,SCROLLING:gn,DRAGGING:In,DESTROYED:Bn};function me(t){t.length=0}function Ce(t,e,n){return Array.prototype.slice.call(t,e,n)}function wt(t){return t.bind.apply(t,[null].concat(Ce(arguments,1)))}var Ei=setTimeout,fo=function(){};function Jo(t){return requestAnimationFrame(t)}function Kn(t,e){return typeof e===t}function on(t){return!Lo(t)&&Kn("object",t)}var To=Array.isArray,Pi=wt(Kn,"function"),be=wt(Kn,"string"),hn=wt(Kn,"undefined");function Lo(t){return t===null}function Wi(t){try{return t instanceof(t.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function fn(t){return To(t)?t:[t]}function Zt(t,e){fn(t).forEach(e)}function _o(t,e){return t.indexOf(e)>-1}function An(t,e){return t.push.apply(t,fn(e)),t}function ce(t,e,n){t&&Zt(e,function(o){o&&t.classList[n?"add":"remove"](o)})}function re(t,e){ce(t,be(e)?e.split(" "):e,!0)}function yn(t,e){Zt(e,t.appendChild.bind(t))}function Eo(t,e){Zt(t,function(n){var o=(e||n).parentNode;o&&o.insertBefore(n,e)})}function rn(t,e){return Wi(t)&&(t.msMatchesSelector||t.matches).call(t,e)}function Fi(t,e){var n=t?Ce(t.children):[];return e?n.filter(function(o){return rn(o,e)}):n}function vn(t,e){return e?Fi(t,e)[0]:t.firstElementChild}var an=Object.keys;function _e(t,e,n){return t&&(n?an(t).reverse():an(t)).forEach(function(o){o!=="__proto__"&&e(t[o],o)}),t}function sn(t){return Ce(arguments,1).forEach(function(e){_e(e,function(n,o){t[o]=e[o]})}),t}function ye(t){return Ce(arguments,1).forEach(function(e){_e(e,function(n,o){To(n)?t[o]=n.slice():on(n)?t[o]=ye({},on(t[o])?t[o]:{},n):t[o]=n})}),t}function Qo(t,e){Zt(e||an(t),function(n){delete t[n]})}function ae(t,e){Zt(t,function(n){Zt(e,function(o){n&&n.removeAttribute(o)})})}function mt(t,e,n){on(e)?_e(e,function(o,i){mt(t,i,o)}):Zt(t,function(o){Lo(n)||n===""?ae(o,e):o.setAttribute(e,String(n))})}function Oe(t,e,n){var o=document.createElement(t);return e&&(be(e)?re(o,e):mt(o,e)),n&&yn(n,o),o}function te(t,e,n){if(hn(n))return getComputedStyle(t)[e];Lo(n)||(t.style[e]=""+n)}function ln(t,e){te(t,"display",e)}function Ri(t){t.setActive&&t.setActive()||t.focus({preventScroll:!0})}function ee(t,e){return t.getAttribute(e)}function ti(t,e){return t&&t.classList.contains(e)}function Yt(t){return t.getBoundingClientRect()}function Ee(t){Zt(t,function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}function Ii(t){return vn(new DOMParser().parseFromString(t,"text/html").body)}function le(t,e){t.preventDefault(),e&&(t.stopPropagation(),t.stopImmediatePropagation())}function Ai(t,e){return t&&t.querySelector(e)}function Po(t,e){return e?Ce(t.querySelectorAll(e)):[]}function de(t,e){ce(t,e,!1)}function yo(t){return t.timeStamp}function we(t){return be(t)?t:t?t+"px":""}var bn="splide",Wo="data-"+bn;function en(t,e){if(!t)throw new Error("["+bn+"] "+(e||""))}var xe=Math.min,zn=Math.max,Dn=Math.floor,cn=Math.ceil,zt=Math.abs;function ki(t,e,n){return zt(t-e)<n}function kn(t,e,n,o){var i=xe(e,n),l=zn(e,n);return o?i<t&&t<l:i<=t&&t<=l}function Ae(t,e,n){var o=xe(e,n),i=zn(e,n);return xe(zn(o,t),i)}function vo(t){return+(t>0)-+(t<0)}function bo(t,e){return Zt(e,function(n){t=t.replace("%s",""+n)}),t}function Fo(t){return t<10?"0"+t:""+t}var ei={};function ha(t){return""+t+Fo(ei[t]=(ei[t]||0)+1)}function Mi(){var t=[];function e(r,s,d,u){i(r,s,function(c,L,v){var h="addEventListener"in c,p=h?c.removeEventListener.bind(c,L,d,u):c.removeListener.bind(c,d);h?c.addEventListener(L,d,u):c.addListener(d),t.push([c,L,v,d,p])})}function n(r,s,d){i(r,s,function(u,c,L){t=t.filter(function(v){return v[0]===u&&v[1]===c&&v[2]===L&&(!d||v[3]===d)?(v[4](),!1):!0})})}function o(r,s,d){var u,c=!0;return typeof CustomEvent=="function"?u=new CustomEvent(s,{bubbles:c,detail:d}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(s,c,!1,d)),r.dispatchEvent(u),u}function i(r,s,d){Zt(r,function(u){u&&Zt(s,function(c){c.split(" ").forEach(function(L){var v=L.split(".");d(u,v[0],v[1])})})})}function l(){t.forEach(function(r){r[4]()}),me(t)}return{bind:e,unbind:n,dispatch:o,destroy:l}}var Se="mounted",xo="ready",ge="move",Ge="moved",Ro="click",Oi="active",Ni="inactive",Hi="visible",Bi="hidden",Ft="refresh",Nt="updated",Be="resize",Un="resized",zi="drag",Di="dragging",ji="dragged",Gn="scroll",We="scrolled",fa="overflow",Io="destroy",Vi="arrows:mounted",Ki="arrows:updated",Ui="pagination:mounted",Gi="pagination:updated",Ao="navigation:mounted",ko="autoplay:play",Yi="autoplay:playing",Mo="autoplay:pause",Oo="lazyload:loaded",qi="sk",Xi="sh",jn="ei";function _t(t){var e=t?t.event.bus:document.createDocumentFragment(),n=Mi();function o(l,r){n.bind(e,fn(l).join(" "),function(s){r.apply(r,To(s.detail)?s.detail:[])})}function i(l){n.dispatch(e,l,Ce(arguments,1))}return t&&t.event.on(Io,n.destroy),sn(n,{bus:e,on:o,off:wt(n.unbind,e),emit:i})}function Yn(t,e,n,o){var i=Date.now,l,r=0,s,d=!0,u=0;function c(){if(!d){if(r=t?xe((i()-l)/t,1):1,n&&n(r),r>=1&&(e(),l=i(),o&&++u>=o))return v();s=Jo(c)}}function L(f){f||p(),l=i()-(f?r*t:0),d=!1,s=Jo(c)}function v(){d=!0}function h(){l=i(),r=0,n&&n(r)}function p(){s&&cancelAnimationFrame(s),r=0,s=0,d=!0}function g(f){t=f}function $(){return d}return{start:L,rewind:h,pause:v,cancel:p,set:g,isPaused:$}}function ya(t){var e=t;function n(i){e=i}function o(i){return _o(fn(i),e)}return{set:n,is:o}}function va(t,e){var n=Yn(0,t,null,1);return function(){n.isPaused()&&n.start()}}function ba(t,e,n){var o=t.state,i=n.breakpoints||{},l=n.reducedMotion||{},r=Mi(),s=[];function d(){var p=n.mediaQuery==="min";an(i).sort(function(g,$){return p?+g-+$:+$-+g}).forEach(function(g){c(i[g],"("+(p?"min":"max")+"-width:"+g+"px)")}),c(l,Zo),L()}function u(p){p&&r.destroy()}function c(p,g){var $=matchMedia(g);r.bind($,"change",L),s.push([p,$])}function L(){var p=o.is(Bn),g=n.direction,$=s.reduce(function(f,x){return ye(f,x[1].matches?x[0]:{})},{});Qo(n),h($),n.destroy?t.destroy(n.destroy==="completely"):p?(u(!0),t.mount()):g!==n.direction&&t.refresh()}function v(p){matchMedia(Zo).matches&&(p?ye(n,l):Qo(n,an(l)))}function h(p,g,$){ye(n,p),g&&ye(Object.getPrototypeOf(n),p),($||!o.is(Me))&&t.emit(Nt,n)}return{setup:d,destroy:u,reduce:v,set:h}}var qn="Arrow",Xn=qn+"Left",Zn=qn+"Right",Zi=qn+"Up",Ji=qn+"Down",ni="rtl",Jn="ttb",so={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Zi,Zn],ArrowRight:[Ji,Xn]};function xa(t,e,n){function o(l,r,s){s=s||n.direction;var d=s===ni&&!r?1:s===Jn?0:-1;return so[l]&&so[l][d]||l.replace(/width|left|right/i,function(u,c){var L=so[u.toLowerCase()][d]||u;return c>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function i(l){return l*(n.direction===ni?1:-1)}return{resolve:o,orient:i}}var ue="role",Ne="tabindex",Ca="disabled",ne="aria-",xn=ne+"controls",Qi=ne+"current",oi=ne+"selected",qt=ne+"label",No=ne+"labelledby",tr=ne+"hidden",Ho=ne+"orientation",dn=ne+"roledescription",ii=ne+"live",ri=ne+"busy",ai=ne+"atomic",Bo=[ue,Ne,Ca,xn,Qi,qt,No,tr,Ho,dn],se=bn+"__",$e="is-",lo=bn,si=se+"track",Sa=se+"list",Qn=se+"slide",er=Qn+"--clone",$a=Qn+"__container",zo=se+"arrows",to=se+"arrow",nr=to+"--prev",or=to+"--next",eo=se+"pagination",ir=eo+"__page",wa=se+"progress",Ta=wa+"__bar",La=se+"toggle",_a=se+"spinner",Ea=se+"sr",Pa=$e+"initialized",Pe=$e+"active",rr=$e+"prev",ar=$e+"next",Co=$e+"visible",So=$e+"loading",sr=$e+"focus-in",lr=$e+"overflow",Wa=[Pe,Co,rr,ar,So,sr,lr],Fa={slide:Qn,clone:er,arrows:zo,arrow:to,prev:nr,next:or,pagination:eo,page:ir,spinner:_a};function Ra(t,e){if(Pi(t.closest))return t.closest(e);for(var n=t;n&&n.nodeType===1&&!rn(n,e);)n=n.parentElement;return n}var Ia=5,li=200,cr="touchstart mousedown",co="touchmove mousemove",uo="touchend touchcancel mouseup click";function Aa(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=t.root,s=n.i18n,d={},u=[],c=[],L=[],v,h,p;function g(){b(),R(),x()}function $(){i(Ft,f),i(Ft,g),i(Nt,x),l(document,cr+" keydown",function(y){p=y.type==="keydown"},{capture:!0}),l(r,"focusin",function(){ce(r,sr,!!p)})}function f(y){var w=Bo.concat("style");me(u),de(r,c),de(v,L),ae([v,h],w),ae(r,y?w:["style",dn])}function x(){de(r,c),de(v,L),c=_(lo),L=_(si),re(r,c),re(v,L),mt(r,qt,n.label),mt(r,No,n.labelledby)}function b(){v=W("."+si),h=vn(v,"."+Sa),en(v&&h,"A track/list element is missing."),An(u,Fi(h,"."+Qn+":not(."+er+")")),_e({arrows:zo,pagination:eo,prev:nr,next:or,bar:Ta,toggle:La},function(y,w){d[w]=W("."+y)}),sn(d,{root:r,track:v,list:h,slides:u})}function R(){var y=r.id||ha(bn),w=n.role;r.id=y,v.id=v.id||y+"-track",h.id=h.id||y+"-list",!ee(r,ue)&&r.tagName!=="SECTION"&&w&&mt(r,ue,w),mt(r,dn,s.carousel),mt(h,ue,"presentation")}function W(y){var w=Ai(r,y);return w&&Ra(w,"."+lo)===r?w:void 0}function _(y){return[y+"--"+n.type,y+"--"+n.direction,n.drag&&y+"--draggable",n.isNavigation&&y+"--nav",y===lo&&Pe]}return sn(d,{setup:g,mount:$,destroy:f})}var ze="slide",Ye="loop",Cn="fade";function ka(t,e,n,o){var i=_t(t),l=i.on,r=i.emit,s=i.bind,d=t.Components,u=t.root,c=t.options,L=c.isNavigation,v=c.updateOnMove,h=c.i18n,p=c.pagination,g=c.slideFocus,$=d.Direction.resolve,f=ee(o,"style"),x=ee(o,qt),b=n>-1,R=vn(o,"."+$a),W;function _(){b||(o.id=u.id+"-slide"+Fo(e+1),mt(o,ue,p?"tabpanel":"group"),mt(o,dn,h.slide),mt(o,qt,x||bo(h.slideLabel,[e+1,t.length]))),y()}function y(){s(o,"click",wt(r,Ro,I)),s(o,"keydown",wt(r,qi,I)),l([Ge,Xi,We],F),l(Ao,E),v&&l(ge,H)}function w(){W=!0,i.destroy(),de(o,Wa),ae(o,Bo),mt(o,"style",f),mt(o,qt,x||"")}function E(){var A=t.splides.map(function(P){var N=P.splide.Components.Slides.getAt(e);return N?N.slide.id:""}).join(" ");mt(o,qt,bo(h.slideX,(b?n:e)+1)),mt(o,xn,A),mt(o,ue,g?"button":""),g&&ae(o,dn)}function H(){W||F()}function F(){if(!W){var A=t.index;O(),z(),ce(o,rr,e===A-1),ce(o,ar,e===A+1)}}function O(){var A=K();A!==ti(o,Pe)&&(ce(o,Pe,A),mt(o,Qi,L&&A||""),r(A?Oi:Ni,I))}function z(){var A=C(),P=!A&&(!K()||b);if(t.state.is([Ue,gn])||mt(o,tr,P||""),mt(Po(o,c.focusableNodes||""),Ne,P?-1:""),g&&mt(o,Ne,P?-1:0),A!==ti(o,Co)&&(ce(o,Co,A),r(A?Hi:Bi,I)),!A&&document.activeElement===o){var N=d.Slides.getAt(t.index);N&&Ri(N.slide)}}function V(A,P,N){te(N&&R||o,A,P)}function K(){var A=t.index;return A===e||c.cloneStatus&&A===n}function C(){if(t.is(Cn))return K();var A=Yt(d.Elements.track),P=Yt(o),N=$("left",!0),Q=$("right",!0);return Dn(A[N])<=cn(P[N])&&Dn(P[Q])<=cn(A[Q])}function k(A,P){var N=zt(A-e);return!b&&(c.rewind||t.is(Ye))&&(N=xe(N,t.length-N)),N<=P}var I={index:e,slideIndex:n,slide:o,container:R,isClone:b,mount:_,destroy:w,update:F,style:V,isWithin:k};return I}function Ma(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=o.bind,s=e.Elements,d=s.slides,u=s.list,c=[];function L(){v(),i(Ft,h),i(Ft,v)}function v(){d.forEach(function(F,O){g(F,O,-1)})}function h(){W(function(F){F.destroy()}),me(c)}function p(){W(function(F){F.update()})}function g(F,O,z){var V=ka(t,O,z,F);V.mount(),c.push(V),c.sort(function(K,C){return K.index-C.index})}function $(F){return F?_(function(O){return!O.isClone}):c}function f(F){var O=e.Controller,z=O.toIndex(F),V=O.hasFocus()?1:n.perPage;return _(function(K){return kn(K.index,z,z+V-1)})}function x(F){return _(F)[0]}function b(F,O){Zt(F,function(z){if(be(z)&&(z=Ii(z)),Wi(z)){var V=d[O];V?Eo(z,V):yn(u,z),re(z,n.classes.slide),w(z,wt(l,Be))}}),l(Ft)}function R(F){Ee(_(F).map(function(O){return O.slide})),l(Ft)}function W(F,O){$(O).forEach(F)}function _(F){return c.filter(Pi(F)?F:function(O){return be(F)?rn(O.slide,F):_o(fn(F),O.index)})}function y(F,O,z){W(function(V){V.style(F,O,z)})}function w(F,O){var z=Po(F,"img"),V=z.length;V?z.forEach(function(K){r(K,"load error",function(){--V||O()})}):O()}function E(F){return F?d.length:c.length}function H(){return c.length>n.perPage}return{mount:L,destroy:h,update:p,register:g,get:$,getIn:f,getAt:x,add:b,remove:R,forEach:W,filter:_,style:y,getLength:E,isEnough:H}}function Oa(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=o.emit,s=e.Slides,d=e.Direction.resolve,u=e.Elements,c=u.root,L=u.track,v=u.list,h=s.getAt,p=s.style,g,$,f;function x(){b(),l(window,"resize load",va(wt(r,Be))),i([Nt,Ft],b),i(Be,R)}function b(){g=n.direction===Jn,te(c,"maxWidth",we(n.width)),te(L,d("paddingLeft"),W(!1)),te(L,d("paddingRight"),W(!0)),R(!0)}function R(I){var A=Yt(c);(I||$.width!==A.width||$.height!==A.height)&&(te(L,"height",_()),p(d("marginRight"),we(n.gap)),p("width",w()),p("height",E(),!0),$=A,r(Un),f!==(f=k())&&(ce(c,lr,f),r(fa,f)))}function W(I){var A=n.padding,P=d(I?"right":"left");return A&&we(A[P]||(on(A)?0:A))||"0px"}function _(){var I="";return g&&(I=y(),en(I,"height or heightRatio is missing."),I="calc("+I+" - "+W(!1)+" - "+W(!0)+")"),I}function y(){return we(n.height||Yt(v).width*n.heightRatio)}function w(){return n.autoWidth?null:we(n.fixedWidth)||(g?"":H())}function E(){return we(n.fixedHeight)||(g?n.autoHeight?null:H():y())}function H(){var I=we(n.gap);return"calc((100%"+(I&&" + "+I)+")/"+(n.perPage||1)+(I&&" - "+I)+")"}function F(){return Yt(v)[d("width")]}function O(I,A){var P=h(I||0);return P?Yt(P.slide)[d("width")]+(A?0:K()):0}function z(I,A){var P=h(I);if(P){var N=Yt(P.slide)[d("right")],Q=Yt(v)[d("left")];return zt(N-Q)+(A?0:K())}return 0}function V(I){return z(t.length-1)-z(0)+O(0,I)}function K(){var I=h(0);return I&&parseFloat(te(I.slide,d("marginRight")))||0}function C(I){return parseFloat(te(L,d("padding"+(I?"Right":"Left"))))||0}function k(){return t.is(Cn)||V(!0)>F()}return{mount:x,resize:R,listSize:F,slideSize:O,sliderSize:V,totalSize:z,getPadding:C,isOverflow:k}}var Na=2;function Ha(t,e,n){var o=_t(t),i=o.on,l=e.Elements,r=e.Slides,s=e.Direction.resolve,d=[],u;function c(){i(Ft,L),i([Nt,Be],h),(u=$())&&(p(u),e.Layout.resize(!0))}function L(){v(),c()}function v(){Ee(d),me(d),o.destroy()}function h(){var f=$();u!==f&&(u<f||!f)&&o.emit(Ft)}function p(f){var x=r.get().slice(),b=x.length;if(b){for(;x.length<f;)An(x,x);An(x.slice(-f),x.slice(0,f)).forEach(function(R,W){var _=W<f,y=g(R.slide,W);_?Eo(y,x[0].slide):yn(l.list,y),An(d,y),r.register(y,W-f+(_?0:b),R.index)})}}function g(f,x){var b=f.cloneNode(!0);return re(b,n.classes.clone),b.id=t.root.id+"-clone"+Fo(x+1),b}function $(){var f=n.clones;if(!t.is(Ye))f=0;else if(hn(f)){var x=n[s("fixedWidth")]&&e.Layout.slideSize(0),b=x&&cn(Yt(l.track)[s("width")]/x);f=b||n[s("autoWidth")]&&t.length||n.perPage*Na}return f}return{mount:c,destroy:v}}function Ba(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=t.state.set,s=e.Layout,d=s.slideSize,u=s.getPadding,c=s.totalSize,L=s.listSize,v=s.sliderSize,h=e.Direction,p=h.resolve,g=h.orient,$=e.Elements,f=$.list,x=$.track,b;function R(){b=e.Transition,i([Se,Un,Nt,Ft],W)}function W(){e.Controller.isBusy()||(e.Scroll.cancel(),y(t.index),e.Slides.update())}function _(P,N,Q,st){P!==N&&I(P>Q)&&(F(),w(H(V(),P>Q),!0)),r(Ue),l(ge,N,Q,P),b.start(N,function(){r(He),l(Ge,N,Q,P),st&&st()})}function y(P){w(z(P,!0))}function w(P,N){if(!t.is(Cn)){var Q=N?P:E(P);te(f,"transform","translate"+p("X")+"("+Q+"px)"),P!==Q&&l(Xi)}}function E(P){if(t.is(Ye)){var N=O(P),Q=N>e.Controller.getEnd(),st=N<0;(st||Q)&&(P=H(P,Q))}return P}function H(P,N){var Q=P-k(N),st=v();return P-=g(st*(cn(zt(Q)/st)||1))*(N?1:-1),P}function F(){w(V(),!0),b.cancel()}function O(P){for(var N=e.Slides.get(),Q=0,st=1/0,ot=0;ot<N.length;ot++){var ut=N[ot].index,M=zt(z(ut,!0)-P);if(M<=st)st=M,Q=ut;else break}return Q}function z(P,N){var Q=g(c(P-1)-C(P));return N?K(Q):Q}function V(){var P=p("left");return Yt(f)[P]-Yt(x)[P]+g(u(!1))}function K(P){return n.trimSpace&&t.is(ze)&&(P=Ae(P,0,g(v(!0)-L()))),P}function C(P){var N=n.focus;return N==="center"?(L()-d(P,!0))/2:+N*d(P)||0}function k(P){return z(P?e.Controller.getEnd():0,!!n.trimSpace)}function I(P){var N=g(H(V(),P));return P?N>=0:N<=f[p("scrollWidth")]-Yt(x)[p("width")]}function A(P,N){N=hn(N)?V():N;var Q=P!==!0&&g(N)<g(k(!1)),st=P!==!1&&g(N)>g(k(!0));return Q||st}return{mount:R,move:_,jump:y,translate:w,shift:H,cancel:F,toIndex:O,toPosition:z,getPosition:V,getLimit:k,exceededLimit:A,reposition:W}}function za(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=e.Move,s=r.getPosition,d=r.getLimit,u=r.toPosition,c=e.Slides,L=c.isEnough,v=c.getLength,h=n.omitEnd,p=t.is(Ye),g=t.is(ze),$=wt(V,!1),f=wt(V,!0),x=n.start||0,b,R=x,W,_,y;function w(){E(),i([Nt,Ft,jn],E),i(Un,H)}function E(){W=v(!0),_=n.perMove,y=n.perPage,b=I();var M=Ae(x,0,h?b:W-1);M!==x&&(x=M,r.reposition())}function H(){b!==I()&&l(jn)}function F(M,J,ht){if(!ut()){var pt=z(M),gt=k(pt);gt>-1&&(J||gt!==x)&&(Q(gt),r.move(pt,gt,R,ht))}}function O(M,J,ht,pt){e.Scroll.scroll(M,J,ht,function(){var gt=k(r.toIndex(s()));Q(h?xe(gt,b):gt),pt&&pt()})}function z(M){var J=x;if(be(M)){var ht=M.match(/([+\-<>])(\d+)?/)||[],pt=ht[1],gt=ht[2];pt==="+"||pt==="-"?J=K(x+ +(""+pt+(+gt||1)),x):pt===">"?J=gt?A(+gt):$(!0):pt==="<"&&(J=f(!0))}else J=p?M:Ae(M,0,b);return J}function V(M,J){var ht=_||(ot()?1:y),pt=K(x+ht*(M?-1:1),x,!(_||ot()));return pt===-1&&g&&!ki(s(),d(!M),1)?M?0:b:J?pt:k(pt)}function K(M,J,ht){if(L()||ot()){var pt=C(M);pt!==M&&(J=M,M=pt,ht=!1),M<0||M>b?!_&&(kn(0,M,J,!0)||kn(b,J,M,!0))?M=A(P(M)):p?M=ht?M<0?-(W%y||y):W:M:n.rewind?M=M<0?b:0:M=-1:ht&&M!==J&&(M=A(P(J)+(M<J?-1:1)))}else M=-1;return M}function C(M){if(g&&n.trimSpace==="move"&&M!==x)for(var J=s();J===u(M,!0)&&kn(M,0,t.length-1,!n.rewind);)M<x?--M:++M;return M}function k(M){return p?(M+W)%W||0:M}function I(){for(var M=W-(ot()||p&&_?1:y);h&&M-- >0;)if(u(W-1,!0)!==u(M,!0)){M++;break}return Ae(M,0,W-1)}function A(M){return Ae(ot()?M:y*M,0,b)}function P(M){return ot()?xe(M,b):Dn((M>=b?W-1:M)/y)}function N(M){var J=r.toIndex(M);return g?Ae(J,0,b):J}function Q(M){M!==x&&(R=x,x=M)}function st(M){return M?R:x}function ot(){return!hn(n.focus)||n.isNavigation}function ut(){return t.state.is([Ue,gn])&&!!n.waitForTransition}return{mount:w,go:F,scroll:O,getNext:$,getPrev:f,getAdjacent:V,getEnd:I,setIndex:Q,getIndex:st,toIndex:A,toPage:P,toDest:N,hasFocus:ot,isBusy:ut}}var Da="http://www.w3.org/2000/svg",ja="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",Ln=40;function Va(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=o.emit,s=n.classes,d=n.i18n,u=e.Elements,c=e.Controller,L=u.arrows,v=u.track,h=L,p=u.prev,g=u.next,$,f,x={};function b(){W(),i(Nt,R)}function R(){_(),b()}function W(){var O=n.arrows;O&&!(p&&g)&&E(),p&&g&&(sn(x,{prev:p,next:g}),ln(h,O?"":"none"),re(h,f=zo+"--"+n.direction),O&&(y(),F(),mt([p,g],xn,v.id),r(Vi,p,g)))}function _(){o.destroy(),de(h,f),$?(Ee(L?[p,g]:h),p=g=null):ae([p,g],Bo)}function y(){i([Se,Ge,Ft,We,jn],F),l(g,"click",wt(w,">")),l(p,"click",wt(w,"<"))}function w(O){c.go(O,!0)}function E(){h=L||Oe("div",s.arrows),p=H(!0),g=H(!1),$=!0,yn(h,[p,g]),!L&&Eo(h,v)}function H(O){var z='<button class="'+s.arrow+" "+(O?s.prev:s.next)+'" type="button"><svg xmlns="'+Da+'" viewBox="0 0 '+Ln+" "+Ln+'" width="'+Ln+'" height="'+Ln+'" focusable="false"><path d="'+(n.arrowPath||ja)+'" />';return Ii(z)}function F(){if(p&&g){var O=t.index,z=c.getPrev(),V=c.getNext(),K=z>-1&&O<z?d.last:d.prev,C=V>-1&&O>V?d.first:d.next;p.disabled=z<0,g.disabled=V<0,mt(p,qt,K),mt(g,qt,C),r(Ki,p,g,z,V)}}return{arrows:x,mount:b,destroy:_,update:F}}var Ka=Wo+"-interval";function Ua(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=o.emit,s=Yn(n.interval,t.go.bind(t,">"),y),d=s.isPaused,u=e.Elements,c=e.Elements,L=c.root,v=c.toggle,h=n.autoplay,p,g,$=h==="pause";function f(){h&&(x(),v&&mt(v,xn,u.track.id),$||b(),_())}function x(){n.pauseOnHover&&l(L,"mouseenter mouseleave",function(E){p=E.type==="mouseenter",W()}),n.pauseOnFocus&&l(L,"focusin focusout",function(E){g=E.type==="focusin",W()}),v&&l(v,"click",function(){$?b():R(!0)}),i([ge,Gn,Ft],s.rewind),i(ge,w)}function b(){d()&&e.Slides.isEnough()&&(s.start(!n.resetProgress),g=p=$=!1,_(),r(ko))}function R(E){E===void 0&&(E=!0),$=!!E,_(),d()||(s.pause(),r(Mo))}function W(){$||(p||g?R(!1):b())}function _(){v&&(ce(v,Pe,!$),mt(v,qt,n.i18n[$?"play":"pause"]))}function y(E){var H=u.bar;H&&te(H,"width",E*100+"%"),r(Yi,E)}function w(E){var H=e.Slides.getAt(E);s.set(H&&+ee(H.slide,Ka)||n.interval)}return{mount:f,destroy:s.cancel,play:b,pause:R,isPaused:d}}function Ga(t,e,n){var o=_t(t),i=o.on;function l(){n.cover&&(i(Oo,wt(s,!0)),i([Se,Nt,Ft],wt(r,!0)))}function r(d){e.Slides.forEach(function(u){var c=vn(u.container||u.slide,"img");c&&c.src&&s(d,c,u)})}function s(d,u,c){c.style("background",d?'center/cover no-repeat url("'+u.src+'")':"",!0),ln(u,d?"none":"")}return{mount:l,destroy:wt(r,!1)}}var Ya=10,qa=600,Xa=.6,Za=1.5,Ja=800;function Qa(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=t.state.set,s=e.Move,d=s.getPosition,u=s.getLimit,c=s.exceededLimit,L=s.translate,v=t.is(ze),h,p,g=1;function $(){i(ge,R),i([Nt,Ft],W)}function f(y,w,E,H,F){var O=d();if(R(),E&&(!v||!c())){var z=e.Layout.sliderSize(),V=vo(y)*z*Dn(zt(y)/z)||0;y=s.toPosition(e.Controller.toDest(y%z))+V}var K=ki(O,y,1);g=1,w=K?0:w||zn(zt(y-O)/Za,Ja),p=H,h=Yn(w,x,wt(b,O,y,F),1),r(gn),l(Gn),h.start()}function x(){r(He),p&&p(),l(We)}function b(y,w,E,H){var F=d(),O=y+(w-y)*_(H),z=(O-F)*g;L(F+z),v&&!E&&c()&&(g*=Xa,zt(z)<Ya&&f(u(c(!0)),qa,!1,p,!0))}function R(){h&&h.cancel()}function W(){h&&!h.isPaused()&&(R(),x())}function _(y){var w=n.easingFunc;return w?w(y):1-Math.pow(1-y,4)}return{mount:$,destroy:R,scroll:f,cancel:W}}var ke={passive:!1,capture:!0};function ts(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=o.bind,s=o.unbind,d=t.state,u=e.Move,c=e.Scroll,L=e.Controller,v=e.Elements.track,h=e.Media.reduce,p=e.Direction,g=p.resolve,$=p.orient,f=u.getPosition,x=u.exceededLimit,b,R,W,_,y,w=!1,E,H,F;function O(){r(v,co,fo,ke),r(v,uo,fo,ke),r(v,cr,V,ke),r(v,"click",k,{capture:!0}),r(v,"dragstart",le),i([Se,Nt],z)}function z(){var B=n.drag;at(!B),_=B==="free"}function V(B){if(E=!1,!H){var T=gt(B);pt(B.target)&&(T||!B.button)&&(L.isBusy()?le(B,!0):(F=T?v:window,y=d.is([Ue,gn]),W=null,r(F,co,K,ke),r(F,uo,C,ke),u.cancel(),c.cancel(),I(B)))}}function K(B){if(d.is(In)||(d.set(In),l(zi)),B.cancelable)if(y){u.translate(b+ht(ot(B)));var T=ut(B)>li,U=w!==(w=x());(T||U)&&I(B),E=!0,l(Di),le(B)}else N(B)&&(y=P(B),le(B))}function C(B){d.is(In)&&(d.set(He),l(ji)),y&&(A(B),le(B)),s(F,co,K),s(F,uo,C),y=!1}function k(B){!H&&E&&le(B,!0)}function I(B){W=R,R=B,b=f()}function A(B){var T=Q(B),U=st(T),q=n.rewind&&n.rewindByDrag;h(!1),_?L.scroll(U,0,n.snap):t.is(Cn)?L.go($(vo(T))<0?q?"<":"-":q?">":"+"):t.is(ze)&&w&&q?L.go(x(!0)?">":"<"):L.go(L.toDest(U),!0),h(!0)}function P(B){var T=n.dragMinThreshold,U=on(T),q=U&&T.mouse||0,Z=(U?T.touch:+T)||10;return zt(ot(B))>(gt(B)?Z:q)}function N(B){return zt(ot(B))>zt(ot(B,!0))}function Q(B){if(t.is(Ye)||!w){var T=ut(B);if(T&&T<li)return ot(B)/T}return 0}function st(B){return f()+vo(B)*xe(zt(B)*(n.flickPower||600),_?1/0:e.Layout.listSize()*(n.flickMaxPages||1))}function ot(B,T){return J(B,T)-J(M(B),T)}function ut(B){return yo(B)-yo(M(B))}function M(B){return R===B&&W||R}function J(B,T){return(gt(B)?B.changedTouches[0]:B)["page"+g(T?"Y":"X")]}function ht(B){return B/(w&&t.is(ze)?Ia:1)}function pt(B){var T=n.noDrag;return!rn(B,"."+ir+", ."+to)&&(!T||!rn(B,T))}function gt(B){return typeof TouchEvent<"u"&&B instanceof TouchEvent}function D(){return y}function at(B){H=B}return{mount:O,disable:at,isDragging:D}}var es={Spacebar:" ",Right:Zn,Left:Xn,Up:Zi,Down:Ji};function Do(t){return t=be(t)?t:t.key,es[t]||t}var ci="keydown";function ns(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=o.unbind,s=t.root,d=e.Direction.resolve,u,c;function L(){v(),i(Nt,h),i(Nt,v),i(ge,g)}function v(){var f=n.keyboard;f&&(u=f==="global"?window:s,l(u,ci,$))}function h(){r(u,ci)}function p(f){c=f}function g(){var f=c;c=!0,Ei(function(){c=f})}function $(f){if(!c){var x=Do(f);x===d(Xn)?t.go("<"):x===d(Zn)&&t.go(">")}}return{mount:L,destroy:h,disable:p}}var nn=Wo+"-lazy",Mn=nn+"-srcset",os="["+nn+"], ["+Mn+"]";function is(t,e,n){var o=_t(t),i=o.on,l=o.off,r=o.bind,s=o.emit,d=n.lazyLoad==="sequential",u=[Ge,We],c=[];function L(){n.lazyLoad&&(v(),i(Ft,v))}function v(){me(c),h(),d?f():(l(u),i(u,p),p())}function h(){e.Slides.forEach(function(x){Po(x.slide,os).forEach(function(b){var R=ee(b,nn),W=ee(b,Mn);if(R!==b.src||W!==b.srcset){var _=n.classes.spinner,y=b.parentElement,w=vn(y,"."+_)||Oe("span",_,y);c.push([b,x,w]),b.src||ln(b,"none")}})})}function p(){c=c.filter(function(x){var b=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(t.index,b)?g(x):!0}),c.length||l(u)}function g(x){var b=x[0];re(x[1].slide,So),r(b,"load error",wt($,x)),mt(b,"src",ee(b,nn)),mt(b,"srcset",ee(b,Mn)),ae(b,nn),ae(b,Mn)}function $(x,b){var R=x[0],W=x[1];de(W.slide,So),b.type!=="error"&&(Ee(x[2]),ln(R,""),s(Oo,R,W),s(Be)),d&&f()}function f(){c.length&&g(c.shift())}return{mount:L,destroy:wt(me,c),check:p}}function rs(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=o.bind,s=e.Slides,d=e.Elements,u=e.Controller,c=u.hasFocus,L=u.getIndex,v=u.go,h=e.Direction.resolve,p=d.pagination,g=[],$,f;function x(){b(),i([Nt,Ft,jn],x);var H=n.pagination;p&&ln(p,H?"":"none"),H&&(i([ge,Gn,We],E),R(),E(),l(Ui,{list:$,items:g},w(t.index)))}function b(){$&&(Ee(p?Ce($.children):$),de($,f),me(g),$=null),o.destroy()}function R(){var H=t.length,F=n.classes,O=n.i18n,z=n.perPage,V=c()?u.getEnd()+1:cn(H/z);$=p||Oe("ul",F.pagination,d.track.parentElement),re($,f=eo+"--"+y()),mt($,ue,"tablist"),mt($,qt,O.select),mt($,Ho,y()===Jn?"vertical":"");for(var K=0;K<V;K++){var C=Oe("li",null,$),k=Oe("button",{class:F.page,type:"button"},C),I=s.getIn(K).map(function(P){return P.slide.id}),A=!c()&&z>1?O.pageX:O.slideX;r(k,"click",wt(W,K)),n.paginationKeyboard&&r(k,"keydown",wt(_,K)),mt(C,ue,"presentation"),mt(k,ue,"tab"),mt(k,xn,I.join(" ")),mt(k,qt,bo(A,K+1)),mt(k,Ne,-1),g.push({li:C,button:k,page:K})}}function W(H){v(">"+H,!0)}function _(H,F){var O=g.length,z=Do(F),V=y(),K=-1;z===h(Zn,!1,V)?K=++H%O:z===h(Xn,!1,V)?K=(--H+O)%O:z==="Home"?K=0:z==="End"&&(K=O-1);var C=g[K];C&&(Ri(C.button),v(">"+K),le(F,!0))}function y(){return n.paginationDirection||n.direction}function w(H){return g[u.toPage(H)]}function E(){var H=w(L(!0)),F=w(L());if(H){var O=H.button;de(O,Pe),ae(O,oi),mt(O,Ne,-1)}if(F){var z=F.button;re(z,Pe),mt(z,oi,!0),mt(z,Ne,"")}l(Gi,{list:$,items:g},H,F)}return{items:g,mount:x,destroy:b,getAt:w,update:E}}var as=[" ","Enter"];function ss(t,e,n){var o=n.isNavigation,i=n.slideFocus,l=[];function r(){t.splides.forEach(function(p){p.isParent||(u(t,p.splide),u(p.splide,t))}),o&&c()}function s(){l.forEach(function(p){p.destroy()}),me(l)}function d(){s(),r()}function u(p,g){var $=_t(p);$.on(ge,function(f,x,b){g.go(g.is(Ye)?b:f)}),l.push($)}function c(){var p=_t(t),g=p.on;g(Ro,v),g(qi,h),g([Se,Nt],L),l.push(p),p.emit(Ao,t.splides)}function L(){mt(e.Elements.list,Ho,n.direction===Jn?"vertical":"")}function v(p){t.go(p.index)}function h(p,g){_o(as,Do(g))&&(v(p),le(g))}return{setup:wt(e.Media.set,{slideFocus:hn(i)?o:i},!0),mount:r,destroy:s,remount:d}}function ls(t,e,n){var o=_t(t),i=o.bind,l=0;function r(){n.wheel&&i(e.Elements.track,"wheel",s,ke)}function s(u){if(u.cancelable){var c=u.deltaY,L=c<0,v=yo(u),h=n.wheelMinThreshold||0,p=n.wheelSleep||0;zt(c)>h&&v-l>p&&(t.go(L?"<":">"),l=v),d(L)&&le(u)}}function d(u){return!n.releaseWheel||t.state.is(Ue)||e.Controller.getAdjacent(u)!==-1}return{mount:r}}var cs=90;function ds(t,e,n){var o=_t(t),i=o.on,l=e.Elements.track,r=n.live&&!n.isNavigation,s=Oe("span",Ea),d=Yn(cs,wt(c,!1));function u(){r&&(v(!e.Autoplay.isPaused()),mt(l,ai,!0),s.textContent="…",i(ko,wt(v,!0)),i(Mo,wt(v,!1)),i([Ge,We],wt(c,!0)))}function c(h){mt(l,ri,h),h?(yn(l,s),d.start()):(Ee(s),d.cancel())}function L(){ae(l,[ii,ai,ri]),Ee(s)}function v(h){r&&mt(l,ii,h?"off":"polite")}return{mount:u,disable:v,destroy:L}}var us=Object.freeze({__proto__:null,Media:ba,Direction:xa,Elements:Aa,Slides:Ma,Layout:Oa,Clones:Ha,Move:Ba,Controller:za,Arrows:Va,Autoplay:Ua,Cover:Ga,Scroll:Qa,Drag:ts,Keyboard:ns,LazyLoad:is,Pagination:rs,Sync:ss,Wheel:ls,Live:ds}),ps={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"},ms={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:Fa,i18n:ps,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function gs(t,e,n){var o=e.Slides;function i(){_t(t).on([Se,Ft],l)}function l(){o.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function r(s,d){o.style("transition","opacity "+n.speed+"ms "+n.easing),Ei(d)}return{mount:i,start:r,cancel:fo}}function hs(t,e,n){var o=e.Move,i=e.Controller,l=e.Scroll,r=e.Elements.list,s=wt(te,r,"transition"),d;function u(){_t(t).bind(r,"transitionend",function(h){h.target===r&&d&&(L(),d())})}function c(h,p){var g=o.toPosition(h,!0),$=o.getPosition(),f=v(h);zt(g-$)>=1&&f>=1?n.useScroll?l.scroll(g,f,!1,p):(s("transform "+f+"ms "+n.easing),o.translate(g,!0),d=p):(o.jump(h),p())}function L(){s(""),l.cancel()}function v(h){var p=n.rewindSpeed;if(t.is(ze)&&p){var g=i.getIndex(!0),$=i.getEnd();if(g===0&&h>=$||g>=$&&h===0)return p}return n.speed}return{mount:u,start:c,cancel:L}}var fs=(function(){function t(n,o){this.event=_t(),this.Components={},this.state=ya(Me),this.splides=[],this._o={},this._E={};var i=be(n)?Ai(document,n):n;en(i,i+" is invalid."),this.root=i,o=ye({label:ee(i,qt)||"",labelledby:ee(i,No)||""},ms,t.defaults,o||{});try{ye(o,JSON.parse(ee(i,Wo)))}catch{en(!1,"Invalid JSON")}this._o=Object.create(ye({},o))}var e=t.prototype;return e.mount=function(o,i){var l=this,r=this.state,s=this.Components;en(r.is([Me,Bn]),"Already mounted!"),r.set(Me),this._C=s,this._T=i||this._T||(this.is(Cn)?gs:hs),this._E=o||this._E;var d=sn({},us,this._E,{Transition:this._T});return _e(d,function(u,c){var L=u(l,s,l._o);s[c]=L,L.setup&&L.setup()}),_e(s,function(u){u.mount&&u.mount()}),this.emit(Se),re(this.root,Pa),r.set(He),this.emit(xo),this},e.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(He)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},e.go=function(o){return this._C.Controller.go(o),this},e.on=function(o,i){return this.event.on(o,i),this},e.off=function(o){return this.event.off(o),this},e.emit=function(o){var i;return(i=this.event).emit.apply(i,[o].concat(Ce(arguments,1))),this},e.add=function(o,i){return this._C.Slides.add(o,i),this},e.remove=function(o){return this._C.Slides.remove(o),this},e.is=function(o){return this._o.type===o},e.refresh=function(){return this.emit(Ft),this},e.destroy=function(o){o===void 0&&(o=!0);var i=this.event,l=this.state;return l.is(Me)?_t(this).on(xo,this.destroy.bind(this,o)):(_e(this._C,function(r){r.destroy&&r.destroy(o)},!0),i.emit(Io),i.destroy(),o&&me(this.splides),l.set(Bn)),this},pa(t,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),t})(),jo=fs;jo.defaults={};jo.STATES=ga;var di=[[Se,"onMounted"],[xo,"onReady"],[ge,"onMove"],[Ge,"onMoved"],[Ro,"onClick"],[Oi,"onActive"],[Ni,"onInactive"],[Hi,"onVisible"],[Bi,"onHidden"],[Ft,"onRefresh"],[Nt,"onUpdated"],[Be,"onResize"],[Un,"onResized"],[zi,"onDrag"],[Di,"onDragging"],[ji,"onDragged"],[Gn,"onScroll"],[We,"onScrolled"],[Io,"onDestroy"],[Vi,"onArrowsMounted"],[Ki,"onArrowsUpdated"],[Ui,"onPaginationMounted"],[Gi,"onPaginationUpdated"],[Ao,"onNavigationMounted"],[ko,"onAutoplayPlay"],[Yi,"onAutoplayPlaying"],[Mo,"onAutoplayPause"],[Oo,"onLazyLoadLoaded"]];function Vo(...t){return t.filter(Boolean).join(" ")}function Vn(t){return t!==null&&typeof t=="object"}function $o(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&!t.some((n,o)=>!$o(n,e[o]));if(Vn(t)&&Vn(e)){const n=Object.keys(t),o=Object.keys(e);return n.length===o.length&&!n.some(i=>!Object.prototype.hasOwnProperty.call(e,i)||!$o(t[i],e[i]))}return t===e}function ys(t,e){return t.length===e.length&&!t.some((n,o)=>n!==e[o])}function vs(t,e){if(t){const n=Object.keys(t);for(let o=0;o<n.length;o++){const i=n[o];if(i!=="__proto__"&&e(t[i],i)===!1)break}}return t}function wo(t,e){const n=t;return vs(e,(o,i)=>{Array.isArray(o)?n[i]=o.slice():Vn(o)?n[i]=wo(Vn(n[i])?n[i]:{},o):n[i]=o}),n}var bs=({children:t,className:e,...n})=>m.createElement("div",{className:Vo("splide__track",e),...n},m.createElement("ul",{className:"splide__list"},t)),Ko=class extends m.Component{constructor(){super(...arguments),this.splideRef=m.createRef(),this.slides=[]}componentDidMount(){const{options:t,extensions:e,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new jo(o,t),this.bind(this.splide),this.splide.mount(e,n),this.options=wo({},t||{}),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:t}=this.props;t&&!$o(this.options,t)&&(this.splide.options=t,this.options=wo({},t));const e=this.getSlides();ys(this.slides,e)||(this.splide.refresh(),this.slides=e)}sync(t){var e;(e=this.splide)==null||e.sync(t)}go(t){var e;(e=this.splide)==null||e.go(t)}getSlides(){var t;if(this.splide){const e=(t=this.splide.Components.Elements)==null?void 0:t.list.children;return e&&Array.prototype.slice.call(e)||[]}return[]}bind(t){di.forEach(([e,n])=>{const o=this.props[n];typeof o=="function"&&t.on(e,(...i)=>{o(t,...i)})})}omit(t,e){return e.forEach(n=>{Object.prototype.hasOwnProperty.call(t,n)&&delete t[n]}),t}render(){const{className:t,tag:e="div",hasTrack:n=!0,children:o,...i}=this.props;return m.createElement(e,{className:Vo("splide",t),ref:this.splideRef,...this.omit(i,["options",...di.map(l=>l[1])])},n?m.createElement(bs,null,o):o)}},Uo=({children:t,className:e,...n})=>m.createElement("li",{className:Vo("splide__slide",e),...n},t);/*!
|
|
2
2
|
* Splide.js
|
|
3
3
|
* Version : 4.1.3
|
|
4
4
|
* License : MIT
|
|
5
5
|
* Copyright: 2022 Naotoshi Fujita
|
|
6
|
-
*/const va="RichTextRenderer-module__link___BWeZ2",ba={link:va},xa=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},yn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>xa(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function ht(e){const{color:t,...n}=e;return n}function Re(e,t){var n,o,r;return{fontFamily:yn(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:$.scalingValue(e.letterSpacing,t),wordSpacing:$.scalingValue(e.wordSpacing,t),fontSize:$.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?$.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(r=e.textAppearance)==null?void 0:r.fontVariant,color:e.color}}const Mt=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?s.jsx("a",{className:ba.link,href:o.value,target:o.target,children:t(o.children)},r):s.jsx("span",{style:Sa(o),children:o.text},r));return s.jsx(s.Fragment,{children:e.map((n,o)=>{const r=n.children;return s.jsx("div",{children:t(r)},o)})})};function Sa(e){return{...e.fontFamily&&{fontFamily:yn(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 Ca="SvgImage-module__svg___q3xE-",wa="SvgImage-module__img___VsTm-",vo={svg:Ca,img:wa},$a=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Ta=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Ke=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:r})=>{const[a,i]=w.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return w.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(u)}},[]),!$a(e)||!a?s.jsx("img",{src:e,alt:"",className:ye(vo.img,o),style:r}):s.jsx("span",{"data-supports-mask":a,className:ye(vo.svg,o),style:{"--svg":Ta(e),"--fill":t,"--hover-fill":n,...r??{}}})},_a={"top-left":J.topLeftAlignment,"top-center":J.topCenterAlignment,"top-right":J.topRightAlignment,"middle-left":J.middleLeftAlignment,"middle-center":J.middleCenterAlignment,"middle-right":J.middleRightAlignment,"bottom-left":J.bottomLeftAlignment,"bottom-center":J.bottomCenterAlignment,"bottom-right":J.bottomRightAlignment};function Ea({settings:e,content:t,styles:n,isEditor:o}){const[r,a]=w.useState(null),{widthSettings:i,fontSettings:u,letterSpacing:c,textAlign:m,wordSpacing:l,fontSizeLineHeight:A,textAppearance:S,color:g}=n.imageCaption,[p,d]=w.useState(void 0),[x,h]=w.useState(null),[y,_]=w.useState(0),[D,W]=w.useState(0),{direction:E,transition:b,controls:C,pagination:F,imageCaption:j,triggers:M}=e,N=w.useRef(b.type),{x:H,y:B}=e.controls.offset,U=f=>{r&&r.go(f)};return w.useEffect(()=>{if(!x)return;const f=new ResizeObserver(I=>{if(!r)return;const[k]=I;d({width:Math.round(k.contentRect.width),height:Math.round(k.contentRect.height)})});return f.observe(x),()=>f.unobserve(x)},[x]),w.useEffect(()=>{!r||N.current===b.type||(W(f=>f+1),N.current=b.type)},[b.type]),s.jsx("div",{className:ye(J.wrapper,{[J.editor]:o}),ref:h,children:s.jsxs("div",{className:J.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:b.backgroundColor&&b.type==="fade in"?b.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&s.jsx("div",{className:ye(J.captionBlock),children:s.jsx("div",{className:J.captionTextWrapper,children:t.map((f,I)=>s.jsx("div",{className:ye(J.captionText,_a[j.alignment],{[J.withPointerEvents]:I===y&&o,[J.active]:I===y}),style:{fontFamily:yn(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:i.sizing==="auto"?"max-content":$.scalingValue(i.width,o),letterSpacing:$.scalingValue(c,o),wordSpacing:$.scalingValue(l,o),textAlign:m,fontSize:$.scalingValue(A.fontSize,o),lineHeight:$.scalingValue(A.lineHeight,o),textTransform:S.textTransform??"none",textDecoration:S.textDecoration??"none",fontVariant:S.fontVariant??"normal",color:g,transitionDuration:b.duration?`${Math.round(parseInt(b.duration)/2)}ms`:"500ms"},children:s.jsx("div",{"data-styles":"imageCaption",className:J.captionTextInner,style:{"--link-hover-color":j.linkHoverColor,"--link-color":j.linkColor,position:"relative",top:$.scalingValue(j.offset.y,o),left:$.scalingValue(j.offset.x,o)},children:s.jsx(Mt,{content:f.imageCaption})})},I))})}),s.jsx(ur,{onMove:f=>{_(f.index)},ref:a,options:{arrows:!1,speed:b.duration?parseInt(b.duration):500,autoplay:M.autoPlay!==null,...M.autoPlay!==null&&{interval:parseInt(M.autoPlay)*1e3},direction:E==="horiz"||b.type==="fade in"?"ltr":"ttb",pagination:!1,drag:M.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:b.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,I)=>s.jsx(pr,{children:s.jsx("div",{className:J.sliderItem,children:s.jsx("div",{className:J.imgWrapper,children:s.jsx("img",{className:ye(J.sliderImage,{[J.contain]:f.image.objectFit==="contain",[J.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},I))},D),C.isActive&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:ye(J.arrow,{[J.arrowVertical]:E==="vert",[J.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:s.jsxs("button",{onClick:()=>{U("-1")},className:J.arrowInner,style:{transform:`translate(${$.scalingValue(H,o)}, ${$.scalingValue(B*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&s.jsx(Ke,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ye(J.arrowImg,J.mirror)}),!C.arrowsImgUrl&&s.jsx(bo,{color:C.color,className:ye(J.arrowIcon,J.arrowImg,J.mirror)})]})}),s.jsx("div",{className:ye(J.arrow,J.nextArrow,{[J.arrowVertical]:E==="vert",[J.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:s.jsxs("button",{className:J.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${$.scalingValue(H*(E==="horiz"?-1:1),o)}, ${$.scalingValue(B,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&s.jsx(Ke,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:J.arrowImg}),!C.arrowsImgUrl&&s.jsx(bo,{color:C.color,className:ye(J.arrowIcon,J.arrowImg)})]})})]}),M.triggersList.click&&s.jsx("div",{className:J.clickOverlay,onClick:()=>{r&&r.go("+1")}}),F.isActive&&s.jsx("div",{className:ye(J.pagination,{[J.paginationInsideBottom]:F.position==="inside-1"&&E==="horiz",[J.paginationInsideTop]:F.position==="inside-2"&&E==="horiz",[J.paginationOutsideBottom]:F.position==="outside-1"&&E==="horiz",[J.paginationOutsideTop]:F.position==="outside-2"&&E==="horiz",[J.paginationInsideLeft]:F.position==="inside-1"&&E==="vert",[J.paginationInsideRight]:F.position==="inside-2"&&E==="vert",[J.paginationOutsideLeft]:F.position==="outside-1"&&E==="vert",[J.paginationOutsideRight]:F.position==="outside-2"&&E==="vert",[J.paginationVertical]:E==="vert"}),children:s.jsx("div",{className:J.paginationInner,style:{backgroundColor:F.colors[2],transform:`scale(${F.scale/100}) translate(${$.scalingValue(F.offset.x,o)}, ${$.scalingValue(F.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((f,I)=>s.jsx("button",{onClick:()=>{r&&r.go(I)},className:ye(J.paginationItem),children:s.jsx("div",{className:ye(J.dot,{[J.activeDot]:I===y}),style:{backgroundColor:I===y?F.colors[0]:F.colors[1],"--pagination-hover-color":F.hover}})},I))})})]})})}function bo({color:e,className:t}){return s.jsx("svg",{viewBox:"0 0 10 18",className:t,children:s.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:s.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 Aa={element:Ea,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},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"]}},ka="ImageRevealSlider-module__imageRevealSlider___UE5Ob",La="ImageRevealSlider-module__image___Qjt-e",Ia="ImageRevealSlider-module__link___N-iLG",Fa="ImageRevealSlider-module__cursor___2U03d",ut={imageRevealSlider:ka,image:La,link:Ia,cursor:Fa};function xo(e,t,n){for(const o of n){const r=new Image;r.src=o.url;const a=o.width?Number.parseFloat(o.width):r.naturalWidth,i=r.naturalHeight/r.naturalWidth*a,u=a/2,c=i/2;if(e>=o.x-u&&e<=o.x+u&&t>=o.y-c&&t<=o.y+c)return!0}return!1}function wn(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Pa(e,t,n,o){let r,a;if(t==="custom"){r=n;const i=await wn(e);a=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await wn(e);a=i.height/i.width*r}else{const i=await wn(e);r=i.width,a=i.height}return{width:r,height:a,finalWidth:`${r}px`}}function Ma({settings:e,content:t,isEditor:n}){const[o,r]=w.useState(null),[a,i]=w.useState([]),[u,c]=w.useState(0),m=w.useRef(0),[l,A]=w.useState({x:0,y:0}),[S,g]=w.useState(1),[p,d]=w.useState("none"),x=w.useRef({x:0,y:0}),[h,y]=w.useState(!1),{sizeType:_,imageWidth:D,randomRangeImageWidth:W}=e.imageSize,{revealPosition:E,visible:b}=e.position,{cursorType:C,target:F,defaultCursorScale:j,defaultCursor:M,hoverCursorScale:N,hoverCursor:H}=e.cursor;w.useEffect(()=>{if(!o)return;const f=(L,T)=>{const R=o.getBoundingClientRect(),Z=L-R.left,ae=T-R.top;if(A({x:Z,y:ae}),C==="system"){d("none"),g(1);return}const te=Z,ce=ae,P=document.elementFromPoint(R.left+te,R.top+ce);if(P&&P.closest("a")){d("none"),g(1);return}const ee=xo(te,ce,a)||F==="area"?{img:H??"none",scale:N}:{img:M??"none",scale:j};d(ee.img),g(ee.scale)},I=L=>{L.stopPropagation(),x.current={x:L.clientX,y:L.clientY},f(L.clientX,L.clientY)},k=()=>{h&&f(x.current.x,x.current.y)};return o.addEventListener("mousemove",I),window.addEventListener("scroll",k,!0),()=>{o.removeEventListener("mousemove",I),window.removeEventListener("scroll",k,!0)}},[o,h,l,C,F,H,M,N,j,a]),w.useEffect(()=>{h||(d("none"),g(0))},[h]);const B=async(f,I,k,L={})=>{const{width:T,height:R,finalWidth:Z}=await Pa(f.image.url,_,D,W);let ae=0,te=0;E==="same"?(ae=I/2,te=k/2):(ae=L.x??Math.random()*I,te=L.y??Math.random()*k);const ce=Math.min(Math.max(ae,T/2),I-T/2),P=Math.min(Math.max(te,R/2),k-R/2);return{id:m.current++,url:f.image.url,link:f.link,name:f.image.name,x:ce,y:P,width:Z}};w.useEffect(()=>{if(!o||t.length===0)return;const f=o.getBoundingClientRect(),I=f.width,k=f.height,L=[];(async()=>{const R=t[0],Z=await B(R,I,k);L.push(Z),i(L),c(1)})()},[_,D,W,E,o]),w.useEffect(()=>{b==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[b]);const U=async f=>{if(!o)return;const I=o.getBoundingClientRect(),k=f.clientX-I.left,L=f.clientY-I.top;if(F==="image"&&!xo(k,L,a))return;let T=0,R=0;E==="on Click"?(T=k,R=L):E==="same"?(T=I.width/2,R=I.height/2):(T=Math.random()*I.width,R=Math.random()*I.height);const Z=t[u],ae=await B(Z,I.width,I.height,{x:T,y:R});i(te=>b==="all"?[...te,ae]:[ae]),c(te=>te>=t.length-1?0:te+1)};return s.jsxs("div",{ref:r,onClick:U,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:ut.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[a.map(f=>s.jsx("div",{className:ut.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:F==="area"&&f.link?s.jsx("a",{href:f.link,target:"_blank",className:ut.link,children:s.jsx("img",{src:f.url,alt:f.name,className:ut.image},f.id)}):s.jsx("img",{src:f.url,alt:f.name,className:ut.image},f.id)},f.id)),h&&s.jsx("div",{className:ut.cursor,style:{left:`${l.x}px`,top:`${l.y}px`,transform:`translate(-50%, -50%) scale(${S})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Ra={element:Ma,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},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:""}]}}}},Wa="LightBox-module__hidden___9s-9x",Na="LightBox-module__heroImage___sTxNF",Va="LightBox-module__background___rm9ml",Ha="LightBox-module__editor___4ACaY",ja="LightBox-module__contentStyle___Bgnsq",za="LightBox-module__imageStyle___tLIlB",Oa="LightBox-module__imgWrapper___LuFUp",Ba="LightBox-module__contain___8-yaS",Da="LightBox-module__cover___hNvOG",qa="LightBox-module__caption___b6L2I",Ua="LightBox-module__captionTextInner___rCGNH",Ga="LightBox-module__lightboxSplide___XFuWC",Ya="LightBox-module__arrow___iz38X",Xa="LightBox-module__arrowVertical___Zfz81",Ka="LightBox-module__nextArrow___zkAQN",Za="LightBox-module__arrowInner___p48sW",Ja="LightBox-module__arrowIcon___3VaFf",Qa="LightBox-module__arrowImg___pNV88",es="LightBox-module__mirror___pjeXc",ts="LightBox-module__thumbsWrapper___GB-nU",ns="LightBox-module__thumbsContainerVertical___wttk5",os="LightBox-module__thumbsContainer___osSma",rs="LightBox-module__thumbsAlignStart___MO6tY",is="LightBox-module__thumbsAlignCenter___Q4sUx",as="LightBox-module__thumbsAlignEnd___p4y9R",ss="LightBox-module__thumbItem___HvnF3",ls="LightBox-module__closeButton___g2khP",cs="LightBox-module__fadeIn___0m5GW",us="LightBox-module__slideInLeft___gPYwC",ps="LightBox-module__slideInRight___S-pPp",ds="LightBox-module__slideInTop___DFdAj",ms="LightBox-module__slideInBottom___m27kZ",gs="LightBox-module__fadeOut___55qBR",fs="LightBox-module__slideOutLeft___NvU7P",hs="LightBox-module__slideOutRight___SK7eC",ys="LightBox-module__slideOutTop___Vgg0z",vs="LightBox-module__slideOutBottom___nJ0Ef",bs="LightBox-module__scaleSlide___vZriG",O={hidden:Wa,heroImage:Na,background:Va,editor:Ha,contentStyle:ja,imageStyle:za,imgWrapper:Oa,contain:Ba,cover:Da,caption:qa,captionTextInner:Ua,lightboxSplide:Ga,arrow:Ya,arrowVertical:Xa,nextArrow:Ka,arrowInner:Za,arrowIcon:Ja,arrowImg:Qa,mirror:es,thumbsWrapper:ts,thumbsContainerVertical:ns,thumbsContainer:os,thumbsAlignStart:rs,thumbsAlignCenter:is,thumbsAlignEnd:as,thumbItem:ss,closeButton:ls,fadeIn:cs,slideInLeft:us,slideInRight:ps,slideInTop:ds,slideInBottom:ms,fadeOut:gs,slideOutLeft:fs,slideOutRight:hs,slideOutTop:ys,slideOutBottom:vs,scaleSlide:bs},Ut=(e,t,n)=>{const o={},[r,a]=e.split("-");return r==="top"?(o.top="0",o.bottom="auto"):r==="middle"?(o.top="50%",o.bottom="auto"):r==="bottom"&&(o.top="auto",o.bottom="0"),a==="left"?(o.left="0",o.right="auto"):a==="center"?(o.left="50%",o.right="auto"):a==="right"&&(o.left="auto",o.right="0"),r==="middle"&&a==="center"?o.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:a==="center"?o.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:o.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,o};function dr(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 So(e){const t=e.getBoundingClientRect(),n=dr(e),o=Math.max(0,t.width-n.left-n.right),r=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,u=o/r,c=a/i;let m,l;c>u?(m=o,l=o/c):(l=r,m=r*c);const A=t.left+n.left,S=t.top+n.top,g=(o-m)/2+A,p=(r-l)/2+S;return{x:g,y:p,width:m,height:l}}function Co(e){const t=e.getBoundingClientRect(),n=dr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function wo(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(r=>parseFloat(r.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function xs(e,t){const n=(()=>{if(e==="fade in")return O.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return O.slideInLeft;case"right":return O.slideInRight;case"top":return O.slideInTop;case"bottom":return O.slideInBottom;default:return O.slideInRight}return O.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return O.fadeIn;if(e==="slide in")switch(t){case"left":return O.slideInLeft;case"right":return O.slideInRight;case"top":return O.slideInTop;case"bottom":return O.slideInBottom;default:return O.slideInRight}return O.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return O.fadeOut;if(e==="slide in")switch(t){case"left":return O.slideOutLeft;case"right":return O.slideOutRight;case"top":return O.slideOutTop;case"bottom":return O.slideOutBottom;default:return O.slideOutRight}return O.fadeOut})(),a=(()=>{if(e==="fade in")return O.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return O.slideOutLeft;case"right":return O.slideOutRight;case"top":return O.slideOutTop;case"bottom":return O.slideOutBottom;default:return O.slideOutRight}return O.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:r,disappearClass:a}}const Ss=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:a})=>{const[i,u]=w.useState(!1),{url:c}=e.thumbnailBlock.cover;return w.useEffect(()=>{r==="close"&&u(!1),r==="open"&&u(!0)},[r]),s.jsxs(s.Fragment,{children:[s.jsx("img",{src:c,alt:"Cover",className:O.heroImage,onClick:()=>u(!0)}),s.jsx(Cs,{isOpen:i,onClose:()=>u(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:a})]})},Cs=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:a,isEditor:i,metadata:u})=>{var V;const[c,m]=w.useState(0),[l,A]=w.useState(0),[S,g]=w.useState(!1),[p,d]=w.useState(!1),[x,h]=w.useState({}),y=w.useRef(null),_=w.useRef(null),D=w.useRef(null),W=w.useRef(!1),E=w.useRef(null),b=w.useRef(null),C=w.useRef(null),F=w.useRef(null),j=w.useRef(!1),M=w.useRef(null),[N,H]=w.useState(!1),{appear:B,triggers:U,slider:f,thumbnail:I,controls:k,area:L,caption:T,layout:R}=r.lightboxBlock,{appearClass:Z,backdropAppearClass:ae,backdropDisappearClass:te,disappearClass:ce}=xs(B.type,B.direction),P=(u==null?void 0:u.itemId)??null;w.useEffect(()=>{const v=()=>{setTimeout(()=>{var K,Q;(Q=(K=y.current)==null?void 0:K.splide)==null||Q.refresh()},16)},q=()=>{A(K=>K+1)};return window.addEventListener("ArticleEditor.Layout:change",v),window.addEventListener("ArticleEditor.ComponentContent:change",q),()=>{window.removeEventListener("ArticleEditor.Layout:change",v),window.removeEventListener("ArticleEditor.ComponentContent:change",q)}},[]),w.useEffect(()=>{if(!e||!I.isActive){H(!1);return}const v=M.current;if(!v)return;const q=()=>{f.direction==="horiz"?H(v.scrollWidth>v.clientWidth):H(v.scrollHeight>v.clientHeight)};q();const K=new ResizeObserver(q);return K.observe(v),()=>K.disconnect()},[e,I.isActive,n.length,x,f.direction]);const ee=w.useCallback(()=>{const v=window.matchMedia("(max-width: 768px)").matches,q=wo(L.color);v&&!i&&q>.9&&(document.body.style.backgroundColor=""),g(!0),W.current=!0;const K=Q=>{Q.target===E.current&&Q.animationName&&(E.current&&b.current&&E.current.removeEventListener("animationend",b.current),b.current=null,W.current&&(W.current=!1,t()),g(!1))};E.current&&(b.current=K,E.current.addEventListener("animationend",K))},[t,L.color,i]),fe=(v,q,K)=>{var Q,ie;if(v){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&c===n.length-1?ee():(Q=y.current)==null||Q.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const re=v.getBoundingClientRect(),ne=q-re.left,ue=K-re.top,z=re.width,X=re.height;let Y;f.direction==="horiz"?Y=ne<z/2?"-1":"+1":Y=ue<X/2?"-1":"+1",(ie=y.current)==null||ie.go(Y)}}},de=v=>{if(j.current){j.current=!1;return}const q=n[c],K=(q==null?void 0:q.image.objectFit)==="cover";let Q,ie;if("changedTouches"in v&&v.changedTouches.length>0)Q=v.changedTouches[0].clientX,ie=v.changedTouches[0].clientY;else if("clientX"in v)Q=v.clientX,ie=v.clientY;else return;let re;if(K&&D.current){const ne=Co(D.current);re=Q>=ne.left&&Q<=ne.right&&ie>=ne.top&&ie<=ne.bottom}else{const ne=D.current?So(D.current):null;if(!ne){v.target===v.currentTarget&&ee();return}re=Q>=ne.x&&Q<=ne.x+ne.width&&ie>=ne.y&&ie<=ne.y+ne.height}re?fe(D.current,Q,ie):ee()},ge=v=>{const q=v.target;(q.classList.contains(O.thumbsWrapper)||q.classList.contains(O.thumbsContainer))&&de(v)};w.useEffect(()=>{if(!e)return;const v=q=>{var K,Q;if(q.key==="Escape"){ee();return}if(q.key==="ArrowRight"){m(ie=>(ie+1)%Math.max(n.length,1)),(K=y.current)==null||K.go("+1");return}q.key==="ArrowLeft"&&(m(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(Q=y.current)==null||Q.go("-1"))};return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}},[e,ee,n.length]),w.useEffect(()=>{if(e){if(m(0),A(q=>q+1),W.current=!1,g(!1),d(!1),h({}),!P)return;const v=new CustomEvent("page-overlay",{detail:{itemId:P}});window.dispatchEvent(v)}return()=>{E.current&&b.current&&(E.current.removeEventListener("animationend",b.current),b.current=null),d(!1)}},[e,P]),w.useEffect(()=>{_.current!==null&&_.current!==f.type&&A(v=>v+1),_.current=f.type},[f.type]),w.useEffect(()=>{if(!e)return;const v=document.body.style.overflow,q=window.matchMedia("(max-width: 768px)").matches,K=wo(L.color);document.body.style.overflow="hidden",d(!1);const Q=re=>{re.target===E.current&&!W.current&&re.animationName&&(q&&!i&&K>.9&&(document.body.style.backgroundColor=L.color),d(!0),E.current&&C.current&&E.current.removeEventListener("animationend",C.current),C.current=null)};E.current&&(C.current=Q,E.current.addEventListener("animationend",Q));const ie=re=>{const ne=re.target;ne&&(ne.closest(`.${O.thumbsWrapper}`)||ne.closest(`.${O.thumbsContainer}`))||f.type!=="slide"&&re.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=v,document.removeEventListener("touchmove",ie),E.current&&C.current&&(E.current.removeEventListener("animationend",C.current),C.current=null),d(!1)}},[e,i,L.color,f.type]),w.useEffect(()=>{if(!e)return;const v=q=>{var Q,ie;if(W.current){q.stopPropagation();return}if(j.current){j.current=!1;return}const K=q.target;if(!(K&&(K.closest(`.${O.thumbsContainer}`)||K.closest(`.${O.thumbItem}`)||K.closest(`.${O.arrow}`)||K.closest(`.${O.closeButton}`)||K.closest(`.${O.caption}`)))){if(f.type==="slide"&&U.type==="drag"&&((ie=(Q=y.current)==null?void 0:Q.splide)!=null&&ie.root)){const re=y.current.splide.root;if(K&&(re.contains(K)||re===K))return}if(q.touches.length===0&&q.changedTouches.length>0){const re=n[c],ne=(re==null?void 0:re.image.objectFit)==="cover",ue=q.changedTouches[0];let z;if(ne&&D.current){const X=Co(D.current);z=ue.clientX>=X.left&&ue.clientX<=X.right&&ue.clientY>=X.top&&ue.clientY<=X.bottom}else{const X=D.current?So(D.current):null;if(!X)return;z=ue.clientX>=X.x&&ue.clientX<=X.x+X.width&&ue.clientY>=X.y&&ue.clientY<=X.y+X.height}if(!z){q.stopPropagation(),W.current=!0;const X=Y=>{Y.stopPropagation(),Y.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),ee()}}}};return document.addEventListener("touchend",v,{passive:!0}),()=>{document.removeEventListener("touchend",v)}},[e,ee,c,n]);const G=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&U.type==="drag";w.useEffect(()=>{var Y,se;if(!e||!G||!((se=(Y=y.current)==null?void 0:Y.splide)!=null&&se.root))return;const v=y.current.splide.root,q=30,K=(oe,pe)=>{if(F.current){const we=Math.abs(oe-F.current.x),$e=Math.abs(pe-F.current.y);(we>0||$e>0)&&(j.current=!0)}},Q=oe=>{F.current&&(oe.preventDefault(),K(oe.clientX,oe.clientY))},ie=oe=>{F.current&&oe.touches.length>0&&(oe.preventDefault(),K(oe.touches[0].clientX,oe.touches[0].clientY))},re=(oe,pe)=>{if(!F.current||!y.current){F.current=null;return}const we=Math.abs(oe-F.current.x),$e=Math.abs(pe-F.current.y);$e>q&&$e>we&&y.current.go(pe<F.current.y?"+1":"-1"),F.current=null},ne=oe=>{F.current&&re(oe.clientX,oe.clientY),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("pointermove",Q)},ue=oe=>{if(F.current){if(oe.changedTouches.length>0){const pe=oe.changedTouches[0];re(pe.clientX,pe.clientY)}document.removeEventListener("touchend",ue),document.removeEventListener("touchcancel",ue),document.removeEventListener("touchmove",ie)}},z=oe=>{F.current={x:oe.clientX,y:oe.clientY},j.current=!1,document.addEventListener("pointermove",Q,{passive:!1}),document.addEventListener("pointerup",ne),document.addEventListener("pointercancel",ne)},X=oe=>{oe.touches.length>0&&(F.current={x:oe.touches[0].clientX,y:oe.touches[0].clientY},j.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",ue),document.addEventListener("touchcancel",ue))};return v.addEventListener("pointerdown",z),v.addEventListener("touchstart",X),()=>{v.removeEventListener("pointerdown",z),v.removeEventListener("touchstart",X),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",ue),document.removeEventListener("touchcancel",ue),F.current=null,j.current=!1}},[e,G,l]);const me={backgroundColor:L.color,backdropFilter:`blur(${L.blur}px)`,animationDuration:`${parseInt(B.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(a)?null:vr.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:i?null:E,className:ye(O.background,S?te:ae,{[O.editor]:i},{[O.hidden]:!e}),style:{...me,...p&&!i&&!S?{position:"absolute"}:{}}}),s.jsxs("div",{ref:i?E:null,className:ye(O.contentStyle,S?ce:Z,{[O.editor]:i},{[O.hidden]:!e}),style:{animationDuration:`${parseInt(B.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[s.jsx(ur,{onMove:v=>m(v.index),ref:y,className:O.lightboxSplide,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,direction:f.direction==="horiz"||f.type==="fade"||f.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!G,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((v,q)=>{const K=Ut(R.position,R.offset,i),Q=`${$.scalingValue(R.padding.top,i)} ${$.scalingValue(R.padding.right,i)} ${$.scalingValue(R.padding.bottom,i)} ${$.scalingValue(R.padding.left,i)}`,ie=f.type==="scale"?(()=>{const{transform:re,...ne}=K;return{...ne,position:"absolute",padding:Q,boxSizing:"border-box","--position-transform":re||"none"}})():{...K,position:"absolute",padding:Q,boxSizing:"border-box"};return s.jsx(pr,{children:s.jsx("div",{className:O.imgWrapper,onClick:de,children:s.jsx("img",{ref:q===c?D:null,className:ye(O.imageStyle,{[O.contain]:v.image.objectFit==="contain",[O.cover]:v.image.objectFit==="cover",[O.scaleSlide]:f.type==="scale"}),src:v.image.url,alt:v.image.name??"",style:{...ie,pointerEvents:v.image.objectFit==="contain"?"none":"auto"}})})},q)})},l),k.isActive&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:ye(O.arrow,{[O.arrowVertical]:f.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:s.jsxs("button",{className:O.arrowInner,style:{transform:`translate(${$.scalingValue(k.offset.x,i)}, ${$.scalingValue(k.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${k.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var v;return(v=y.current)==null?void 0:v.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&s.jsx(Ke,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:ye(O.arrowImg,O.mirror)}),!k.arrowsImgUrl&&s.jsx($o,{color:k.color,className:ye(O.arrowIcon,O.arrowImg,O.mirror)})]})}),s.jsx("div",{className:ye(O.arrow,O.nextArrow,{[O.arrowVertical]:f.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:s.jsxs("button",{className:O.arrowInner,style:{transform:`translate(${$.scalingValue(k.offset.x*(f.direction==="horiz"?-1:1),i)}, ${$.scalingValue(k.offset.y,i)}) scale(${k.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var v;return(v=y.current)==null?void 0:v.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&s.jsx(Ke,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:O.arrowImg}),!k.arrowsImgUrl&&s.jsx($o,{color:k.color,className:ye(O.arrowIcon,O.arrowImg)})]})})]}),L.closeIconUrl&&(()=>{const v=Ut(L.closeIconAlign,L.closeIconOffset,i),q=`scale(${L.closeIconScale})`,K=v.transform?`${v.transform} ${q}`:q;return s.jsx("button",{className:O.closeButton,style:{...v,transform:K},onClick:ee,"aria-label":"Close lightbox",children:s.jsx(Ke,{url:L.closeIconUrl,fill:L.closeIconColor??"#000000",hoverFill:L.closeIconHover??"#cccccc"})})})(),T&&T.isActive&&o.imageCaption&&((V=n[c])==null?void 0:V.imageCaption)&&(()=>{const{widthSettings:v,fontSettings:q,letterSpacing:K,textAlign:Q,wordSpacing:ie,fontSizeLineHeight:re,textAppearance:ne,color:ue}=o.imageCaption;return s.jsx("div",{className:O.caption,style:{...Ut(T.alignment,T.offset,i),fontFamily:yn(q.fontFamily),fontWeight:q.fontWeight,fontStyle:q.fontStyle,width:v.sizing==="auto"?"max-content":$.scalingValue(v.width,i),letterSpacing:$.scalingValue(K,i),wordSpacing:$.scalingValue(ie,i),textAlign:Q,fontSize:$.scalingValue(re.fontSize,i),lineHeight:$.scalingValue(re.lineHeight,i),textTransform:ne.textTransform??"none",textDecoration:ne.textDecoration??"none",fontVariant:ne.fontVariant??"normal",color:ue},onClick:z=>z.stopPropagation(),children:s.jsx("div",{"data-styles":"imageCaption",className:O.captionTextInner,style:{"--link-color":T.linkColor,"--link-hover-color":T.linkHoverColor},children:s.jsx(Mt,{content:n[c].imageCaption})})})})(),I.isActive&&(()=>{const[v,q]=I.position.split("-"),K=f.direction==="horiz"?`${v}-left`:I.position,Q=Ut(K,I.offset,i),ie=()=>{if(f.direction==="horiz"){if(q==="left")return"flex-start";if(q==="center")return"center";if(q==="right")return"flex-end"}else{if(v==="top")return"flex-start";if(v==="middle")return"center";if(v==="bottom")return"flex-end"}return"flex-start"};return s.jsx("div",{ref:M,className:O.thumbsWrapper,onClick:re=>ge(re),style:{position:i?"absolute":"fixed",...Q,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:s.jsx("div",{className:ye(O.thumbsContainer,{[O.thumbsContainerVertical]:f.direction==="vert",[O.thumbsAlignStart]:I.align==="start",[O.thumbsAlignCenter]:I.align==="center",[O.thumbsAlignEnd]:I.align==="end"}),style:{gap:$.scalingValue(I.grid.gap,i),justifyContent:N?"flex-start":ie()},children:n.map((re,ne)=>{const ue=ne===c,z=x[ne],Y=I.grid.size*(ue?I.activeState.scale:1),se=()=>{if(I.fit!=="fit")return{};if(!z)return f.direction==="horiz"?{height:$.scalingValue(Y,i)}:{width:$.scalingValue(Y,i)};const oe=z.width/z.height;if(f.direction==="horiz"){const pe=Y,we=pe*oe;return{width:$.scalingValue(we,i),height:$.scalingValue(pe,i)}}else{const pe=Y,we=pe/oe;return{width:$.scalingValue(pe,i),height:$.scalingValue(we,i)}}};return s.jsx("button",{className:O.thumbItem,style:{...f.direction==="horiz"&&I.fit!=="fit"?{height:$.scalingValue(Y,i)}:{},...f.direction==="vert"&&I.fit!=="fit"?{width:$.scalingValue(Y,i)}:{},...I.fit==="cover"?{width:$.scalingValue(Y,i),height:$.scalingValue(Y,i)}:{},...se(),transition:ue?"all 0.25s ease-out":"none",opacity:ue?I.activeState.opacity/100:I.opacity/100,"--thumb-hover":I.activeState.opacity/100},onClick:oe=>{var pe;oe.stopPropagation(),m(ne),(pe=y.current)==null||pe.go(ne)},onMouseEnter:()=>{var oe;I.triggers==="hov"&&((oe=y.current)==null||oe.go(ne))},children:s.jsx("img",{src:re.image.url,alt:re.image.name??"",onLoad:oe=>{const pe=oe.currentTarget;pe.naturalWidth&&pe.naturalHeight&&h(we=>({...we,[ne]:{width:pe.naturalWidth,height:pe.naturalHeight}}))},style:{objectFit:I.fit==="cover"?"cover":"contain",...I.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...I.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${re.image.name}-${ne}`)})})})})()]})]}),document.getElementById(a))};function $o({color:e,className:t}){return s.jsx("svg",{viewBox:"0 0 10 18",className:t,children:s.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:s.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 ws={element:Ss,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.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 Gt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $s(e){return`
|
|
7
|
-
.${
|
|
6
|
+
*/const xs="RichTextRenderer-module__link___BWeZ2",Cs={link:xs},Ss=t=>{const e=t.trim();return!e||e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?!1:e.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},no=t=>t&&t.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Ss(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function pe(t){const{color:e,...n}=t;return n}function Vt(t,e){var n,o,i;return{fontFamily:no(t.fontSettings.fontFamily),fontWeight:t.fontSettings.fontWeight,fontStyle:t.fontSettings.fontStyle,letterSpacing:S.scalingValue(t.letterSpacing,e),wordSpacing:S.scalingValue(t.wordSpacing,e),fontSize:S.scalingValue(t.fontSize,e),lineHeight:t.lineHeight!==void 0?S.scalingValue(t.lineHeight,e):void 0,textTransform:(n=t.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=t.textAppearance)==null?void 0:o.textDecoration,fontVariant:(i=t.textAppearance)==null?void 0:i.fontVariant,color:t.color}}const un=({content:t})=>{const e=n=>n.map((o,i)=>o.type==="link"?a.jsx("a",{className:Cs.link,href:o.value,target:o.target,children:e(o.children)},i):a.jsx("span",{style:$s(o),children:o.text},i));return a.jsx(a.Fragment,{children:t.map((n,o)=>{const i=n.children;return a.jsx("div",{children:e(i)},o)})})};function $s(t){return{...t.fontFamily&&{fontFamily:no(t.fontFamily)},...t.fontWeight&&{fontWeight:t.fontWeight},...t.fontStyle&&{fontStyle:t.fontStyle},...t.textDecoration&&{textDecoration:t.textDecoration},...t.textTransform&&{textTransform:t.textTransform},...t.fontVariant&&{fontVariant:t.fontVariant},...t.verticalAlign&&{verticalAlign:t.verticalAlign,lineHeight:"0px"}}}const ws="SvgImage-module__svg___q3xE-",Ts="SvgImage-module__img___VsTm-",ui={svg:ws,img:Ts},Ls=t=>{const e=t.trim();return e.startsWith("data:image/svg+xml")?!0:(e.split(/[?#]/)[0]??e).endsWith(".svg")},_s=t=>`url("${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,ve=({url:t,fill:e="#000000",hoverFill:n="#CCCCCC",className:o="",style:i})=>{const[l,r]=m.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return m.useEffect(()=>{if(typeof window<"u"&&window.CSS){const s=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');r(s)}},[]),!Ls(t)||!l?a.jsx("img",{src:t,alt:"",className:xt(ui.img,o),style:i}):a.jsx("span",{"data-supports-mask":l,className:xt(ui.svg,o),style:{"--svg":_s(t),"--fill":e,"--hover-fill":n,...i??{}}})},Es={"top-left":tt.topLeftAlignment,"top-center":tt.topCenterAlignment,"top-right":tt.topRightAlignment,"middle-left":tt.middleLeftAlignment,"middle-center":tt.middleCenterAlignment,"middle-right":tt.middleRightAlignment,"bottom-left":tt.bottomLeftAlignment,"bottom-center":tt.bottomCenterAlignment,"bottom-right":tt.bottomRightAlignment};function Ps({settings:t,content:e,styles:n,isEditor:o}){const[i,l]=m.useState(null),{widthSettings:r,fontSettings:s,letterSpacing:d,textAlign:u,wordSpacing:c,fontSizeLineHeight:L,textAppearance:v,color:h}=n.imageCaption,[p,g]=m.useState(void 0),[$,f]=m.useState(null),[x,b]=m.useState(0),[R,W]=m.useState(0),{direction:_,transition:y,controls:w,pagination:E,imageCaption:H,triggers:F}=t,O=m.useRef(y.type),{x:z,y:V}=t.controls.offset,K=C=>{i&&i.go(C)};return m.useEffect(()=>{if(!$)return;const C=new ResizeObserver(k=>{if(!i)return;const[I]=k;g({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return C.observe($),()=>C.unobserve($)},[$]),m.useEffect(()=>{!i||O.current===y.type||(W(C=>C+1),O.current=y.type)},[y.type]),a.jsx("div",{className:xt(tt.wrapper,{[tt.editor]:o}),ref:f,children:a.jsxs("div",{className:tt.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:y.backgroundColor&&y.type==="fade in"?y.backgroundColor:"transparent"},children:[t.imageCaption.isActive&&a.jsx("div",{className:xt(tt.captionBlock),children:a.jsx("div",{className:tt.captionTextWrapper,children:e.map((C,k)=>a.jsx("div",{className:xt(tt.captionText,Es[H.alignment],{[tt.withPointerEvents]:k===x&&o,[tt.active]:k===x}),style:{fontFamily:no(s.fontFamily),fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:r.sizing==="auto"?"max-content":S.scalingValue(r.width,o),letterSpacing:S.scalingValue(d,o),wordSpacing:S.scalingValue(c,o),textAlign:u,fontSize:S.scalingValue(L.fontSize,o),lineHeight:S.scalingValue(L.lineHeight,o),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:h,transitionDuration:y.duration?`${Math.round(parseInt(y.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:tt.captionTextInner,style:{"--link-hover-color":H.linkHoverColor,"--link-color":H.linkColor,position:"relative",top:S.scalingValue(H.offset.y,o),left:S.scalingValue(H.offset.x,o)},children:a.jsx(un,{content:C.imageCaption})})},k))})}),a.jsx(Ko,{onMove:C=>{b(C.index)},ref:l,options:{arrows:!1,speed:y.duration?parseInt(y.duration):500,autoplay:F.autoPlay!==null,...F.autoPlay!==null&&{interval:parseInt(F.autoPlay)*1e3},direction:_==="horiz"||y.type==="fade in"?"ltr":"ttb",pagination:!1,drag:F.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:y.type==="fade in"?"fade":"loop",rewind:!0},children:e.map((C,k)=>a.jsx(Uo,{children:a.jsx("div",{className:tt.sliderItem,children:a.jsx("div",{className:tt.imgWrapper,children:a.jsx("img",{className:xt(tt.sliderImage,{[tt.contain]:C.image.objectFit==="contain",[tt.cover]:C.image.objectFit==="cover"}),src:C.image.url,alt:C.image.name??""})})})},k))},R),w.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:xt(tt.arrow,{[tt.arrowVertical]:_==="vert",[tt.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{onClick:()=>{K("-1")},className:tt.arrowInner,style:{transform:`translate(${S.scalingValue(z,o)}, ${S.scalingValue(V*(_==="horiz"?1:-1),o)}) scale(${t.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx(ve,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:xt(tt.arrowImg,tt.mirror)}),!w.arrowsImgUrl&&a.jsx(pi,{color:w.color,className:xt(tt.arrowIcon,tt.arrowImg,tt.mirror)})]})}),a.jsx("div",{className:xt(tt.arrow,tt.nextArrow,{[tt.arrowVertical]:_==="vert",[tt.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{className:tt.arrowInner,onClick:()=>K("+1"),style:{transform:`translate(${S.scalingValue(z*(_==="horiz"?-1:1),o)}, ${S.scalingValue(V,o)}) scale(${t.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx(ve,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:tt.arrowImg}),!w.arrowsImgUrl&&a.jsx(pi,{color:w.color,className:xt(tt.arrowIcon,tt.arrowImg)})]})})]}),F.triggersList.click&&a.jsx("div",{className:tt.clickOverlay,onClick:()=>{i&&i.go("+1")}}),E.isActive&&a.jsx("div",{className:xt(tt.pagination,{[tt.paginationInsideBottom]:E.position==="inside-1"&&_==="horiz",[tt.paginationInsideTop]:E.position==="inside-2"&&_==="horiz",[tt.paginationOutsideBottom]:E.position==="outside-1"&&_==="horiz",[tt.paginationOutsideTop]:E.position==="outside-2"&&_==="horiz",[tt.paginationInsideLeft]:E.position==="inside-1"&&_==="vert",[tt.paginationInsideRight]:E.position==="inside-2"&&_==="vert",[tt.paginationOutsideLeft]:E.position==="outside-1"&&_==="vert",[tt.paginationOutsideRight]:E.position==="outside-2"&&_==="vert",[tt.paginationVertical]:_==="vert"}),children:a.jsx("div",{className:tt.paginationInner,style:{backgroundColor:E.colors[2],transform:`scale(${E.scale/100}) translate(${S.scalingValue(E.offset.x,o)}, ${S.scalingValue(E.offset.y,o)}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:e.map((C,k)=>a.jsx("button",{onClick:()=>{i&&i.go(k)},className:xt(tt.paginationItem),children:a.jsx("div",{className:xt(tt.dot,{[tt.activeDot]:k===x}),style:{backgroundColor:k===x?E.colors[0]:E.colors[1],"--pagination-hover-color":E.hover}})},k))})})]})})}function pi({color:t,className:e}){return a.jsx("svg",{viewBox:"0 0 10 18",className:e,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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:t,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Ws={element:Ps,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},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"]}},Fs="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Rs="ImageRevealSlider-module__image___Qjt-e",Is="ImageRevealSlider-module__link___N-iLG",As="ImageRevealSlider-module__cursor___2U03d",Ie={imageRevealSlider:Fs,image:Rs,link:Is,cursor:As};function mi(t,e,n){for(const o of n){const i=new Image;i.src=o.url;const l=o.width?Number.parseFloat(o.width):i.naturalWidth,r=i.naturalHeight/i.naturalWidth*l,s=l/2,d=r/2;if(t>=o.x-s&&t<=o.x+s&&e>=o.y-d&&e<=o.y+d)return!0}return!1}function po(t){return new Promise(e=>{const n=new Image;n.src=t,n.onload=()=>{e({width:n.naturalWidth,height:n.naturalHeight})}})}async function ks(t,e,n,o){let i,l;if(e==="custom"){i=n;const r=await po(t);l=r.height/r.width*i}else if(e==="random"){i=Math.random()*(o.max-o.min)+o.min;const r=await po(t);l=r.height/r.width*i}else{const r=await po(t);i=r.width,l=r.height}return{width:i,height:l,finalWidth:`${i}px`}}function Ms({settings:t,content:e,isEditor:n}){const[o,i]=m.useState(null),[l,r]=m.useState([]),[s,d]=m.useState(0),u=m.useRef(0),[c,L]=m.useState({x:0,y:0}),[v,h]=m.useState(1),[p,g]=m.useState("none"),$=m.useRef({x:0,y:0}),[f,x]=m.useState(!1),{sizeType:b,imageWidth:R,randomRangeImageWidth:W}=t.imageSize,{revealPosition:_,visible:y}=t.position,{cursorType:w,target:E,defaultCursorScale:H,defaultCursor:F,hoverCursorScale:O,hoverCursor:z}=t.cursor;m.useEffect(()=>{if(!o)return;const C=(A,P)=>{const N=o.getBoundingClientRect(),Q=A-N.left,st=P-N.top;if(L({x:Q,y:st}),w==="system"){g("none"),h(1);return}const ot=Q,ut=st,M=document.elementFromPoint(N.left+ot,N.top+ut);if(M&&M.closest("a")){g("none"),h(1);return}const J=mi(ot,ut,l)||E==="area"?{img:z??"none",scale:O}:{img:F??"none",scale:H};g(J.img),h(J.scale)},k=A=>{A.stopPropagation(),$.current={x:A.clientX,y:A.clientY},C(A.clientX,A.clientY)},I=()=>{f&&C($.current.x,$.current.y)};return o.addEventListener("mousemove",k),window.addEventListener("scroll",I,!0),()=>{o.removeEventListener("mousemove",k),window.removeEventListener("scroll",I,!0)}},[o,f,c,w,E,z,F,O,H,l]),m.useEffect(()=>{f||(g("none"),h(0))},[f]);const V=async(C,k,I,A={})=>{const{width:P,height:N,finalWidth:Q}=await ks(C.image.url,b,R,W);let st=0,ot=0;_==="same"?(st=k/2,ot=I/2):(st=A.x??Math.random()*k,ot=A.y??Math.random()*I);const ut=Math.min(Math.max(st,P/2),k-P/2),M=Math.min(Math.max(ot,N/2),I-N/2);return{id:u.current++,url:C.image.url,link:C.link,name:C.image.name,x:ut,y:M,width:Q}};m.useEffect(()=>{if(!o||e.length===0)return;const C=o.getBoundingClientRect(),k=C.width,I=C.height,A=[];(async()=>{const N=e[0],Q=await V(N,k,I);A.push(Q),r(A),d(1)})()},[b,R,W,_,o]),m.useEffect(()=>{y==="last One"&&r(C=>C.length>0?[C[C.length-1]]:[])},[y]);const K=async C=>{if(!o)return;const k=o.getBoundingClientRect(),I=C.clientX-k.left,A=C.clientY-k.top;if(E==="image"&&!mi(I,A,l))return;let P=0,N=0;_==="on Click"?(P=I,N=A):_==="same"?(P=k.width/2,N=k.height/2):(P=Math.random()*k.width,N=Math.random()*k.height);const Q=e[s],st=await V(Q,k.width,k.height,{x:P,y:N});r(ot=>y==="all"?[...ot,st]:[st]),d(ot=>ot>=e.length-1?0:ot+1)};return a.jsxs("div",{ref:i,onClick:K,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:Ie.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[l.map(C=>a.jsx("div",{className:Ie.wrapper,style:{top:`${C.y}px`,left:`${C.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:C.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:E==="area"&&C.link?a.jsx("a",{href:C.link,target:"_blank",className:Ie.link,children:a.jsx("img",{src:C.url,alt:C.name,className:Ie.image},C.id)}):a.jsx("img",{src:C.url,alt:C.name,className:Ie.image},C.id)},C.id)),f&&a.jsx("div",{className:Ie.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Os={element:Ms,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},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:""}]}}}},Ns="LightBox-module__hidden___9s-9x",Hs="LightBox-module__heroImage___sTxNF",Bs="LightBox-module__background___rm9ml",zs="LightBox-module__editor___4ACaY",Ds="LightBox-module__contentStyle___Bgnsq",js="LightBox-module__imageStyle___tLIlB",Vs="LightBox-module__imgWrapper___LuFUp",Ks="LightBox-module__contain___8-yaS",Us="LightBox-module__cover___hNvOG",Gs="LightBox-module__caption___b6L2I",Ys="LightBox-module__captionTextInner___rCGNH",qs="LightBox-module__lightboxSplide___XFuWC",Xs="LightBox-module__arrow___iz38X",Zs="LightBox-module__arrowVertical___Zfz81",Js="LightBox-module__nextArrow___zkAQN",Qs="LightBox-module__arrowInner___p48sW",tl="LightBox-module__arrowIcon___3VaFf",el="LightBox-module__arrowImg___pNV88",nl="LightBox-module__mirror___pjeXc",ol="LightBox-module__thumbsWrapper___GB-nU",il="LightBox-module__thumbsContainerVertical___wttk5",rl="LightBox-module__thumbsContainer___osSma",al="LightBox-module__thumbsAlignStart___MO6tY",sl="LightBox-module__thumbsAlignCenter___Q4sUx",ll="LightBox-module__thumbsAlignEnd___p4y9R",cl="LightBox-module__thumbItem___HvnF3",dl="LightBox-module__closeButton___g2khP",ul="LightBox-module__fadeIn___0m5GW",pl="LightBox-module__slideInLeft___gPYwC",ml="LightBox-module__slideInRight___S-pPp",gl="LightBox-module__slideInTop___DFdAj",hl="LightBox-module__slideInBottom___m27kZ",fl="LightBox-module__fadeOut___55qBR",yl="LightBox-module__slideOutLeft___NvU7P",vl="LightBox-module__slideOutRight___SK7eC",bl="LightBox-module__slideOutTop___Vgg0z",xl="LightBox-module__slideOutBottom___nJ0Ef",Cl="LightBox-module__scaleSlide___vZriG",G={hidden:Ns,heroImage:Hs,background:Bs,editor:zs,contentStyle:Ds,imageStyle:js,imgWrapper:Vs,contain:Ks,cover:Us,caption:Gs,captionTextInner:Ys,lightboxSplide:qs,arrow:Xs,arrowVertical:Zs,nextArrow:Js,arrowInner:Qs,arrowIcon:tl,arrowImg:el,mirror:nl,thumbsWrapper:ol,thumbsContainerVertical:il,thumbsContainer:rl,thumbsAlignStart:al,thumbsAlignCenter:sl,thumbsAlignEnd:ll,thumbItem:cl,closeButton:dl,fadeIn:ul,slideInLeft:pl,slideInRight:ml,slideInTop:gl,slideInBottom:hl,fadeOut:fl,slideOutLeft:yl,slideOutRight:vl,slideOutTop:bl,slideOutBottom:xl,scaleSlide:Cl},_n=(t,e,n)=>{const o={},[i,l]=t.split("-");return i==="top"?(o.top="0",o.bottom="auto"):i==="middle"?(o.top="50%",o.bottom="auto"):i==="bottom"&&(o.top="auto",o.bottom="0"),l==="left"?(o.left="0",o.right="auto"):l==="center"?(o.left="50%",o.right="auto"):l==="right"&&(o.left="auto",o.right="0"),i==="middle"&&l==="center"?o.transform=`translate(calc(-50% + ${S.scalingValue(e.x,n)}), calc(-50% + ${S.scalingValue(e.y,n)}))`:i==="middle"?o.transform=`translate(${S.scalingValue(e.x,n)}, calc(-50% + ${S.scalingValue(e.y,n)}))`:l==="center"?o.transform=`translate(calc(-50% + ${S.scalingValue(e.x,n)}), ${S.scalingValue(e.y,n)})`:o.transform=`translate(${S.scalingValue(e.x,n)}, ${S.scalingValue(e.y,n)})`,o};function dr(t){const e=window.getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,right:parseFloat(e.paddingRight)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0}}function gi(t){const e=t.getBoundingClientRect(),n=dr(t),o=Math.max(0,e.width-n.left-n.right),i=Math.max(0,e.height-n.top-n.bottom),l=t.naturalWidth,r=t.naturalHeight,s=o/i,d=l/r;let u,c;d>s?(u=o,c=o/d):(c=i,u=i*d);const L=e.left+n.left,v=e.top+n.top,h=(o-u)/2+L,p=(i-c)/2+v;return{x:h,y:p,width:u,height:c}}function hi(t){const e=t.getBoundingClientRect(),n=dr(t);return{left:e.left+n.left,right:e.right-n.right,top:e.top+n.top,bottom:e.bottom-n.bottom}}function fi(t){const e=t.match(/rgba?\(([^)]+)\)/);if(e){const o=e[1].split(",").map(i=>parseFloat(i.trim()));return o.length===4?o[3]:1}const n=t.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return t.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Sl(t,e){const n=(()=>{if(t==="fade in")return G.fadeIn;if(t==="slide in"||t==="mix")switch(e){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),o=(()=>{if(t==="fade in"||t==="mix")return G.fadeIn;if(t==="slide in")switch(e){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),i=(()=>{if(t==="fade in"||t==="mix")return G.fadeOut;if(t==="slide in")switch(e){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})(),l=(()=>{if(t==="fade in")return G.fadeOut;if(t==="slide in"||t==="mix")switch(e){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:i,disappearClass:l}}const $l=({settings:t,content:e,styles:n,portalId:o,activeEvent:i,isEditor:l})=>{const[r,s]=m.useState(!1),{url:d}=t.thumbnailBlock.cover;return m.useEffect(()=>{i==="close"&&s(!1),i==="open"&&s(!0)},[i]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:d,alt:"Cover",className:G.heroImage,onClick:()=>s(!0)}),a.jsx(wl,{isOpen:r,onClose:()=>s(!1),content:e,settings:t,lightboxStyles:n,portalId:o,isEditor:l})]})},wl=({isOpen:t,onClose:e,content:n,lightboxStyles:o,settings:i,portalId:l,isEditor:r,metadata:s})=>{var B;const[d,u]=m.useState(0),[c,L]=m.useState(0),[v,h]=m.useState(!1),[p,g]=m.useState(!1),[$,f]=m.useState({}),x=m.useRef(null),b=m.useRef(null),R=m.useRef(null),W=m.useRef(!1),_=m.useRef(null),y=m.useRef(null),w=m.useRef(null),E=m.useRef(null),H=m.useRef(!1),F=m.useRef(null),[O,z]=m.useState(!1),{appear:V,triggers:K,slider:C,thumbnail:k,controls:I,area:A,caption:P,layout:N}=i.lightboxBlock,{appearClass:Q,backdropAppearClass:st,backdropDisappearClass:ot,disappearClass:ut}=Sl(V.type,V.direction),M=(s==null?void 0:s.itemId)??null;m.useEffect(()=>{const T=()=>{setTimeout(()=>{var q,Z;(Z=(q=x.current)==null?void 0:q.splide)==null||Z.refresh()},16)},U=()=>{L(q=>q+1)};return window.addEventListener("ArticleEditor.Layout:change",T),window.addEventListener("ArticleEditor.ComponentContent:change",U),()=>{window.removeEventListener("ArticleEditor.Layout:change",T),window.removeEventListener("ArticleEditor.ComponentContent:change",U)}},[]),m.useEffect(()=>{if(!t||!k.isActive){z(!1);return}const T=F.current;if(!T)return;const U=()=>{C.direction==="horiz"?z(T.scrollWidth>T.clientWidth):z(T.scrollHeight>T.clientHeight)};U();const q=new ResizeObserver(U);return q.observe(T),()=>q.disconnect()},[t,k.isActive,n.length,$,C.direction]);const J=m.useCallback(()=>{const T=window.matchMedia("(max-width: 768px)").matches,U=fi(A.color);T&&!r&&U>.9&&(document.body.style.backgroundColor=""),h(!0),W.current=!0;const q=Z=>{Z.target===_.current&&Z.animationName&&(_.current&&y.current&&_.current.removeEventListener("animationend",y.current),y.current=null,W.current&&(W.current=!1,e()),h(!1))};_.current&&(y.current=q,_.current.addEventListener("animationend",q))},[e,A.color,r]),ht=(T,U,q)=>{var Z,it;if(T){if(K.type==="click"&&K.switch==="image")K.repeat==="close"&&d===n.length-1?J():(Z=x.current)==null||Z.go("+1");else if(K.type==="click"&&K.switch==="50/50"){const rt=T.getBoundingClientRect(),et=U-rt.left,dt=q-rt.top,j=rt.width,X=rt.height;let Y;C.direction==="horiz"?Y=et<j/2?"-1":"+1":Y=dt<X/2?"-1":"+1",(it=x.current)==null||it.go(Y)}}},pt=T=>{if(H.current){H.current=!1;return}const U=n[d],q=(U==null?void 0:U.image.objectFit)==="cover";let Z,it;if("changedTouches"in T&&T.changedTouches.length>0)Z=T.changedTouches[0].clientX,it=T.changedTouches[0].clientY;else if("clientX"in T)Z=T.clientX,it=T.clientY;else return;let rt;if(q&&R.current){const et=hi(R.current);rt=Z>=et.left&&Z<=et.right&&it>=et.top&&it<=et.bottom}else{const et=R.current?gi(R.current):null;if(!et){T.target===T.currentTarget&&J();return}rt=Z>=et.x&&Z<=et.x+et.width&&it>=et.y&&it<=et.y+et.height}rt?ht(R.current,Z,it):J()},gt=T=>{const U=T.target;(U.classList.contains(G.thumbsWrapper)||U.classList.contains(G.thumbsContainer))&&pt(T)};m.useEffect(()=>{if(!t)return;const T=U=>{var q,Z;if(U.key==="Escape"){J();return}if(U.key==="ArrowRight"){u(it=>(it+1)%Math.max(n.length,1)),(q=x.current)==null||q.go("+1");return}U.key==="ArrowLeft"&&(u(it=>(it-1+Math.max(n.length,1))%Math.max(n.length,1)),(Z=x.current)==null||Z.go("-1"))};return window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}},[t,J,n.length]),m.useEffect(()=>{if(t){if(u(0),L(U=>U+1),W.current=!1,h(!1),g(!1),f({}),!M)return;const T=new CustomEvent("page-overlay",{detail:{itemId:M}});window.dispatchEvent(T)}return()=>{_.current&&y.current&&(_.current.removeEventListener("animationend",y.current),y.current=null),g(!1)}},[t,M]),m.useEffect(()=>{b.current!==null&&b.current!==C.type&&L(T=>T+1),b.current=C.type},[C.type]),m.useEffect(()=>{if(!t)return;const T=document.body.style.overflow,U=window.matchMedia("(max-width: 768px)").matches,q=fi(A.color);document.body.style.overflow="hidden",g(!1);const Z=rt=>{rt.target===_.current&&!W.current&&rt.animationName&&(U&&!r&&q>.9&&(document.body.style.backgroundColor=A.color),g(!0),_.current&&w.current&&_.current.removeEventListener("animationend",w.current),w.current=null)};_.current&&(w.current=Z,_.current.addEventListener("animationend",Z));const it=rt=>{const et=rt.target;et&&(et.closest(`.${G.thumbsWrapper}`)||et.closest(`.${G.thumbsContainer}`))||C.type!=="slide"&&rt.preventDefault()};return document.addEventListener("touchmove",it,{passive:!1}),()=>{document.body.style.overflow=T,document.removeEventListener("touchmove",it),_.current&&w.current&&(_.current.removeEventListener("animationend",w.current),w.current=null),g(!1)}},[t,r,A.color,C.type]),m.useEffect(()=>{if(!t)return;const T=U=>{var Z,it;if(W.current){U.stopPropagation();return}if(H.current){H.current=!1;return}const q=U.target;if(!(q&&(q.closest(`.${G.thumbsContainer}`)||q.closest(`.${G.thumbItem}`)||q.closest(`.${G.arrow}`)||q.closest(`.${G.closeButton}`)||q.closest(`.${G.caption}`)))){if(C.type==="slide"&&K.type==="drag"&&((it=(Z=x.current)==null?void 0:Z.splide)!=null&&it.root)){const rt=x.current.splide.root;if(q&&(rt.contains(q)||rt===q))return}if(U.touches.length===0&&U.changedTouches.length>0){const rt=n[d],et=(rt==null?void 0:rt.image.objectFit)==="cover",dt=U.changedTouches[0];let j;if(et&&R.current){const X=hi(R.current);j=dt.clientX>=X.left&&dt.clientX<=X.right&&dt.clientY>=X.top&&dt.clientY<=X.bottom}else{const X=R.current?gi(R.current):null;if(!X)return;j=dt.clientX>=X.x&&dt.clientX<=X.x+X.width&&dt.clientY>=X.y&&dt.clientY<=X.y+X.height}if(!j){U.stopPropagation(),W.current=!0;const X=Y=>{Y.stopPropagation(),Y.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),J()}}}};return document.addEventListener("touchend",T,{passive:!0}),()=>{document.removeEventListener("touchend",T)}},[t,J,d,n]);const D=(C.type==="scale"||C.type==="fade")&&C.direction==="vert"&&K.type==="drag";m.useEffect(()=>{var Y,lt;if(!t||!D||!((lt=(Y=x.current)==null?void 0:Y.splide)!=null&<.root))return;const T=x.current.splide.root,U=30,q=(nt,ct)=>{if(E.current){const Ct=Math.abs(nt-E.current.x),Lt=Math.abs(ct-E.current.y);(Ct>0||Lt>0)&&(H.current=!0)}},Z=nt=>{E.current&&(nt.preventDefault(),q(nt.clientX,nt.clientY))},it=nt=>{E.current&&nt.touches.length>0&&(nt.preventDefault(),q(nt.touches[0].clientX,nt.touches[0].clientY))},rt=(nt,ct)=>{if(!E.current||!x.current){E.current=null;return}const Ct=Math.abs(nt-E.current.x),Lt=Math.abs(ct-E.current.y);Lt>U&&Lt>Ct&&x.current.go(ct<E.current.y?"+1":"-1"),E.current=null},et=nt=>{E.current&&rt(nt.clientX,nt.clientY),document.removeEventListener("pointerup",et),document.removeEventListener("pointercancel",et),document.removeEventListener("pointermove",Z)},dt=nt=>{if(E.current){if(nt.changedTouches.length>0){const ct=nt.changedTouches[0];rt(ct.clientX,ct.clientY)}document.removeEventListener("touchend",dt),document.removeEventListener("touchcancel",dt),document.removeEventListener("touchmove",it)}},j=nt=>{E.current={x:nt.clientX,y:nt.clientY},H.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",et),document.addEventListener("pointercancel",et)},X=nt=>{nt.touches.length>0&&(E.current={x:nt.touches[0].clientX,y:nt.touches[0].clientY},H.current=!1,document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",dt),document.addEventListener("touchcancel",dt))};return T.addEventListener("pointerdown",j),T.addEventListener("touchstart",X),()=>{T.removeEventListener("pointerdown",j),T.removeEventListener("touchstart",X),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",et),document.removeEventListener("pointercancel",et),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",dt),document.removeEventListener("touchcancel",dt),E.current=null,H.current=!1}},[t,D,c]);const at={backgroundColor:A.color,backdropFilter:`blur(${A.blur}px)`,animationDuration:`${parseInt(V.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:_i.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:r?null:_,className:xt(G.background,v?ot:st,{[G.editor]:r},{[G.hidden]:!t}),style:{...at,...p&&!r&&!v?{position:"absolute"}:{}}}),a.jsxs("div",{ref:r?_:null,className:xt(G.contentStyle,v?ut:Q,{[G.editor]:r},{[G.hidden]:!t}),style:{animationDuration:`${parseInt(V.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ko,{onMove:T=>u(T.index),ref:x,className:G.lightboxSplide,options:{arrows:!1,speed:C.duration?parseInt(C.duration):500,direction:C.direction==="horiz"||C.type==="fade"||C.type==="scale"?"ltr":"ttb",pagination:!1,drag:K.type==="drag"&&!D,perPage:1,width:"100%",height:"100%",type:C.type==="fade"||C.type==="scale"?"fade":"loop",padding:0,rewind:K.repeat!=="close",start:0},style:{"--splide-speed":C.duration},children:n.map((T,U)=>{const q=_n(N.position,N.offset,r),Z=`${S.scalingValue(N.padding.top,r)} ${S.scalingValue(N.padding.right,r)} ${S.scalingValue(N.padding.bottom,r)} ${S.scalingValue(N.padding.left,r)}`,it=C.type==="scale"?(()=>{const{transform:rt,...et}=q;return{...et,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":rt||"none"}})():{...q,position:"absolute",padding:Z,boxSizing:"border-box"};return a.jsx(Uo,{children:a.jsx("div",{className:G.imgWrapper,onClick:pt,children:a.jsx("img",{ref:U===d?R:null,className:xt(G.imageStyle,{[G.contain]:T.image.objectFit==="contain",[G.cover]:T.image.objectFit==="cover",[G.scaleSlide]:C.type==="scale"}),src:T.image.url,alt:T.image.name??"",style:{...it,pointerEvents:T.image.objectFit==="contain"?"none":"auto"}})})},U)})},c),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:xt(G.arrow,{[G.arrowVertical]:C.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${S.scalingValue(I.offset.x,r)}, ${S.scalingValue(I.offset.y*(C.direction==="horiz"?1:-1),r)}) scale(${I.scale}) rotate(${C.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var T;return(T=x.current)==null?void 0:T.go("-1")},"aria-label":"Previous",children:[I.arrowsImgUrl&&a.jsx(ve,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:xt(G.arrowImg,G.mirror)}),!I.arrowsImgUrl&&a.jsx(yi,{color:I.color,className:xt(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:xt(G.arrow,G.nextArrow,{[G.arrowVertical]:C.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${S.scalingValue(I.offset.x*(C.direction==="horiz"?-1:1),r)}, ${S.scalingValue(I.offset.y,r)}) scale(${I.scale}) rotate(${C.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var T;return(T=x.current)==null?void 0:T.go("+1")},"aria-label":"Next",children:[I.arrowsImgUrl&&a.jsx(ve,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:G.arrowImg}),!I.arrowsImgUrl&&a.jsx(yi,{color:I.color,className:xt(G.arrowIcon,G.arrowImg)})]})})]}),A.closeIconUrl&&(()=>{const T=_n(A.closeIconAlign,A.closeIconOffset,r),U=`scale(${A.closeIconScale})`,q=T.transform?`${T.transform} ${U}`:U;return a.jsx("button",{className:G.closeButton,style:{...T,transform:q},onClick:J,"aria-label":"Close lightbox",children:a.jsx(ve,{url:A.closeIconUrl,fill:A.closeIconColor??"#000000",hoverFill:A.closeIconHover??"#cccccc"})})})(),P&&P.isActive&&o.imageCaption&&((B=n[d])==null?void 0:B.imageCaption)&&(()=>{const{widthSettings:T,fontSettings:U,letterSpacing:q,textAlign:Z,wordSpacing:it,fontSizeLineHeight:rt,textAppearance:et,color:dt}=o.imageCaption;return a.jsx("div",{className:G.caption,style:{..._n(P.alignment,P.offset,r),fontFamily:no(U.fontFamily),fontWeight:U.fontWeight,fontStyle:U.fontStyle,width:T.sizing==="auto"?"max-content":S.scalingValue(T.width,r),letterSpacing:S.scalingValue(q,r),wordSpacing:S.scalingValue(it,r),textAlign:Z,fontSize:S.scalingValue(rt.fontSize,r),lineHeight:S.scalingValue(rt.lineHeight,r),textTransform:et.textTransform??"none",textDecoration:et.textDecoration??"none",fontVariant:et.fontVariant??"normal",color:dt},onClick:j=>j.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":P.linkColor,"--link-hover-color":P.linkHoverColor},children:a.jsx(un,{content:n[d].imageCaption})})})})(),k.isActive&&(()=>{const[T,U]=k.position.split("-"),q=C.direction==="horiz"?`${T}-left`:k.position,Z=_n(q,k.offset,r),it=()=>{if(C.direction==="horiz"){if(U==="left")return"flex-start";if(U==="center")return"center";if(U==="right")return"flex-end"}else{if(T==="top")return"flex-start";if(T==="middle")return"center";if(T==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:F,className:G.thumbsWrapper,onClick:rt=>gt(rt),style:{position:r?"absolute":"fixed",...Z,...C.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:xt(G.thumbsContainer,{[G.thumbsContainerVertical]:C.direction==="vert",[G.thumbsAlignStart]:k.align==="start",[G.thumbsAlignCenter]:k.align==="center",[G.thumbsAlignEnd]:k.align==="end"}),style:{gap:S.scalingValue(k.grid.gap,r),justifyContent:O?"flex-start":it()},children:n.map((rt,et)=>{const dt=et===d,j=$[et],Y=k.grid.size*(dt?k.activeState.scale:1),lt=()=>{if(k.fit!=="fit")return{};if(!j)return C.direction==="horiz"?{height:S.scalingValue(Y,r)}:{width:S.scalingValue(Y,r)};const nt=j.width/j.height;if(C.direction==="horiz"){const ct=Y,Ct=ct*nt;return{width:S.scalingValue(Ct,r),height:S.scalingValue(ct,r)}}else{const ct=Y,Ct=ct/nt;return{width:S.scalingValue(ct,r),height:S.scalingValue(Ct,r)}}};return a.jsx("button",{className:G.thumbItem,style:{...C.direction==="horiz"&&k.fit!=="fit"?{height:S.scalingValue(Y,r)}:{},...C.direction==="vert"&&k.fit!=="fit"?{width:S.scalingValue(Y,r)}:{},...k.fit==="cover"?{width:S.scalingValue(Y,r),height:S.scalingValue(Y,r)}:{},...lt(),transition:dt?"all 0.25s ease-out":"none",opacity:dt?k.activeState.opacity/100:k.opacity/100,"--thumb-hover":k.activeState.opacity/100},onClick:nt=>{var ct;nt.stopPropagation(),u(et),(ct=x.current)==null||ct.go(et)},onMouseEnter:()=>{var nt;k.triggers==="hov"&&((nt=x.current)==null||nt.go(et))},children:a.jsx("img",{src:rt.image.url,alt:rt.image.name??"",onLoad:nt=>{const ct=nt.currentTarget;ct.naturalWidth&&ct.naturalHeight&&f(Ct=>({...Ct,[et]:{width:ct.naturalWidth,height:ct.naturalHeight}}))},style:{objectFit:k.fit==="cover"?"cover":"contain",...k.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...k.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${rt.image.name}-${et}`)})})})})()]})]}),document.getElementById(l))};function yi({color:t,className:e}){return a.jsx("svg",{viewBox:"0 0 10 18",className:e,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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:t,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Tl={element:$l,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.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 En(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Ll(t){return`
|
|
7
|
+
.${t}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${En(48)};
|
|
12
12
|
}
|
|
13
|
-
.${
|
|
14
|
-
.${
|
|
13
|
+
.${t}-wrapper.${t}-type-C .${t}-input:focus-visible,
|
|
14
|
+
.${t}-wrapper.${t}-type-C .${t}-button:focus-visible {
|
|
15
15
|
outline: none;
|
|
16
16
|
}
|
|
17
|
-
.${
|
|
17
|
+
.${t}-form {
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
width: 100%;
|
|
21
21
|
}
|
|
22
|
-
.${
|
|
22
|
+
.${t}-fields {
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
flex: 1;
|
|
26
26
|
min-width: 0;
|
|
27
27
|
}
|
|
28
|
-
.${
|
|
28
|
+
.${t}-field-group {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
flex: 1;
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
|
-
.${
|
|
35
|
-
gap: ${
|
|
34
|
+
.${t}-field-group.${t}-labeled {
|
|
35
|
+
gap: ${En(4)};
|
|
36
36
|
}
|
|
37
|
-
.${
|
|
37
|
+
.${t}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
39
|
-
color: var(--${
|
|
39
|
+
color: var(--${t}-label-text-color);
|
|
40
40
|
}
|
|
41
|
-
.${
|
|
41
|
+
.${t}-input {
|
|
42
42
|
width: 100%;
|
|
43
43
|
box-sizing: border-box;
|
|
44
44
|
outline: none;
|
|
45
45
|
-webkit-tap-highlight-color: transparent;
|
|
46
|
-
background-color: var(--${
|
|
47
|
-
color: var(--${
|
|
48
|
-
border-color: var(--${
|
|
46
|
+
background-color: var(--${t}-input-color);
|
|
47
|
+
color: var(--${t}-input-text-color);
|
|
48
|
+
border-color: var(--${t}-input-border-color);
|
|
49
49
|
transition: color 250ms, border-color 250ms, background-color 250ms;
|
|
50
50
|
}
|
|
51
|
-
.${
|
|
52
|
-
color: var(--${
|
|
51
|
+
.${t}-input::placeholder {
|
|
52
|
+
color: var(--${t}-placeholder-color);
|
|
53
53
|
opacity: 1;
|
|
54
54
|
transition: color 250ms, opacity 250ms;
|
|
55
55
|
}
|
|
56
|
-
.${
|
|
57
|
-
background-color: var(--${
|
|
58
|
-
color: var(--${
|
|
59
|
-
border-color: var(--${
|
|
60
|
-
}
|
|
61
|
-
.${
|
|
62
|
-
background-color: var(--${
|
|
63
|
-
color: var(--${
|
|
64
|
-
border-color: var(--${
|
|
65
|
-
}
|
|
66
|
-
.${
|
|
67
|
-
.${
|
|
68
|
-
.${
|
|
69
|
-
background-color: var(--${
|
|
70
|
-
color: var(--${
|
|
71
|
-
border-color: var(--${
|
|
72
|
-
}
|
|
73
|
-
.${
|
|
74
|
-
background-color: var(--${
|
|
75
|
-
color: var(--${
|
|
76
|
-
border-color: var(--${
|
|
77
|
-
}
|
|
78
|
-
.${
|
|
79
|
-
background-color: var(--${
|
|
80
|
-
color: var(--${
|
|
81
|
-
border-color: var(--${
|
|
82
|
-
}
|
|
83
|
-
.${
|
|
84
|
-
.${
|
|
56
|
+
.${t}-input:hover {
|
|
57
|
+
background-color: var(--${t}-hover-input-color, var(--${t}-input-color));
|
|
58
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
59
|
+
border-color: var(--${t}-hover-input-border-color, var(--${t}-input-border-color));
|
|
60
|
+
}
|
|
61
|
+
.${t}-wrapper.${t}-state-hover .${t}-input {
|
|
62
|
+
background-color: var(--${t}-hover-input-color, var(--${t}-input-color));
|
|
63
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
64
|
+
border-color: var(--${t}-hover-input-border-color, var(--${t}-input-border-color));
|
|
65
|
+
}
|
|
66
|
+
.${t}-input:focus,
|
|
67
|
+
.${t}-input:focus-visible,
|
|
68
|
+
.${t}-wrapper.${t}-state-focus .${t}-input {
|
|
69
|
+
background-color: var(--${t}-focus-input-color, var(--${t}-input-color));
|
|
70
|
+
color: var(--${t}-focus-input-text-color, var(--${t}-input-text-color));
|
|
71
|
+
border-color: var(--${t}-focus-input-border-color, var(--${t}-input-border-color));
|
|
72
|
+
}
|
|
73
|
+
.${t}-input[data-filled="true"] {
|
|
74
|
+
background-color: var(--${t}-filled-input-color, var(--${t}-input-color));
|
|
75
|
+
color: var(--${t}-filled-input-text-color, var(--${t}-input-text-color));
|
|
76
|
+
border-color: var(--${t}-filled-input-border-color, var(--${t}-input-border-color));
|
|
77
|
+
}
|
|
78
|
+
.${t}-wrapper.${t}-state-filled .${t}-button {
|
|
79
|
+
background-color: var(--${t}-filled-button-color, var(--${t}-button-color));
|
|
80
|
+
color: var(--${t}-filled-button-text-color, var(--${t}-button-text-color));
|
|
81
|
+
border-color: var(--${t}-filled-button-border-color, var(--${t}-button-border-color));
|
|
82
|
+
}
|
|
83
|
+
.${t}-wrapper.${t}-state-success .${t}-input,
|
|
84
|
+
.${t}-wrapper.${t}-state-success .${t}-button {
|
|
85
85
|
pointer-events: none;
|
|
86
86
|
}
|
|
87
|
-
.${
|
|
87
|
+
.${t}-wrapper.${t}-state-error .${t}-input {
|
|
88
88
|
}
|
|
89
|
-
.${
|
|
89
|
+
.${t}-input[data-field-type="textarea"] {
|
|
90
90
|
resize: vertical;
|
|
91
91
|
}
|
|
92
|
-
.${
|
|
92
|
+
.${t}-input:disabled {
|
|
93
93
|
cursor: not-allowed;
|
|
94
94
|
}
|
|
95
|
-
.${
|
|
95
|
+
.${t}-button {
|
|
96
96
|
cursor: pointer;
|
|
97
97
|
white-space: nowrap;
|
|
98
98
|
box-sizing: border-box;
|
|
99
99
|
outline: none;
|
|
100
|
-
background-color: var(--${
|
|
101
|
-
color: var(--${
|
|
102
|
-
border-color: var(--${
|
|
100
|
+
background-color: var(--${t}-button-color);
|
|
101
|
+
color: var(--${t}-button-text-color);
|
|
102
|
+
border-color: var(--${t}-button-border-color);
|
|
103
103
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
104
104
|
}
|
|
105
|
-
.${
|
|
106
|
-
background-color: var(--${
|
|
107
|
-
color: var(--${
|
|
108
|
-
border-color: var(--${
|
|
109
|
-
}
|
|
110
|
-
.${
|
|
111
|
-
background-color: var(--${
|
|
112
|
-
color: var(--${
|
|
113
|
-
border-color: var(--${
|
|
114
|
-
}
|
|
115
|
-
.${
|
|
116
|
-
.${
|
|
117
|
-
.${
|
|
118
|
-
background-color: var(--${
|
|
119
|
-
color: var(--${
|
|
120
|
-
border-color: var(--${
|
|
121
|
-
}
|
|
122
|
-
.${
|
|
123
|
-
.${
|
|
105
|
+
.${t}-button:hover {
|
|
106
|
+
background-color: var(--${t}-hover-button-color, var(--${t}-button-color));
|
|
107
|
+
color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
108
|
+
border-color: var(--${t}-hover-button-border-color, var(--${t}-button-border-color));
|
|
109
|
+
}
|
|
110
|
+
.${t}-wrapper.${t}-state-hover .${t}-button {
|
|
111
|
+
background-color: var(--${t}-hover-button-color, var(--${t}-button-color));
|
|
112
|
+
color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
113
|
+
border-color: var(--${t}-hover-button-border-color, var(--${t}-button-border-color));
|
|
114
|
+
}
|
|
115
|
+
.${t}-button:focus,
|
|
116
|
+
.${t}-button:focus-visible,
|
|
117
|
+
.${t}-wrapper.${t}-state-focus .${t}-button {
|
|
118
|
+
background-color: var(--${t}-focus-button-color, var(--${t}-button-color));
|
|
119
|
+
color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
120
|
+
border-color: var(--${t}-focus-button-border-color, var(--${t}-button-border-color));
|
|
121
|
+
}
|
|
122
|
+
.${t}-input:focus-visible,
|
|
123
|
+
.${t}-wrapper.${t}-state-focus .${t}-input {
|
|
124
124
|
outline: none;
|
|
125
125
|
}
|
|
126
|
-
.${
|
|
127
|
-
.${
|
|
126
|
+
.${t}-button:focus-visible,
|
|
127
|
+
.${t}-wrapper.${t}-state-focus .${t}-button {
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
|
-
.${
|
|
131
|
-
margin-top: ${
|
|
132
|
-
color: var(--${
|
|
130
|
+
.${t}-success {
|
|
131
|
+
margin-top: ${En(8)};
|
|
132
|
+
color: var(--${t}-success-success-color, var(--${t}-success-color));
|
|
133
133
|
}
|
|
134
|
-
.${
|
|
135
|
-
margin-top: ${
|
|
136
|
-
color: var(--${
|
|
134
|
+
.${t}-error {
|
|
135
|
+
margin-top: ${En(8)};
|
|
136
|
+
color: var(--${t}-error-error-color, var(--${t}-error-color));
|
|
137
137
|
}
|
|
138
|
-
.${
|
|
138
|
+
.${t}-overlay-anchor {
|
|
139
139
|
position: relative;
|
|
140
140
|
height: auto;
|
|
141
141
|
}
|
|
142
|
-
`}function
|
|
142
|
+
`}function _l({settings:t,isEditor:e,metadata:n,activeEvent:o}){const{prefix:i}=S.useScopedStyles(),{type:l="A",fieldsToShow:r=2,fields:s=[],buttonLabel:d,gap:u,fieldsGap:c,buttonCorners:L,buttonStroke:v,buttonPadding:h,isButtonFullWidth:p,inputCorners:g,inputStroke:$,inputPadding:f,inputColor:x,inputTextColor:b,inputBorderColor:R,placeholderColor:W,buttonColor:_,buttonTextColor:y,buttonBorderColor:w,labelTextColor:E,successColor:H,errorColor:F,fontFamily:O,inputFontSettings:z,inputFontSize:V,inputLineHeight:K,inputLetterSpacing:C,inputWordSpacing:k,inputTextAppearance:I,buttonFontSettings:A,buttonFontSize:P,buttonLineHeight:N,buttonLetterSpacing:Q,buttonWordSpacing:st,buttonTextAppearance:ot,labelFontSettings:ut,labelFontSize:M,labelLineHeight:J,labelLetterSpacing:ht,labelWordSpacing:pt,labelTextAppearance:gt,statusFontSettings:D,statusFontSize:at,statusLineHeight:B,statusLetterSpacing:T,statusWordSpacing:U,statusTextAppearance:q,successMessage:Z,errorMessage:it,stateOverrides:rt}=t,et=l==="B",dt=s.slice(0,Math.min(r,s.length)),j={fontSettings:{fontFamily:O,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:V??.01,lineHeight:K,letterSpacing:C??0,wordSpacing:k??0,textAppearance:I,color:b},X=pe(Vt(j,e)),Y=S.scalingValue($??0,e),lt=S.scalingValue((K??V??.01)+((f==null?void 0:f.top)??0)+((f==null?void 0:f.bottom)??0)+(l==="C"?$??0:($??0)*2),e),nt={...X,borderStyle:"solid",borderRadius:l==="C"?0:S.scalingValue(g??0,e),...l==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Y,borderLeftWidth:0}:{borderWidth:Y},paddingTop:S.scalingValue((f==null?void 0:f.top)??0,e),paddingRight:S.scalingValue((f==null?void 0:f.right)??0,e),paddingBottom:S.scalingValue((f==null?void 0:f.bottom)??0,e),paddingLeft:S.scalingValue((f==null?void 0:f.left)??0,e),height:lt,minHeight:lt},ct={fontSettings:{fontFamily:O,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:P??.01,lineHeight:N,letterSpacing:Q??0,wordSpacing:st??0,textAppearance:ot,color:y},Ct=pe(Vt(ct,e)),Lt=S.scalingValue(v??0,e),Pt={fontSettings:{fontFamily:O,fontWeight:(ut==null?void 0:ut.fontWeight)??400,fontStyle:(ut==null?void 0:ut.fontStyle)??"normal"},fontSize:M??.01,lineHeight:J,letterSpacing:ht??0,wordSpacing:pt??0,textAppearance:gt,color:E},Dt=Vt(Pt,e),St={fontSettings:{fontFamily:O,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:at??.01,lineHeight:B,letterSpacing:T??0,wordSpacing:U??0,textAppearance:q,color:H},At=pe(Vt(St,e)),Kt=S.buildColorVars(i,{inputColor:x,inputTextColor:b,inputBorderColor:R,placeholderColor:W!=null&&W.trim()?W:"#cccccc",buttonColor:_,buttonTextColor:y,buttonBorderColor:w,labelTextColor:E,successColor:H,errorColor:F},El,Pl,rt),[yt,Wt]=m.useState(()=>Object.fromEntries(dt.map(vt=>[vt.name,""]))),[$t,Mt]=m.useState("idle"),[kt,Rt]=m.useState(null),It=o==="success"?"success":o==="error"?"error":$t,Ut=o==="error"?it:kt,oe=o==="filled",Jt=m.useMemo(()=>{if(!oe)return yt;let vt=null;for(const Qt of dt)(yt[Qt.name]??"").trim().length>0||(vt=vt??{...yt},vt[Qt.name]="Filled");return vt??yt},[yt,oe,dt]),oo=It==="error"?S.getFormFieldValidationError(dt,Jt):null,ro=`${o&&o!=="default"?`${i}-state-${o}`:""}`.trim(),bt=n==null?void 0:n.submitUrl,Xe=(vt,Qt)=>{Wt(jt=>({...jt,[vt]:Qt}))},Sn=async vt=>{vt.preventDefault();const Qt=Object.fromEntries(dt.map(Ot=>{var Gt;return[Ot.name,((Gt=yt[Ot.name])==null?void 0:Gt.trim())??""]}).filter(([,Ot])=>Ot));if(!bt){Mt("error"),Rt("No integrations were found for this form.");return}if(Object.keys(Qt).length===0)return;const jt=S.getFormFieldValidationError(dt,yt);if(jt){Mt("error"),Rt(jt);return}Mt("submitting"),Rt(null);try{const Ot=await fetch(bt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Qt)});if(!Ot.ok){const Gt=await Ot.text();throw new Error(Gt||`Request failed: ${Ot.status}`)}Mt("success"),Wt(Object.fromEntries(dt.map(Gt=>[Gt.name,""])))}catch(Ot){Mt("error"),Rt(Ot instanceof Error?Ot.message:"Something went wrong")}};return a.jsxs("div",{className:`${i}-wrapper ${i}-type-${l} ${ro}`.trim(),style:Kt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ll(i)}}),a.jsxs("form",{onSubmit:Sn,className:`${i}-form`,style:{gap:S.scalingValue(u??0,e)},children:[a.jsx("div",{className:`${i}-fields`,style:{gap:S.scalingValue(c??0,e)},children:dt.map((vt,Qt)=>a.jsxs("div",{className:`${i}-field-group${et?` ${i}-labeled`:""}`,children:[et&&a.jsx("span",{className:`${i}-field-label`,style:Dt?{...Dt,lineHeight:Dt.fontSize}:void 0,children:vt.label||vt.name}),vt.type==="textarea"?a.jsx("textarea",{name:vt.name,autoComplete:"off",value:Jt[vt.name]??"",onChange:jt=>Xe(vt.name,jt.target.value),placeholder:vt.placeholder,className:`${i}-input`,style:nt,rows:1,"data-filled":oe||(Jt[vt.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:vt.type==="phone"?"tel":vt.type==="email"?"email":"text",name:vt.name,autoComplete:"off",value:Jt[vt.name]??"",onChange:jt=>Xe(vt.name,jt.target.value),placeholder:vt.placeholder,required:vt.isRequired??vt.type==="email",className:`${i}-input`,style:nt,"data-filled":oe||(Jt[vt.name]??"").trim().length>0})]},Qt))}),a.jsx("div",{className:`${i}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${i}-button`,style:{borderStyle:"solid",borderRadius:S.scalingValue(L??0,e),borderWidth:Lt,paddingTop:S.scalingValue((h==null?void 0:h.top)??0,e),paddingRight:S.scalingValue((h==null?void 0:h.right)??0,e),paddingBottom:S.scalingValue((h==null?void 0:h.bottom)??0,e),paddingLeft:S.scalingValue((h==null?void 0:h.left)??0,e),...Ct,...p?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${i}-overlay-anchor`,style:p?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:$t==="submitting"?"...":d})})})]}),It==="success"&&a.jsx("p",{className:`${i}-success`,style:{...At},children:Z}),It==="error"&&a.jsx("p",{className:`${i}-error`,style:{...At},role:"alert",children:oo??Ut??it})]})}const El={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"},Pl=["hover","focus","filled","success","error"],Wl=`import React, { useMemo, useState } from 'react';
|
|
143
143
|
import { CommonComponentProps } from '../props';
|
|
144
144
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
145
145
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -740,8 +740,8 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
740
740
|
};
|
|
741
741
|
|
|
742
742
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
743
|
-
`,ks=[{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."},{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"}],Yt={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ls=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Is={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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:"range-control"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control",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:"range-control"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Input Stroke",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",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:"Button Stroke",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Color",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:{...Yt.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:{...Yt.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:{...Yt.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:{...Yt.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:ks,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",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:!1,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:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},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","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"",items:["inputPadding"]}]},{type:"group",title:"Button",items:[{type:"row",items:["isButtonFullWidth"]},{type:"row",items:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"",items:["buttonPadding"]}]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Ls],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"]},Fs={element:Ts,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:Is,sourceCode:As};function Xt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ps(e){return`
|
|
744
|
-
.${
|
|
743
|
+
`,Fl=[{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."},{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"}],Pn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Rl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Il={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Input Stroke",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",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:"Button Stroke",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Color",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:{...Pn.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:{...Pn.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:{...Pn.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:{...Pn.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:Fl,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",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:!1,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:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},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","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["isButtonFullWidth"]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Rl],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"]},Al={element:_l,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:Il,sourceCode:Wl};function Wn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function kl(t){return`
|
|
744
|
+
.${t}-wrapper {
|
|
745
745
|
display: flex;
|
|
746
746
|
flex-direction: column;
|
|
747
747
|
width: 100%;
|
|
@@ -749,90 +749,90 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
749
749
|
align-items: stretch;
|
|
750
750
|
justify-content: center;
|
|
751
751
|
}
|
|
752
|
-
.${
|
|
752
|
+
.${t}-form {
|
|
753
753
|
display: flex;
|
|
754
754
|
width: 100%;
|
|
755
755
|
align-items: stretch;
|
|
756
756
|
overflow: hidden;
|
|
757
|
-
border-color: var(--${
|
|
757
|
+
border-color: var(--${t}-stroke-color);
|
|
758
758
|
transition: border-color 250ms;
|
|
759
759
|
}
|
|
760
|
-
.${
|
|
761
|
-
border-color: var(--${
|
|
760
|
+
.${t}-form:hover {
|
|
761
|
+
border-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
762
762
|
}
|
|
763
|
-
.${
|
|
764
|
-
border-color: var(--${
|
|
763
|
+
.${t}-form:focus-within {
|
|
764
|
+
border-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
765
765
|
}
|
|
766
|
-
.${
|
|
767
|
-
border-color: var(--${
|
|
766
|
+
.${t}-wrapper.${t}-state-hover .${t}-form {
|
|
767
|
+
border-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
768
768
|
}
|
|
769
|
-
.${
|
|
770
|
-
border-color: var(--${
|
|
769
|
+
.${t}-wrapper.${t}-state-focus .${t}-form {
|
|
770
|
+
border-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
771
771
|
}
|
|
772
|
-
.${
|
|
773
|
-
border-color: var(--${
|
|
772
|
+
.${t}-wrapper.${t}-state-filled .${t}-form {
|
|
773
|
+
border-color: var(--${t}-filled-stroke-color, var(--${t}-stroke-color));
|
|
774
774
|
}
|
|
775
|
-
.${
|
|
775
|
+
.${t}-inputWrap {
|
|
776
776
|
position: relative;
|
|
777
777
|
display: flex;
|
|
778
778
|
align-items: center;
|
|
779
779
|
flex: 1;
|
|
780
780
|
min-width: 0;
|
|
781
|
-
background-color: var(--${
|
|
781
|
+
background-color: var(--${t}-input-color);
|
|
782
782
|
transition: background-color 250ms;
|
|
783
783
|
}
|
|
784
|
-
.${
|
|
785
|
-
.${
|
|
786
|
-
background-color: var(--${
|
|
784
|
+
.${t}-inputWrap:hover,
|
|
785
|
+
.${t}-wrapper.${t}-state-hover .${t}-inputWrap {
|
|
786
|
+
background-color: var(--${t}-hover-input-color, var(--${t}-input-color));
|
|
787
787
|
}
|
|
788
|
-
.${
|
|
789
|
-
.${
|
|
790
|
-
background-color: var(--${
|
|
788
|
+
.${t}-inputWrap:focus-within,
|
|
789
|
+
.${t}-wrapper.${t}-state-focus .${t}-inputWrap {
|
|
790
|
+
background-color: var(--${t}-focus-input-color, var(--${t}-input-color));
|
|
791
791
|
}
|
|
792
|
-
.${
|
|
793
|
-
background-color: var(--${
|
|
792
|
+
.${t}-wrapper.${t}-state-filled .${t}-inputWrap {
|
|
793
|
+
background-color: var(--${t}-filled-input-color, var(--${t}-input-color));
|
|
794
794
|
}
|
|
795
|
-
.${
|
|
795
|
+
.${t}-input {
|
|
796
796
|
flex: 1;
|
|
797
797
|
min-width: 0;
|
|
798
798
|
background: transparent;
|
|
799
799
|
border: none;
|
|
800
800
|
outline: none;
|
|
801
801
|
-webkit-tap-highlight-color: transparent;
|
|
802
|
-
color: var(--${
|
|
802
|
+
color: var(--${t}-input-text-color);
|
|
803
803
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
804
804
|
}
|
|
805
|
-
.${
|
|
806
|
-
color: var(--${
|
|
805
|
+
.${t}-input:hover {
|
|
806
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
807
807
|
}
|
|
808
|
-
.${
|
|
809
|
-
.${
|
|
810
|
-
color: var(--${
|
|
808
|
+
.${t}-inputWrap:hover .${t}-input,
|
|
809
|
+
.${t}-wrapper.${t}-state-hover .${t}-input {
|
|
810
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
811
811
|
}
|
|
812
|
-
.${
|
|
813
|
-
.${
|
|
814
|
-
color: var(--${
|
|
812
|
+
.${t}-input:focus,
|
|
813
|
+
.${t}-wrapper.${t}-state-focus .${t}-input {
|
|
814
|
+
color: var(--${t}-focus-input-text-color, var(--${t}-input-text-color));
|
|
815
815
|
}
|
|
816
|
-
.${
|
|
817
|
-
color: var(--${
|
|
816
|
+
.${t}-wrapper.${t}-state-filled .${t}-input {
|
|
817
|
+
color: var(--${t}-filled-input-text-color, var(--${t}-input-text-color));
|
|
818
818
|
}
|
|
819
|
-
.${
|
|
820
|
-
color: var(--${
|
|
819
|
+
.${t}-input::placeholder {
|
|
820
|
+
color: var(--${t}-placeholder-color);
|
|
821
821
|
opacity: 1;
|
|
822
822
|
transition: color 250ms, opacity 250ms;
|
|
823
823
|
}
|
|
824
|
-
.${
|
|
825
|
-
.${
|
|
826
|
-
color: var(--${
|
|
824
|
+
.${t}-inputWrap:hover .${t}-input::placeholder,
|
|
825
|
+
.${t}-wrapper.${t}-state-hover .${t}-input::placeholder {
|
|
826
|
+
color: var(--${t}-hover-placeholder-color, var(--${t}-placeholder-color));
|
|
827
827
|
}
|
|
828
|
-
.${
|
|
829
|
-
.${
|
|
830
|
-
color: var(--${
|
|
828
|
+
.${t}-inputWrap:focus-within .${t}-input::placeholder,
|
|
829
|
+
.${t}-wrapper.${t}-state-focus .${t}-input::placeholder {
|
|
830
|
+
color: var(--${t}-focus-placeholder-color, var(--${t}-placeholder-color));
|
|
831
831
|
}
|
|
832
|
-
.${
|
|
833
|
-
color: var(--${
|
|
832
|
+
.${t}-wrapper.${t}-state-filled .${t}-input::placeholder {
|
|
833
|
+
color: var(--${t}-filled-placeholder-color, var(--${t}-placeholder-color));
|
|
834
834
|
}
|
|
835
|
-
.${
|
|
835
|
+
.${t}-submitBtn {
|
|
836
836
|
box-sizing: border-box;
|
|
837
837
|
height: 100%;
|
|
838
838
|
display: flex;
|
|
@@ -841,13 +841,13 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
841
841
|
border: none;
|
|
842
842
|
cursor: pointer;
|
|
843
843
|
white-space: nowrap;
|
|
844
|
-
background-color: var(--${
|
|
845
|
-
color: var(--${
|
|
844
|
+
background-color: var(--${t}-button-color);
|
|
845
|
+
color: var(--${t}-button-text-color);
|
|
846
846
|
border-left-style: solid;
|
|
847
|
-
border-left-color: var(--${
|
|
847
|
+
border-left-color: var(--${t}-stroke-color);
|
|
848
848
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
849
849
|
}
|
|
850
|
-
.${
|
|
850
|
+
.${t}-submitBtn img {
|
|
851
851
|
display: block;
|
|
852
852
|
box-sizing: border-box;
|
|
853
853
|
flex: 0 1 auto;
|
|
@@ -858,7 +858,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
858
858
|
max-height: 100%;
|
|
859
859
|
object-fit: contain;
|
|
860
860
|
}
|
|
861
|
-
.${
|
|
861
|
+
.${t}-submitBtn svg {
|
|
862
862
|
display: block;
|
|
863
863
|
box-sizing: border-box;
|
|
864
864
|
flex: 0 1 auto;
|
|
@@ -868,7 +868,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
868
868
|
max-width: 100%;
|
|
869
869
|
max-height: 100%;
|
|
870
870
|
}
|
|
871
|
-
.${
|
|
871
|
+
.${t}-submitBtn .${t}-submitBtnIcon {
|
|
872
872
|
position: relative;
|
|
873
873
|
top: auto;
|
|
874
874
|
left: auto;
|
|
@@ -884,54 +884,54 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
884
884
|
max-width: 100%;
|
|
885
885
|
max-height: 100%;
|
|
886
886
|
}
|
|
887
|
-
.${
|
|
888
|
-
.${
|
|
889
|
-
background-color: var(--${
|
|
890
|
-
color: var(--${
|
|
891
|
-
border-left-color: var(--${
|
|
887
|
+
.${t}-submitBtn:hover,
|
|
888
|
+
.${t}-wrapper.${t}-state-hover .${t}-submitBtn {
|
|
889
|
+
background-color: var(--${t}-hover-button-color, var(--${t}-button-color));
|
|
890
|
+
color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
891
|
+
border-left-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
892
892
|
}
|
|
893
|
-
.${
|
|
894
|
-
.${
|
|
895
|
-
background-color: var(--${
|
|
896
|
-
color: var(--${
|
|
897
|
-
border-left-color: var(--${
|
|
893
|
+
.${t}-submitBtn:focus,
|
|
894
|
+
.${t}-wrapper.${t}-state-focus .${t}-submitBtn {
|
|
895
|
+
background-color: var(--${t}-focus-button-color, var(--${t}-button-color));
|
|
896
|
+
color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
897
|
+
border-left-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
898
898
|
}
|
|
899
|
-
.${
|
|
900
|
-
background-color: var(--${
|
|
901
|
-
color: var(--${
|
|
902
|
-
border-left-color: var(--${
|
|
899
|
+
.${t}-wrapper.${t}-state-filled .${t}-submitBtn {
|
|
900
|
+
background-color: var(--${t}-filled-button-color, var(--${t}-button-color));
|
|
901
|
+
color: var(--${t}-filled-button-text-color, var(--${t}-button-text-color));
|
|
902
|
+
border-left-color: var(--${t}-filled-stroke-color, var(--${t}-stroke-color));
|
|
903
903
|
}
|
|
904
|
-
.${
|
|
905
|
-
.${
|
|
906
|
-
background-color: var(--${
|
|
904
|
+
.${t}-submitBtn:hover .${t}-submitBtnIcon,
|
|
905
|
+
.${t}-wrapper.${t}-state-hover .${t}-submitBtn .${t}-submitBtnIcon {
|
|
906
|
+
background-color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
907
907
|
}
|
|
908
|
-
.${
|
|
909
|
-
.${
|
|
910
|
-
background-color: var(--${
|
|
908
|
+
.${t}-submitBtn:focus .${t}-submitBtnIcon,
|
|
909
|
+
.${t}-wrapper.${t}-state-focus .${t}-submitBtn .${t}-submitBtnIcon {
|
|
910
|
+
background-color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
911
911
|
}
|
|
912
|
-
.${
|
|
913
|
-
background-color: var(--${
|
|
912
|
+
.${t}-wrapper.${t}-state-filled .${t}-submitBtn .${t}-submitBtnIcon {
|
|
913
|
+
background-color: var(--${t}-filled-button-text-color, var(--${t}-button-text-color));
|
|
914
914
|
}
|
|
915
|
-
.${
|
|
916
|
-
.${
|
|
915
|
+
.${t}-wrapper.${t}-state-success .${t}-input,
|
|
916
|
+
.${t}-wrapper.${t}-state-success .${t}-submitBtn {
|
|
917
917
|
pointer-events: none;
|
|
918
918
|
}
|
|
919
|
-
.${
|
|
919
|
+
.${t}-overlayAnchor {
|
|
920
920
|
position: relative;
|
|
921
921
|
display: flex;
|
|
922
922
|
align-items: center;
|
|
923
923
|
}
|
|
924
|
-
.${
|
|
925
|
-
margin-top: ${
|
|
926
|
-
font-size: ${
|
|
927
|
-
color: var(--${
|
|
924
|
+
.${t}-success {
|
|
925
|
+
margin-top: ${Wn(8)};
|
|
926
|
+
font-size: ${Wn(14)};
|
|
927
|
+
color: var(--${t}-success-success-color, var(--${t}-success-color));
|
|
928
928
|
}
|
|
929
|
-
.${
|
|
930
|
-
margin-top: ${
|
|
931
|
-
font-size: ${
|
|
932
|
-
color: var(--${
|
|
929
|
+
.${t}-error {
|
|
930
|
+
margin-top: ${Wn(8)};
|
|
931
|
+
font-size: ${Wn(14)};
|
|
932
|
+
color: var(--${t}-error-error-color, var(--${t}-error-color));
|
|
933
933
|
}
|
|
934
|
-
`}const
|
|
934
|
+
`}const Ml=({settings:t,isEditor:e,metadata:n,activeEvent:o})=>{const{prefix:i}=S.useScopedStyles(),{fields:l=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:r,buttonLabel:s,fieldsToShow:d=1,fontFamily:u,inputFontSettings:c,inputFontSize:L,inputLineHeight:v,inputLetterSpacing:h,inputWordSpacing:p,inputTextAppearance:g,buttonFontSettings:$,buttonFontSize:f,buttonLineHeight:x,buttonLetterSpacing:b,buttonWordSpacing:R,buttonTextAppearance:W,statusFontSettings:_,statusFontSize:y,statusLineHeight:w,statusLetterSpacing:E,statusWordSpacing:H,statusTextAppearance:F,iconMaxWidth:O,minHeight:z,corners:V,stroke:K,stateOverrides:C,inputPadding:k,buttonPadding:I,successMessage:A="Thanks for subscribing!",errorMessage:P="Please, fill all required fields."}=t,N=l.slice(0,Math.min(d,l.length)),[Q,st]=m.useState(()=>Object.fromEntries(N.map(St=>[St.name,""]))),[ot,ut]=m.useState("idle"),[M,J]=m.useState(null),ht=o==="success"?"success":o==="error"?"error":ot,pt=o==="error"?P:M,gt=o==="filled",D=m.useMemo(()=>{if(!gt)return Q;let St=null;for(const At of N)(Q[At.name]??"").trim().length>0||(St=St??{...Q},St[At.name]="Filled");return St??Q},[gt,Q,N]),at=ht==="error"?S.getFormFieldValidationError(N,D):null,B=o&&o!=="default"?`${i}-state-${o}`:"",T=N.some(St=>(D[St.name]??"").trim().length>0),U=B!==`${i}-state-filled`&&T?`${i}-state-filled`:"",q=`${B} ${U}`.trim(),Z=n==null?void 0:n.submitUrl,it=s??"",rt=(r==null?void 0:r.icon)??"",et=(r==null?void 0:r.mode)==="On",dt=it||"Submit",j={fontSettings:{fontFamily:u,fontWeight:(c==null?void 0:c.fontWeight)??400,fontStyle:(c==null?void 0:c.fontStyle)??"normal"},fontSize:L??.01,lineHeight:v,letterSpacing:h??0,wordSpacing:p??0,textAppearance:g,color:t.inputTextColor??"#111111"},X={fontSettings:{fontFamily:u,fontWeight:($==null?void 0:$.fontWeight)??400,fontStyle:($==null?void 0:$.fontStyle)??"normal"},fontSize:f??.01,lineHeight:x,letterSpacing:b??0,wordSpacing:R??0,textAppearance:W,color:t.buttonTextColor??"#ffffff"},Y={fontSettings:{fontFamily:u,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:y??.01,lineHeight:w,letterSpacing:E??0,wordSpacing:H??0,textAppearance:F,color:t.successColor??"#22c55e"},lt=pe(Vt(j,e)),nt=pe(Vt(X,e)),ct=pe(Vt(Y,e)),Ct=S.buildColorVars(i,{strokeColor:t.strokeColor,inputColor:t.inputColor,placeholderColor:t.placeholderColor,buttonColor:t.buttonColor,successColor:t.successColor,errorColor:t.errorColor,inputTextColor:t.inputTextColor??(j==null?void 0:j.color)??"#111111",buttonTextColor:t.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},Ol,Nl,C),Lt={borderRadius:S.scalingValue(V,e),borderWidth:S.scalingValue(K,e),borderStyle:"solid"},Pt={borderLeftWidth:S.scalingValue(K,e)},Dt=async St=>{St.preventDefault();const At=Object.fromEntries(N.map(yt=>{var Wt;return[yt.name,((Wt=Q[yt.name])==null?void 0:Wt.trim())??""]}).filter(([,yt])=>yt));if(!Z){ut("error"),J("No integrations were found for this form.");return}if(Object.keys(At).length===0)return;const Kt=S.getFormFieldValidationError(N,Q);if(Kt){ut("error"),J(Kt);return}ut("submitting"),J(null);try{const yt=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(At)});if(!yt.ok){const Wt=await yt.text();throw new Error(Wt||`Request failed: ${yt.status}`)}ut("success"),st(Object.fromEntries(N.map(Wt=>[Wt.name,""])))}catch(yt){ut("error"),J(yt instanceof Error?yt.message:"Something went wrong")}};return a.jsxs("div",{className:`${i}-wrapper ${q}`.trim(),style:Ct,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:kl(i)}}),a.jsxs("form",{onSubmit:Dt,className:`${i}-form`,style:{...Lt,height:S.scalingValue(z,e),minHeight:S.scalingValue(z,e)},children:[a.jsx("div",{className:`${i}-inputWrap ${i}-overlayAnchor`,style:{flex:1,minWidth:0},children:N.map(St=>a.jsx("input",{type:St.type==="email"?"email":St.type==="phone"?"tel":"text",name:St.name,autoComplete:"off",value:D[St.name]??"",onChange:At=>st(Kt=>({...Kt,[St.name]:At.target.value})),placeholder:St.placeholder,required:St.isRequired??St.type==="email",className:`${i}-input`,style:{...lt,paddingRight:S.scalingValue(k.right,e),paddingLeft:S.scalingValue(k.left,e),paddingTop:S.scalingValue(k.top,e),paddingBottom:S.scalingValue(k.bottom,e)}},St.name))}),a.jsx("div",{className:`${i}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${i}-submitBtn`,"aria-label":dt,style:{...nt,...Pt,paddingRight:S.scalingValue(I.right,e),paddingLeft:S.scalingValue(I.left,e),paddingTop:S.scalingValue(I.top,e),paddingBottom:S.scalingValue(I.bottom,e)},children:ot==="submitting"?"...":et?rt&&a.jsx(ve,{url:rt,className:`${i}-submitBtnIcon`,style:{maxWidth:S.scalingValue(O??0,e)},fill:`var(--${i}-button-text-color)`,hoverFill:`var(--${i}-button-text-color)`}):it})})]}),ht==="success"&&a.jsx("p",{className:`${i}-success`,style:{...ct},children:A}),ht==="error"&&a.jsx("p",{className:`${i}-error`,style:{...ct},role:"alert",children:at??pt??P})]})},Ol={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"},Nl=["hover","focus","filled","success","error"],Hl=`import React, { useMemo, useState } from 'react';
|
|
935
935
|
import { CommonComponentProps } from '../props';
|
|
936
936
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
937
937
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1503,24 +1503,24 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1503
1503
|
};
|
|
1504
1504
|
|
|
1505
1505
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1506
|
-
`,Vs="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>'),Hs=[{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."}],$n={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},js=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],zs={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Input Fill",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 Text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",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:{...$n.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:{...$n.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:{...$n.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:Hs,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Vs},fontFamily:"Arial",strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#0088D7",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:0,corners:0,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},d:{minHeight:.028,iconMaxWidth:.028,stroke:0,corners:0,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__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonIcon"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...js],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"]},Os={element:Ms,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:zs,sourceCode:Ns};function To(e){return`
|
|
1507
|
-
.${
|
|
1506
|
+
`,Bl="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>'),zl=[{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."}],mo={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Dl=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],jl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Input Fill",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 Text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",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:{...mo.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:{...mo.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:{...mo.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:zl,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Bl},fontFamily:"Arial",strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#0088D7",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:0,corners:0,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},d:{minHeight:.028,iconMaxWidth:.028,stroke:0,corners:0,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__","fieldsToShow"]},{type:"row",items:["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:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Dl],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"]},Vl={element:Ml,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:jl,sourceCode:Hl};function vi(t){return`
|
|
1507
|
+
.${t}-marquee-wrapper {
|
|
1508
1508
|
overflow: hidden;
|
|
1509
1509
|
width: 100%;
|
|
1510
1510
|
height: auto;
|
|
1511
1511
|
}
|
|
1512
1512
|
|
|
1513
|
-
@keyframes ${
|
|
1513
|
+
@keyframes ${t}-marquee-left {
|
|
1514
1514
|
from { transform: translate3d(0, 0, 0); }
|
|
1515
1515
|
to { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1516
1516
|
}
|
|
1517
1517
|
|
|
1518
|
-
@keyframes ${
|
|
1518
|
+
@keyframes ${t}-marquee-right {
|
|
1519
1519
|
from { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1520
1520
|
to { transform: translate3d(0, 0, 0); }
|
|
1521
1521
|
}
|
|
1522
1522
|
|
|
1523
|
-
.${
|
|
1523
|
+
.${t}-marquee-track {
|
|
1524
1524
|
display: flex;
|
|
1525
1525
|
flex-direction: row;
|
|
1526
1526
|
width: max-content;
|
|
@@ -1536,28 +1536,28 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1536
1536
|
animation-play-state: var(--marquee-play-state, running);
|
|
1537
1537
|
}
|
|
1538
1538
|
|
|
1539
|
-
.${
|
|
1540
|
-
animation-name: ${
|
|
1539
|
+
.${t}-marquee-track[data-direction="left"] {
|
|
1540
|
+
animation-name: ${t}-marquee-left;
|
|
1541
1541
|
}
|
|
1542
1542
|
|
|
1543
|
-
.${
|
|
1544
|
-
animation-name: ${
|
|
1543
|
+
.${t}-marquee-track[data-direction="right"] {
|
|
1544
|
+
animation-name: ${t}-marquee-right;
|
|
1545
1545
|
}
|
|
1546
1546
|
|
|
1547
|
-
.${
|
|
1547
|
+
.${t}-marquee-set {
|
|
1548
1548
|
display: flex;
|
|
1549
1549
|
flex-direction: row;
|
|
1550
1550
|
flex: 0 0 auto;
|
|
1551
1551
|
}
|
|
1552
1552
|
|
|
1553
|
-
.${
|
|
1553
|
+
.${t}-wrapper {
|
|
1554
1554
|
position: relative;
|
|
1555
1555
|
width: 100%;
|
|
1556
1556
|
height: 100%;
|
|
1557
1557
|
order: 1;
|
|
1558
1558
|
}
|
|
1559
1559
|
|
|
1560
|
-
.${
|
|
1560
|
+
.${t}-cover {
|
|
1561
1561
|
position: absolute;
|
|
1562
1562
|
width: 100%;
|
|
1563
1563
|
height: 100%;
|
|
@@ -1565,7 +1565,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1565
1565
|
left: 0;
|
|
1566
1566
|
}
|
|
1567
1567
|
|
|
1568
|
-
.${
|
|
1568
|
+
.${t}-elements-overlay {
|
|
1569
1569
|
position: relative;
|
|
1570
1570
|
inset: 0;
|
|
1571
1571
|
display: flex;
|
|
@@ -1573,13 +1573,13 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1573
1573
|
pointer-events: none;
|
|
1574
1574
|
}
|
|
1575
1575
|
|
|
1576
|
-
.${
|
|
1576
|
+
.${t}-control {
|
|
1577
1577
|
position: relative;
|
|
1578
1578
|
z-index: 2;
|
|
1579
1579
|
width: 100%;
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
-
.${
|
|
1582
|
+
.${t}-control::before {
|
|
1583
1583
|
content: "";
|
|
1584
1584
|
position: absolute;
|
|
1585
1585
|
top: 0;
|
|
@@ -1590,7 +1590,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1590
1590
|
pointer-events: auto;
|
|
1591
1591
|
z-index: 10;
|
|
1592
1592
|
}
|
|
1593
|
-
`}const
|
|
1593
|
+
`}const Kl=30,Ul=({settings:t,content:e,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=S.useScopedStyles(),{autoplay:l,align:r,speed:s,direction:d,pauseOnHover:u,gap:c,cardWidth:L,corners:v,stroke:h,strokeColor:p,bgColor:g,padding:$,logoMarginTop:f,logoWidth:x,logoHeight:b,captionMarginTop:R}=t,W=l==="on"&&!o,_=W,y=Math.max(0,s)*Kl,w=j=>S.scalingValue(j,n??!1),E=m.useRef(null),H=m.useRef(null),F=m.useRef(null),[O,z]=m.useState(0),[V,K]=m.useState(0),[C,k]=m.useState(0),I=_&&u==="on",[A,P]=m.useState(!1),N=m.useRef(null),[Q,st]=m.useState(0),[ot,ut]=m.useState(0),M=m.useRef(null),J=j=>{var Y,lt,nt,ct,Ct;return{fontSettings:{fontFamily:(t==null?void 0:t[`${j}FontFamily`])??"Arial",fontWeight:((Y=t==null?void 0:t[`${j}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((lt=t==null?void 0:t[`${j}FontSettings`])==null?void 0:lt.fontStyle)??"normal"},textAppearance:{textTransform:((nt=t==null?void 0:t[`${j}TextAppearance`])==null?void 0:nt.textTransform)??"none",textDecoration:((ct=t==null?void 0:t[`${j}TextAppearance`])==null?void 0:ct.textDecoration)??"none",fontVariant:((Ct=t==null?void 0:t[`${j}TextAppearance`])==null?void 0:Ct.fontVariant)??"normal"},letterSpacing:(t==null?void 0:t[`${j}LetterSpacing`])??0,wordSpacing:(t==null?void 0:t[`${j}WordSpacing`])??0,fontSize:(t==null?void 0:t[`${j}FontSize`])??.01,lineHeight:(t==null?void 0:t[`${j}LineHeight`])??.01,color:(t==null?void 0:t[`${j}Color`])??"#000000"}},ht=J("text"),pt=J("caption"),gt=m.useMemo(()=>((e==null?void 0:e.length)??0)>1&&(e??[]).some(j=>{var X,Y;return(((X=j.text)==null?void 0:X.length)??0)>0||(((Y=j.caption)==null?void 0:Y.length)??0)>0}),[e]),D=m.useMemo(()=>!W||(e==null?void 0:e.length)===0?1:V<=0||O<=0?2:Math.max(2,Math.ceil(O/V)+1),[W,e==null?void 0:e.length,V,O]);m.useLayoutEffect(()=>{if(!W)return;const j=E.current,X=F.current;if(!j||!X)return;let Y=0;const lt=()=>{const Ct=j.getBoundingClientRect().width,Lt=X.getBoundingClientRect().width,Pt=M.current,Dt=typeof Pt=="number"&&Math.abs(Pt-Lt)<=.25;if(M.current=Lt,z(Ct),typeof Lt=="number"&&Lt>0&&V<=0){K(Lt);return}Dt&&Lt!==V?K(Lt):!Dt&&V<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(lt))},nt=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(lt)};nt();const ct=new ResizeObserver(nt);return ct.observe(j),ct.observe(X),()=>{cancelAnimationFrame(Y),ct.disconnect()}},[W,V]),m.useLayoutEffect(()=>{const j=H.current;if(!W||!j||!_)return;const X=V>0?V:0,Y=X>0&&y>0?X/y*1e3:0,lt=`${Math.max(0,Y)/1e3}s`;j.style.setProperty("--marquee-distance",`${X}px`),j.style.setProperty("--marquee-duration",lt)},[W,_,y,V]),m.useLayoutEffect(()=>{if(!W){k(0);return}const j=H.current;if(!j)return;const X=()=>{const lt=j.getBoundingClientRect().height;k(lt>0?lt:0)};X();const Y=new ResizeObserver(X);return Y.observe(j),()=>{Y.disconnect()}},[W,D,e,n,c,L,$,h,v,x,b]);const at=()=>{I&&P(!0)},B=()=>{I&&P(!1)},T=m.useMemo(()=>{switch(r){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[r]),U=m.useMemo(()=>{switch(r){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[r]),q=m.useCallback((j,X,Y,lt)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":lt==null?void 0:lt.controlsName,"data-controls-axis":"y",className:`${i}-control`,style:{height:w((lt==null?void 0:lt.marginTop)??0)}}),a.jsx("div",{...lt!=null&<.dataMeasureKind?{"data-testimonial-measure":lt.dataMeasureKind}:{},style:{...Vt(j,n),textAlign:U,pointerEvents:"auto",...typeof(lt==null?void 0:lt.minHeightPx)=="number"&<.minHeightPx>0?{minHeight:lt.minHeightPx}:{}},children:a.jsx(un,{content:X})})]},Y),[T,U,n]),Z=m.useCallback((j,X,Y)=>{var lt,nt,ct;return a.jsxs("div",{style:{padding:`${w($.top)} ${w($.right)} ${w($.bottom)} ${w($.left)}`,width:w(L+h*2),height:"100%",borderRadius:w(v),border:`${w(h)} solid ${p}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${i}-cover`,style:{background:g}}),a.jsxs("div",{className:`${i}-elements-overlay`,style:{alignItems:T,textAlign:U},children:[j.text&&q(ht,j.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${i}-control`,style:{height:w(f)}}),a.jsx("div",{style:{width:w(x),height:w(b)},children:((lt=j.logo)==null?void 0:lt.url)&&a.jsx("img",{src:j.logo.url,alt:((nt=j.logo)==null?void 0:nt.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ct=j.logo)==null?void 0:ct.objectFit)||"contain"}})})]}),j.caption&&q(pt,j.caption,"caption",{controlsName:"captionMarginTop",marginTop:R,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},X)},[g,R,pt,L,v,b,f,x,T,U,$.bottom,$.left,$.right,$.top,q,h,p,ht,n]),it=m.useCallback(j=>{st(j.maxTextPx),ut(j.maxCaptionPx)},[]);m.useLayoutEffect(()=>{if(!gt){it({maxTextPx:0,maxCaptionPx:0});return}const j=N.current;if(!j)return;const X=()=>{S.readTestimonialTextMeasure(j,it)};X();const Y=new ResizeObserver(X);return Y.observe(j),()=>{Y.disconnect()}},[gt,it,e,Z]);const rt=gt?{textMinHeightPx:Q,captionMinHeightPx:ot}:void 0,et=gt?a.jsx("div",{ref:N,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(e??[]).map((j,X)=>Z(j,`measure-${X}`,{dataMeasureAttrs:!0}))}):null,dt=(j,X)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Z(j,`card-${X}`,rt),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${w(c)})`,width:w(c),height:"100%",pointerEvents:"auto",zIndex:2}})]},X);return W&&((e==null?void 0:e.length)??0)>0?a.jsxs("div",{ref:E,className:xt(`${i}-wrapper`,`${i}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...C>0?{height:C}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vi(i)}}),et,a.jsx("div",{ref:H,className:`${i}-marquee-track`,"data-direction":d,onMouseEnter:at,onMouseLeave:B,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...I?{"--marquee-play-state":A?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:D},(j,X)=>a.jsx("div",{ref:X===0?F:void 0,className:`${i}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:w(c),paddingRight:w(c)},"aria-hidden":X>0,children:e==null?void 0:e.map((Y,lt)=>dt(Y,`${X}-${lt}`))},`set-${X}`))})]}):a.jsxs("div",{className:`${i}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vi(i)}}),et,a.jsx("div",{style:{gap:w(c),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:e==null?void 0:e.map((j,X)=>dt(j,X))})]})},Gl=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1594
1594
|
import cn from 'classnames';
|
|
1595
1595
|
import { CommonComponentProps } from '../props';
|
|
1596
1596
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -2186,8 +2186,8 @@ type TestimonialsSettings = {
|
|
|
2186
2186
|
logoHeight: number;
|
|
2187
2187
|
captionMarginTop: number;
|
|
2188
2188
|
};
|
|
2189
|
-
`,
|
|
2190
|
-
.${
|
|
2189
|
+
`,bi={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Yl={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,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",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 color",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG color",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:100,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 color",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption color",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...bi.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:{...bi.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:{autoplay:"on",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:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},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__","autoplay","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__","autoplay"]},{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:[{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"}]}]}]}},ql={element:Ul,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonials.png"},defaultSize:{d:{width:"100%",height:320}},schema:Yl,sourceCode:Gl,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Xl(t){return`
|
|
2190
|
+
.${t}-container {
|
|
2191
2191
|
position: relative;
|
|
2192
2192
|
overflow-x: clip;
|
|
2193
2193
|
display: flex;
|
|
@@ -2196,7 +2196,7 @@ type TestimonialsSettings = {
|
|
|
2196
2196
|
align-items: center;
|
|
2197
2197
|
}
|
|
2198
2198
|
|
|
2199
|
-
.${
|
|
2199
|
+
.${t}-wrapper {
|
|
2200
2200
|
position: relative;
|
|
2201
2201
|
width: 100%;
|
|
2202
2202
|
order: 1;
|
|
@@ -2208,42 +2208,42 @@ type TestimonialsSettings = {
|
|
|
2208
2208
|
height: auto;
|
|
2209
2209
|
}
|
|
2210
2210
|
|
|
2211
|
-
.${
|
|
2211
|
+
.${t}-fade-stack {
|
|
2212
2212
|
position: relative;
|
|
2213
2213
|
width: 100%;
|
|
2214
2214
|
}
|
|
2215
2215
|
|
|
2216
|
-
.${
|
|
2216
|
+
.${t}-fade-item-prev {
|
|
2217
2217
|
position: absolute;
|
|
2218
2218
|
inset: 0;
|
|
2219
2219
|
width: 100%;
|
|
2220
2220
|
height: 100%;
|
|
2221
2221
|
}
|
|
2222
2222
|
|
|
2223
|
-
.${
|
|
2223
|
+
.${t}-fade-item-current {
|
|
2224
2224
|
position: relative;
|
|
2225
2225
|
width: 100%;
|
|
2226
2226
|
}
|
|
2227
2227
|
|
|
2228
|
-
@keyframes ${
|
|
2228
|
+
@keyframes ${t}-testimonial-fade-in {
|
|
2229
2229
|
from { opacity: 0; }
|
|
2230
2230
|
to { opacity: 1; }
|
|
2231
2231
|
}
|
|
2232
2232
|
|
|
2233
|
-
@keyframes ${
|
|
2233
|
+
@keyframes ${t}-testimonial-fade-out {
|
|
2234
2234
|
from { opacity: 1; }
|
|
2235
2235
|
to { opacity: 0; }
|
|
2236
2236
|
}
|
|
2237
2237
|
|
|
2238
|
-
.${
|
|
2239
|
-
animation: ${
|
|
2238
|
+
.${t}-fade-in {
|
|
2239
|
+
animation: ${t}-testimonial-fade-in 300ms ease-in forwards;
|
|
2240
2240
|
}
|
|
2241
2241
|
|
|
2242
|
-
.${
|
|
2243
|
-
animation: ${
|
|
2242
|
+
.${t}-fade-out {
|
|
2243
|
+
animation: ${t}-testimonial-fade-out 300ms ease-in forwards;
|
|
2244
2244
|
}
|
|
2245
2245
|
|
|
2246
|
-
.${
|
|
2246
|
+
.${t}-controls {
|
|
2247
2247
|
position: absolute;
|
|
2248
2248
|
inset: 0;
|
|
2249
2249
|
pointer-events: none;
|
|
@@ -2253,7 +2253,7 @@ type TestimonialsSettings = {
|
|
|
2253
2253
|
justify-content: space-between;
|
|
2254
2254
|
}
|
|
2255
2255
|
|
|
2256
|
-
.${
|
|
2256
|
+
.${t}-arrow {
|
|
2257
2257
|
pointer-events: auto;
|
|
2258
2258
|
position: relative;
|
|
2259
2259
|
display: flex;
|
|
@@ -2265,11 +2265,11 @@ type TestimonialsSettings = {
|
|
|
2265
2265
|
padding: 0;
|
|
2266
2266
|
}
|
|
2267
2267
|
|
|
2268
|
-
.${
|
|
2268
|
+
.${t}-next-arrow {
|
|
2269
2269
|
left: unset;
|
|
2270
2270
|
}
|
|
2271
2271
|
|
|
2272
|
-
.${
|
|
2272
|
+
.${t}-arrow-inner {
|
|
2273
2273
|
all: unset;
|
|
2274
2274
|
cursor: pointer;
|
|
2275
2275
|
width: 100%;
|
|
@@ -2277,25 +2277,25 @@ type TestimonialsSettings = {
|
|
|
2277
2277
|
pointer-events: auto;
|
|
2278
2278
|
}
|
|
2279
2279
|
|
|
2280
|
-
.${
|
|
2280
|
+
.${t}-arrow-img {
|
|
2281
2281
|
position: absolute;
|
|
2282
2282
|
top: 50%;
|
|
2283
2283
|
left: 50%;
|
|
2284
2284
|
transform: translate(-50%, -50%);
|
|
2285
2285
|
}
|
|
2286
2286
|
|
|
2287
|
-
.${
|
|
2287
|
+
.${t}-mirror {
|
|
2288
2288
|
transform: translate(-50%, -50%) scaleX(-1) !important;
|
|
2289
2289
|
}
|
|
2290
2290
|
|
|
2291
|
-
.${
|
|
2291
|
+
.${t}-control {
|
|
2292
2292
|
position: relative;
|
|
2293
2293
|
z-index: 2;
|
|
2294
2294
|
pointer-events: auto;
|
|
2295
2295
|
width: 100%;
|
|
2296
2296
|
}
|
|
2297
2297
|
|
|
2298
|
-
.${
|
|
2298
|
+
.${t}-control::before {
|
|
2299
2299
|
content: "";
|
|
2300
2300
|
position: absolute;
|
|
2301
2301
|
top: 0;
|
|
@@ -2305,12 +2305,12 @@ type TestimonialsSettings = {
|
|
|
2305
2305
|
pointer-events: auto;
|
|
2306
2306
|
z-index: 10;
|
|
2307
2307
|
}
|
|
2308
|
-
.${
|
|
2308
|
+
.${t}-icon {
|
|
2309
2309
|
pointer-events: auto;
|
|
2310
2310
|
width: 100%;
|
|
2311
2311
|
height: 100%;
|
|
2312
2312
|
}
|
|
2313
|
-
`}const
|
|
2313
|
+
`}const Zl=({settings:t,content:e,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=S.useScopedStyles(),l=e||[],{autoplay:r,delay:s,align:d,width:u,imageMarginTop:c,textMarginTop:L,captionMarginTop:v,imageWidth:h,imageHeight:p,controlsWidth:g,controlsColor:$,controlsHoverColor:f}=t,x=r==="on"&&!o,[b,R]=m.useState(0),[W,_]=m.useState(null),[y,w]=m.useState(!1),E=m.useRef(null),H=m.useMemo(()=>{switch(d){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[d]),F=m.useMemo(()=>{switch(d){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[d]);m.useEffect(()=>{R(0),_(null),w(!1)},[l.length]);const O=l[b],z=W===null?null:l[W],V=D=>{var B,T,U,q,Z;return{fontSettings:{fontFamily:(t==null?void 0:t[`${D}FontFamily`])??"Arial",fontWeight:((B=t==null?void 0:t[`${D}FontSettings`])==null?void 0:B.fontWeight)??400,fontStyle:((T=t==null?void 0:t[`${D}FontSettings`])==null?void 0:T.fontStyle)??"normal"},textAppearance:{textTransform:((U=t==null?void 0:t[`${D}TextAppearance`])==null?void 0:U.textTransform)??"none",textDecoration:((q=t==null?void 0:t[`${D}TextAppearance`])==null?void 0:q.textDecoration)??"none",fontVariant:((Z=t==null?void 0:t[`${D}TextAppearance`])==null?void 0:Z.fontVariant)??"normal"},fontSize:(t==null?void 0:t[`${D}FontSize`])??.01,lineHeight:(t==null?void 0:t[`${D}LineHeight`])??.01,letterSpacing:(t==null?void 0:t[`${D}LetterSpacing`])??0,wordSpacing:(t==null?void 0:t[`${D}WordSpacing`])??0,color:(t==null?void 0:t[`${D}Color`])??"#000000"}},K=V("text"),C=V("caption"),k=l.length>1&&l.some(D=>{var at,B;return(((at=D.text)==null?void 0:at.length)??0)>0||(((B=D.caption)==null?void 0:B.length)??0)>0}),I=m.useRef(null),[A,P]=m.useState(0),[N,Q]=m.useState(0),st=t.controls??{mode:"Off",icon:null},ot=l.length>1,ut=m.useCallback((D,at)=>!ot||at===D?D:(E.current&&window.clearTimeout(E.current),_(D),w(!0),E.current=window.setTimeout(()=>{_(null),w(!1),E.current=null},300),at),[ot]),M=m.useCallback(()=>{ot&&R(D=>ut(D,(D-1+l.length)%l.length))},[ot,ut,l.length]),J=m.useCallback(()=>{ot&&R(D=>ut(D,(D+1)%l.length))},[ot,ut,l.length]);m.useEffect(()=>{if(!x||!ot)return;const D=Math.max(300,Number.isFinite(s*1e3)?s*1e3:0),at=window.setInterval(()=>{R(B=>ut(B,(B+1)%l.length))},D);return()=>{window.clearInterval(at)}},[x,ot,ut,l.length,s]),m.useEffect(()=>()=>{E.current&&window.clearTimeout(E.current)},[]);const ht=(D,at)=>{var q,Z,it,rt;const B=at==null?void 0:at.textMinHeightPx,T=at==null?void 0:at.captionMinHeightPx,U=at==null?void 0:at.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[D.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:H,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${i}-control`,style:{height:S.scalingValue(L??0,n??!1)}}),a.jsx("div",{...U&&{"data-testimonial-measure":"text"},style:{...Vt(K,n),...B&&B>0?{minHeight:B}:{},textAlign:F,pointerEvents:"auto"},children:a.jsx(un,{content:D.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:H,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${i}-control`,style:{height:S.scalingValue(c??0,n??!1)}}),a.jsx("div",{style:{width:S.scalingValue(h??0,n??!1),height:S.scalingValue(p??0,n??!1)},children:((q=D.image)==null?void 0:q.url)&&a.jsx("img",{src:(Z=D.image)==null?void 0:Z.url,alt:((it=D.image)==null?void 0:it.name)??"",className:`${i}-icon`,style:{objectFit:((rt=D.image)==null?void 0:rt.objectFit)||"contain"}})})]}),D.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:H,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${i}-control`,style:{height:S.scalingValue(v??0,n??!1)}}),a.jsx("div",{...U?{"data-testimonial-measure":"caption"}:{},style:{...Vt(C,n),...T&&T>0?{minHeight:T}:{},textAlign:F,pointerEvents:"auto"},children:a.jsx(un,{content:D.caption})})]})]})},pt=m.useCallback(D=>{P(D.maxTextPx),Q(D.maxCaptionPx)},[]);if(m.useLayoutEffect(()=>{if(!k){pt({maxTextPx:0,maxCaptionPx:0});return}const D=I.current;if(!D)return;const at=()=>{S.readTestimonialTextMeasure(D,pt)};at();const B=new ResizeObserver(at);return B.observe(D),()=>{B.disconnect()}},[k,pt,e]),!O)return a.jsx(a.Fragment,{});const gt=k?{textMinHeightPx:A,captionMinHeightPx:N}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${i}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Xl(i)}}),a.jsxs("div",{className:`${i}-wrapper`,style:{width:S.scalingValue(u??0,n??!1),alignItems:H},children:[k&&a.jsx("div",{ref:I,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((D,at)=>a.jsx("div",{style:{width:"100%"},children:ht(D,{dataMeasureAttrs:!0})},at))}),a.jsxs("div",{className:`${i}-fade-stack`,children:[z&&y&&a.jsx("div",{className:xt(`${i}-fade-item-prev`,`${i}-fade-out`),children:ht(z,gt)}),a.jsx("div",{className:xt(`${i}-fade-item-current`,y?`${i}-fade-in`:void 0),children:ht(O,gt)})]})]}),st.mode==="On"&&a.jsxs("div",{className:`${i}-controls`,children:[a.jsx("div",{className:`${i}-arrow`,style:{width:S.scalingValue(g??.02,n??!1),height:S.scalingValue(g??.02,n??!1),"--arrow-hover-color":f},children:a.jsx("button",{type:"button",className:`${i}-arrow-inner`,onClick:M,disabled:!ot,"aria-label":"Previous testimonial",children:st.icon&&a.jsx(ve,{url:st.icon,fill:$,hoverFill:f,className:xt(`${i}-arrow-img`,`${i}-mirror`)})})}),a.jsx("div",{className:xt(`${i}-arrow`,`${i}-next-arrow`),style:{width:S.scalingValue(g??.02,n??!1),height:S.scalingValue(g??.02,n??!1),"--arrow-hover-color":f},children:a.jsx("button",{type:"button",className:`${i}-arrow-inner`,onClick:J,disabled:!ot,"aria-label":"Next testimonial",children:st.icon&&a.jsx(ve,{url:st.icon,fill:$,hoverFill:f,className:`${i}-arrow-img`})})})]})]})})},Jl=`import cn from 'classnames';
|
|
2314
2314
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2315
2315
|
import { CommonComponentProps } from '../props';
|
|
2316
2316
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -2802,4 +2802,2941 @@ type TestimonialsSettings = {
|
|
|
2802
2802
|
icon?: string | null;
|
|
2803
2803
|
};
|
|
2804
2804
|
};
|
|
2805
|
-
`,
|
|
2805
|
+
`,Ql="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>'),xi={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},tc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},delay:{type:"number",scope:"layout",title:"Delay(s)",display:{type:"percentage-input"},step:1,min:1,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:100,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:100,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 Color",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:100,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...xi.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 Color"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...xi.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 Color"}},defaults:{autoplay:"on",controls:{mode:"On",icon:Ql},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:"Charter",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{delay:3,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{delay:3,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},displayRules:[{if:{name:"autoplay",value:"off"},then:{name:"properties.delay.display.enabled",value:!1}}],layout:["__componentName__","autoplay","delay","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","delay"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{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"}]}]}]}},ec={element:Zl,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonialsSingle.png"},defaultSize:{d:{width:700,height:300},t:{width:373,height:300},m:{width:334,height:300}},schema:tc,sourceCode:Jl,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function nc(){return window.navigator.platform==="Win32"||window.navigator.platform==="Win64"?'"InputMono-Regular", monospace':'"DepartureMono-Regular", monospace'}function oc(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function ic(t){return`
|
|
2806
|
+
.${t}-wrapper {
|
|
2807
|
+
display: grid;
|
|
2808
|
+
align-items: start;
|
|
2809
|
+
min-height: ${oc(48)};
|
|
2810
|
+
}
|
|
2811
|
+
.${t}-item {
|
|
2812
|
+
display: flex;
|
|
2813
|
+
flex-direction: column;
|
|
2814
|
+
justify-content: center;
|
|
2815
|
+
align-items: center;
|
|
2816
|
+
}
|
|
2817
|
+
.${t}-item-inner {
|
|
2818
|
+
display: flex;
|
|
2819
|
+
flex-direction: column;
|
|
2820
|
+
align-items: center;
|
|
2821
|
+
outline: 1px solid #ccc;
|
|
2822
|
+
}
|
|
2823
|
+
.${t}-item-inner-hidden {
|
|
2824
|
+
display: flex;
|
|
2825
|
+
flex-direction: column;
|
|
2826
|
+
align-items: center;
|
|
2827
|
+
}
|
|
2828
|
+
.${t}-item-image-wrapper {
|
|
2829
|
+
display: flex;
|
|
2830
|
+
justify-content: center;
|
|
2831
|
+
align-items: center;
|
|
2832
|
+
}
|
|
2833
|
+
.${t}-item-image-link {
|
|
2834
|
+
width: 100%;
|
|
2835
|
+
height: 100%;
|
|
2836
|
+
display: flex;
|
|
2837
|
+
flex-direction: column;
|
|
2838
|
+
align-items: center;
|
|
2839
|
+
}
|
|
2840
|
+
.${t}-item-image {
|
|
2841
|
+
width: 100%;
|
|
2842
|
+
height: 100%;
|
|
2843
|
+
display: block;
|
|
2844
|
+
}
|
|
2845
|
+
.${t}-item-slider,
|
|
2846
|
+
.${t}-item-slider .splide__track,
|
|
2847
|
+
.${t}-item-slider .splide__list,
|
|
2848
|
+
.${t}-item-slider .splide__slide {
|
|
2849
|
+
width: 100%;
|
|
2850
|
+
height: 100%;
|
|
2851
|
+
}
|
|
2852
|
+
.${t}-item-slider .splide__slide {
|
|
2853
|
+
display: flex;
|
|
2854
|
+
justify-content: center;
|
|
2855
|
+
align-items: center;
|
|
2856
|
+
}
|
|
2857
|
+
.${t}-item-title {
|
|
2858
|
+
white-space: normal;
|
|
2859
|
+
overflow-wrap: anywhere;
|
|
2860
|
+
word-break: break-word;
|
|
2861
|
+
text-align: center;
|
|
2862
|
+
margin-bottom: 0px;
|
|
2863
|
+
margin-top: 0px;
|
|
2864
|
+
color: var(--${t}-title-color);
|
|
2865
|
+
}
|
|
2866
|
+
.${t}-item-subtitle {
|
|
2867
|
+
white-space: normal;
|
|
2868
|
+
overflow-wrap: anywhere;
|
|
2869
|
+
word-break: break-word;
|
|
2870
|
+
text-align: center;
|
|
2871
|
+
margin-bottom: 0px;
|
|
2872
|
+
margin-top: 0px;
|
|
2873
|
+
color: var(--${t}-subtitle-color);
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
.${t}-control {
|
|
2877
|
+
position: relative;
|
|
2878
|
+
z-index: 2;
|
|
2879
|
+
width: 100%;
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
.${t}-control::before {
|
|
2883
|
+
content: "";
|
|
2884
|
+
position: absolute;
|
|
2885
|
+
top: 0;
|
|
2886
|
+
left: 0;
|
|
2887
|
+
width: 100%;
|
|
2888
|
+
height: 100%;
|
|
2889
|
+
min-height: 20px;
|
|
2890
|
+
pointer-events: auto;
|
|
2891
|
+
z-index: 10;
|
|
2892
|
+
}
|
|
2893
|
+
`}const fe=500,Te="cubic-bezier(0.22, 1, 0.36, 1)";function rc({images:t,index:e,imageDisplay:n,originRect:o,reverseClose:i,onClose:l,onPrev:r,onNext:s}){const d=m.useRef(null),u=m.useRef(null),[c,L]=m.useState(null),[v,h]=m.useState(o?"opening":"open"),[p,g]=m.useState(!0),$=m.useRef(e),f=m.useCallback(()=>{const y=d.current,w=u.current;if(!y||!w)return;const E=y.getBoundingClientRect(),H=E.width,F=E.height,O=w.naturalWidth,z=w.naturalHeight;if(!H||!F||!O||!z)return;if(n==="Cover"){L({width:H,height:F,left:E.left,top:E.top});return}const V=O/z,K=H/F;if(V>K){const C=H/V;L({width:H,height:C,left:E.left,top:E.top+(F-C)/2})}else{const C=F*V;L({width:C,height:F,left:E.left+(H-C)/2,top:E.top})}},[n]);m.useEffect(()=>{f();const y=d.current;if(!y)return;const w=new ResizeObserver(()=>f());return w.observe(y),()=>w.disconnect()},[f,e]),m.useEffect(()=>{if(v!=="opening"||!c)return;const y={id:0};return y.id=requestAnimationFrame(()=>{y.id=requestAnimationFrame(()=>h("open"))}),()=>cancelAnimationFrame(y.id)},[v,c]),m.useEffect(()=>{if(v!=="closing")return;const y=setTimeout(()=>l(),fe);return()=>clearTimeout(y)},[v,l]),m.useEffect(()=>{$.current!==e&&g(!1),$.current=e},[e]);const x=()=>{v!=="closing"&&h("closing")},b=v==="open",R=v==="closing",W=R&&i&&!!o,_=v==="opening"?o??c:W?o:c;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:x,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:b?1:0,transition:`opacity ${fe}ms ${Te}`,pointerEvents:"none"}}),a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:d,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",color:"#E6E6E6",letterSpacing:"-0.6px",lineHeight:"16px",opacity:b?1:0,transition:`opacity ${fe}ms ${Te}`,fontFamily:nc()},children:t.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:e+1}),a.jsx("p",{children:"/"}),a.jsx("p",{children:t.length})]})})]}),_&&a.jsx("img",{ref:u,src:t[e],onLoad:f,style:{position:"fixed",top:_.top,left:_.left,width:_.width,height:_.height,objectFit:n==="Cover"?"cover":"contain",opacity:R&&!W?0:1,transition:R&&!W?`opacity ${fe}ms ${Te}`:W||p?`top ${fe}ms ${Te}, left ${fe}ms ${Te}, width ${fe}ms ${Te}, height ${fe}ms ${Te}`:"none",pointerEvents:"none",zIndex:9998}}),b&&c&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:c.top,left:c.left,width:c.width/2,height:c.height,cursor:"w-resize",zIndex:9999},onClick:y=>{y.stopPropagation(),r()}}),a.jsx("div",{style:{position:"fixed",top:c.top,left:c.left+c.width/2,width:c.width/2,height:c.height,cursor:"e-resize",zIndex:9999},onClick:y=>{y.stopPropagation(),s()}})]})]})}function ac({settings:t,content:e,isEditor:n,isPreviewMode:o,metadata:i,activeEvent:l,layoutId:r}){const{prefix:s}=S.useScopedStyles(),{type:d="A",gridLayout:u,textBoxWidth:c,verticalGap:L,entriesCount:v,lightbox:h,imageDisplay:p,slider:g,sliderTiming:$,direction:f,transition:x,titleMarginTop:b,subtitleMarginTop:R,titleColor:W,subtitleColor:_,titleFontFamily:y,titleFontSettings:w,titleFontSize:E,titleLineHeight:H,titleLetterSpacing:F,titleWordSpacing:O,titleTextAppearance:z,subtitleFontFamily:V,subtitleFontSettings:K,subtitleFontSize:C,subtitleLineHeight:k,subtitleLetterSpacing:I,subtitleWordSpacing:A,subtitleTextAppearance:P}=t,N={fontSettings:{fontFamily:y,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:E??.01,lineHeight:H,letterSpacing:F??0,wordSpacing:O??0,textAppearance:z,color:W},st={...pe(Vt(N,n))},ot={fontSettings:{fontFamily:V,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:C??.01,lineHeight:k,letterSpacing:I??0,wordSpacing:A??0,textAppearance:P,color:_},M={...pe(Vt(ot,n))},J=S.buildColorVars(s,{titleColor:W,subtitleColor:_},sc,lc),pt=`${l&&l!=="default"?`${s}-state-${l}`:""}`.trim(),gt=v===0?1/0:v,D=(e??[]).slice(0,gt),at=u.entryWidth??.2,B=(p==null?void 0:p.display)==="Cover",T=(p==null?void 0:p.ratioValue)??"1:1",U=(p==null?void 0:p.reversed)??!1,[q,Z]=T.split(":").map(Number),it=U?Z:q,rt=U?q:Z,et=`${it} / ${rt}`,dt=it>=rt,j={objectFit:B?"cover":"contain",...B&&{aspectRatio:et,width:dt?"100%":"auto",height:dt?"auto":"100%"}},[X,Y]=m.useState("ltr"),[lt,nt]=m.useState(0),ct=m.useRef(null);m.useEffect(()=>{const $t=ct.current;if(!$t)return;const Mt=new ResizeObserver(kt=>{nt(Math.round(kt[0].contentRect.width))});return Mt.observe($t),()=>Mt.disconnect()},[]);const[Ct,Lt]=m.useState(!1),[Pt,Dt]=m.useState([]),[St,At]=m.useState(0),[Kt,yt]=m.useState(null),Wt=($t,Mt,kt)=>{if(h==="Off")return;const Rt=$t.currentTarget.getBoundingClientRect();yt({top:Rt.top,left:Rt.left,width:Rt.width,height:Rt.height}),Dt(Mt),At(kt),Lt(!0)};return m.useEffect(()=>{if(!Ct||h!=="On"||typeof document>"u")return;const $t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=$t}},[Ct,h]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ic(s)}}),a.jsx("div",{style:J,children:a.jsx("div",{ref:ct,className:`${s}-wrapper ${s}-type-${d} ${pt}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:S.scalingValue(L??0,n),columnGap:S.scalingValue(u.horizontalGap??0,n),width:S.scalingValue(u.wrapperWidth??0,n)},children:D.map(($t,Mt)=>{var kt,Rt;return a.jsx("div",{className:`${s}-item`.trim(),children:a.jsx("div",{className:o?`${s}-item-inner`:`${s}-item-inner-hidden`,style:{width:(c??0)>100?`calc(${S.scalingValue(at??0,n)} * (${c} / 100))`:S.scalingValue(at??0,n)},children:a.jsxs("a",{href:(((kt=$t.link)==null?void 0:kt.length)??0)>0&&h==="Off"?$t.link:void 0,target:"_blank",className:`${s}-item-image-link`,children:[a.jsx("div",{className:`${s}-item-image-wrapper`,style:{width:S.scalingValue(at??0,n),height:S.scalingValue(at??0,n)},children:(((Rt=$t.image)==null?void 0:Rt.length)??0)===0?null:g==="Off"?a.jsx("img",{src:$t.image[0].url,alt:$t.image[0].name,className:`${s}-item-image`.trim(),style:j,onClick:It=>Wt(It,$t.image.map(Ut=>Ut.url),0)}):a.jsx(Ko,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:$*1e3,width:"100%",height:"100%",speed:500,type:x==="Fade"?"fade":"loop",rewind:x==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:x==="Fade"?"ltr":f!=="Random"?f==="Horizontal"?"ltr":"ttb":X},onMoved:It=>{if(f!=="Random"||x==="Fade")return;const Ut=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";Y(Ut),setTimeout(()=>{It.refresh()},0)},children:$t.image.map((It,Ut)=>a.jsx(Uo,{children:a.jsx("img",{src:It.url,alt:It.name,className:`${s}-item-image`.trim(),style:j,onClick:oe=>Wt(oe,$t.image.map(Jt=>Jt.url),Ut)})},Ut))},`${x}-${at}-${f}-${$}-${lt}-${r}`)}),a.jsx("div",{"data-controls":"titleMarginTop",className:`${s}-control`,style:{height:S.scalingValue(b??0,n),width:S.scalingValue(at*c/100,n)}}),a.jsx("p",{className:`${s}-item-title`.trim(),style:{width:`calc(${S.scalingValue(at??0,n)} * (${c} / 100))`,...st},children:$t.title}),d==="B"&&a.jsx("div",{"data-controls":"subtitleMarginTop",className:`${s}-control`,style:{height:S.scalingValue(R??0,n),width:S.scalingValue(at*c/100,n)}}),d==="B"&&a.jsx("p",{className:`${s}-item-subtitle`.trim(),style:{width:`calc(${S.scalingValue(at??0,n)} * (${c} / 100))`,...M},children:$t.subtitle})]})})},Mt)})})}),Ct&&typeof document&&document.getElementById("grid-component-lightbox-portal")&&h==="On"&&_i.createPortal(a.jsx("div",{"data-selection":"none",children:a.jsx(rc,{images:Pt,index:St,imageDisplay:p.display,originRect:Kt,reverseClose:g==="Off",onClose:()=>Lt(!1),onPrev:()=>At($t=>($t-1+Pt.length)%Pt.length),onNext:()=>At($t=>($t+1)%Pt.length)})}),document.body)]})}const sc={titleColor:"title-color",subtitleColor:"subtitle-color"},lc=["hover","focus","filled","success","error"],cc=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
2894
|
+
import '@splidejs/react-splide/css/core';
|
|
2895
|
+
import { CommonComponentProps } from '../props';
|
|
2896
|
+
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
2897
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2898
|
+
import { createPortal } from 'react-dom';
|
|
2899
|
+
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
2900
|
+
import { getFontBasedOnSystem } from '../utils/getMainFontBaseOnSystem';
|
|
2901
|
+
|
|
2902
|
+
function sv(px: number): string {
|
|
2903
|
+
return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
function getCSS(P: string): string {
|
|
2907
|
+
return \`
|
|
2908
|
+
.\${P}-wrapper {
|
|
2909
|
+
display: grid;
|
|
2910
|
+
align-items: start;
|
|
2911
|
+
min-height: \${sv(48)};
|
|
2912
|
+
}
|
|
2913
|
+
.\${P}-item {
|
|
2914
|
+
display: flex;
|
|
2915
|
+
flex-direction: column;
|
|
2916
|
+
justify-content: center;
|
|
2917
|
+
align-items: center;
|
|
2918
|
+
}
|
|
2919
|
+
.\${P}-item-inner {
|
|
2920
|
+
display: flex;
|
|
2921
|
+
flex-direction: column;
|
|
2922
|
+
align-items: center;
|
|
2923
|
+
outline: 1px solid #ccc;
|
|
2924
|
+
}
|
|
2925
|
+
.\${P}-item-inner-hidden {
|
|
2926
|
+
display: flex;
|
|
2927
|
+
flex-direction: column;
|
|
2928
|
+
align-items: center;
|
|
2929
|
+
}
|
|
2930
|
+
.\${P}-item-image-wrapper {
|
|
2931
|
+
display: flex;
|
|
2932
|
+
justify-content: center;
|
|
2933
|
+
align-items: center;
|
|
2934
|
+
}
|
|
2935
|
+
.\${P}-item-image-link {
|
|
2936
|
+
width: 100%;
|
|
2937
|
+
height: 100%;
|
|
2938
|
+
display: flex;
|
|
2939
|
+
flex-direction: column;
|
|
2940
|
+
align-items: center;
|
|
2941
|
+
}
|
|
2942
|
+
.\${P}-item-image {
|
|
2943
|
+
width: 100%;
|
|
2944
|
+
height: 100%;
|
|
2945
|
+
display: block;
|
|
2946
|
+
}
|
|
2947
|
+
.\${P}-item-slider,
|
|
2948
|
+
.\${P}-item-slider .splide__track,
|
|
2949
|
+
.\${P}-item-slider .splide__list,
|
|
2950
|
+
.\${P}-item-slider .splide__slide {
|
|
2951
|
+
width: 100%;
|
|
2952
|
+
height: 100%;
|
|
2953
|
+
}
|
|
2954
|
+
.\${P}-item-slider .splide__slide {
|
|
2955
|
+
display: flex;
|
|
2956
|
+
justify-content: center;
|
|
2957
|
+
align-items: center;
|
|
2958
|
+
}
|
|
2959
|
+
.\${P}-item-title {
|
|
2960
|
+
white-space: normal;
|
|
2961
|
+
overflow-wrap: anywhere;
|
|
2962
|
+
word-break: break-word;
|
|
2963
|
+
text-align: center;
|
|
2964
|
+
margin-bottom: 0px;
|
|
2965
|
+
margin-top: 0px;
|
|
2966
|
+
color: var(--\${P}-title-color);
|
|
2967
|
+
}
|
|
2968
|
+
.\${P}-item-subtitle {
|
|
2969
|
+
white-space: normal;
|
|
2970
|
+
overflow-wrap: anywhere;
|
|
2971
|
+
word-break: break-word;
|
|
2972
|
+
text-align: center;
|
|
2973
|
+
margin-bottom: 0px;
|
|
2974
|
+
margin-top: 0px;
|
|
2975
|
+
color: var(--\${P}-subtitle-color);
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
.\${P}-control {
|
|
2979
|
+
position: relative;
|
|
2980
|
+
z-index: 2;
|
|
2981
|
+
width: 100%;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
.\${P}-control::before {
|
|
2985
|
+
content: "";
|
|
2986
|
+
position: absolute;
|
|
2987
|
+
top: 0;
|
|
2988
|
+
left: 0;
|
|
2989
|
+
width: 100%;
|
|
2990
|
+
height: 100%;
|
|
2991
|
+
min-height: 20px;
|
|
2992
|
+
pointer-events: auto;
|
|
2993
|
+
z-index: 10;
|
|
2994
|
+
}
|
|
2995
|
+
\`;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
type GridProps = {
|
|
2999
|
+
layoutId?: string;
|
|
3000
|
+
settings: GridSettings;
|
|
3001
|
+
content?: any;
|
|
3002
|
+
isEditor?: boolean;
|
|
3003
|
+
isPreviewMode?: boolean;
|
|
3004
|
+
activeEvent: string | undefined;
|
|
3005
|
+
onUpdateSettings?: (settings: GridSettings) => void;
|
|
3006
|
+
} & CommonComponentProps;
|
|
3007
|
+
|
|
3008
|
+
type AnimRect = { top: number; left: number; width: number; height: number };
|
|
3009
|
+
|
|
3010
|
+
type LightboxProps = {
|
|
3011
|
+
images: string[];
|
|
3012
|
+
index: number;
|
|
3013
|
+
imageDisplay: 'Fit' | 'Cover';
|
|
3014
|
+
originRect: AnimRect | null;
|
|
3015
|
+
reverseClose: boolean;
|
|
3016
|
+
onClose: () => void;
|
|
3017
|
+
onPrev: () => void;
|
|
3018
|
+
onNext: () => void;
|
|
3019
|
+
};
|
|
3020
|
+
|
|
3021
|
+
const LIGHTBOX_ANIM_MS = 500;
|
|
3022
|
+
const LIGHTBOX_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';
|
|
3023
|
+
|
|
3024
|
+
function Lightbox({ images, index, imageDisplay, originRect, reverseClose, onClose, onPrev, onNext }: LightboxProps) {
|
|
3025
|
+
const ghostRef = useRef<HTMLDivElement>(null);
|
|
3026
|
+
const imgRef = useRef<HTMLImageElement>(null);
|
|
3027
|
+
const [finalRect, setFinalRect] = useState<AnimRect | null>(null);
|
|
3028
|
+
const [phase, setPhase] = useState<'opening' | 'open' | 'closing'>(originRect ? 'opening' : 'open');
|
|
3029
|
+
const [transitionsEnabled, setTransitionsEnabled] = useState(true);
|
|
3030
|
+
const prevIndexRef = useRef(index);
|
|
3031
|
+
|
|
3032
|
+
const computeFinalRect = useCallback(() => {
|
|
3033
|
+
const ghost = ghostRef.current;
|
|
3034
|
+
const img = imgRef.current;
|
|
3035
|
+
if (!ghost || !img) return;
|
|
3036
|
+
const cb = ghost.getBoundingClientRect();
|
|
3037
|
+
const cw = cb.width;
|
|
3038
|
+
const ch = cb.height;
|
|
3039
|
+
const nw = img.naturalWidth;
|
|
3040
|
+
const nh = img.naturalHeight;
|
|
3041
|
+
if (!cw || !ch || !nw || !nh) return;
|
|
3042
|
+
if (imageDisplay === 'Cover') {
|
|
3043
|
+
setFinalRect({ width: cw, height: ch, left: cb.left, top: cb.top });
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
3046
|
+
const ir = nw / nh;
|
|
3047
|
+
const cr = cw / ch;
|
|
3048
|
+
if (ir > cr) {
|
|
3049
|
+
const dh = cw / ir;
|
|
3050
|
+
setFinalRect({ width: cw, height: dh, left: cb.left, top: cb.top + (ch - dh) / 2 });
|
|
3051
|
+
} else {
|
|
3052
|
+
const dw = ch * ir;
|
|
3053
|
+
setFinalRect({ width: dw, height: ch, left: cb.left + (cw - dw) / 2, top: cb.top });
|
|
3054
|
+
}
|
|
3055
|
+
}, [imageDisplay]);
|
|
3056
|
+
|
|
3057
|
+
useEffect(() => {
|
|
3058
|
+
computeFinalRect();
|
|
3059
|
+
const c = ghostRef.current;
|
|
3060
|
+
if (!c) return;
|
|
3061
|
+
const ro = new ResizeObserver(() => computeFinalRect());
|
|
3062
|
+
ro.observe(c);
|
|
3063
|
+
return () => ro.disconnect();
|
|
3064
|
+
}, [computeFinalRect, index]);
|
|
3065
|
+
|
|
3066
|
+
useEffect(() => {
|
|
3067
|
+
if (phase !== 'opening' || !finalRect) return;
|
|
3068
|
+
const handle = { id: 0 };
|
|
3069
|
+
handle.id = requestAnimationFrame(() => {
|
|
3070
|
+
handle.id = requestAnimationFrame(() => setPhase('open'));
|
|
3071
|
+
});
|
|
3072
|
+
return () => cancelAnimationFrame(handle.id);
|
|
3073
|
+
}, [phase, finalRect]);
|
|
3074
|
+
|
|
3075
|
+
useEffect(() => {
|
|
3076
|
+
if (phase !== 'closing') return;
|
|
3077
|
+
const t = setTimeout(() => onClose(), LIGHTBOX_ANIM_MS);
|
|
3078
|
+
return () => clearTimeout(t);
|
|
3079
|
+
}, [phase, onClose]);
|
|
3080
|
+
|
|
3081
|
+
useEffect(() => {
|
|
3082
|
+
if (prevIndexRef.current !== index) {
|
|
3083
|
+
setTransitionsEnabled(false);
|
|
3084
|
+
}
|
|
3085
|
+
prevIndexRef.current = index;
|
|
3086
|
+
}, [index]);
|
|
3087
|
+
|
|
3088
|
+
const handleClose = () => {
|
|
3089
|
+
if (phase === 'closing') return;
|
|
3090
|
+
setPhase('closing');
|
|
3091
|
+
};
|
|
3092
|
+
|
|
3093
|
+
const isOpen = phase === 'open';
|
|
3094
|
+
const isClosing = phase === 'closing';
|
|
3095
|
+
const reverseAnimateClose = isClosing && reverseClose && !!originRect;
|
|
3096
|
+
const animatedRect = phase === 'opening'
|
|
3097
|
+
? (originRect ?? finalRect)
|
|
3098
|
+
: reverseAnimateClose
|
|
3099
|
+
? originRect
|
|
3100
|
+
: finalRect;
|
|
3101
|
+
|
|
3102
|
+
return (
|
|
3103
|
+
<div
|
|
3104
|
+
style={{
|
|
3105
|
+
position: 'fixed',
|
|
3106
|
+
top: 0,
|
|
3107
|
+
left: 0,
|
|
3108
|
+
width: '100vw',
|
|
3109
|
+
height: '100vh',
|
|
3110
|
+
zIndex: 9997,
|
|
3111
|
+
}}
|
|
3112
|
+
onClick={handleClose}
|
|
3113
|
+
>
|
|
3114
|
+
<div
|
|
3115
|
+
style={{
|
|
3116
|
+
position: 'absolute',
|
|
3117
|
+
inset: 0,
|
|
3118
|
+
background: 'rgba(28,31,34,0.9)',
|
|
3119
|
+
opacity: isOpen ? 1 : 0,
|
|
3120
|
+
transition: \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`,
|
|
3121
|
+
pointerEvents: 'none',
|
|
3122
|
+
}}
|
|
3123
|
+
/>
|
|
3124
|
+
<div
|
|
3125
|
+
style={{
|
|
3126
|
+
position: 'relative',
|
|
3127
|
+
width: '100%',
|
|
3128
|
+
height: '100%',
|
|
3129
|
+
display: 'flex',
|
|
3130
|
+
flexDirection: 'column',
|
|
3131
|
+
alignItems: 'center',
|
|
3132
|
+
justifyContent: 'center',
|
|
3133
|
+
}}
|
|
3134
|
+
>
|
|
3135
|
+
<div style={{ height: '10%' }}></div>
|
|
3136
|
+
<div
|
|
3137
|
+
style={{
|
|
3138
|
+
width: '70%',
|
|
3139
|
+
height: '80%',
|
|
3140
|
+
display: 'flex',
|
|
3141
|
+
justifyContent: 'center',
|
|
3142
|
+
alignItems: 'center'
|
|
3143
|
+
}}>
|
|
3144
|
+
<div ref={ghostRef} style={{ width: '100%', height: '100%' }} />
|
|
3145
|
+
</div>
|
|
3146
|
+
<div
|
|
3147
|
+
style={{
|
|
3148
|
+
display: 'flex',
|
|
3149
|
+
flexDirection: 'row',
|
|
3150
|
+
justifyContent: 'center',
|
|
3151
|
+
alignItems: 'center',
|
|
3152
|
+
height: '10%',
|
|
3153
|
+
color: '#E6E6E6',
|
|
3154
|
+
letterSpacing: '-0.6px',
|
|
3155
|
+
lineHeight: '16px',
|
|
3156
|
+
opacity: isOpen ? 1 : 0,
|
|
3157
|
+
transition: \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`,
|
|
3158
|
+
fontFamily: getFontBasedOnSystem(),
|
|
3159
|
+
}}
|
|
3160
|
+
>
|
|
3161
|
+
{images.length > 1 &&
|
|
3162
|
+
<>
|
|
3163
|
+
<p>{index + 1}</p>
|
|
3164
|
+
<p>/</p>
|
|
3165
|
+
<p>{images.length}</p>
|
|
3166
|
+
</>
|
|
3167
|
+
}
|
|
3168
|
+
</div>
|
|
3169
|
+
</div>
|
|
3170
|
+
|
|
3171
|
+
{animatedRect && (
|
|
3172
|
+
<img
|
|
3173
|
+
ref={imgRef}
|
|
3174
|
+
src={images[index]}
|
|
3175
|
+
onLoad={computeFinalRect}
|
|
3176
|
+
style={{
|
|
3177
|
+
position: 'fixed',
|
|
3178
|
+
top: animatedRect.top,
|
|
3179
|
+
left: animatedRect.left,
|
|
3180
|
+
width: animatedRect.width,
|
|
3181
|
+
height: animatedRect.height,
|
|
3182
|
+
objectFit: imageDisplay === 'Cover' ? 'cover' : 'contain',
|
|
3183
|
+
opacity: isClosing && !reverseAnimateClose ? 0 : 1,
|
|
3184
|
+
transition: isClosing && !reverseAnimateClose
|
|
3185
|
+
? \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
3186
|
+
: (reverseAnimateClose || transitionsEnabled)
|
|
3187
|
+
? \`top \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}, left \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}, width \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}, height \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
3188
|
+
: 'none',
|
|
3189
|
+
pointerEvents: 'none',
|
|
3190
|
+
zIndex: 9998,
|
|
3191
|
+
}}
|
|
3192
|
+
/>
|
|
3193
|
+
)}
|
|
3194
|
+
|
|
3195
|
+
{isOpen && finalRect && (
|
|
3196
|
+
<>
|
|
3197
|
+
<div
|
|
3198
|
+
style={{
|
|
3199
|
+
position: 'fixed',
|
|
3200
|
+
top: finalRect.top,
|
|
3201
|
+
left: finalRect.left,
|
|
3202
|
+
width: finalRect.width / 2,
|
|
3203
|
+
height: finalRect.height,
|
|
3204
|
+
cursor: 'w-resize',
|
|
3205
|
+
zIndex: 9999,
|
|
3206
|
+
}}
|
|
3207
|
+
onClick={(e) => {
|
|
3208
|
+
e.stopPropagation();
|
|
3209
|
+
onPrev();
|
|
3210
|
+
}}
|
|
3211
|
+
/>
|
|
3212
|
+
<div
|
|
3213
|
+
style={{
|
|
3214
|
+
position: 'fixed',
|
|
3215
|
+
top: finalRect.top,
|
|
3216
|
+
left: finalRect.left + finalRect.width / 2,
|
|
3217
|
+
width: finalRect.width / 2,
|
|
3218
|
+
height: finalRect.height,
|
|
3219
|
+
cursor: 'e-resize',
|
|
3220
|
+
zIndex: 9999,
|
|
3221
|
+
}}
|
|
3222
|
+
onClick={(e) => {
|
|
3223
|
+
e.stopPropagation();
|
|
3224
|
+
onNext();
|
|
3225
|
+
}}
|
|
3226
|
+
/>
|
|
3227
|
+
</>
|
|
3228
|
+
)}
|
|
3229
|
+
</div>
|
|
3230
|
+
);
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
export function Grid({ settings, content, isEditor, isPreviewMode, metadata, activeEvent, layoutId }: GridProps) {
|
|
3234
|
+
const { prefix: P } = useScopedStyles();
|
|
3235
|
+
const {
|
|
3236
|
+
type = 'A',
|
|
3237
|
+
gridLayout,
|
|
3238
|
+
textBoxWidth,
|
|
3239
|
+
verticalGap,
|
|
3240
|
+
entriesCount,
|
|
3241
|
+
lightbox,
|
|
3242
|
+
imageDisplay,
|
|
3243
|
+
slider,
|
|
3244
|
+
sliderTiming,
|
|
3245
|
+
direction,
|
|
3246
|
+
transition,
|
|
3247
|
+
titleMarginTop,
|
|
3248
|
+
subtitleMarginTop,
|
|
3249
|
+
titleColor,
|
|
3250
|
+
subtitleColor,
|
|
3251
|
+
titleFontFamily,
|
|
3252
|
+
titleFontSettings,
|
|
3253
|
+
titleFontSize,
|
|
3254
|
+
titleLineHeight,
|
|
3255
|
+
titleLetterSpacing,
|
|
3256
|
+
titleWordSpacing,
|
|
3257
|
+
titleTextAppearance,
|
|
3258
|
+
subtitleFontFamily,
|
|
3259
|
+
subtitleFontSettings,
|
|
3260
|
+
subtitleFontSize,
|
|
3261
|
+
subtitleLineHeight,
|
|
3262
|
+
subtitleLetterSpacing,
|
|
3263
|
+
subtitleWordSpacing,
|
|
3264
|
+
subtitleTextAppearance,
|
|
3265
|
+
} = settings;
|
|
3266
|
+
|
|
3267
|
+
const resolvedTitleTextStyle: TextStyles = {
|
|
3268
|
+
fontSettings: {
|
|
3269
|
+
fontFamily: titleFontFamily,
|
|
3270
|
+
fontWeight: titleFontSettings?.fontWeight ?? 400,
|
|
3271
|
+
fontStyle: titleFontSettings?.fontStyle ?? 'normal',
|
|
3272
|
+
},
|
|
3273
|
+
fontSize: titleFontSize ?? 0.01,
|
|
3274
|
+
lineHeight: titleLineHeight,
|
|
3275
|
+
letterSpacing: titleLetterSpacing ?? 0,
|
|
3276
|
+
wordSpacing: titleWordSpacing ?? 0,
|
|
3277
|
+
textAppearance: titleTextAppearance,
|
|
3278
|
+
color: titleColor,
|
|
3279
|
+
};
|
|
3280
|
+
const titleTypographyCss = omitTextColors(textStylesToCss(resolvedTitleTextStyle, isEditor));
|
|
3281
|
+
const titleFieldCss = {
|
|
3282
|
+
...titleTypographyCss,
|
|
3283
|
+
} as React.CSSProperties;
|
|
3284
|
+
|
|
3285
|
+
const resolvedSubtitleTextStyle: TextStyles = {
|
|
3286
|
+
fontSettings: {
|
|
3287
|
+
fontFamily: subtitleFontFamily,
|
|
3288
|
+
fontWeight: subtitleFontSettings?.fontWeight ?? 400,
|
|
3289
|
+
fontStyle: subtitleFontSettings?.fontStyle ?? 'normal',
|
|
3290
|
+
},
|
|
3291
|
+
fontSize: subtitleFontSize ?? 0.01,
|
|
3292
|
+
lineHeight: subtitleLineHeight,
|
|
3293
|
+
letterSpacing: subtitleLetterSpacing ?? 0,
|
|
3294
|
+
wordSpacing: subtitleWordSpacing ?? 0,
|
|
3295
|
+
textAppearance: subtitleTextAppearance,
|
|
3296
|
+
color: subtitleColor,
|
|
3297
|
+
};
|
|
3298
|
+
const subtitleTypographyCss = omitTextColors(textStylesToCss(resolvedSubtitleTextStyle, isEditor));
|
|
3299
|
+
const subtitleFieldCss = {
|
|
3300
|
+
...subtitleTypographyCss,
|
|
3301
|
+
} as React.CSSProperties;
|
|
3302
|
+
|
|
3303
|
+
const colorVars = buildColorVars(P, {
|
|
3304
|
+
titleColor,
|
|
3305
|
+
subtitleColor,
|
|
3306
|
+
}, COLOR_VAR_MAP, STATE_KEYS);
|
|
3307
|
+
|
|
3308
|
+
const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
|
|
3309
|
+
const wrapperStateClasses = \`\${stateClass}\`.trim();
|
|
3310
|
+
|
|
3311
|
+
const resEntriesCount = entriesCount === 0 ? Infinity : entriesCount;
|
|
3312
|
+
|
|
3313
|
+
const cropContent = (content ?? []).slice(0, resEntriesCount);
|
|
3314
|
+
|
|
3315
|
+
const size = gridLayout.entryWidth ?? 0.2;
|
|
3316
|
+
|
|
3317
|
+
const isCover = imageDisplay?.display === 'Cover';
|
|
3318
|
+
const ratioValue = imageDisplay?.ratioValue ?? '1:1';
|
|
3319
|
+
const ratioReversed = imageDisplay?.reversed ?? false;
|
|
3320
|
+
const [rW, rH] = ratioValue.split(':').map(Number);
|
|
3321
|
+
const effW = ratioReversed ? rH : rW;
|
|
3322
|
+
const effH = ratioReversed ? rW : rH;
|
|
3323
|
+
const aspectRatio = \`\${effW} / \${effH}\`;
|
|
3324
|
+
const isLandscape = effW >= effH;
|
|
3325
|
+
|
|
3326
|
+
const imageStyle: React.CSSProperties = {
|
|
3327
|
+
objectFit: isCover ? 'cover' : 'contain',
|
|
3328
|
+
...(isCover && {
|
|
3329
|
+
aspectRatio,
|
|
3330
|
+
width: isLandscape ? '100%' : 'auto',
|
|
3331
|
+
height: isLandscape ? 'auto' : '100%',
|
|
3332
|
+
}),
|
|
3333
|
+
};
|
|
3334
|
+
|
|
3335
|
+
const [dir, setDir] = useState('ltr');
|
|
3336
|
+
const [containerWidth, setContainerWidth] = useState(0);
|
|
3337
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
3338
|
+
|
|
3339
|
+
useEffect(() => {
|
|
3340
|
+
const el = containerRef.current;
|
|
3341
|
+
if (!el) return;
|
|
3342
|
+
const ro = new ResizeObserver((entries) => {
|
|
3343
|
+
setContainerWidth(Math.round(entries[0].contentRect.width));
|
|
3344
|
+
});
|
|
3345
|
+
ro.observe(el);
|
|
3346
|
+
return () => ro.disconnect();
|
|
3347
|
+
}, []);
|
|
3348
|
+
|
|
3349
|
+
const [lightboxOpen, setLightboxOpen] = useState(false);
|
|
3350
|
+
const [lightboxImages, setLightboxImages] = useState<string[]>([]);
|
|
3351
|
+
const [lightboxIndex, setLightboxIndex] = useState(0);
|
|
3352
|
+
const [lightboxOriginRect, setLightboxOriginRect] = useState<AnimRect | null>(null);
|
|
3353
|
+
|
|
3354
|
+
const openLightbox = (e: React.MouseEvent<HTMLImageElement>, urls: string[], idx: number) => {
|
|
3355
|
+
if (lightbox === 'Off') return;
|
|
3356
|
+
const r = e.currentTarget.getBoundingClientRect();
|
|
3357
|
+
setLightboxOriginRect({ top: r.top, left: r.left, width: r.width, height: r.height });
|
|
3358
|
+
setLightboxImages(urls);
|
|
3359
|
+
setLightboxIndex(idx);
|
|
3360
|
+
setLightboxOpen(true);
|
|
3361
|
+
};
|
|
3362
|
+
|
|
3363
|
+
useEffect(() => {
|
|
3364
|
+
if (!lightboxOpen || lightbox !== 'On') return;
|
|
3365
|
+
if (typeof document === 'undefined') return;
|
|
3366
|
+
const prevOverflow = document.body.style.overflow;
|
|
3367
|
+
document.body.style.overflow = 'hidden';
|
|
3368
|
+
return () => {
|
|
3369
|
+
document.body.style.overflow = prevOverflow;
|
|
3370
|
+
};
|
|
3371
|
+
}, [lightboxOpen, lightbox]);
|
|
3372
|
+
|
|
3373
|
+
return (
|
|
3374
|
+
<>
|
|
3375
|
+
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
3376
|
+
<div style={colorVars}>
|
|
3377
|
+
<div
|
|
3378
|
+
ref={containerRef}
|
|
3379
|
+
className={\`\${P}-wrapper \${P}-type-\${type} \${wrapperStateClasses}\`.trim()}
|
|
3380
|
+
style={{
|
|
3381
|
+
gridTemplateColumns: \`repeat(\${gridLayout.columnsCount}, minmax(0, 1fr))\`,
|
|
3382
|
+
rowGap: scalingValue(verticalGap ?? 0, isEditor),
|
|
3383
|
+
columnGap: scalingValue(gridLayout.horizontalGap ?? 0, isEditor),
|
|
3384
|
+
width: scalingValue(gridLayout.wrapperWidth ?? 0, isEditor)
|
|
3385
|
+
}}>
|
|
3386
|
+
{cropContent.map((item: any, index: number) => (
|
|
3387
|
+
<div
|
|
3388
|
+
key={index}
|
|
3389
|
+
className={\`\${P}-item\`.trim()}
|
|
3390
|
+
>
|
|
3391
|
+
<div
|
|
3392
|
+
className={isPreviewMode ? \`\${P}-item-inner\` : \`\${P}-item-inner-hidden\`}
|
|
3393
|
+
style={{ width: (textBoxWidth ?? 0) > 100 ? \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\` : scalingValue(size ?? 0, isEditor) }}
|
|
3394
|
+
>
|
|
3395
|
+
<a href={(item.link?.length ?? 0) > 0 && lightbox === 'Off' ? item.link : undefined} target='_blank' className={\`\${P}-item-image-link\`}>
|
|
3396
|
+
<div className={\`\${P}-item-image-wrapper\`} style={{ width: scalingValue(size ?? 0, isEditor), height: scalingValue(size ?? 0, isEditor) }}>
|
|
3397
|
+
{(item.image?.length ?? 0) === 0
|
|
3398
|
+
? null
|
|
3399
|
+
: slider === 'Off'
|
|
3400
|
+
?
|
|
3401
|
+
<img
|
|
3402
|
+
src={item.image[0].url}
|
|
3403
|
+
alt={item.image[0].name}
|
|
3404
|
+
className={\`\${P}-item-image\`.trim()}
|
|
3405
|
+
style={imageStyle}
|
|
3406
|
+
onClick={(e) => openLightbox(e, item.image.map((i: any) => i.url), 0)}
|
|
3407
|
+
/>
|
|
3408
|
+
:
|
|
3409
|
+
<Splide
|
|
3410
|
+
key={\`\${transition}-\${size}-\${direction}-\${sliderTiming}-\${containerWidth}-\${layoutId}\`}
|
|
3411
|
+
className={\`\${P}-item-slider\`}
|
|
3412
|
+
options={{
|
|
3413
|
+
arrows: false,
|
|
3414
|
+
pagination: false,
|
|
3415
|
+
drag: false,
|
|
3416
|
+
perPage: 1,
|
|
3417
|
+
autoplay: true,
|
|
3418
|
+
interval: sliderTiming * 1000,
|
|
3419
|
+
width: '100%',
|
|
3420
|
+
height: '100%',
|
|
3421
|
+
speed: 500,
|
|
3422
|
+
type: transition === 'Fade' ? 'fade' : 'loop',
|
|
3423
|
+
rewind: transition === 'Fade',
|
|
3424
|
+
pauseOnHover: false,
|
|
3425
|
+
pauseOnFocus: false,
|
|
3426
|
+
direction: transition === 'Fade' ? 'ltr' : direction !== 'Random'
|
|
3427
|
+
? direction === 'Horizontal'
|
|
3428
|
+
? 'ltr'
|
|
3429
|
+
: 'ttb'
|
|
3430
|
+
: dir as 'ltr' | 'ttb' | 'rtl',
|
|
3431
|
+
}}
|
|
3432
|
+
onMoved={(splide) => {
|
|
3433
|
+
if (direction !== 'Random' || transition === 'Fade') return;
|
|
3434
|
+
const next = Math.random() > 0.5 ? Math.random() > 0.5 ? 'rtl' : 'ltr' : Math.random() > 0.5 ? 'btt' : 'ttb';
|
|
3435
|
+
setDir(next);
|
|
3436
|
+
|
|
3437
|
+
setTimeout(() => {
|
|
3438
|
+
splide.refresh();
|
|
3439
|
+
}, 0);
|
|
3440
|
+
}}
|
|
3441
|
+
>
|
|
3442
|
+
{item.image.map((img: { url: string; name?: string }, imgIndex: number) => (
|
|
3443
|
+
<SplideSlide key={imgIndex}>
|
|
3444
|
+
<img
|
|
3445
|
+
src={img.url}
|
|
3446
|
+
alt={img.name}
|
|
3447
|
+
className={\`\${P}-item-image\`.trim()}
|
|
3448
|
+
style={imageStyle}
|
|
3449
|
+
onClick={(e) => openLightbox(e, item.image.map((i: any) => i.url), imgIndex)}
|
|
3450
|
+
/>
|
|
3451
|
+
</SplideSlide>
|
|
3452
|
+
))}
|
|
3453
|
+
</Splide>
|
|
3454
|
+
}
|
|
3455
|
+
</div>
|
|
3456
|
+
<div
|
|
3457
|
+
data-controls="titleMarginTop"
|
|
3458
|
+
className={\`\${P}-control\`}
|
|
3459
|
+
style={{ height: scalingValue(titleMarginTop ?? 0, isEditor), width: scalingValue(size * textBoxWidth / 100, isEditor) }}
|
|
3460
|
+
/>
|
|
3461
|
+
<p className={\`\${P}-item-title\`.trim()} style={{ width: \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`, ...titleFieldCss }}>
|
|
3462
|
+
{item.title}
|
|
3463
|
+
</p>
|
|
3464
|
+
{type === 'B' && <div
|
|
3465
|
+
data-controls="subtitleMarginTop"
|
|
3466
|
+
className={\`\${P}-control\`}
|
|
3467
|
+
style={{ height: scalingValue(subtitleMarginTop ?? 0, isEditor), width: scalingValue(size * textBoxWidth / 100, isEditor) }}
|
|
3468
|
+
/>}
|
|
3469
|
+
{type === 'B' && <p className={\`\${P}-item-subtitle\`.trim()} style={{ width: \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`, ...subtitleFieldCss }}>
|
|
3470
|
+
{item.subtitle}
|
|
3471
|
+
</p>}
|
|
3472
|
+
</a>
|
|
3473
|
+
</div>
|
|
3474
|
+
</div>
|
|
3475
|
+
))}
|
|
3476
|
+
</div>
|
|
3477
|
+
</div>
|
|
3478
|
+
{lightboxOpen && typeof document && document.getElementById("grid-component-lightbox-portal") && lightbox === 'On' &&
|
|
3479
|
+
createPortal(
|
|
3480
|
+
<div data-selection="none">
|
|
3481
|
+
<Lightbox
|
|
3482
|
+
images={lightboxImages}
|
|
3483
|
+
index={lightboxIndex}
|
|
3484
|
+
imageDisplay={imageDisplay.display}
|
|
3485
|
+
originRect={lightboxOriginRect}
|
|
3486
|
+
reverseClose={slider === 'Off'}
|
|
3487
|
+
onClose={() => setLightboxOpen(false)}
|
|
3488
|
+
onPrev={() => setLightboxIndex((prev) => (prev - 1 + lightboxImages.length) % lightboxImages.length)}
|
|
3489
|
+
onNext={() => setLightboxIndex((prev) => (prev + 1) % lightboxImages.length)}
|
|
3490
|
+
/>
|
|
3491
|
+
</div>,
|
|
3492
|
+
document.body
|
|
3493
|
+
)}
|
|
3494
|
+
</>
|
|
3495
|
+
);
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
type GridLayoutConfig = {
|
|
3499
|
+
entryWidth: number;
|
|
3500
|
+
horizontalGap: number;
|
|
3501
|
+
wrapperWidth: number;
|
|
3502
|
+
columnsCount: number;
|
|
3503
|
+
lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
|
|
3504
|
+
};
|
|
3505
|
+
|
|
3506
|
+
type GridSettings = {
|
|
3507
|
+
type: 'A' | 'B';
|
|
3508
|
+
gridLayout: GridLayoutConfig;
|
|
3509
|
+
textBoxWidth: number;
|
|
3510
|
+
verticalGap: number;
|
|
3511
|
+
entriesCount: number;
|
|
3512
|
+
lightbox: 'On' | 'Off';
|
|
3513
|
+
imageDisplay: {
|
|
3514
|
+
display: 'Fit' | 'Cover';
|
|
3515
|
+
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
3516
|
+
reversed: boolean;
|
|
3517
|
+
};
|
|
3518
|
+
slider: 'On' | 'Off';
|
|
3519
|
+
sliderTiming: number;
|
|
3520
|
+
direction: 'Horizontal' | 'Vertical' | 'Random',
|
|
3521
|
+
transition: 'Fade' | 'Slide',
|
|
3522
|
+
titleMarginTop: number;
|
|
3523
|
+
subtitleMarginTop: number;
|
|
3524
|
+
titleColor: string;
|
|
3525
|
+
subtitleColor: string;
|
|
3526
|
+
titleFontFamily: string;
|
|
3527
|
+
titleFontSettings?: { fontWeight: number; fontStyle: string };
|
|
3528
|
+
titleFontSize?: number;
|
|
3529
|
+
titleLineHeight?: number;
|
|
3530
|
+
titleLetterSpacing?: number;
|
|
3531
|
+
titleWordSpacing?: number;
|
|
3532
|
+
titleTextAppearance?: TextStyles['textAppearance'];
|
|
3533
|
+
subtitleFontFamily: string;
|
|
3534
|
+
subtitleFontSettings?: { fontWeight: number; fontStyle: string };
|
|
3535
|
+
subtitleFontSize?: number;
|
|
3536
|
+
subtitleLineHeight?: number;
|
|
3537
|
+
subtitleLetterSpacing?: number;
|
|
3538
|
+
subtitleWordSpacing?: number;
|
|
3539
|
+
subtitleTextAppearance?: TextStyles['textAppearance'];
|
|
3540
|
+
};
|
|
3541
|
+
|
|
3542
|
+
type ColorKeys =
|
|
3543
|
+
| 'titleColor'
|
|
3544
|
+
| 'subtitleColor'
|
|
3545
|
+
|
|
3546
|
+
const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
3547
|
+
titleColor: 'title-color',
|
|
3548
|
+
subtitleColor: 'subtitle-color',
|
|
3549
|
+
};
|
|
3550
|
+
|
|
3551
|
+
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
3552
|
+
`,Ci={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},dc=["titleColor","subtitleColor"],uc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},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"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Title 1",subtitle:"Subtitle 1",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Grid-1.png",objectFit:"cover"}],link:""},{title:"Title 2",subtitle:"Subtitle 2",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Grid-2.png",objectFit:"cover"}],link:""},{title:"Title 3",subtitle:"Subtitle 3",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Grid-3.png",objectFit:"cover"}],link:""}]}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},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:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0,max:200},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},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"}}},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 Color",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Color",display:{type:"palette-color-picker",visible:!1}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ci.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:{...Ci.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"}}},defaults:{lightbox:"Off",imageDisplay:{display:"Fit",ratioValue:"16:9",reversed:!1},type:"A",slider:"Off",sliderTiming:5,direction:"Horizontal",transition:"Slide",titleColor:"#767676",subtitleColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Arial",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.043,titleLineHeight:.043,subtitleFontSize:.0373,subtitleLineHeight:.0373},d:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.01,titleLineHeight:.01,subtitleFontSize:.01,subtitleLineHeight:.01}},displayRules:[{if:{name:"transition",value:"Fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"type",value:"B"},then:{name:"properties.subtitleColor.display.visible",value:!0}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","entriesCount","lightbox","imageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","entriesCount"]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"Image",items:["imageDisplay","lightbox"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","sliderTiming"]},{type:"group",title:"",items:["direction","transition"]}]}]},{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:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]}]}],paletteBookmark:{items:[...dc],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},pc={element:ac,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:uc,sourceCode:cc};function On(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function mc(t){return String(t??"").trim().length>0}function gc(t,e,n,o,i,l,r){const s=S.scalingValue(l,r),d=S.scalingValue(0,r),u=t===0,c=t===e-1&&!i;return{borderTopWidth:u&&n?s:d,borderBottomWidth:!c||o?s:d}}function hc(t,e,n){const o=S.scalingValue(e,n),i=S.scalingValue(0,n);return{borderTopWidth:i,borderBottomWidth:t?o:i}}function fc(t){return`
|
|
3553
|
+
.${t}-wrapper {
|
|
3554
|
+
display: grid;
|
|
3555
|
+
align-items: start;
|
|
3556
|
+
min-height: ${On(48)};
|
|
3557
|
+
position: relative;
|
|
3558
|
+
overflow: visible;
|
|
3559
|
+
box-sizing: border-box;
|
|
3560
|
+
}
|
|
3561
|
+
|
|
3562
|
+
.${t}-hover-image {
|
|
3563
|
+
position: absolute;
|
|
3564
|
+
right: 0;
|
|
3565
|
+
bottom: 0;
|
|
3566
|
+
z-index: 10;
|
|
3567
|
+
pointer-events: none;
|
|
3568
|
+
display: block;
|
|
3569
|
+
height: auto;
|
|
3570
|
+
}
|
|
3571
|
+
|
|
3572
|
+
.${t}-list-item {
|
|
3573
|
+
display: flex;
|
|
3574
|
+
flex-direction: column;
|
|
3575
|
+
align-items: stretch;
|
|
3576
|
+
width: 100%;
|
|
3577
|
+
overflow: visible;
|
|
3578
|
+
position: relative;
|
|
3579
|
+
box-sizing: content-box;
|
|
3580
|
+
user-select: none;
|
|
3581
|
+
background: var(--${t}-background-color);
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
.${t}-wrapper.${t}-divider-top .${t}-list-item {
|
|
3585
|
+
border-top-style: solid;
|
|
3586
|
+
border-top-color: var(--${t}-divider-color);
|
|
3587
|
+
}
|
|
3588
|
+
|
|
3589
|
+
.${t}-wrapper.${t}-divider-bottom .${t}-list-item {
|
|
3590
|
+
border-bottom-style: solid;
|
|
3591
|
+
border-bottom-color: var(--${t}-divider-color);
|
|
3592
|
+
}
|
|
3593
|
+
|
|
3594
|
+
.${t}-list-cols-row {
|
|
3595
|
+
display: flex;
|
|
3596
|
+
align-items: start;
|
|
3597
|
+
width: 100%;
|
|
3598
|
+
box-sizing: border-box;
|
|
3599
|
+
}
|
|
3600
|
+
|
|
3601
|
+
.${t}-wrapper.${t}-type-b .${t}-list-cols-row {
|
|
3602
|
+
flex-direction: column;
|
|
3603
|
+
align-items: stretch;
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
.${t}-wrapper.${t}-type-b .${t}-list-col {
|
|
3607
|
+
width: 100%;
|
|
3608
|
+
min-width: 0;
|
|
3609
|
+
justify-content: center;
|
|
3610
|
+
align-items: flex-start;
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
.${t}-wrapper.${t}-type-b .${t}-list-col-title {
|
|
3614
|
+
text-align: center;
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
.${t}-wrapper.${t}-type-b .${t}-cut-item .${t}-list-cols-row {
|
|
3618
|
+
flex-direction: row;
|
|
3619
|
+
align-items: center;
|
|
3620
|
+
justify-content: center;
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
.${t}-wrapper.${t}-type-b .${t}-cut-label {
|
|
3624
|
+
text-align: center;
|
|
3625
|
+
width: 100%;
|
|
3626
|
+
box-sizing: border-box;
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
.${t}-wrapper.${t}-type-b .${t}-list-col-last {
|
|
3630
|
+
flex: 0 0 auto;
|
|
3631
|
+
min-width: 0;
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
a.${t}-list-item {
|
|
3635
|
+
text-decoration: none;
|
|
3636
|
+
color: inherit;
|
|
3637
|
+
cursor: pointer;
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
.${t}-list-col {
|
|
3641
|
+
flex-shrink: 0;
|
|
3642
|
+
overflow: visible;
|
|
3643
|
+
box-sizing: border-box;
|
|
3644
|
+
min-width: ${On(50)};
|
|
3645
|
+
position: relative;
|
|
3646
|
+
display: flex;
|
|
3647
|
+
align-items: center;
|
|
3648
|
+
}
|
|
3649
|
+
|
|
3650
|
+
.${t}-list-col-last {
|
|
3651
|
+
flex: 1 1 auto;
|
|
3652
|
+
min-width: ${On(50)};
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
.${t}-list-col-title {
|
|
3656
|
+
color: var(--${t}-text-color);
|
|
3657
|
+
white-space: pre-wrap;
|
|
3658
|
+
overflow-wrap: anywhere;
|
|
3659
|
+
word-break: break-word;
|
|
3660
|
+
flex: 1;
|
|
3661
|
+
min-width: 0;
|
|
3662
|
+
width: 100%;
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
.${t}-col-resize-handle,
|
|
3666
|
+
.${t}-padding-control-handle {
|
|
3667
|
+
background: transparent;
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
.${t}-row-padding-handle {
|
|
3671
|
+
position: relative;
|
|
3672
|
+
z-index: 2;
|
|
3673
|
+
width: 100%;
|
|
3674
|
+
flex-shrink: 0;
|
|
3675
|
+
background: transparent;
|
|
3676
|
+
}
|
|
3677
|
+
|
|
3678
|
+
.${t}-row-padding-handle::before {
|
|
3679
|
+
content: "";
|
|
3680
|
+
position: absolute;
|
|
3681
|
+
top: 0;
|
|
3682
|
+
left: 0;
|
|
3683
|
+
width: 100%;
|
|
3684
|
+
height: 100%;
|
|
3685
|
+
min-height: 20px;
|
|
3686
|
+
pointer-events: auto;
|
|
3687
|
+
z-index: 10;
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
.${t}-col-resize-handle::after {
|
|
3691
|
+
content: '';
|
|
3692
|
+
position: absolute;
|
|
3693
|
+
top: 0;
|
|
3694
|
+
left: 50%;
|
|
3695
|
+
transform: translateX(-50%);
|
|
3696
|
+
width: 2px;
|
|
3697
|
+
height: 100%;
|
|
3698
|
+
background: #FF5C02;
|
|
3699
|
+
pointer-events: none;
|
|
3700
|
+
}
|
|
3701
|
+
|
|
3702
|
+
.${t}-wrapper.${t}-type-b .${t}-col-resize-handle::after {
|
|
3703
|
+
top: 50%;
|
|
3704
|
+
left: 0;
|
|
3705
|
+
transform: translateY(-50%);
|
|
3706
|
+
width: 100%;
|
|
3707
|
+
height: 2px;
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3710
|
+
.${t}-padding-control-handle::after {
|
|
3711
|
+
content: '';
|
|
3712
|
+
position: absolute;
|
|
3713
|
+
top: 50%;
|
|
3714
|
+
left: 50%;
|
|
3715
|
+
transform: translate(-50%, -50%);
|
|
3716
|
+
width: 4px;
|
|
3717
|
+
height: 12px;
|
|
3718
|
+
background: #FF5C02;
|
|
3719
|
+
border: 1px solid #FFFFFF;
|
|
3720
|
+
border-radius: 5px;
|
|
3721
|
+
pointer-events: none;
|
|
3722
|
+
box-sizing: border-box;
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3725
|
+
.${t}-wrapper.${t}-type-b .${t}-padding-control-handle::after {
|
|
3726
|
+
width: 12px;
|
|
3727
|
+
height: 4px;
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
.${t}-text-padding-lr-handle {
|
|
3731
|
+
background: transparent;
|
|
3732
|
+
}
|
|
3733
|
+
|
|
3734
|
+
.${t}-text-padding-lr-handle::after {
|
|
3735
|
+
content: '';
|
|
3736
|
+
position: absolute;
|
|
3737
|
+
top: 50%;
|
|
3738
|
+
left: 50%;
|
|
3739
|
+
transform: translate(-50%, -50%);
|
|
3740
|
+
width: 4px;
|
|
3741
|
+
height: 12px;
|
|
3742
|
+
background: #FF5C02;
|
|
3743
|
+
border: 1px solid #FFFFFF;
|
|
3744
|
+
border-radius: 5px;
|
|
3745
|
+
pointer-events: none;
|
|
3746
|
+
box-sizing: border-box;
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-list-item,
|
|
3750
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-item,
|
|
3751
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-cut-item,
|
|
3752
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-item {
|
|
3753
|
+
transition: background-color 250ms, border-color 250ms;
|
|
3754
|
+
}
|
|
3755
|
+
|
|
3756
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-list-col-title,
|
|
3757
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-col-title,
|
|
3758
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-cut-label,
|
|
3759
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-label {
|
|
3760
|
+
transition: color 250ms;
|
|
3761
|
+
}
|
|
3762
|
+
|
|
3763
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-list-item:hover,
|
|
3764
|
+
.${t}-wrapper.${t}-entry-hover-default.${t}-state-hover .${t}-list-item,
|
|
3765
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-cut-item:hover,
|
|
3766
|
+
.${t}-wrapper.${t}-entry-hover-default.${t}-state-hover .${t}-cut-item {
|
|
3767
|
+
background: var(--${t}-background-hover-color);
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default .${t}-list-item:hover,
|
|
3771
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default .${t}-list-item:has(+ .${t}-list-item:hover),
|
|
3772
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default .${t}-list-item:has(+ .${t}-cut-item:hover),
|
|
3773
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default.${t}-state-hover .${t}-list-item,
|
|
3774
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default .${t}-cut-item:hover,
|
|
3775
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default.${t}-state-hover .${t}-cut-item,
|
|
3776
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-list-item:hover,
|
|
3777
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-list-item:has(+ .${t}-list-item:hover),
|
|
3778
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-list-item:has(+ .${t}-cut-item:hover),
|
|
3779
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item,
|
|
3780
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-cut-item:hover,
|
|
3781
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds.${t}-state-hover .${t}-cut-item {
|
|
3782
|
+
border-bottom-color: var(--${t}-divider-hover-color);
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
.${t}-wrapper.${t}-divider-top:not(.${t}-divider-bottom).${t}-entry-hover-default .${t}-list-item:hover:first-child,
|
|
3786
|
+
.${t}-wrapper.${t}-divider-top:not(.${t}-divider-bottom).${t}-entry-hover-default.${t}-state-hover .${t}-list-item:first-child,
|
|
3787
|
+
.${t}-wrapper.${t}-divider-top:not(.${t}-divider-bottom).${t}-entry-hover-blinds .${t}-list-item:hover:first-child,
|
|
3788
|
+
.${t}-wrapper.${t}-divider-top:not(.${t}-divider-bottom).${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item:first-child {
|
|
3789
|
+
border-top-color: var(--${t}-divider-hover-color);
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
.${t}-wrapper.${t}-divider-top.${t}-divider-bottom.${t}-entry-hover-default .${t}-list-item:hover:first-child,
|
|
3793
|
+
.${t}-wrapper.${t}-divider-top.${t}-divider-bottom.${t}-entry-hover-default.${t}-state-hover .${t}-list-item:first-child,
|
|
3794
|
+
.${t}-wrapper.${t}-divider-top.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-list-item:hover:first-child,
|
|
3795
|
+
.${t}-wrapper.${t}-divider-top.${t}-divider-bottom.${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item:first-child {
|
|
3796
|
+
border-top-color: var(--${t}-divider-hover-color);
|
|
3797
|
+
}
|
|
3798
|
+
|
|
3799
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-list-item:hover .${t}-list-col-title,
|
|
3800
|
+
.${t}-wrapper.${t}-entry-hover-default.${t}-state-hover .${t}-list-item .${t}-list-col-title,
|
|
3801
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-cut-item:hover .${t}-cut-label,
|
|
3802
|
+
.${t}-wrapper.${t}-entry-hover-default.${t}-state-hover .${t}-cut-item .${t}-cut-label,
|
|
3803
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-item:hover .${t}-list-col-title,
|
|
3804
|
+
.${t}-wrapper.${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item .${t}-list-col-title,
|
|
3805
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-item:hover .${t}-cut-label,
|
|
3806
|
+
.${t}-wrapper.${t}-entry-hover-blinds.${t}-state-hover .${t}-cut-item .${t}-cut-label {
|
|
3807
|
+
color: var(--${t}-text-hover-color);
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-item::before,
|
|
3811
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-item::before {
|
|
3812
|
+
content: '';
|
|
3813
|
+
position: absolute;
|
|
3814
|
+
inset: 0;
|
|
3815
|
+
background: var(--${t}-background-hover-color);
|
|
3816
|
+
transform: scaleY(0);
|
|
3817
|
+
transform-origin: center center;
|
|
3818
|
+
transition: transform 250ms;
|
|
3819
|
+
z-index: 0;
|
|
3820
|
+
pointer-events: none;
|
|
3821
|
+
}
|
|
3822
|
+
|
|
3823
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-col,
|
|
3824
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-label {
|
|
3825
|
+
position: relative;
|
|
3826
|
+
z-index: 1;
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-item:hover::before,
|
|
3830
|
+
.${t}-wrapper.${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item::before,
|
|
3831
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-item:hover::before,
|
|
3832
|
+
.${t}-wrapper.${t}-entry-hover-blinds.${t}-state-hover .${t}-cut-item::before {
|
|
3833
|
+
transform: scaleY(1);
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3836
|
+
.${t}-cut-item {
|
|
3837
|
+
display: flex;
|
|
3838
|
+
align-items: center;
|
|
3839
|
+
justify-content: center;
|
|
3840
|
+
width: 100%;
|
|
3841
|
+
overflow: visible;
|
|
3842
|
+
position: relative;
|
|
3843
|
+
z-index: 3;
|
|
3844
|
+
box-sizing: border-box;
|
|
3845
|
+
user-select: none;
|
|
3846
|
+
background: var(--${t}-background-color);
|
|
3847
|
+
}
|
|
3848
|
+
|
|
3849
|
+
.${t}-wrapper.${t}-divider-bottom .${t}-cut-item {
|
|
3850
|
+
border-bottom-style: solid;
|
|
3851
|
+
border-bottom-color: var(--${t}-divider-color);
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
.${t}-cut-label {
|
|
3855
|
+
all: unset;
|
|
3856
|
+
cursor: pointer;
|
|
3857
|
+
position: relative;
|
|
3858
|
+
z-index: 1;
|
|
3859
|
+
color: var(--${t}-text-color);
|
|
3860
|
+
white-space: pre-wrap;
|
|
3861
|
+
overflow-wrap: anywhere;
|
|
3862
|
+
word-break: break-word;
|
|
3863
|
+
}
|
|
3864
|
+
`}const De=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],qe=["AColumn","BColumn","CColumn","DColumn","EColumn"],yc={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"},vc=["textFontFamily","textFontSettings","textFontSize","textLineHeight","textLetterSpacing","textWordSpacing","textTextAppearance"];function Go(t,e){return`${t}${e.replace(/^text/,"Text")}`}function bc(t){return{textFontFamily:t.textFontFamily??"Arial",textFontSettings:t.textFontSettings??{fontWeight:400,fontStyle:"normal"},textFontSize:t.textFontSize,textLineHeight:t.textLineHeight,textLetterSpacing:t.textLetterSpacing??0,textWordSpacing:t.textWordSpacing??0,textTextAppearance:t.textTextAppearance,textColor:t.textColor}}function xc(t,e){const n=o=>{const i=Go(e,o),l=t[i];return l!==void 0?l:t[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,textTextAppearance:n("textTextAppearance"),textColor:t.textColor}}function Si(t,e){var r,s;const n=t.textFontSize??.01,o=n*1.2,i=Math.max(t.textLineHeight??n,o),l={fontSettings:{fontFamily:t.textFontFamily,fontWeight:((r=t.textFontSettings)==null?void 0:r.fontWeight)??400,fontStyle:((s=t.textFontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:n,lineHeight:i,letterSpacing:t.textLetterSpacing,wordSpacing:t.textWordSpacing,textAppearance:t.textTextAppearance,color:t.textColor??"#767676"};return pe(Vt(l,e))}function Cc(t,e){const n={};let o=!1;for(const i of vc)if(t[i]!==e[i]&&t[i]!==void 0){o=!0;for(const l of qe)n[Go(l,i)]=t[i]}return o?n:null}const Xt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],je=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ve=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ke=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Sc={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},$c=["hover","focus","filled","success","error"],$i=.004,Qe=.004,Yo=50,pn=1440,mn=Yo/pn;function ur(t){const e=typeof t=="number"&&t>0?t:pn;return Yo/e}function wc(t){let e=t??null;for(;e;){const n=e.style.getPropertyValue("--cntrl-article-width").trim();if(n){const i=parseFloat(n);if(Number.isFinite(i)&&i>0)return i}const o=getComputedStyle(e).getPropertyValue("--cntrl-article-width").trim();if(o){const i=parseFloat(o);if(Number.isFinite(i)&&i>0)return i}e=e.parentElement}return pn}const pr={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Nn(t){const e=typeof t.wrapperWidth=="number"?t.wrapperWidth:1;return Math.max(0,e)}function Tc(t,e=1){const n=e/t;return Object.fromEntries(Xt.map(o=>[o,n]))}function Lc(){return Object.fromEntries([...je.map(t=>[t,0]),...Ve.map(t=>[t,0])])}function _c(){return Object.fromEntries(Ke.map(t=>[t,0]))}function Fn(t){return Object.fromEntries(Xt.map(e=>[e,typeof t[e]=="number"?t[e]:pr[e]]))}function mr(t,e,n){const o=t-mn,i=e+n;if(i<=0||i<=o)return{paddingLeft:e,paddingRight:n};if(o<=0)return{paddingLeft:0,paddingRight:0};const l=o/i;return{paddingLeft:e*l,paddingRight:n*l}}function Hn(t,e,n){const o=qo(t,e,n);if(t<=0)return[];const i=o.slice(0,t-1).reduce((l,r)=>l+r,0);return[...o.slice(0,t-1),Math.max(0,e-i)]}function Ec(t,e,n){const o={};for(let i=0;i<t;i+=1){const l=je[i],r=Ve[i],s=typeof n[l]=="number"?n[l]:0,d=typeof n[r]=="number"?n[r]:0,u=mr(e[i]??0,s,d);u.paddingLeft!==s&&(o[l]=u.paddingLeft),u.paddingRight!==d&&(o[r]=u.paddingRight)}return o}function qo(t,e,n){if(t<=0)return[];const o=Xt.slice(0,t).map(u=>n[u]);if(t===1)return o;const i=o.slice(0,t-1),r=i.reduce((u,c)=>u+c,0)+mn;if(e>=r)return o;const s=[...i];let d=r-e;for(let u=s.length-1;u>=0&&d>0;u-=1){const c=s[u]-mn;if(c<=0)continue;const L=Math.min(d,c);s[u]-=L,d-=L}return[...s,o[t-1]]}function Pc(t,e,n){if(t<=1)return{};const o=qo(t,e,n),i={};for(let l=0;l<t-1;l+=1){const r=Xt[l];o[l]!==n[r]&&(i[r]=o[l])}return i}function wi(t){return Array.isArray(t.columnsOrder)&&t.columnsOrder.length>0?t.columnsOrder:[...De]}function Wc(t,e){return t.length!==e.length?!1:t.every((n,o)=>n===e[o])}function Fc(t,e,n,o){const i=Math.min(o,t.length,Xt.length),l={};for(let r=0;r<i;r+=1){const s=t[r],d=e.indexOf(s);if(d===-1)continue;const u=Xt[d],c=je[d],L=Ve[d],v=Ke[d],h=Xt[r],p=je[r],g=Ve[r],$=Ke[r],f=n[u],x=n[c],b=n[L],R=n[v];typeof f=="number"&&(l[h]=f),typeof x=="number"&&(l[p]=x),typeof b=="number"&&(l[g]=b),typeof R=="number"&&(l[$]=R)}return l}function Rc(t,e,n){const o=Cc(t,e);o&&(t={...t,...o});const i=ur(n==null?void 0:n.designWidth),l=t.columns,r=e.columns,s=Nn(t),d=Nn(e),u=t.type==="B"||t.type===void 0&&e.type==="B",c=typeof l=="number"?l:typeof r=="number"?r:De.length,L=b=>{if(u)return b;const R=Fn({...e,...b}),W=Nn(b),_=Hn(c,W,R),y=Ec(c,_,{...e,...b});return Object.keys(y).length===0?b:{...b,...y}};if(typeof l=="number"&&l!==r){const b={...t,...Tc(l,s),...Lc()};if(u)for(const R of Ke)typeof e[R]=="number"&&(b[R]=e[R]);else Object.assign(b,_c());return b}const v=wi(t),h=wi(e);if(!Wc(v,h))return L({...t,...Fc(v,h,e,c)});if(s<d&&typeof c=="number"&&!u){const b=Fn({...e,...t});return L({...t,...Pc(c,s,b)})}if(u){const b=typeof t.textPaddingLR=="number"?t.textPaddingLR:0,R=Math.max(0,(s-i)/2);return b>R?{...t,textPaddingLR:R}:t}const p=Fn({...e,...t}),g=Hn(c,d,Fn(e)),f=Hn(c,s,p).some((b,R)=>b<(g[R]??b)),x=Xt.some(b=>{const R=t[b],W=e[b];return typeof R=="number"&&typeof W=="number"&&R!==W});return f||x?L(t):t}function Ic(t,e,n,o){const i=e.slice(0,t).reduce((r,s)=>r+s,0),l=n.slice(t+1,e.length-1).reduce((r,s)=>r+s,0);return Math.max(mn,o-i-l-mn)}function Ac(t,e){return Math.random()*(e-t)+t}function kc(t){return Object.fromEntries(Xt.map(e=>[e,typeof t[e]=="number"?t[e]:pr[e]]))}function go(t,e,n=0){return Object.fromEntries(e.map(o=>[o,typeof t[o]=="number"?t[o]:n]))}function Mc(t,e,n,o,i,l){return t.slice(0,e).map((r,s)=>{const d=je[s],u=Ve[s],c=Ke[s];return{key:r,textPrefix:yc[r],widthKey:Xt[s],width:n[Xt[s]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:c,paddingLeft:o[d],paddingRight:i[u],paddingBottom:l[c]}})}function Oc({settings:t,content:e,isEditor:n,isPreviewMode:o,activeEvent:i,layoutId:l,onUpdateSettings:r}){const{prefix:s}=S.useScopedStyles(),d=!!(n&&o),{columns:u,type:c,wrapperWidth:L,entriesCount:v,cellMinHeight:h,dividerWidth:p,showVisibility:g,cut:$,showCut:f,cutCellMinHeight:x,cutLabel:b,imageSize:R,imageOnHover:W,entryHoverEffect:_,rowPaddingTop:y,rowPaddingBottom:w,rowPaddingTopB:E,columnsOrder:H,textPaddingLR:F,textColor:O,textFontFamily:z,textFontSettings:V,textFontSize:K,textLineHeight:C,textLetterSpacing:k,textWordSpacing:I,textTextAppearance:A,backgroundColor:P,dividerColor:N,textHoverColor:Q,backgroundHoverColor:st,dividerHoverColor:ot}=t,[ut,M]=m.useState(void 0),[J,ht]=m.useState(null),pt=W==="On",gt=($??0)>0,D=c==="B",at=m.useRef(null),[B,T]=m.useState(pn),U=ur(B),q=Math.max(0,((L??0)-U)/2),Z=Math.min(F??0,q),it=Math.max(Z,Qe),rt=((L??0)+U)/2;m.useLayoutEffect(()=>{if(!n){T(pn);return}const ft=()=>{T(wc(at.current))};ft();const Tt=at.current;if(!Tt)return;const Ht=new ResizeObserver(ft);Ht.observe(Tt);let Bt=Tt;for(;Bt&&!Bt.style.getPropertyValue("--cntrl-article-width");)Bt=Bt.parentElement;return Bt&&Ht.observe(Bt),()=>Ht.disconnect()},[n,l]),m.useEffect(()=>{M(void 0)},[$,f,e,v]);const et=Si(bc(t),n),dt=m.useMemo(()=>Object.fromEntries(qe.map(ft=>[ft,Si(xc(t,ft),n)])),[t,z,V,K,C,k,I,A,O,n]),j=S.buildColorVars(s,{textColor:O,backgroundColor:P,dividerColor:N,textHoverColor:Q,backgroundHoverColor:st,dividerHoverColor:ot},Sc,$c),X=i&&i!=="default"?`${s}-state-${i}`:"",lt=`${_==="Default"?`${s}-entry-hover-default`:_==="Blinds"?`${s}-entry-hover-blinds`:""} ${X}`.trim(),nt=(g==null?void 0:g[0])??!1,ct=(g==null?void 0:g[1])??!1,Ct=m.useRef(t),Lt=m.useRef(l);m.useEffect(()=>{if(!r||!n){Ct.current=t,Lt.current=l;return}if(Lt.current!==l){Ct.current=t,Lt.current=l;return}const ft=Ct.current,Tt=Rc(t,ft,{designWidth:B});Ct.current=t,Tt!==t&&r(Tt)},[t,r,n,l,B]);const Pt=m.useMemo(()=>kc(t),[t.AColumnWidth,t.BColumnWidth,t.CColumnWidth,t.DColumnWidth,t.EColumnWidth]),Dt=m.useMemo(()=>go(t,je),[t.AColumnPaddingLeft,t.BColumnPaddingLeft,t.CColumnPaddingLeft,t.DColumnPaddingLeft,t.EColumnPaddingLeft]),St=m.useMemo(()=>go(t,Ve),[t.AColumnPaddingRight,t.BColumnPaddingRight,t.CColumnPaddingRight,t.DColumnPaddingRight,t.EColumnPaddingRight]),At=m.useMemo(()=>go(t,Ke),[t.AColumnPaddingBottom,t.BColumnPaddingBottom,t.CColumnPaddingBottom,t.DColumnPaddingBottom,t.EColumnPaddingBottom]),Kt=m.useMemo(()=>Array.isArray(H)&&H.length>0?H:[...De],[H]),yt=m.useMemo(()=>Mc(Kt,u,Pt,Dt,St,At),[Kt,u,Pt,Dt,St,At]),Wt=Nn(t),$t=m.useMemo(()=>Xt.slice(0,u).map(ft=>Pt[ft]),[u,Pt]),Mt=m.useMemo(()=>qo(u,Wt,Pt),[u,Wt,Pt]),kt=m.useMemo(()=>Hn(u,Wt,Pt),[u,Wt,Pt]),Rt=m.useMemo(()=>yt.map((ft,Tt)=>mr(kt[Tt]??0,ft.paddingLeft,ft.paddingRight)),[yt,kt]),It=m.useMemo(()=>{const ft=v===0?1/0:v;return(e??[]).slice(0,ft).map((Ht,Bt)=>({id:Bt,cells:Object.fromEntries(De.map(he=>[he,Ht[he]??""])),image:Ht.image,link:Ht.link}))},[e,v]),Ut=gt?ut??$:It.length,oe=m.useMemo(()=>gt?It.slice(0,Ut):It,[It,gt,Ut]),Jt=gt&&Ut<It.length,oo=oe.length>1||Jt,io=[nt?`${s}-divider-top`:"",ct||oo?`${s}-divider-bottom`:""].filter(Boolean).join(" "),ro=()=>{const ft=ut??$;if(!f){M(It.length);return}M(Math.min(ft+f,It.length))},bt=ft=>S.scalingValue(ft,n??!1),Xe=D?E??0:y??0,Sn=w??0,vt=h??0,Qt=D?"rowPaddingTopB":"rowPaddingTop",jt=yt[0],Ot=yt[yt.length-1],Gt=Rt[0],Ze=Rt[Rt.length-1],gr=jt&&Gt?Math.max(Gt.paddingLeft,Qe):0,Xo=Ot&&Ze?Math.max(Ze.paddingRight,Qe):0,hr=Wt,fr=ft=>{if(!pt)return;const Tt=ft.image;if(!(Tt!=null&&Tt.url)){ht(null);return}if((J==null?void 0:J.rowId)===ft.id)return;const Ht=(R==null?void 0:R.min)??80,Bt=(R==null?void 0:R.max)??320;ht({rowId:ft.id,url:Tt.url,objectFit:Tt.objectFit??"cover",widthPx:Ac(Ht,Bt)})},yr=()=>{ht(null)};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:fc(s)}}),a.jsx("div",{style:j,children:a.jsxs("div",{ref:at,className:`${s}-wrapper ${lt}${io?` ${io}`:""}${D?` ${s}-type-b`:""}`.trim(),style:{width:S.scalingValue(L??0,n)},onMouseLeave:pt?yr:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[oe.map((ft,Tt)=>{var Je;const Ht=(((Je=ft.link)==null?void 0:Je.length)??0)>0,Bt=Ht?"a":"div",he=gc(Tt,oe.length,nt,ct,Jt,p??0,n??!1);return a.jsxs(Bt,{className:`${s}-list-item`,...Ht?{href:ft.link,target:"_blank"}:{},style:he,onMouseEnter:pt?()=>fr(ft):void 0,children:[(Xe>0||d)&&a.jsx("div",{...d?{"data-controls":Qt,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:bt(Xe)}}),a.jsx("div",{className:`${s}-list-cols-row`,style:D?void 0:{minHeight:bt(vt)},children:yt.map((ie,Re)=>{const $n=Re===yt.length-1,wn=Rt[Re],Tn=ie.paddingBottom,ao=mc(ft.cells[ie.key]),vr=D&&ao&&(Tn>0||d),br=D?{minHeight:bt(vt)}:$n?{}:{width:bt(kt[Re])},xr=D?{paddingLeft:bt(Z),paddingRight:bt(Z)}:{paddingLeft:bt(wn.paddingLeft),paddingRight:bt(wn.paddingRight)};return a.jsxs("div",{children:[a.jsx("div",{className:`${s}-list-col${$n?` ${s}-list-col-last`:""}`,style:{...xr,...br},"data-test":ie.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:dt[ie.textPrefix]??et,children:ft.cells[ie.key]??null})}),vr&&a.jsx("div",{...d?{"data-controls":ie.paddingBottomKey,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:bt(Tn)}})]},ie.key)})}),!D&&(Sn>0||d)&&a.jsx("div",{...d?{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:bt(Sn)}})]},ft.id)}),Jt&&a.jsx("div",{className:`${s}-cut-item`,style:{minHeight:bt(x??0),...hc(ct,p??0,n??!1)},children:a.jsx("div",{className:`${s}-list-cols-row`,style:D?{paddingLeft:bt(Z),paddingRight:bt(Z)}:{justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${s}-cut-label`,style:et,onClick:ro,children:b})})})]}),d&&!D&&jt&&Ot&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":jt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(kt[0]-((Gt==null?void 0:Gt.paddingRight)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:0,width:bt(gr),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Ot.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(kt[yt.length-1]-((Ze==null?void 0:Ze.paddingLeft)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:bt(hr-Xo),width:bt(Xo),height:"100%",pointerEvents:"auto",zIndex:2}})]},"column-edge-padding-handles"),d&&!D&&yt.slice(0,-1).map((ft,Tt)=>{const Ht=yt[Tt+1],Bt=Ic(Tt,Mt,$t,Wt),he=Mt.slice(0,Tt+1).reduce((Tn,ao)=>Tn+ao,0),Je=Rt[Tt],ie=Rt[Tt+1],Re=Math.max(Je.paddingRight,Qe),$n=Math.max(ie.paddingLeft,Qe),wn=he-$i/2;return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":ft.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(kt[Tt]-Je.paddingLeft),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:bt(he-Re),width:bt(Re),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":ft.widthKey,"data-controls-axis":"x","data-controls-min":String(Yo),"data-controls-max-fraction":String(Bt),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:bt(wn),width:bt($i),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":Ht.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(kt[Tt+1]-ie.paddingRight),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:bt(he),width:bt($n),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${ft.widthKey}-junction`)}),d&&D&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(rt),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:0,width:bt(it),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(rt),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:bt(Math.max(it,Wt-it)),width:bt(it),height:"100%",pointerEvents:"auto",zIndex:2}})]},"text-padding-lr-handles"),pt&&J&&a.jsx("img",{className:`${s}-hover-image`,src:J.url,alt:"",style:{width:On(J.widthPx),objectFit:J.objectFit}})]})})]})}const Nc=`import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3865
|
+
import { CommonComponentProps } from '../props';
|
|
3866
|
+
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
3867
|
+
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
3868
|
+
|
|
3869
|
+
type ListSettings = {
|
|
3870
|
+
columns: number;
|
|
3871
|
+
type: 'A' | 'B';
|
|
3872
|
+
wrapperWidth: number;
|
|
3873
|
+
entriesCount: number;
|
|
3874
|
+
cellMinHeight: number;
|
|
3875
|
+
imageOnHover: 'On' | 'Off';
|
|
3876
|
+
imageSize?: { min: number; max: number };
|
|
3877
|
+
dividerWidth: number;
|
|
3878
|
+
showVisibility: boolean[];
|
|
3879
|
+
cut: number;
|
|
3880
|
+
showCut: number;
|
|
3881
|
+
cutCellMinHeight: number;
|
|
3882
|
+
cutLabel: string;
|
|
3883
|
+
entryHoverEffect: 'None' | 'Default' | 'Blinds';
|
|
3884
|
+
rowPaddingTop: number;
|
|
3885
|
+
rowPaddingBottom: number;
|
|
3886
|
+
rowPaddingTopB: number;
|
|
3887
|
+
AColumnWidth: number;
|
|
3888
|
+
AColumnPaddingLeft: number;
|
|
3889
|
+
AColumnPaddingRight: number;
|
|
3890
|
+
AColumnPaddingBottom: number;
|
|
3891
|
+
BColumnWidth: number;
|
|
3892
|
+
BColumnPaddingLeft: number;
|
|
3893
|
+
BColumnPaddingRight: number;
|
|
3894
|
+
BColumnPaddingBottom: number;
|
|
3895
|
+
CColumnWidth: number;
|
|
3896
|
+
CColumnPaddingLeft: number;
|
|
3897
|
+
CColumnPaddingRight: number;
|
|
3898
|
+
CColumnPaddingBottom: number;
|
|
3899
|
+
DColumnWidth: number;
|
|
3900
|
+
DColumnPaddingLeft: number;
|
|
3901
|
+
DColumnPaddingRight: number;
|
|
3902
|
+
DColumnPaddingBottom: number;
|
|
3903
|
+
EColumnWidth: number;
|
|
3904
|
+
EColumnPaddingLeft: number;
|
|
3905
|
+
EColumnPaddingRight: number;
|
|
3906
|
+
EColumnPaddingBottom: number;
|
|
3907
|
+
columnsOrder?: string[];
|
|
3908
|
+
textPaddingLR?: number;
|
|
3909
|
+
textColor: string;
|
|
3910
|
+
textFontFamily: string;
|
|
3911
|
+
textFontSettings?: { fontWeight: number; fontStyle: string };
|
|
3912
|
+
textFontSize?: number;
|
|
3913
|
+
textLineHeight?: number;
|
|
3914
|
+
textLetterSpacing?: number;
|
|
3915
|
+
textWordSpacing?: number;
|
|
3916
|
+
textTextAppearance?: TextStyles['textAppearance'];
|
|
3917
|
+
backgroundColor: string;
|
|
3918
|
+
dividerColor: string;
|
|
3919
|
+
textHoverColor: string;
|
|
3920
|
+
backgroundHoverColor: string;
|
|
3921
|
+
dividerHoverColor: string;
|
|
3922
|
+
};
|
|
3923
|
+
|
|
3924
|
+
type ListContentItem = {
|
|
3925
|
+
AColumn?: string;
|
|
3926
|
+
BColumnWidth?: string;
|
|
3927
|
+
CColumnWidth?: string;
|
|
3928
|
+
DColumnWidth?: string;
|
|
3929
|
+
EColumnWidth?: string;
|
|
3930
|
+
image?: {
|
|
3931
|
+
objectFit?: 'cover' | 'contain';
|
|
3932
|
+
url: string;
|
|
3933
|
+
name: string;
|
|
3934
|
+
};
|
|
3935
|
+
link?: string;
|
|
3936
|
+
};
|
|
3937
|
+
|
|
3938
|
+
type ListItemRow = {
|
|
3939
|
+
id: string | number;
|
|
3940
|
+
cells: Record<string, React.ReactNode>;
|
|
3941
|
+
image?: ListContentItem['image'];
|
|
3942
|
+
link?: string;
|
|
3943
|
+
};
|
|
3944
|
+
|
|
3945
|
+
type HoverImageState = {
|
|
3946
|
+
rowId: string | number;
|
|
3947
|
+
url: string;
|
|
3948
|
+
objectFit: 'cover' | 'contain';
|
|
3949
|
+
widthPx: number;
|
|
3950
|
+
};
|
|
3951
|
+
|
|
3952
|
+
type ListProps = {
|
|
3953
|
+
layoutId?: string;
|
|
3954
|
+
settings: ListSettings;
|
|
3955
|
+
content?: ListContentItem[];
|
|
3956
|
+
isEditor?: boolean;
|
|
3957
|
+
isPreviewMode?: boolean;
|
|
3958
|
+
activeEvent: string | undefined;
|
|
3959
|
+
onUpdateSettings?: (settings: ListSettings) => void;
|
|
3960
|
+
} & CommonComponentProps;
|
|
3961
|
+
|
|
3962
|
+
function sv(px: number): string {
|
|
3963
|
+
return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
|
|
3964
|
+
}
|
|
3965
|
+
|
|
3966
|
+
function hasListColumnText(value: unknown): boolean {
|
|
3967
|
+
return String(value ?? '').trim().length > 0;
|
|
3968
|
+
}
|
|
3969
|
+
|
|
3970
|
+
function getEntryDividerWidths(
|
|
3971
|
+
rowIdx: number,
|
|
3972
|
+
rowCount: number,
|
|
3973
|
+
showDividerTop: boolean,
|
|
3974
|
+
showDividerBottom: boolean,
|
|
3975
|
+
hasCutItem: boolean,
|
|
3976
|
+
dividerWidth: number,
|
|
3977
|
+
isEditor: boolean,
|
|
3978
|
+
): { borderTopWidth: string; borderBottomWidth: string } {
|
|
3979
|
+
const scaledDividerWidth = scalingValue(dividerWidth, isEditor);
|
|
3980
|
+
const none = scalingValue(0, isEditor);
|
|
3981
|
+
|
|
3982
|
+
const isFirst = rowIdx === 0;
|
|
3983
|
+
const isLastEntry = rowIdx === rowCount - 1 && !hasCutItem;
|
|
3984
|
+
|
|
3985
|
+
const borderTopWidth = isFirst && showDividerTop ? scaledDividerWidth : none;
|
|
3986
|
+
const borderBottomWidth = !isLastEntry || showDividerBottom ? scaledDividerWidth : none;
|
|
3987
|
+
|
|
3988
|
+
return { borderTopWidth, borderBottomWidth };
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
function getCutItemDividerWidths(
|
|
3992
|
+
showDividerBottom: boolean,
|
|
3993
|
+
dividerWidth: number,
|
|
3994
|
+
isEditor: boolean,
|
|
3995
|
+
): { borderTopWidth: string; borderBottomWidth: string } {
|
|
3996
|
+
const scaledDividerWidth = scalingValue(dividerWidth, isEditor);
|
|
3997
|
+
const none = scalingValue(0, isEditor);
|
|
3998
|
+
|
|
3999
|
+
return {
|
|
4000
|
+
borderTopWidth: none,
|
|
4001
|
+
borderBottomWidth: showDividerBottom ? scaledDividerWidth : none,
|
|
4002
|
+
};
|
|
4003
|
+
}
|
|
4004
|
+
|
|
4005
|
+
function getCSS(P: string): string {
|
|
4006
|
+
return \`
|
|
4007
|
+
.\${P}-wrapper {
|
|
4008
|
+
display: grid;
|
|
4009
|
+
align-items: start;
|
|
4010
|
+
min-height: \${sv(48)};
|
|
4011
|
+
position: relative;
|
|
4012
|
+
overflow: visible;
|
|
4013
|
+
box-sizing: border-box;
|
|
4014
|
+
}
|
|
4015
|
+
|
|
4016
|
+
.\${P}-hover-image {
|
|
4017
|
+
position: absolute;
|
|
4018
|
+
right: 0;
|
|
4019
|
+
bottom: 0;
|
|
4020
|
+
z-index: 10;
|
|
4021
|
+
pointer-events: none;
|
|
4022
|
+
display: block;
|
|
4023
|
+
height: auto;
|
|
4024
|
+
}
|
|
4025
|
+
|
|
4026
|
+
.\${P}-list-item {
|
|
4027
|
+
display: flex;
|
|
4028
|
+
flex-direction: column;
|
|
4029
|
+
align-items: stretch;
|
|
4030
|
+
width: 100%;
|
|
4031
|
+
overflow: visible;
|
|
4032
|
+
position: relative;
|
|
4033
|
+
box-sizing: content-box;
|
|
4034
|
+
user-select: none;
|
|
4035
|
+
background: var(--\${P}-background-color);
|
|
4036
|
+
}
|
|
4037
|
+
|
|
4038
|
+
.\${P}-wrapper.\${P}-divider-top .\${P}-list-item {
|
|
4039
|
+
border-top-style: solid;
|
|
4040
|
+
border-top-color: var(--\${P}-divider-color);
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
.\${P}-wrapper.\${P}-divider-bottom .\${P}-list-item {
|
|
4044
|
+
border-bottom-style: solid;
|
|
4045
|
+
border-bottom-color: var(--\${P}-divider-color);
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
.\${P}-list-cols-row {
|
|
4049
|
+
display: flex;
|
|
4050
|
+
align-items: start;
|
|
4051
|
+
width: 100%;
|
|
4052
|
+
box-sizing: border-box;
|
|
4053
|
+
}
|
|
4054
|
+
|
|
4055
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-list-cols-row {
|
|
4056
|
+
flex-direction: column;
|
|
4057
|
+
align-items: stretch;
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-list-col {
|
|
4061
|
+
width: 100%;
|
|
4062
|
+
min-width: 0;
|
|
4063
|
+
justify-content: center;
|
|
4064
|
+
align-items: flex-start;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-list-col-title {
|
|
4068
|
+
text-align: center;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-cut-item .\${P}-list-cols-row {
|
|
4072
|
+
flex-direction: row;
|
|
4073
|
+
align-items: center;
|
|
4074
|
+
justify-content: center;
|
|
4075
|
+
}
|
|
4076
|
+
|
|
4077
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-cut-label {
|
|
4078
|
+
text-align: center;
|
|
4079
|
+
width: 100%;
|
|
4080
|
+
box-sizing: border-box;
|
|
4081
|
+
}
|
|
4082
|
+
|
|
4083
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-list-col-last {
|
|
4084
|
+
flex: 0 0 auto;
|
|
4085
|
+
min-width: 0;
|
|
4086
|
+
}
|
|
4087
|
+
|
|
4088
|
+
a.\${P}-list-item {
|
|
4089
|
+
text-decoration: none;
|
|
4090
|
+
color: inherit;
|
|
4091
|
+
cursor: pointer;
|
|
4092
|
+
}
|
|
4093
|
+
|
|
4094
|
+
.\${P}-list-col {
|
|
4095
|
+
flex-shrink: 0;
|
|
4096
|
+
overflow: visible;
|
|
4097
|
+
box-sizing: border-box;
|
|
4098
|
+
min-width: \${sv(50)};
|
|
4099
|
+
position: relative;
|
|
4100
|
+
display: flex;
|
|
4101
|
+
align-items: center;
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
.\${P}-list-col-last {
|
|
4105
|
+
flex: 1 1 auto;
|
|
4106
|
+
min-width: \${sv(50)};
|
|
4107
|
+
}
|
|
4108
|
+
|
|
4109
|
+
.\${P}-list-col-title {
|
|
4110
|
+
color: var(--\${P}-text-color);
|
|
4111
|
+
white-space: pre-wrap;
|
|
4112
|
+
overflow-wrap: anywhere;
|
|
4113
|
+
word-break: break-word;
|
|
4114
|
+
flex: 1;
|
|
4115
|
+
min-width: 0;
|
|
4116
|
+
width: 100%;
|
|
4117
|
+
}
|
|
4118
|
+
|
|
4119
|
+
.\${P}-col-resize-handle,
|
|
4120
|
+
.\${P}-padding-control-handle {
|
|
4121
|
+
background: transparent;
|
|
4122
|
+
}
|
|
4123
|
+
|
|
4124
|
+
.\${P}-row-padding-handle {
|
|
4125
|
+
position: relative;
|
|
4126
|
+
z-index: 2;
|
|
4127
|
+
width: 100%;
|
|
4128
|
+
flex-shrink: 0;
|
|
4129
|
+
background: transparent;
|
|
4130
|
+
}
|
|
4131
|
+
|
|
4132
|
+
.\${P}-row-padding-handle::before {
|
|
4133
|
+
content: "";
|
|
4134
|
+
position: absolute;
|
|
4135
|
+
top: 0;
|
|
4136
|
+
left: 0;
|
|
4137
|
+
width: 100%;
|
|
4138
|
+
height: 100%;
|
|
4139
|
+
min-height: 20px;
|
|
4140
|
+
pointer-events: auto;
|
|
4141
|
+
z-index: 10;
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
.\${P}-col-resize-handle::after {
|
|
4145
|
+
content: '';
|
|
4146
|
+
position: absolute;
|
|
4147
|
+
top: 0;
|
|
4148
|
+
left: 50%;
|
|
4149
|
+
transform: translateX(-50%);
|
|
4150
|
+
width: 2px;
|
|
4151
|
+
height: 100%;
|
|
4152
|
+
background: #FF5C02;
|
|
4153
|
+
pointer-events: none;
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-col-resize-handle::after {
|
|
4157
|
+
top: 50%;
|
|
4158
|
+
left: 0;
|
|
4159
|
+
transform: translateY(-50%);
|
|
4160
|
+
width: 100%;
|
|
4161
|
+
height: 2px;
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4164
|
+
.\${P}-padding-control-handle::after {
|
|
4165
|
+
content: '';
|
|
4166
|
+
position: absolute;
|
|
4167
|
+
top: 50%;
|
|
4168
|
+
left: 50%;
|
|
4169
|
+
transform: translate(-50%, -50%);
|
|
4170
|
+
width: 4px;
|
|
4171
|
+
height: 12px;
|
|
4172
|
+
background: #FF5C02;
|
|
4173
|
+
border: 1px solid #FFFFFF;
|
|
4174
|
+
border-radius: 5px;
|
|
4175
|
+
pointer-events: none;
|
|
4176
|
+
box-sizing: border-box;
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4179
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-padding-control-handle::after {
|
|
4180
|
+
width: 12px;
|
|
4181
|
+
height: 4px;
|
|
4182
|
+
}
|
|
4183
|
+
|
|
4184
|
+
.\${P}-text-padding-lr-handle {
|
|
4185
|
+
background: transparent;
|
|
4186
|
+
}
|
|
4187
|
+
|
|
4188
|
+
.\${P}-text-padding-lr-handle::after {
|
|
4189
|
+
content: '';
|
|
4190
|
+
position: absolute;
|
|
4191
|
+
top: 50%;
|
|
4192
|
+
left: 50%;
|
|
4193
|
+
transform: translate(-50%, -50%);
|
|
4194
|
+
width: 4px;
|
|
4195
|
+
height: 12px;
|
|
4196
|
+
background: #FF5C02;
|
|
4197
|
+
border: 1px solid #FFFFFF;
|
|
4198
|
+
border-radius: 5px;
|
|
4199
|
+
pointer-events: none;
|
|
4200
|
+
box-sizing: border-box;
|
|
4201
|
+
}
|
|
4202
|
+
|
|
4203
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item,
|
|
4204
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item,
|
|
4205
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item,
|
|
4206
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item {
|
|
4207
|
+
transition: background-color 250ms, border-color 250ms;
|
|
4208
|
+
}
|
|
4209
|
+
|
|
4210
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-col-title,
|
|
4211
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-col-title,
|
|
4212
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-label,
|
|
4213
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-label {
|
|
4214
|
+
transition: color 250ms;
|
|
4215
|
+
}
|
|
4216
|
+
|
|
4217
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover,
|
|
4218
|
+
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,
|
|
4219
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover,
|
|
4220
|
+
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item {
|
|
4221
|
+
background: var(--\${P}-background-hover-color);
|
|
4222
|
+
}
|
|
4223
|
+
|
|
4224
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:hover,
|
|
4225
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-list-item:hover),
|
|
4226
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-cut-item:hover),
|
|
4227
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,
|
|
4228
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-cut-item:hover,
|
|
4229
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item,
|
|
4230
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:hover,
|
|
4231
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-list-item:hover),
|
|
4232
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-cut-item:hover),
|
|
4233
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item,
|
|
4234
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-cut-item:hover,
|
|
4235
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item {
|
|
4236
|
+
border-bottom-color: var(--\${P}-divider-hover-color);
|
|
4237
|
+
}
|
|
4238
|
+
|
|
4239
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-default .\${P}-list-item:hover:first-child,
|
|
4240
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,
|
|
4241
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,
|
|
4242
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {
|
|
4243
|
+
border-top-color: var(--\${P}-divider-hover-color);
|
|
4244
|
+
}
|
|
4245
|
+
|
|
4246
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:hover:first-child,
|
|
4247
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,
|
|
4248
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,
|
|
4249
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {
|
|
4250
|
+
border-top-color: var(--\${P}-divider-hover-color);
|
|
4251
|
+
}
|
|
4252
|
+
|
|
4253
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover .\${P}-list-col-title,
|
|
4254
|
+
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item .\${P}-list-col-title,
|
|
4255
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover .\${P}-cut-label,
|
|
4256
|
+
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item .\${P}-cut-label,
|
|
4257
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover .\${P}-list-col-title,
|
|
4258
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item .\${P}-list-col-title,
|
|
4259
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover .\${P}-cut-label,
|
|
4260
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item .\${P}-cut-label {
|
|
4261
|
+
color: var(--\${P}-text-hover-color);
|
|
4262
|
+
}
|
|
4263
|
+
|
|
4264
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item::before,
|
|
4265
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item::before {
|
|
4266
|
+
content: '';
|
|
4267
|
+
position: absolute;
|
|
4268
|
+
inset: 0;
|
|
4269
|
+
background: var(--\${P}-background-hover-color);
|
|
4270
|
+
transform: scaleY(0);
|
|
4271
|
+
transform-origin: center center;
|
|
4272
|
+
transition: transform 250ms;
|
|
4273
|
+
z-index: 0;
|
|
4274
|
+
pointer-events: none;
|
|
4275
|
+
}
|
|
4276
|
+
|
|
4277
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-col,
|
|
4278
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-label {
|
|
4279
|
+
position: relative;
|
|
4280
|
+
z-index: 1;
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover::before,
|
|
4284
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item::before,
|
|
4285
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover::before,
|
|
4286
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item::before {
|
|
4287
|
+
transform: scaleY(1);
|
|
4288
|
+
}
|
|
4289
|
+
|
|
4290
|
+
.\${P}-cut-item {
|
|
4291
|
+
display: flex;
|
|
4292
|
+
align-items: center;
|
|
4293
|
+
justify-content: center;
|
|
4294
|
+
width: 100%;
|
|
4295
|
+
overflow: visible;
|
|
4296
|
+
position: relative;
|
|
4297
|
+
z-index: 3;
|
|
4298
|
+
box-sizing: border-box;
|
|
4299
|
+
user-select: none;
|
|
4300
|
+
background: var(--\${P}-background-color);
|
|
4301
|
+
}
|
|
4302
|
+
|
|
4303
|
+
.\${P}-wrapper.\${P}-divider-bottom .\${P}-cut-item {
|
|
4304
|
+
border-bottom-style: solid;
|
|
4305
|
+
border-bottom-color: var(--\${P}-divider-color);
|
|
4306
|
+
}
|
|
4307
|
+
|
|
4308
|
+
.\${P}-cut-label {
|
|
4309
|
+
all: unset;
|
|
4310
|
+
cursor: pointer;
|
|
4311
|
+
position: relative;
|
|
4312
|
+
z-index: 1;
|
|
4313
|
+
color: var(--\${P}-text-color);
|
|
4314
|
+
white-space: pre-wrap;
|
|
4315
|
+
overflow-wrap: anywhere;
|
|
4316
|
+
word-break: break-word;
|
|
4317
|
+
}
|
|
4318
|
+
\`;
|
|
4319
|
+
}
|
|
4320
|
+
|
|
4321
|
+
export const COLUMN_CONTENT_KEYS = [
|
|
4322
|
+
'AColumn',
|
|
4323
|
+
'BColumnWidth',
|
|
4324
|
+
'CColumnWidth',
|
|
4325
|
+
'DColumnWidth',
|
|
4326
|
+
'EColumnWidth',
|
|
4327
|
+
] as const;
|
|
4328
|
+
|
|
4329
|
+
export const COLUMN_TEXT_PREFIXES = [
|
|
4330
|
+
'AColumn',
|
|
4331
|
+
'BColumn',
|
|
4332
|
+
'CColumn',
|
|
4333
|
+
'DColumn',
|
|
4334
|
+
'EColumn',
|
|
4335
|
+
] as const;
|
|
4336
|
+
|
|
4337
|
+
const COLUMN_CONTENT_KEY_TO_TEXT_PREFIX: Record<
|
|
4338
|
+
typeof COLUMN_CONTENT_KEYS[number],
|
|
4339
|
+
typeof COLUMN_TEXT_PREFIXES[number]
|
|
4340
|
+
> = {
|
|
4341
|
+
AColumn: 'AColumn',
|
|
4342
|
+
BColumnWidth: 'BColumn',
|
|
4343
|
+
CColumnWidth: 'CColumn',
|
|
4344
|
+
DColumnWidth: 'DColumn',
|
|
4345
|
+
EColumnWidth: 'EColumn',
|
|
4346
|
+
};
|
|
4347
|
+
|
|
4348
|
+
export const LIST_GLOBAL_TEXT_STYLE_KEYS = [
|
|
4349
|
+
'textFontFamily',
|
|
4350
|
+
'textFontSettings',
|
|
4351
|
+
'textFontSize',
|
|
4352
|
+
'textLineHeight',
|
|
4353
|
+
'textLetterSpacing',
|
|
4354
|
+
'textWordSpacing',
|
|
4355
|
+
'textTextAppearance',
|
|
4356
|
+
] as const;
|
|
4357
|
+
|
|
4358
|
+
export type ListGlobalTextStyleKey = typeof LIST_GLOBAL_TEXT_STYLE_KEYS[number];
|
|
4359
|
+
|
|
4360
|
+
export function getListColumnTextSettingKey(
|
|
4361
|
+
prefix: typeof COLUMN_TEXT_PREFIXES[number],
|
|
4362
|
+
globalKey: ListGlobalTextStyleKey,
|
|
4363
|
+
): string {
|
|
4364
|
+
return \`\${prefix}\${globalKey.replace(/^text/, 'Text')}\`;
|
|
4365
|
+
}
|
|
4366
|
+
|
|
4367
|
+
type ListTextStyleFields = {
|
|
4368
|
+
textFontFamily?: string;
|
|
4369
|
+
textFontSettings?: { fontWeight: number; fontStyle: string };
|
|
4370
|
+
textFontSize?: number;
|
|
4371
|
+
textLineHeight?: number;
|
|
4372
|
+
textLetterSpacing?: number;
|
|
4373
|
+
textWordSpacing?: number;
|
|
4374
|
+
textTextAppearance?: TextStyles['textAppearance'];
|
|
4375
|
+
textColor?: string;
|
|
4376
|
+
};
|
|
4377
|
+
|
|
4378
|
+
type ResolvedListTextFields = {
|
|
4379
|
+
textFontFamily: string;
|
|
4380
|
+
textFontSettings: { fontWeight: number; fontStyle: string };
|
|
4381
|
+
textFontSize?: number;
|
|
4382
|
+
textLineHeight?: number;
|
|
4383
|
+
textLetterSpacing: number;
|
|
4384
|
+
textWordSpacing: number;
|
|
4385
|
+
textTextAppearance?: TextStyles['textAppearance'];
|
|
4386
|
+
textColor?: string;
|
|
4387
|
+
};
|
|
4388
|
+
|
|
4389
|
+
function resolveListGlobalTextFields(
|
|
4390
|
+
settings: ListTextStyleFields,
|
|
4391
|
+
): ResolvedListTextFields {
|
|
4392
|
+
return {
|
|
4393
|
+
textFontFamily: settings.textFontFamily ?? 'Arial',
|
|
4394
|
+
textFontSettings: settings.textFontSettings ?? {
|
|
4395
|
+
fontWeight: 400,
|
|
4396
|
+
fontStyle: 'normal',
|
|
4397
|
+
},
|
|
4398
|
+
textFontSize: settings.textFontSize,
|
|
4399
|
+
textLineHeight: settings.textLineHeight,
|
|
4400
|
+
textLetterSpacing: settings.textLetterSpacing ?? 0,
|
|
4401
|
+
textWordSpacing: settings.textWordSpacing ?? 0,
|
|
4402
|
+
textTextAppearance: settings.textTextAppearance,
|
|
4403
|
+
textColor: settings.textColor,
|
|
4404
|
+
};
|
|
4405
|
+
}
|
|
4406
|
+
|
|
4407
|
+
function resolveListColumnTextFields(
|
|
4408
|
+
settings: ListTextStyleFields & Record<string, unknown>,
|
|
4409
|
+
textPrefix: typeof COLUMN_TEXT_PREFIXES[number],
|
|
4410
|
+
): ResolvedListTextFields {
|
|
4411
|
+
const read = <K extends ListGlobalTextStyleKey>(globalKey: K) => {
|
|
4412
|
+
const columnKey = getListColumnTextSettingKey(textPrefix, globalKey);
|
|
4413
|
+
const columnValue = settings[columnKey];
|
|
4414
|
+
if (columnValue !== undefined) {
|
|
4415
|
+
return columnValue as ListTextStyleFields[K];
|
|
4416
|
+
}
|
|
4417
|
+
return settings[globalKey];
|
|
4418
|
+
};
|
|
4419
|
+
|
|
4420
|
+
return {
|
|
4421
|
+
textFontFamily: (read('textFontFamily') as string | undefined) ?? 'Arial',
|
|
4422
|
+
textFontSettings: (read('textFontSettings') as ListTextStyleFields['textFontSettings']) ?? {
|
|
4423
|
+
fontWeight: 400,
|
|
4424
|
+
fontStyle: 'normal',
|
|
4425
|
+
},
|
|
4426
|
+
textFontSize: read('textFontSize') as number | undefined,
|
|
4427
|
+
textLineHeight: read('textLineHeight') as number | undefined,
|
|
4428
|
+
textLetterSpacing: (read('textLetterSpacing') as number | undefined) ?? 0,
|
|
4429
|
+
textWordSpacing: (read('textWordSpacing') as number | undefined) ?? 0,
|
|
4430
|
+
textTextAppearance: read('textTextAppearance') as ListTextStyleFields['textTextAppearance'],
|
|
4431
|
+
textColor: settings.textColor,
|
|
4432
|
+
};
|
|
4433
|
+
}
|
|
4434
|
+
|
|
4435
|
+
function listColumnTextFieldsToCss(
|
|
4436
|
+
fields: ResolvedListTextFields,
|
|
4437
|
+
isEditor?: boolean,
|
|
4438
|
+
): React.CSSProperties {
|
|
4439
|
+
const resolvedFontSize = fields.textFontSize ?? 0.01;
|
|
4440
|
+
const minLineHeight = resolvedFontSize * 1.2;
|
|
4441
|
+
const resolvedLineHeight = Math.max(fields.textLineHeight ?? resolvedFontSize, minLineHeight);
|
|
4442
|
+
const resolvedTextStyle: TextStyles = {
|
|
4443
|
+
fontSettings: {
|
|
4444
|
+
fontFamily: fields.textFontFamily,
|
|
4445
|
+
fontWeight: fields.textFontSettings?.fontWeight ?? 400,
|
|
4446
|
+
fontStyle: fields.textFontSettings?.fontStyle ?? 'normal',
|
|
4447
|
+
},
|
|
4448
|
+
fontSize: resolvedFontSize,
|
|
4449
|
+
lineHeight: resolvedLineHeight,
|
|
4450
|
+
letterSpacing: fields.textLetterSpacing,
|
|
4451
|
+
wordSpacing: fields.textWordSpacing,
|
|
4452
|
+
textAppearance: fields.textTextAppearance,
|
|
4453
|
+
color: fields.textColor ?? '#767676',
|
|
4454
|
+
};
|
|
4455
|
+
|
|
4456
|
+
return omitTextColors(textStylesToCss(resolvedTextStyle, isEditor));
|
|
4457
|
+
}
|
|
4458
|
+
|
|
4459
|
+
function getListGlobalTextSyncUpdates(
|
|
4460
|
+
nextSettings: Record<string, unknown>,
|
|
4461
|
+
prevSettings: Record<string, unknown>,
|
|
4462
|
+
): Record<string, unknown> | null {
|
|
4463
|
+
const updates: Record<string, unknown> = {};
|
|
4464
|
+
let hasChanges = false;
|
|
4465
|
+
|
|
4466
|
+
for (const globalKey of LIST_GLOBAL_TEXT_STYLE_KEYS) {
|
|
4467
|
+
if (nextSettings[globalKey] === prevSettings[globalKey]) {
|
|
4468
|
+
continue;
|
|
4469
|
+
}
|
|
4470
|
+
if (nextSettings[globalKey] === undefined) {
|
|
4471
|
+
continue;
|
|
4472
|
+
}
|
|
4473
|
+
|
|
4474
|
+
hasChanges = true;
|
|
4475
|
+
for (const prefix of COLUMN_TEXT_PREFIXES) {
|
|
4476
|
+
updates[getListColumnTextSettingKey(prefix, globalKey)] = nextSettings[globalKey];
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
|
|
4480
|
+
return hasChanges ? updates : null;
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4483
|
+
const COLUMN_WIDTH_KEYS = [
|
|
4484
|
+
'AColumnWidth',
|
|
4485
|
+
'BColumnWidth',
|
|
4486
|
+
'CColumnWidth',
|
|
4487
|
+
'DColumnWidth',
|
|
4488
|
+
'EColumnWidth',
|
|
4489
|
+
] as const;
|
|
4490
|
+
|
|
4491
|
+
const COLUMN_PADDING_LEFT_KEYS = [
|
|
4492
|
+
'AColumnPaddingLeft',
|
|
4493
|
+
'BColumnPaddingLeft',
|
|
4494
|
+
'CColumnPaddingLeft',
|
|
4495
|
+
'DColumnPaddingLeft',
|
|
4496
|
+
'EColumnPaddingLeft',
|
|
4497
|
+
] as const;
|
|
4498
|
+
|
|
4499
|
+
const COLUMN_PADDING_RIGHT_KEYS = [
|
|
4500
|
+
'AColumnPaddingRight',
|
|
4501
|
+
'BColumnPaddingRight',
|
|
4502
|
+
'CColumnPaddingRight',
|
|
4503
|
+
'DColumnPaddingRight',
|
|
4504
|
+
'EColumnPaddingRight',
|
|
4505
|
+
] as const;
|
|
4506
|
+
|
|
4507
|
+
const COLUMN_PADDING_BOTTOM_KEYS = [
|
|
4508
|
+
'AColumnPaddingBottom',
|
|
4509
|
+
'BColumnPaddingBottom',
|
|
4510
|
+
'CColumnPaddingBottom',
|
|
4511
|
+
'DColumnPaddingBottom',
|
|
4512
|
+
'EColumnPaddingBottom',
|
|
4513
|
+
] as const;
|
|
4514
|
+
|
|
4515
|
+
type ColumnWidthKey = typeof COLUMN_WIDTH_KEYS[number];
|
|
4516
|
+
type ColumnPaddingLeftKey = typeof COLUMN_PADDING_LEFT_KEYS[number];
|
|
4517
|
+
type ColumnPaddingRightKey = typeof COLUMN_PADDING_RIGHT_KEYS[number];
|
|
4518
|
+
type ColumnPaddingBottomKey = typeof COLUMN_PADDING_BOTTOM_KEYS[number];
|
|
4519
|
+
|
|
4520
|
+
type ListItemColumn = {
|
|
4521
|
+
key: string;
|
|
4522
|
+
textPrefix: typeof COLUMN_TEXT_PREFIXES[number];
|
|
4523
|
+
widthKey: ColumnWidthKey;
|
|
4524
|
+
paddingLeftKey: ColumnPaddingLeftKey;
|
|
4525
|
+
paddingRightKey: ColumnPaddingRightKey;
|
|
4526
|
+
paddingBottomKey: ColumnPaddingBottomKey;
|
|
4527
|
+
width: number;
|
|
4528
|
+
paddingLeft: number;
|
|
4529
|
+
paddingRight: number;
|
|
4530
|
+
paddingBottom: number;
|
|
4531
|
+
};
|
|
4532
|
+
|
|
4533
|
+
type ColorKeys =
|
|
4534
|
+
| 'textColor'
|
|
4535
|
+
| 'backgroundColor'
|
|
4536
|
+
| 'dividerColor'
|
|
4537
|
+
| 'textHoverColor'
|
|
4538
|
+
| 'backgroundHoverColor'
|
|
4539
|
+
| 'dividerHoverColor';
|
|
4540
|
+
|
|
4541
|
+
const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
4542
|
+
textColor: 'text-color',
|
|
4543
|
+
backgroundColor: 'background-color',
|
|
4544
|
+
dividerColor: 'divider-color',
|
|
4545
|
+
textHoverColor: 'text-hover-color',
|
|
4546
|
+
backgroundHoverColor: 'background-hover-color',
|
|
4547
|
+
dividerHoverColor: 'divider-hover-color',
|
|
4548
|
+
};
|
|
4549
|
+
|
|
4550
|
+
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
4551
|
+
|
|
4552
|
+
const COL_RESIZE_HANDLE_WIDTH = 0.004;
|
|
4553
|
+
const COL_PADDING_HANDLE_WIDTH = 0.004;
|
|
4554
|
+
const MIN_COLUMN_WIDTH_PX = 50;
|
|
4555
|
+
const ARTICLE_DESIGN_WIDTH = 1440;
|
|
4556
|
+
const MIN_COLUMN_WIDTH = MIN_COLUMN_WIDTH_PX / ARTICLE_DESIGN_WIDTH;
|
|
4557
|
+
|
|
4558
|
+
export function getListMinColumnWidth(designWidthPx?: number): number {
|
|
4559
|
+
const designWidth = typeof designWidthPx === 'number' && designWidthPx > 0
|
|
4560
|
+
? designWidthPx
|
|
4561
|
+
: ARTICLE_DESIGN_WIDTH;
|
|
4562
|
+
|
|
4563
|
+
return MIN_COLUMN_WIDTH_PX / designWidth;
|
|
4564
|
+
}
|
|
4565
|
+
|
|
4566
|
+
function getEditorDesignWidth(element: HTMLElement | null | undefined): number {
|
|
4567
|
+
let el = element ?? null;
|
|
4568
|
+
|
|
4569
|
+
while (el) {
|
|
4570
|
+
const inline = el.style.getPropertyValue('--cntrl-article-width').trim();
|
|
4571
|
+
if (inline) {
|
|
4572
|
+
const px = parseFloat(inline);
|
|
4573
|
+
if (Number.isFinite(px) && px > 0) {
|
|
4574
|
+
return px;
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4577
|
+
|
|
4578
|
+
const computed = getComputedStyle(el).getPropertyValue('--cntrl-article-width').trim();
|
|
4579
|
+
if (computed) {
|
|
4580
|
+
const px = parseFloat(computed);
|
|
4581
|
+
if (Number.isFinite(px) && px > 0) {
|
|
4582
|
+
return px;
|
|
4583
|
+
}
|
|
4584
|
+
}
|
|
4585
|
+
|
|
4586
|
+
el = el.parentElement;
|
|
4587
|
+
}
|
|
4588
|
+
|
|
4589
|
+
return ARTICLE_DESIGN_WIDTH;
|
|
4590
|
+
}
|
|
4591
|
+
|
|
4592
|
+
const DEFAULT_COLUMN_WIDTHS: Record<ColumnWidthKey, number> = {
|
|
4593
|
+
AColumnWidth: 0.02,
|
|
4594
|
+
BColumnWidth: 0.02,
|
|
4595
|
+
CColumnWidth: 0.02,
|
|
4596
|
+
DColumnWidth: 0.02,
|
|
4597
|
+
EColumnWidth: 0.02,
|
|
4598
|
+
};
|
|
4599
|
+
|
|
4600
|
+
export function getListEffectiveContentWidth(
|
|
4601
|
+
settings: Record<string, unknown>,
|
|
4602
|
+
): number {
|
|
4603
|
+
const wrapperWidth = typeof settings.wrapperWidth === 'number' ? settings.wrapperWidth : 1;
|
|
4604
|
+
|
|
4605
|
+
return Math.max(0, wrapperWidth);
|
|
4606
|
+
}
|
|
4607
|
+
|
|
4608
|
+
export function getEqualListColumnWidthUpdates(
|
|
4609
|
+
columns: number,
|
|
4610
|
+
contentWidth: number = 1,
|
|
4611
|
+
): Record<ColumnWidthKey, number> {
|
|
4612
|
+
const equalColumnWidth = contentWidth / columns;
|
|
4613
|
+
return Object.fromEntries(
|
|
4614
|
+
COLUMN_WIDTH_KEYS.map((key) => [key, equalColumnWidth]),
|
|
4615
|
+
) as Record<ColumnWidthKey, number>;
|
|
4616
|
+
}
|
|
4617
|
+
|
|
4618
|
+
function getResetListColumnPaddingUpdates(): Record<
|
|
4619
|
+
ColumnPaddingLeftKey | ColumnPaddingRightKey,
|
|
4620
|
+
number
|
|
4621
|
+
> {
|
|
4622
|
+
return Object.fromEntries([
|
|
4623
|
+
...COLUMN_PADDING_LEFT_KEYS.map((key) => [key, 0]),
|
|
4624
|
+
...COLUMN_PADDING_RIGHT_KEYS.map((key) => [key, 0]),
|
|
4625
|
+
]) as Record<ColumnPaddingLeftKey | ColumnPaddingRightKey, number>;
|
|
4626
|
+
}
|
|
4627
|
+
|
|
4628
|
+
function getResetListColumnPaddingBottomUpdates(): Record<ColumnPaddingBottomKey, number> {
|
|
4629
|
+
return Object.fromEntries(
|
|
4630
|
+
COLUMN_PADDING_BOTTOM_KEYS.map((key) => [key, 0]),
|
|
4631
|
+
) as Record<ColumnPaddingBottomKey, number>;
|
|
4632
|
+
}
|
|
4633
|
+
|
|
4634
|
+
function getStoredColumnWidths(
|
|
4635
|
+
settings: Record<string, unknown>,
|
|
4636
|
+
): Record<ColumnWidthKey, number> {
|
|
4637
|
+
return Object.fromEntries(
|
|
4638
|
+
COLUMN_WIDTH_KEYS.map((key) => [
|
|
4639
|
+
key,
|
|
4640
|
+
typeof settings[key] === 'number'
|
|
4641
|
+
? settings[key] as number
|
|
4642
|
+
: DEFAULT_COLUMN_WIDTHS[key],
|
|
4643
|
+
]),
|
|
4644
|
+
) as Record<ColumnWidthKey, number>;
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4647
|
+
export function resolveListColumnPadding(
|
|
4648
|
+
columnWidth: number,
|
|
4649
|
+
paddingLeft: number,
|
|
4650
|
+
paddingRight: number,
|
|
4651
|
+
): { paddingLeft: number; paddingRight: number } {
|
|
4652
|
+
const maxTotalPadding = columnWidth - MIN_COLUMN_WIDTH;
|
|
4653
|
+
const totalPadding = paddingLeft + paddingRight;
|
|
4654
|
+
|
|
4655
|
+
if (totalPadding <= 0 || totalPadding <= maxTotalPadding) {
|
|
4656
|
+
return { paddingLeft, paddingRight };
|
|
4657
|
+
}
|
|
4658
|
+
|
|
4659
|
+
if (maxTotalPadding <= 0) {
|
|
4660
|
+
return { paddingLeft: 0, paddingRight: 0 };
|
|
4661
|
+
}
|
|
4662
|
+
|
|
4663
|
+
const scale = maxTotalPadding / totalPadding;
|
|
4664
|
+
|
|
4665
|
+
return {
|
|
4666
|
+
paddingLeft: paddingLeft * scale,
|
|
4667
|
+
paddingRight: paddingRight * scale,
|
|
4668
|
+
};
|
|
4669
|
+
}
|
|
4670
|
+
|
|
4671
|
+
export function getEffectiveListColumnWidths(
|
|
4672
|
+
columns: number,
|
|
4673
|
+
wrapperWidth: number,
|
|
4674
|
+
storedWidths: Record<ColumnWidthKey, number>,
|
|
4675
|
+
): number[] {
|
|
4676
|
+
const resolvedWidths = resolveListColumnWidths(columns, wrapperWidth, storedWidths);
|
|
4677
|
+
|
|
4678
|
+
if (columns <= 0) {
|
|
4679
|
+
return [];
|
|
4680
|
+
}
|
|
4681
|
+
|
|
4682
|
+
const sumFixed = resolvedWidths.slice(0, columns - 1).reduce((sum, width) => sum + width, 0);
|
|
4683
|
+
|
|
4684
|
+
return [
|
|
4685
|
+
...resolvedWidths.slice(0, columns - 1),
|
|
4686
|
+
Math.max(0, wrapperWidth - sumFixed),
|
|
4687
|
+
];
|
|
4688
|
+
}
|
|
4689
|
+
|
|
4690
|
+
function getListColumnPaddingUpdates(
|
|
4691
|
+
columns: number,
|
|
4692
|
+
effectiveWidths: number[],
|
|
4693
|
+
settings: Record<string, unknown>,
|
|
4694
|
+
): Partial<Record<ColumnPaddingLeftKey | ColumnPaddingRightKey, number>> {
|
|
4695
|
+
const updates: Partial<Record<ColumnPaddingLeftKey | ColumnPaddingRightKey, number>> = {};
|
|
4696
|
+
|
|
4697
|
+
for (let index = 0; index < columns; index += 1) {
|
|
4698
|
+
const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
|
|
4699
|
+
const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
|
|
4700
|
+
const storedPaddingLeft = typeof settings[paddingLeftKey] === 'number'
|
|
4701
|
+
? settings[paddingLeftKey] as number
|
|
4702
|
+
: 0;
|
|
4703
|
+
const storedPaddingRight = typeof settings[paddingRightKey] === 'number'
|
|
4704
|
+
? settings[paddingRightKey] as number
|
|
4705
|
+
: 0;
|
|
4706
|
+
const resolvedPadding = resolveListColumnPadding(
|
|
4707
|
+
effectiveWidths[index] ?? 0,
|
|
4708
|
+
storedPaddingLeft,
|
|
4709
|
+
storedPaddingRight,
|
|
4710
|
+
);
|
|
4711
|
+
|
|
4712
|
+
if (resolvedPadding.paddingLeft !== storedPaddingLeft) {
|
|
4713
|
+
updates[paddingLeftKey] = resolvedPadding.paddingLeft;
|
|
4714
|
+
}
|
|
4715
|
+
|
|
4716
|
+
if (resolvedPadding.paddingRight !== storedPaddingRight) {
|
|
4717
|
+
updates[paddingRightKey] = resolvedPadding.paddingRight;
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
|
|
4721
|
+
return updates;
|
|
4722
|
+
}
|
|
4723
|
+
|
|
4724
|
+
export function resolveListColumnWidths(
|
|
4725
|
+
columns: number,
|
|
4726
|
+
wrapperWidth: number,
|
|
4727
|
+
storedWidths: Record<ColumnWidthKey, number>,
|
|
4728
|
+
): number[] {
|
|
4729
|
+
if (columns <= 0) {
|
|
4730
|
+
return [];
|
|
4731
|
+
}
|
|
4732
|
+
|
|
4733
|
+
const widths = COLUMN_WIDTH_KEYS.slice(0, columns).map(
|
|
4734
|
+
(key) => storedWidths[key],
|
|
4735
|
+
);
|
|
4736
|
+
|
|
4737
|
+
if (columns === 1) {
|
|
4738
|
+
return widths;
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4741
|
+
const fixedWidths = widths.slice(0, columns - 1);
|
|
4742
|
+
const fixedSum = fixedWidths.reduce((sum, width) => sum + width, 0);
|
|
4743
|
+
const minTotalWidth = fixedSum + MIN_COLUMN_WIDTH;
|
|
4744
|
+
|
|
4745
|
+
if (wrapperWidth >= minTotalWidth) {
|
|
4746
|
+
return widths;
|
|
4747
|
+
}
|
|
4748
|
+
|
|
4749
|
+
const resolvedFixedWidths = [...fixedWidths];
|
|
4750
|
+
let overflow = minTotalWidth - wrapperWidth;
|
|
4751
|
+
|
|
4752
|
+
for (let index = resolvedFixedWidths.length - 1; index >= 0 && overflow > 0; index -= 1) {
|
|
4753
|
+
const shrinkable = resolvedFixedWidths[index] - MIN_COLUMN_WIDTH;
|
|
4754
|
+
if (shrinkable <= 0) {
|
|
4755
|
+
continue;
|
|
4756
|
+
}
|
|
4757
|
+
|
|
4758
|
+
const shrinkAmount = Math.min(overflow, shrinkable);
|
|
4759
|
+
resolvedFixedWidths[index] -= shrinkAmount;
|
|
4760
|
+
overflow -= shrinkAmount;
|
|
4761
|
+
}
|
|
4762
|
+
|
|
4763
|
+
return [...resolvedFixedWidths, widths[columns - 1]];
|
|
4764
|
+
}
|
|
4765
|
+
|
|
4766
|
+
function getListColumnWidthUpdatesForWrapperWidth(
|
|
4767
|
+
columns: number,
|
|
4768
|
+
wrapperWidth: number,
|
|
4769
|
+
storedWidths: Record<ColumnWidthKey, number>,
|
|
4770
|
+
): Partial<Record<ColumnWidthKey, number>> {
|
|
4771
|
+
if (columns <= 1) {
|
|
4772
|
+
return {};
|
|
4773
|
+
}
|
|
4774
|
+
|
|
4775
|
+
const resolvedWidths = resolveListColumnWidths(columns, wrapperWidth, storedWidths);
|
|
4776
|
+
const updates: Partial<Record<ColumnWidthKey, number>> = {};
|
|
4777
|
+
|
|
4778
|
+
for (let index = 0; index < columns - 1; index += 1) {
|
|
4779
|
+
const key = COLUMN_WIDTH_KEYS[index];
|
|
4780
|
+
if (resolvedWidths[index] !== storedWidths[key]) {
|
|
4781
|
+
updates[key] = resolvedWidths[index];
|
|
4782
|
+
}
|
|
4783
|
+
}
|
|
4784
|
+
|
|
4785
|
+
return updates;
|
|
4786
|
+
}
|
|
4787
|
+
|
|
4788
|
+
function getColumnsOrder(settings: Record<string, unknown>): string[] {
|
|
4789
|
+
if (Array.isArray(settings.columnsOrder) && settings.columnsOrder.length > 0) {
|
|
4790
|
+
return settings.columnsOrder as string[];
|
|
4791
|
+
}
|
|
4792
|
+
|
|
4793
|
+
return [...COLUMN_CONTENT_KEYS];
|
|
4794
|
+
}
|
|
4795
|
+
|
|
4796
|
+
function areStringArraysEqual(left: string[], right: string[]): boolean {
|
|
4797
|
+
if (left.length !== right.length) {
|
|
4798
|
+
return false;
|
|
4799
|
+
}
|
|
4800
|
+
|
|
4801
|
+
return left.every((value, index) => value === right[index]);
|
|
4802
|
+
}
|
|
4803
|
+
|
|
4804
|
+
function getColumnLayoutUpdatesForOrderChange(
|
|
4805
|
+
nextOrder: string[],
|
|
4806
|
+
prevOrder: string[],
|
|
4807
|
+
prevSettings: Record<string, unknown>,
|
|
4808
|
+
columns: number,
|
|
4809
|
+
): Record<string, number> {
|
|
4810
|
+
const count = Math.min(columns, nextOrder.length, COLUMN_WIDTH_KEYS.length);
|
|
4811
|
+
const updates: Record<string, number> = {};
|
|
4812
|
+
|
|
4813
|
+
for (let index = 0; index < count; index += 1) {
|
|
4814
|
+
const contentKey = nextOrder[index];
|
|
4815
|
+
const prevSlotIndex = prevOrder.indexOf(contentKey);
|
|
4816
|
+
|
|
4817
|
+
if (prevSlotIndex === -1) {
|
|
4818
|
+
continue;
|
|
4819
|
+
}
|
|
4820
|
+
|
|
4821
|
+
const prevWidthKey = COLUMN_WIDTH_KEYS[prevSlotIndex];
|
|
4822
|
+
const prevPaddingLeftKey = COLUMN_PADDING_LEFT_KEYS[prevSlotIndex];
|
|
4823
|
+
const prevPaddingRightKey = COLUMN_PADDING_RIGHT_KEYS[prevSlotIndex];
|
|
4824
|
+
const prevPaddingBottomKey = COLUMN_PADDING_BOTTOM_KEYS[prevSlotIndex];
|
|
4825
|
+
const widthKey = COLUMN_WIDTH_KEYS[index];
|
|
4826
|
+
const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
|
|
4827
|
+
const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
|
|
4828
|
+
const paddingBottomKey = COLUMN_PADDING_BOTTOM_KEYS[index];
|
|
4829
|
+
|
|
4830
|
+
const prevWidth = prevSettings[prevWidthKey];
|
|
4831
|
+
const prevPaddingLeft = prevSettings[prevPaddingLeftKey];
|
|
4832
|
+
const prevPaddingRight = prevSettings[prevPaddingRightKey];
|
|
4833
|
+
const prevPaddingBottom = prevSettings[prevPaddingBottomKey];
|
|
4834
|
+
|
|
4835
|
+
if (typeof prevWidth === 'number') {
|
|
4836
|
+
updates[widthKey] = prevWidth;
|
|
4837
|
+
}
|
|
4838
|
+
|
|
4839
|
+
if (typeof prevPaddingLeft === 'number') {
|
|
4840
|
+
updates[paddingLeftKey] = prevPaddingLeft;
|
|
4841
|
+
}
|
|
4842
|
+
|
|
4843
|
+
if (typeof prevPaddingRight === 'number') {
|
|
4844
|
+
updates[paddingRightKey] = prevPaddingRight;
|
|
4845
|
+
}
|
|
4846
|
+
|
|
4847
|
+
if (typeof prevPaddingBottom === 'number') {
|
|
4848
|
+
updates[paddingBottomKey] = prevPaddingBottom;
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4851
|
+
|
|
4852
|
+
return updates;
|
|
4853
|
+
}
|
|
4854
|
+
|
|
4855
|
+
export function applyListSettingsChange(
|
|
4856
|
+
nextSettings: Record<string, unknown>,
|
|
4857
|
+
prevSettings: Record<string, unknown>,
|
|
4858
|
+
options?: { designWidth?: number },
|
|
4859
|
+
): Record<string, unknown> {
|
|
4860
|
+
const textSyncUpdates = getListGlobalTextSyncUpdates(nextSettings, prevSettings);
|
|
4861
|
+
if (textSyncUpdates) {
|
|
4862
|
+
nextSettings = { ...nextSettings, ...textSyncUpdates };
|
|
4863
|
+
}
|
|
4864
|
+
|
|
4865
|
+
const minColumnWidth = getListMinColumnWidth(options?.designWidth);
|
|
4866
|
+
const nextColumns = nextSettings.columns;
|
|
4867
|
+
const prevColumns = prevSettings.columns;
|
|
4868
|
+
const nextContentWidth = getListEffectiveContentWidth(nextSettings);
|
|
4869
|
+
const prevContentWidth = getListEffectiveContentWidth(prevSettings);
|
|
4870
|
+
const isVerticalLayout = nextSettings.type === 'B'
|
|
4871
|
+
|| (nextSettings.type === undefined && prevSettings.type === 'B');
|
|
4872
|
+
const columns =
|
|
4873
|
+
typeof nextColumns === 'number'
|
|
4874
|
+
? nextColumns
|
|
4875
|
+
: typeof prevColumns === 'number'
|
|
4876
|
+
? prevColumns
|
|
4877
|
+
: COLUMN_CONTENT_KEYS.length;
|
|
4878
|
+
|
|
4879
|
+
const withColumnPaddingUpdates = (
|
|
4880
|
+
settings: Record<string, unknown>,
|
|
4881
|
+
): Record<string, unknown> => {
|
|
4882
|
+
if (isVerticalLayout) {
|
|
4883
|
+
return settings;
|
|
4884
|
+
}
|
|
4885
|
+
|
|
4886
|
+
const storedWidths = getStoredColumnWidths({ ...prevSettings, ...settings });
|
|
4887
|
+
const contentWidth = getListEffectiveContentWidth(settings);
|
|
4888
|
+
const effectiveWidths = getEffectiveListColumnWidths(columns, contentWidth, storedWidths);
|
|
4889
|
+
const paddingUpdates = getListColumnPaddingUpdates(columns, effectiveWidths, {
|
|
4890
|
+
...prevSettings,
|
|
4891
|
+
...settings,
|
|
4892
|
+
});
|
|
4893
|
+
|
|
4894
|
+
if (Object.keys(paddingUpdates).length === 0) {
|
|
4895
|
+
return settings;
|
|
4896
|
+
}
|
|
4897
|
+
|
|
4898
|
+
return {
|
|
4899
|
+
...settings,
|
|
4900
|
+
...paddingUpdates,
|
|
4901
|
+
};
|
|
4902
|
+
};
|
|
4903
|
+
|
|
4904
|
+
if (typeof nextColumns === 'number' && nextColumns !== prevColumns) {
|
|
4905
|
+
const updates: Record<string, unknown> = {
|
|
4906
|
+
...nextSettings,
|
|
4907
|
+
...getEqualListColumnWidthUpdates(nextColumns, nextContentWidth),
|
|
4908
|
+
...getResetListColumnPaddingUpdates(),
|
|
4909
|
+
};
|
|
4910
|
+
|
|
4911
|
+
if (isVerticalLayout) {
|
|
4912
|
+
for (const key of COLUMN_PADDING_BOTTOM_KEYS) {
|
|
4913
|
+
if (typeof prevSettings[key] === 'number') {
|
|
4914
|
+
updates[key] = prevSettings[key];
|
|
4915
|
+
}
|
|
4916
|
+
}
|
|
4917
|
+
} else {
|
|
4918
|
+
Object.assign(updates, getResetListColumnPaddingBottomUpdates());
|
|
4919
|
+
}
|
|
4920
|
+
|
|
4921
|
+
return updates;
|
|
4922
|
+
}
|
|
4923
|
+
|
|
4924
|
+
const nextOrder = getColumnsOrder(nextSettings);
|
|
4925
|
+
const prevOrder = getColumnsOrder(prevSettings);
|
|
4926
|
+
|
|
4927
|
+
if (!areStringArraysEqual(nextOrder, prevOrder)) {
|
|
4928
|
+
return withColumnPaddingUpdates({
|
|
4929
|
+
...nextSettings,
|
|
4930
|
+
...getColumnLayoutUpdatesForOrderChange(nextOrder, prevOrder, prevSettings, columns),
|
|
4931
|
+
});
|
|
4932
|
+
}
|
|
4933
|
+
|
|
4934
|
+
if (nextContentWidth < prevContentWidth) {
|
|
4935
|
+
if (typeof columns === 'number' && !isVerticalLayout) {
|
|
4936
|
+
const storedWidths = getStoredColumnWidths({ ...prevSettings, ...nextSettings });
|
|
4937
|
+
|
|
4938
|
+
return withColumnPaddingUpdates({
|
|
4939
|
+
...nextSettings,
|
|
4940
|
+
...getListColumnWidthUpdatesForWrapperWidth(columns, nextContentWidth, storedWidths),
|
|
4941
|
+
});
|
|
4942
|
+
}
|
|
4943
|
+
}
|
|
4944
|
+
|
|
4945
|
+
if (isVerticalLayout) {
|
|
4946
|
+
const storedTextPaddingLR = typeof nextSettings.textPaddingLR === 'number'
|
|
4947
|
+
? nextSettings.textPaddingLR as number
|
|
4948
|
+
: 0;
|
|
4949
|
+
const maxAllowedPadding = Math.max(0, (nextContentWidth - minColumnWidth) / 2);
|
|
4950
|
+
|
|
4951
|
+
if (storedTextPaddingLR > maxAllowedPadding) {
|
|
4952
|
+
return { ...nextSettings, textPaddingLR: maxAllowedPadding };
|
|
4953
|
+
}
|
|
4954
|
+
|
|
4955
|
+
return nextSettings;
|
|
4956
|
+
}
|
|
4957
|
+
|
|
4958
|
+
const storedWidths = getStoredColumnWidths({ ...prevSettings, ...nextSettings });
|
|
4959
|
+
const prevEffectiveWidths = getEffectiveListColumnWidths(
|
|
4960
|
+
columns,
|
|
4961
|
+
prevContentWidth,
|
|
4962
|
+
getStoredColumnWidths(prevSettings),
|
|
4963
|
+
);
|
|
4964
|
+
const nextEffectiveWidths = getEffectiveListColumnWidths(
|
|
4965
|
+
columns,
|
|
4966
|
+
nextContentWidth,
|
|
4967
|
+
storedWidths,
|
|
4968
|
+
);
|
|
4969
|
+
const columnWidthDecreased = nextEffectiveWidths.some(
|
|
4970
|
+
(width, index) => width < (prevEffectiveWidths[index] ?? width),
|
|
4971
|
+
);
|
|
4972
|
+
const columnWidthSettingChanged = COLUMN_WIDTH_KEYS.some((key) => {
|
|
4973
|
+
const nextWidth = nextSettings[key];
|
|
4974
|
+
const prevWidth = prevSettings[key];
|
|
4975
|
+
|
|
4976
|
+
return typeof nextWidth === 'number'
|
|
4977
|
+
&& typeof prevWidth === 'number'
|
|
4978
|
+
&& nextWidth !== prevWidth;
|
|
4979
|
+
});
|
|
4980
|
+
|
|
4981
|
+
if (columnWidthDecreased || columnWidthSettingChanged) {
|
|
4982
|
+
return withColumnPaddingUpdates(nextSettings);
|
|
4983
|
+
}
|
|
4984
|
+
|
|
4985
|
+
return nextSettings;
|
|
4986
|
+
}
|
|
4987
|
+
|
|
4988
|
+
function getColumnMaxWidth(
|
|
4989
|
+
columnIndex: number,
|
|
4990
|
+
resolvedWidths: number[],
|
|
4991
|
+
storedWidths: number[],
|
|
4992
|
+
wrapperWidth: number,
|
|
4993
|
+
): number {
|
|
4994
|
+
const leftWidth = resolvedWidths
|
|
4995
|
+
.slice(0, columnIndex)
|
|
4996
|
+
.reduce((sum, width) => sum + width, 0);
|
|
4997
|
+
const rightPreferredWidth = storedWidths
|
|
4998
|
+
.slice(columnIndex + 1, resolvedWidths.length - 1)
|
|
4999
|
+
.reduce((sum, width) => sum + width, 0);
|
|
5000
|
+
|
|
5001
|
+
return Math.max(
|
|
5002
|
+
MIN_COLUMN_WIDTH,
|
|
5003
|
+
wrapperWidth - leftWidth - rightPreferredWidth - MIN_COLUMN_WIDTH,
|
|
5004
|
+
);
|
|
5005
|
+
}
|
|
5006
|
+
|
|
5007
|
+
function randomBetween(min: number, max: number): number {
|
|
5008
|
+
return Math.random() * (max - min) + min;
|
|
5009
|
+
}
|
|
5010
|
+
|
|
5011
|
+
function getColumnWidthsFromSettings(
|
|
5012
|
+
settings: Record<string, unknown>,
|
|
5013
|
+
): Record<ColumnWidthKey, number> {
|
|
5014
|
+
return Object.fromEntries(
|
|
5015
|
+
COLUMN_WIDTH_KEYS.map((key) => [
|
|
5016
|
+
key,
|
|
5017
|
+
typeof settings[key] === 'number' ? settings[key] as number : DEFAULT_COLUMN_WIDTHS[key],
|
|
5018
|
+
]),
|
|
5019
|
+
) as Record<ColumnWidthKey, number>;
|
|
5020
|
+
}
|
|
5021
|
+
|
|
5022
|
+
function getNumericSettingValues<K extends string>(
|
|
5023
|
+
settings: Record<string, unknown>,
|
|
5024
|
+
keys: readonly K[],
|
|
5025
|
+
fallback = 0,
|
|
5026
|
+
): Record<K, number> {
|
|
5027
|
+
return Object.fromEntries(
|
|
5028
|
+
keys.map((key) => [
|
|
5029
|
+
key,
|
|
5030
|
+
typeof settings[key] === 'number' ? settings[key] as number : fallback,
|
|
5031
|
+
]),
|
|
5032
|
+
) as Record<K, number>;
|
|
5033
|
+
}
|
|
5034
|
+
|
|
5035
|
+
function buildListColumns(
|
|
5036
|
+
columnContentOrder: readonly typeof COLUMN_CONTENT_KEYS[number][],
|
|
5037
|
+
columns: number,
|
|
5038
|
+
columnWidthByKey: Record<ColumnWidthKey, number>,
|
|
5039
|
+
columnPaddingLeftByKey: Record<ColumnPaddingLeftKey, number>,
|
|
5040
|
+
columnPaddingRightByKey: Record<ColumnPaddingRightKey, number>,
|
|
5041
|
+
columnPaddingBottomByKey: Record<ColumnPaddingBottomKey, number>,
|
|
5042
|
+
): ListItemColumn[] {
|
|
5043
|
+
return columnContentOrder.slice(0, columns).map((key, index) => {
|
|
5044
|
+
const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
|
|
5045
|
+
const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
|
|
5046
|
+
const paddingBottomKey = COLUMN_PADDING_BOTTOM_KEYS[index];
|
|
5047
|
+
|
|
5048
|
+
return {
|
|
5049
|
+
key,
|
|
5050
|
+
textPrefix: COLUMN_CONTENT_KEY_TO_TEXT_PREFIX[key],
|
|
5051
|
+
widthKey: COLUMN_WIDTH_KEYS[index],
|
|
5052
|
+
width: columnWidthByKey[COLUMN_WIDTH_KEYS[index]],
|
|
5053
|
+
paddingLeftKey,
|
|
5054
|
+
paddingRightKey,
|
|
5055
|
+
paddingBottomKey,
|
|
5056
|
+
paddingLeft: columnPaddingLeftByKey[paddingLeftKey],
|
|
5057
|
+
paddingRight: columnPaddingRightByKey[paddingRightKey],
|
|
5058
|
+
paddingBottom: columnPaddingBottomByKey[paddingBottomKey],
|
|
5059
|
+
};
|
|
5060
|
+
});
|
|
5061
|
+
}
|
|
5062
|
+
|
|
5063
|
+
export function List({ settings, content, isEditor, isPreviewMode, activeEvent, layoutId, onUpdateSettings }: ListProps) {
|
|
5064
|
+
const { prefix: P } = useScopedStyles();
|
|
5065
|
+
const showControls = Boolean(isEditor && isPreviewMode);
|
|
5066
|
+
const {
|
|
5067
|
+
columns,
|
|
5068
|
+
type,
|
|
5069
|
+
wrapperWidth,
|
|
5070
|
+
entriesCount,
|
|
5071
|
+
cellMinHeight,
|
|
5072
|
+
dividerWidth,
|
|
5073
|
+
showVisibility,
|
|
5074
|
+
cut,
|
|
5075
|
+
showCut,
|
|
5076
|
+
cutCellMinHeight,
|
|
5077
|
+
cutLabel,
|
|
5078
|
+
imageSize,
|
|
5079
|
+
imageOnHover,
|
|
5080
|
+
entryHoverEffect,
|
|
5081
|
+
rowPaddingTop,
|
|
5082
|
+
rowPaddingBottom,
|
|
5083
|
+
rowPaddingTopB,
|
|
5084
|
+
columnsOrder,
|
|
5085
|
+
textPaddingLR,
|
|
5086
|
+
textColor,
|
|
5087
|
+
textFontFamily,
|
|
5088
|
+
textFontSettings,
|
|
5089
|
+
textFontSize,
|
|
5090
|
+
textLineHeight,
|
|
5091
|
+
textLetterSpacing,
|
|
5092
|
+
textWordSpacing,
|
|
5093
|
+
textTextAppearance,
|
|
5094
|
+
backgroundColor,
|
|
5095
|
+
dividerColor,
|
|
5096
|
+
textHoverColor,
|
|
5097
|
+
backgroundHoverColor,
|
|
5098
|
+
dividerHoverColor,
|
|
5099
|
+
} = settings;
|
|
5100
|
+
|
|
5101
|
+
const [visibleRowCount, setVisibleRowCount] = useState<number | undefined>(undefined);
|
|
5102
|
+
const [hoverImage, setHoverImage] = useState<HoverImageState | null>(null);
|
|
5103
|
+
const showHoverImage = imageOnHover === 'On';
|
|
5104
|
+
const cutEnabled = (cut ?? 0) > 0;
|
|
5105
|
+
const isVerticalLayout = type === 'B';
|
|
5106
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
5107
|
+
const [designWidth, setDesignWidth] = useState(ARTICLE_DESIGN_WIDTH);
|
|
5108
|
+
const minColumnWidth = getListMinColumnWidth(designWidth);
|
|
5109
|
+
|
|
5110
|
+
const storedTextPaddingLRMax = Math.max(0, ((wrapperWidth ?? 0) - minColumnWidth) / 2);
|
|
5111
|
+
const effectiveTextPaddingLR = Math.min(textPaddingLR ?? 0, storedTextPaddingLRMax);
|
|
5112
|
+
const textPaddingLRHandleWidth = Math.max(effectiveTextPaddingLR, COL_PADDING_HANDLE_WIDTH);
|
|
5113
|
+
const textPaddingLRMaxFraction = ((wrapperWidth ?? 0) + minColumnWidth) / 2;
|
|
5114
|
+
|
|
5115
|
+
useLayoutEffect(() => {
|
|
5116
|
+
if (!isEditor) {
|
|
5117
|
+
setDesignWidth(ARTICLE_DESIGN_WIDTH);
|
|
5118
|
+
return;
|
|
5119
|
+
}
|
|
5120
|
+
|
|
5121
|
+
const syncDesignWidth = () => {
|
|
5122
|
+
setDesignWidth(getEditorDesignWidth(containerRef.current));
|
|
5123
|
+
};
|
|
5124
|
+
|
|
5125
|
+
syncDesignWidth();
|
|
5126
|
+
|
|
5127
|
+
const observed = containerRef.current;
|
|
5128
|
+
if (!observed) {
|
|
5129
|
+
return;
|
|
5130
|
+
}
|
|
5131
|
+
|
|
5132
|
+
const observer = new ResizeObserver(syncDesignWidth);
|
|
5133
|
+
observer.observe(observed);
|
|
5134
|
+
|
|
5135
|
+
let pageEl: HTMLElement | null = observed;
|
|
5136
|
+
while (pageEl && !pageEl.style.getPropertyValue('--cntrl-article-width')) {
|
|
5137
|
+
pageEl = pageEl.parentElement;
|
|
5138
|
+
}
|
|
5139
|
+
if (pageEl) {
|
|
5140
|
+
observer.observe(pageEl);
|
|
5141
|
+
}
|
|
5142
|
+
|
|
5143
|
+
return () => observer.disconnect();
|
|
5144
|
+
}, [isEditor, layoutId]);
|
|
5145
|
+
|
|
5146
|
+
useEffect(() => {
|
|
5147
|
+
setVisibleRowCount(undefined);
|
|
5148
|
+
}, [cut, showCut, content, entriesCount]);
|
|
5149
|
+
|
|
5150
|
+
const textFieldCss = listColumnTextFieldsToCss(resolveListGlobalTextFields(settings), isEditor);
|
|
5151
|
+
|
|
5152
|
+
const columnTextCssByPrefix = useMemo(
|
|
5153
|
+
() => Object.fromEntries(
|
|
5154
|
+
COLUMN_TEXT_PREFIXES.map((prefix) => [
|
|
5155
|
+
prefix,
|
|
5156
|
+
listColumnTextFieldsToCss(resolveListColumnTextFields(settings, prefix), isEditor),
|
|
5157
|
+
]),
|
|
5158
|
+
),
|
|
5159
|
+
[
|
|
5160
|
+
settings,
|
|
5161
|
+
textFontFamily,
|
|
5162
|
+
textFontSettings,
|
|
5163
|
+
textFontSize,
|
|
5164
|
+
textLineHeight,
|
|
5165
|
+
textLetterSpacing,
|
|
5166
|
+
textWordSpacing,
|
|
5167
|
+
textTextAppearance,
|
|
5168
|
+
textColor,
|
|
5169
|
+
isEditor,
|
|
5170
|
+
],
|
|
5171
|
+
);
|
|
5172
|
+
|
|
5173
|
+
const colorVars = buildColorVars(P, {
|
|
5174
|
+
textColor,
|
|
5175
|
+
backgroundColor,
|
|
5176
|
+
dividerColor,
|
|
5177
|
+
textHoverColor,
|
|
5178
|
+
backgroundHoverColor,
|
|
5179
|
+
dividerHoverColor
|
|
5180
|
+
}, COLOR_VAR_MAP, STATE_KEYS);
|
|
5181
|
+
|
|
5182
|
+
const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
|
|
5183
|
+
const entryHoverClass =
|
|
5184
|
+
entryHoverEffect === 'Default'
|
|
5185
|
+
? \`\${P}-entry-hover-default\`
|
|
5186
|
+
: entryHoverEffect === 'Blinds'
|
|
5187
|
+
? \`\${P}-entry-hover-blinds\`
|
|
5188
|
+
: '';
|
|
5189
|
+
const wrapperStateClasses = \`\${entryHoverClass} \${stateClass}\`.trim();
|
|
5190
|
+
const showDividerTop = showVisibility?.[0] ?? false;
|
|
5191
|
+
const showDividerBottom = showVisibility?.[1] ?? false;
|
|
5192
|
+
|
|
5193
|
+
const prevSettingsRef = useRef(settings);
|
|
5194
|
+
const prevLayoutIdRef = useRef(layoutId);
|
|
5195
|
+
|
|
5196
|
+
useEffect(() => {
|
|
5197
|
+
if (!onUpdateSettings || !isEditor) {
|
|
5198
|
+
prevSettingsRef.current = settings;
|
|
5199
|
+
prevLayoutIdRef.current = layoutId;
|
|
5200
|
+
return;
|
|
5201
|
+
}
|
|
5202
|
+
|
|
5203
|
+
if (prevLayoutIdRef.current !== layoutId) {
|
|
5204
|
+
prevSettingsRef.current = settings;
|
|
5205
|
+
prevLayoutIdRef.current = layoutId;
|
|
5206
|
+
return;
|
|
5207
|
+
}
|
|
5208
|
+
|
|
5209
|
+
const prevSettings = prevSettingsRef.current;
|
|
5210
|
+
const updatedSettings = applyListSettingsChange(
|
|
5211
|
+
settings as Record<string, unknown>,
|
|
5212
|
+
prevSettings as Record<string, unknown>,
|
|
5213
|
+
{ designWidth },
|
|
5214
|
+
) as ListSettings;
|
|
5215
|
+
|
|
5216
|
+
prevSettingsRef.current = settings;
|
|
5217
|
+
|
|
5218
|
+
if (updatedSettings === settings) {
|
|
5219
|
+
return;
|
|
5220
|
+
}
|
|
5221
|
+
|
|
5222
|
+
onUpdateSettings(updatedSettings);
|
|
5223
|
+
}, [settings, onUpdateSettings, isEditor, layoutId, designWidth]);
|
|
5224
|
+
|
|
5225
|
+
const columnWidthByKey = useMemo(
|
|
5226
|
+
() => getColumnWidthsFromSettings(settings as Record<string, unknown>),
|
|
5227
|
+
[
|
|
5228
|
+
settings.AColumnWidth,
|
|
5229
|
+
settings.BColumnWidth,
|
|
5230
|
+
settings.CColumnWidth,
|
|
5231
|
+
settings.DColumnWidth,
|
|
5232
|
+
settings.EColumnWidth,
|
|
5233
|
+
],
|
|
5234
|
+
);
|
|
5235
|
+
|
|
5236
|
+
const columnPaddingLeftByKey = useMemo(
|
|
5237
|
+
() => getNumericSettingValues(settings as Record<string, unknown>, COLUMN_PADDING_LEFT_KEYS),
|
|
5238
|
+
[
|
|
5239
|
+
settings.AColumnPaddingLeft,
|
|
5240
|
+
settings.BColumnPaddingLeft,
|
|
5241
|
+
settings.CColumnPaddingLeft,
|
|
5242
|
+
settings.DColumnPaddingLeft,
|
|
5243
|
+
settings.EColumnPaddingLeft,
|
|
5244
|
+
],
|
|
5245
|
+
);
|
|
5246
|
+
|
|
5247
|
+
const columnPaddingRightByKey = useMemo(
|
|
5248
|
+
() => getNumericSettingValues(settings as Record<string, unknown>, COLUMN_PADDING_RIGHT_KEYS),
|
|
5249
|
+
[
|
|
5250
|
+
settings.AColumnPaddingRight,
|
|
5251
|
+
settings.BColumnPaddingRight,
|
|
5252
|
+
settings.CColumnPaddingRight,
|
|
5253
|
+
settings.DColumnPaddingRight,
|
|
5254
|
+
settings.EColumnPaddingRight,
|
|
5255
|
+
],
|
|
5256
|
+
);
|
|
5257
|
+
|
|
5258
|
+
const columnPaddingBottomByKey = useMemo(
|
|
5259
|
+
() => getNumericSettingValues(settings as Record<string, unknown>, COLUMN_PADDING_BOTTOM_KEYS),
|
|
5260
|
+
[
|
|
5261
|
+
settings.AColumnPaddingBottom,
|
|
5262
|
+
settings.BColumnPaddingBottom,
|
|
5263
|
+
settings.CColumnPaddingBottom,
|
|
5264
|
+
settings.DColumnPaddingBottom,
|
|
5265
|
+
settings.EColumnPaddingBottom,
|
|
5266
|
+
],
|
|
5267
|
+
);
|
|
5268
|
+
|
|
5269
|
+
const columnContentOrder = useMemo((): typeof COLUMN_CONTENT_KEYS[number][] => {
|
|
5270
|
+
if (Array.isArray(columnsOrder) && columnsOrder.length > 0) {
|
|
5271
|
+
return columnsOrder as typeof COLUMN_CONTENT_KEYS[number][];
|
|
5272
|
+
}
|
|
5273
|
+
return [...COLUMN_CONTENT_KEYS];
|
|
5274
|
+
}, [columnsOrder]);
|
|
5275
|
+
|
|
5276
|
+
const listColumns = useMemo(
|
|
5277
|
+
() => buildListColumns(
|
|
5278
|
+
columnContentOrder,
|
|
5279
|
+
columns,
|
|
5280
|
+
columnWidthByKey,
|
|
5281
|
+
columnPaddingLeftByKey,
|
|
5282
|
+
columnPaddingRightByKey,
|
|
5283
|
+
columnPaddingBottomByKey,
|
|
5284
|
+
),
|
|
5285
|
+
[columnContentOrder, columns, columnWidthByKey, columnPaddingLeftByKey, columnPaddingRightByKey, columnPaddingBottomByKey],
|
|
5286
|
+
);
|
|
5287
|
+
|
|
5288
|
+
const resolvedContentWidth = getListEffectiveContentWidth(settings as Record<string, unknown>);
|
|
5289
|
+
|
|
5290
|
+
const storedColumnWidths = useMemo(
|
|
5291
|
+
() => COLUMN_WIDTH_KEYS.slice(0, columns).map((key) => columnWidthByKey[key]),
|
|
5292
|
+
[columns, columnWidthByKey],
|
|
5293
|
+
);
|
|
5294
|
+
|
|
5295
|
+
const resolvedColumnWidths = useMemo(
|
|
5296
|
+
() => resolveListColumnWidths(columns, resolvedContentWidth, columnWidthByKey),
|
|
5297
|
+
[columns, resolvedContentWidth, columnWidthByKey],
|
|
5298
|
+
);
|
|
5299
|
+
|
|
5300
|
+
const effectiveColumnWidths = useMemo(
|
|
5301
|
+
() => getEffectiveListColumnWidths(columns, resolvedContentWidth, columnWidthByKey),
|
|
5302
|
+
[columns, resolvedContentWidth, columnWidthByKey],
|
|
5303
|
+
);
|
|
5304
|
+
|
|
5305
|
+
const effectiveColumnPaddings = useMemo(
|
|
5306
|
+
() =>
|
|
5307
|
+
listColumns.map((col, index) =>
|
|
5308
|
+
resolveListColumnPadding(
|
|
5309
|
+
effectiveColumnWidths[index] ?? 0,
|
|
5310
|
+
col.paddingLeft,
|
|
5311
|
+
col.paddingRight,
|
|
5312
|
+
)),
|
|
5313
|
+
[listColumns, effectiveColumnWidths],
|
|
5314
|
+
);
|
|
5315
|
+
|
|
5316
|
+
const allRows: ListItemRow[] = useMemo(() => {
|
|
5317
|
+
const resEntriesCount = entriesCount === 0 ? Infinity : entriesCount;
|
|
5318
|
+
const items = (content ?? []).slice(0, resEntriesCount);
|
|
5319
|
+
|
|
5320
|
+
return items.map((item, index) => ({
|
|
5321
|
+
id: index,
|
|
5322
|
+
cells: Object.fromEntries(
|
|
5323
|
+
COLUMN_CONTENT_KEYS.map((key) => [key, item[key] ?? ''])
|
|
5324
|
+
),
|
|
5325
|
+
image: item.image,
|
|
5326
|
+
link: item.link,
|
|
5327
|
+
}));
|
|
5328
|
+
}, [content, entriesCount]);
|
|
5329
|
+
|
|
5330
|
+
const effectiveVisibleCount = cutEnabled
|
|
5331
|
+
? (visibleRowCount ?? cut)
|
|
5332
|
+
: allRows.length;
|
|
5333
|
+
|
|
5334
|
+
const visibleRows = useMemo(() => {
|
|
5335
|
+
if (cutEnabled) {
|
|
5336
|
+
return allRows.slice(0, effectiveVisibleCount);
|
|
5337
|
+
}
|
|
5338
|
+
return allRows;
|
|
5339
|
+
}, [allRows, cutEnabled, effectiveVisibleCount]);
|
|
5340
|
+
|
|
5341
|
+
const showCutLabel = cutEnabled && effectiveVisibleCount < allRows.length;
|
|
5342
|
+
|
|
5343
|
+
const hasBetweenItemDividers = visibleRows.length > 1 || showCutLabel;
|
|
5344
|
+
const dividerClassNames = [
|
|
5345
|
+
showDividerTop ? \`\${P}-divider-top\` : '',
|
|
5346
|
+
showDividerBottom || hasBetweenItemDividers ? \`\${P}-divider-bottom\` : '',
|
|
5347
|
+
].filter(Boolean).join(' ');
|
|
5348
|
+
|
|
5349
|
+
const handleShowMore = () => {
|
|
5350
|
+
const currentVisible = visibleRowCount ?? cut;
|
|
5351
|
+
if (!showCut) {
|
|
5352
|
+
setVisibleRowCount(allRows.length);
|
|
5353
|
+
return;
|
|
5354
|
+
}
|
|
5355
|
+
setVisibleRowCount(Math.min(currentVisible + showCut, allRows.length));
|
|
5356
|
+
};
|
|
5357
|
+
|
|
5358
|
+
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
5359
|
+
const resolvedRowPaddingTop = isVerticalLayout
|
|
5360
|
+
? (rowPaddingTopB ?? 0)
|
|
5361
|
+
: (rowPaddingTop ?? 0);
|
|
5362
|
+
const resolvedRowPaddingBottom = rowPaddingBottom ?? 0;
|
|
5363
|
+
const resolvedCellMinHeight = cellMinHeight ?? 0;
|
|
5364
|
+
const rowPaddingTopControlKey = isVerticalLayout ? 'rowPaddingTopB' : 'rowPaddingTop';
|
|
5365
|
+
const firstColumn = listColumns[0];
|
|
5366
|
+
const lastColumn = listColumns[listColumns.length - 1];
|
|
5367
|
+
const firstColumnEffectivePadding = effectiveColumnPaddings[0];
|
|
5368
|
+
const lastColumnEffectivePadding = effectiveColumnPaddings[effectiveColumnPaddings.length - 1];
|
|
5369
|
+
const firstColumnPaddingLeftWidth = firstColumn && firstColumnEffectivePadding
|
|
5370
|
+
? Math.max(firstColumnEffectivePadding.paddingLeft, COL_PADDING_HANDLE_WIDTH)
|
|
5371
|
+
: 0;
|
|
5372
|
+
const lastColumnPaddingRightWidth = lastColumn && lastColumnEffectivePadding
|
|
5373
|
+
? Math.max(lastColumnEffectivePadding.paddingRight, COL_PADDING_HANDLE_WIDTH)
|
|
5374
|
+
: 0;
|
|
5375
|
+
const columnsRightEdge = resolvedContentWidth;
|
|
5376
|
+
|
|
5377
|
+
const handleRowMouseEnter = (row: ListItemRow) => {
|
|
5378
|
+
if (!showHoverImage) return;
|
|
5379
|
+
|
|
5380
|
+
const image = row.image;
|
|
5381
|
+
if (!image?.url) {
|
|
5382
|
+
setHoverImage(null);
|
|
5383
|
+
return;
|
|
5384
|
+
}
|
|
5385
|
+
|
|
5386
|
+
if (hoverImage?.rowId === row.id) {
|
|
5387
|
+
return;
|
|
5388
|
+
}
|
|
5389
|
+
|
|
5390
|
+
const minWidth = imageSize?.min ?? 80;
|
|
5391
|
+
const maxWidth = imageSize?.max ?? 320;
|
|
5392
|
+
setHoverImage({
|
|
5393
|
+
rowId: row.id,
|
|
5394
|
+
url: image.url,
|
|
5395
|
+
objectFit: image.objectFit ?? 'cover',
|
|
5396
|
+
widthPx: randomBetween(minWidth, maxWidth),
|
|
5397
|
+
});
|
|
5398
|
+
};
|
|
5399
|
+
|
|
5400
|
+
const handleWrapperMouseLeave = () => {
|
|
5401
|
+
setHoverImage(null);
|
|
5402
|
+
};
|
|
5403
|
+
|
|
5404
|
+
return (
|
|
5405
|
+
<>
|
|
5406
|
+
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
5407
|
+
<div style={colorVars}>
|
|
5408
|
+
<div
|
|
5409
|
+
ref={containerRef}
|
|
5410
|
+
className={\`\${P}-wrapper \${wrapperStateClasses}\${dividerClassNames ? \` \${dividerClassNames}\` : ''}\${isVerticalLayout ? \` \${P}-type-b\` : ''}\`.trim()}
|
|
5411
|
+
style={{
|
|
5412
|
+
width: scalingValue(wrapperWidth ?? 0, isEditor),
|
|
5413
|
+
}}
|
|
5414
|
+
onMouseLeave={showHoverImage ? handleWrapperMouseLeave : undefined}
|
|
5415
|
+
>
|
|
5416
|
+
<div style={{ width: '100%' }}>
|
|
5417
|
+
{visibleRows.map((row, rowIdx) => {
|
|
5418
|
+
const hasLink = (row.link?.length ?? 0) > 0;
|
|
5419
|
+
const RowElement = hasLink ? 'a' : 'div';
|
|
5420
|
+
const rowStyle = getEntryDividerWidths(
|
|
5421
|
+
rowIdx,
|
|
5422
|
+
visibleRows.length,
|
|
5423
|
+
showDividerTop,
|
|
5424
|
+
showDividerBottom,
|
|
5425
|
+
showCutLabel,
|
|
5426
|
+
dividerWidth ?? 0,
|
|
5427
|
+
isEditor ?? false,
|
|
5428
|
+
);
|
|
5429
|
+
|
|
5430
|
+
return (
|
|
5431
|
+
<RowElement
|
|
5432
|
+
key={row.id}
|
|
5433
|
+
className={\`\${P}-list-item\`}
|
|
5434
|
+
{...(hasLink ? { href: row.link, target: '_blank' } : {})}
|
|
5435
|
+
style={rowStyle}
|
|
5436
|
+
onMouseEnter={showHoverImage ? () => handleRowMouseEnter(row) : undefined}
|
|
5437
|
+
>
|
|
5438
|
+
{(resolvedRowPaddingTop > 0 || showControls) && (
|
|
5439
|
+
<div
|
|
5440
|
+
{...(showControls ? {
|
|
5441
|
+
'data-controls': rowPaddingTopControlKey,
|
|
5442
|
+
'data-controls-axis': 'y',
|
|
5443
|
+
'data-controls-min': '0',
|
|
5444
|
+
} : {})}
|
|
5445
|
+
className={\`\${P}-row-padding-handle\`}
|
|
5446
|
+
style={{ height: scaled(resolvedRowPaddingTop) }}
|
|
5447
|
+
/>
|
|
5448
|
+
)}
|
|
5449
|
+
<div
|
|
5450
|
+
className={\`\${P}-list-cols-row\`}
|
|
5451
|
+
style={isVerticalLayout ? undefined : { minHeight: scaled(resolvedCellMinHeight) }}
|
|
5452
|
+
>
|
|
5453
|
+
{listColumns.map((col, colIndex) => {
|
|
5454
|
+
const isLastColumn = colIndex === listColumns.length - 1;
|
|
5455
|
+
const effectivePadding = effectiveColumnPaddings[colIndex];
|
|
5456
|
+
const columnPaddingBottom = col.paddingBottom;
|
|
5457
|
+
const hasColumnText = hasListColumnText(row.cells[col.key]);
|
|
5458
|
+
const showColumnPaddingBottom = isVerticalLayout
|
|
5459
|
+
&& hasColumnText
|
|
5460
|
+
&& (columnPaddingBottom > 0 || showControls);
|
|
5461
|
+
const columnSizeStyle = isVerticalLayout
|
|
5462
|
+
? { minHeight: scaled(resolvedCellMinHeight) }
|
|
5463
|
+
: (isLastColumn ? {} : { width: scaled(effectiveColumnWidths[colIndex]) });
|
|
5464
|
+
const columnPaddingStyle = isVerticalLayout
|
|
5465
|
+
? {
|
|
5466
|
+
paddingLeft: scaled(effectiveTextPaddingLR),
|
|
5467
|
+
paddingRight: scaled(effectiveTextPaddingLR),
|
|
5468
|
+
}
|
|
5469
|
+
: {
|
|
5470
|
+
paddingLeft: scaled(effectivePadding.paddingLeft),
|
|
5471
|
+
paddingRight: scaled(effectivePadding.paddingRight),
|
|
5472
|
+
};
|
|
5473
|
+
|
|
5474
|
+
return (
|
|
5475
|
+
<div key={col.key}>
|
|
5476
|
+
<div
|
|
5477
|
+
className={\`\${P}-list-col\${isLastColumn ? \` \${P}-list-col-last\` : ''}\`}
|
|
5478
|
+
style={{
|
|
5479
|
+
...columnPaddingStyle,
|
|
5480
|
+
...columnSizeStyle,
|
|
5481
|
+
}}
|
|
5482
|
+
data-test={col.width}
|
|
5483
|
+
>
|
|
5484
|
+
<span
|
|
5485
|
+
className={\`\${P}-list-col-title\`}
|
|
5486
|
+
style={columnTextCssByPrefix[col.textPrefix] ?? textFieldCss}
|
|
5487
|
+
>
|
|
5488
|
+
{row.cells[col.key] ?? null}
|
|
5489
|
+
</span>
|
|
5490
|
+
</div>
|
|
5491
|
+
{showColumnPaddingBottom && (
|
|
5492
|
+
<div
|
|
5493
|
+
{...(showControls ? {
|
|
5494
|
+
'data-controls': col.paddingBottomKey,
|
|
5495
|
+
'data-controls-axis': 'y',
|
|
5496
|
+
'data-controls-min': '0',
|
|
5497
|
+
} : {})}
|
|
5498
|
+
className={\`\${P}-row-padding-handle\`}
|
|
5499
|
+
style={{ height: scaled(columnPaddingBottom) }}
|
|
5500
|
+
/>
|
|
5501
|
+
)}
|
|
5502
|
+
</div>
|
|
5503
|
+
);
|
|
5504
|
+
})}
|
|
5505
|
+
</div>
|
|
5506
|
+
{!isVerticalLayout && (resolvedRowPaddingBottom > 0 || showControls) && (
|
|
5507
|
+
<div
|
|
5508
|
+
{...(showControls ? {
|
|
5509
|
+
'data-controls': 'rowPaddingBottom',
|
|
5510
|
+
'data-controls-axis': 'y',
|
|
5511
|
+
'data-controls-min': '0',
|
|
5512
|
+
} : {})}
|
|
5513
|
+
className={\`\${P}-row-padding-handle\`}
|
|
5514
|
+
style={{ height: scaled(resolvedRowPaddingBottom) }}
|
|
5515
|
+
/>
|
|
5516
|
+
)}
|
|
5517
|
+
</RowElement>
|
|
5518
|
+
);
|
|
5519
|
+
})}
|
|
5520
|
+
{showCutLabel && (
|
|
5521
|
+
<div
|
|
5522
|
+
className={\`\${P}-cut-item\`}
|
|
5523
|
+
style={{
|
|
5524
|
+
minHeight: scaled(cutCellMinHeight ?? 0),
|
|
5525
|
+
...getCutItemDividerWidths(
|
|
5526
|
+
showDividerBottom,
|
|
5527
|
+
dividerWidth ?? 0,
|
|
5528
|
+
isEditor ?? false,
|
|
5529
|
+
),
|
|
5530
|
+
}}
|
|
5531
|
+
>
|
|
5532
|
+
<div
|
|
5533
|
+
className={\`\${P}-list-cols-row\`}
|
|
5534
|
+
style={
|
|
5535
|
+
isVerticalLayout
|
|
5536
|
+
? {
|
|
5537
|
+
paddingLeft: scaled(effectiveTextPaddingLR),
|
|
5538
|
+
paddingRight: scaled(effectiveTextPaddingLR),
|
|
5539
|
+
}
|
|
5540
|
+
: { justifyContent: 'center' }
|
|
5541
|
+
}
|
|
5542
|
+
>
|
|
5543
|
+
<button
|
|
5544
|
+
type="button"
|
|
5545
|
+
className={\`\${P}-cut-label\`}
|
|
5546
|
+
style={textFieldCss}
|
|
5547
|
+
onClick={handleShowMore}
|
|
5548
|
+
>
|
|
5549
|
+
{cutLabel}
|
|
5550
|
+
</button>
|
|
5551
|
+
</div>
|
|
5552
|
+
</div>
|
|
5553
|
+
)}
|
|
5554
|
+
</div>
|
|
5555
|
+
{showControls && !isVerticalLayout && firstColumn && lastColumn && (
|
|
5556
|
+
<div key="column-edge-padding-handles" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
5557
|
+
<div
|
|
5558
|
+
data-controls={firstColumn.paddingLeftKey}
|
|
5559
|
+
data-controls-axis="x"
|
|
5560
|
+
data-controls-variant="column-padding"
|
|
5561
|
+
data-controls-min="0"
|
|
5562
|
+
data-controls-max-fraction={String(
|
|
5563
|
+
effectiveColumnWidths[0] - (firstColumnEffectivePadding?.paddingRight ?? 0),
|
|
5564
|
+
)}
|
|
5565
|
+
data-controls-static-handle=""
|
|
5566
|
+
className={\`\${P}-padding-control-handle\`}
|
|
5567
|
+
style={{
|
|
5568
|
+
position: 'absolute',
|
|
5569
|
+
top: 0,
|
|
5570
|
+
left: 0,
|
|
5571
|
+
width: scaled(firstColumnPaddingLeftWidth),
|
|
5572
|
+
height: '100%',
|
|
5573
|
+
pointerEvents: 'auto',
|
|
5574
|
+
zIndex: 2,
|
|
5575
|
+
}}
|
|
5576
|
+
/>
|
|
5577
|
+
<div
|
|
5578
|
+
data-controls={lastColumn.paddingRightKey}
|
|
5579
|
+
data-controls-axis="x"
|
|
5580
|
+
data-controls-variant="column-padding"
|
|
5581
|
+
data-controls-reverse=""
|
|
5582
|
+
data-controls-min="0"
|
|
5583
|
+
data-controls-max-fraction={String(
|
|
5584
|
+
effectiveColumnWidths[listColumns.length - 1]
|
|
5585
|
+
- (lastColumnEffectivePadding?.paddingLeft ?? 0),
|
|
5586
|
+
)}
|
|
5587
|
+
data-controls-static-handle=""
|
|
5588
|
+
className={\`\${P}-padding-control-handle\`}
|
|
5589
|
+
style={{
|
|
5590
|
+
position: 'absolute',
|
|
5591
|
+
top: 0,
|
|
5592
|
+
left: scaled(columnsRightEdge - lastColumnPaddingRightWidth),
|
|
5593
|
+
width: scaled(lastColumnPaddingRightWidth),
|
|
5594
|
+
height: '100%',
|
|
5595
|
+
pointerEvents: 'auto',
|
|
5596
|
+
zIndex: 2,
|
|
5597
|
+
}}
|
|
5598
|
+
/>
|
|
5599
|
+
</div>
|
|
5600
|
+
)}
|
|
5601
|
+
{showControls && !isVerticalLayout && listColumns.slice(0, -1).map((col, colIndex) => {
|
|
5602
|
+
const nextCol = listColumns[colIndex + 1];
|
|
5603
|
+
const maxColumnWidth = getColumnMaxWidth(
|
|
5604
|
+
colIndex,
|
|
5605
|
+
resolvedColumnWidths,
|
|
5606
|
+
storedColumnWidths,
|
|
5607
|
+
resolvedContentWidth,
|
|
5608
|
+
);
|
|
5609
|
+
const boundaryOffset = resolvedColumnWidths.slice(0, colIndex + 1).reduce((sum, width) => sum + width, 0);
|
|
5610
|
+
const colEffectivePadding = effectiveColumnPaddings[colIndex];
|
|
5611
|
+
const nextColEffectivePadding = effectiveColumnPaddings[colIndex + 1];
|
|
5612
|
+
const paddingRightWidth = Math.max(
|
|
5613
|
+
colEffectivePadding.paddingRight,
|
|
5614
|
+
COL_PADDING_HANDLE_WIDTH,
|
|
5615
|
+
);
|
|
5616
|
+
const paddingLeftWidth = Math.max(
|
|
5617
|
+
nextColEffectivePadding.paddingLeft,
|
|
5618
|
+
COL_PADDING_HANDLE_WIDTH,
|
|
5619
|
+
);
|
|
5620
|
+
const columnWidthHandleOffset = boundaryOffset - COL_RESIZE_HANDLE_WIDTH / 2;
|
|
5621
|
+
|
|
5622
|
+
return (
|
|
5623
|
+
<div key={\`\${col.widthKey}-junction\`} style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
5624
|
+
<div
|
|
5625
|
+
data-controls={col.paddingRightKey}
|
|
5626
|
+
data-controls-axis="x"
|
|
5627
|
+
data-controls-variant="column-padding"
|
|
5628
|
+
data-controls-reverse=""
|
|
5629
|
+
data-controls-min="0"
|
|
5630
|
+
data-controls-max-fraction={String(
|
|
5631
|
+
effectiveColumnWidths[colIndex] - colEffectivePadding.paddingLeft,
|
|
5632
|
+
)}
|
|
5633
|
+
data-controls-static-handle=""
|
|
5634
|
+
className={\`\${P}-padding-control-handle\`}
|
|
5635
|
+
style={{
|
|
5636
|
+
position: 'absolute',
|
|
5637
|
+
top: 0,
|
|
5638
|
+
left: scaled(boundaryOffset - paddingRightWidth),
|
|
5639
|
+
width: scaled(paddingRightWidth),
|
|
5640
|
+
height: '100%',
|
|
5641
|
+
pointerEvents: 'auto',
|
|
5642
|
+
zIndex: 2,
|
|
5643
|
+
}}
|
|
5644
|
+
/>
|
|
5645
|
+
<div
|
|
5646
|
+
data-controls={col.widthKey}
|
|
5647
|
+
data-controls-axis="x"
|
|
5648
|
+
data-controls-min={String(MIN_COLUMN_WIDTH_PX)}
|
|
5649
|
+
data-controls-max-fraction={String(maxColumnWidth)}
|
|
5650
|
+
data-controls-variant="column-width"
|
|
5651
|
+
className={\`\${P}-col-resize-handle\`}
|
|
5652
|
+
style={{
|
|
5653
|
+
position: 'absolute',
|
|
5654
|
+
top: '0px',
|
|
5655
|
+
left: scaled(columnWidthHandleOffset),
|
|
5656
|
+
width: scaled(COL_RESIZE_HANDLE_WIDTH),
|
|
5657
|
+
height: 'calc(100%)',
|
|
5658
|
+
pointerEvents: 'auto',
|
|
5659
|
+
zIndex: 4,
|
|
5660
|
+
}}
|
|
5661
|
+
/>
|
|
5662
|
+
<div
|
|
5663
|
+
data-controls={nextCol.paddingLeftKey}
|
|
5664
|
+
data-controls-axis="x"
|
|
5665
|
+
data-controls-variant="column-padding"
|
|
5666
|
+
data-controls-min="0"
|
|
5667
|
+
data-controls-max-fraction={String(
|
|
5668
|
+
effectiveColumnWidths[colIndex + 1] - nextColEffectivePadding.paddingRight,
|
|
5669
|
+
)}
|
|
5670
|
+
data-controls-static-handle=""
|
|
5671
|
+
className={\`\${P}-padding-control-handle\`}
|
|
5672
|
+
style={{
|
|
5673
|
+
position: 'absolute',
|
|
5674
|
+
top: 0,
|
|
5675
|
+
left: scaled(boundaryOffset),
|
|
5676
|
+
width: scaled(paddingLeftWidth),
|
|
5677
|
+
height: '100%',
|
|
5678
|
+
pointerEvents: 'auto',
|
|
5679
|
+
zIndex: 2,
|
|
5680
|
+
}}
|
|
5681
|
+
/>
|
|
5682
|
+
</div>
|
|
5683
|
+
);
|
|
5684
|
+
})}
|
|
5685
|
+
{showControls && isVerticalLayout && (
|
|
5686
|
+
<div key="text-padding-lr-handles" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
5687
|
+
<div
|
|
5688
|
+
data-controls="textPaddingLR"
|
|
5689
|
+
data-controls-paired=""
|
|
5690
|
+
data-controls-axis="x"
|
|
5691
|
+
data-controls-min="0"
|
|
5692
|
+
data-controls-max-fraction={String(textPaddingLRMaxFraction)}
|
|
5693
|
+
data-controls-static-handle=""
|
|
5694
|
+
className={\`\${P}-text-padding-lr-handle\`}
|
|
5695
|
+
style={{
|
|
5696
|
+
position: 'absolute',
|
|
5697
|
+
top: 0,
|
|
5698
|
+
left: 0,
|
|
5699
|
+
width: scaled(textPaddingLRHandleWidth),
|
|
5700
|
+
height: '100%',
|
|
5701
|
+
pointerEvents: 'auto',
|
|
5702
|
+
zIndex: 2,
|
|
5703
|
+
}}
|
|
5704
|
+
/>
|
|
5705
|
+
<div
|
|
5706
|
+
data-controls="textPaddingLR"
|
|
5707
|
+
data-controls-paired=""
|
|
5708
|
+
data-controls-axis="x"
|
|
5709
|
+
data-controls-reverse=""
|
|
5710
|
+
data-controls-min="0"
|
|
5711
|
+
data-controls-max-fraction={String(textPaddingLRMaxFraction)}
|
|
5712
|
+
data-controls-static-handle=""
|
|
5713
|
+
className={\`\${P}-text-padding-lr-handle\`}
|
|
5714
|
+
style={{
|
|
5715
|
+
position: 'absolute',
|
|
5716
|
+
top: 0,
|
|
5717
|
+
left: scaled(Math.max(textPaddingLRHandleWidth, resolvedContentWidth - textPaddingLRHandleWidth)),
|
|
5718
|
+
width: scaled(textPaddingLRHandleWidth),
|
|
5719
|
+
height: '100%',
|
|
5720
|
+
pointerEvents: 'auto',
|
|
5721
|
+
zIndex: 2,
|
|
5722
|
+
}}
|
|
5723
|
+
/>
|
|
5724
|
+
</div>
|
|
5725
|
+
)}
|
|
5726
|
+
{showHoverImage && hoverImage && (
|
|
5727
|
+
<img
|
|
5728
|
+
className={\`\${P}-hover-image\`}
|
|
5729
|
+
src={hoverImage.url}
|
|
5730
|
+
alt=""
|
|
5731
|
+
style={{
|
|
5732
|
+
width: sv(hoverImage.widthPx),
|
|
5733
|
+
objectFit: hoverImage.objectFit,
|
|
5734
|
+
}}
|
|
5735
|
+
/>
|
|
5736
|
+
)}
|
|
5737
|
+
</div>
|
|
5738
|
+
</div>
|
|
5739
|
+
</>
|
|
5740
|
+
);
|
|
5741
|
+
}
|
|
5742
|
+
`,Fe=["A","B","C","D","E"],Hc={FontFamily:"textFontFamily",FontSettings:"textFontSettings",FontSize:"textFontSize",LineHeight:"textLineHeight",LetterSpacing:"textLetterSpacing",WordSpacing:"textWordSpacing",TextAppearance:"textTextAppearance"};function Et(t,e){return Go(t,Hc[e])}const Le={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"}},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 Bc(t){return{type:"string",label:t,placeholder:"Add Title...",display:{type:"text-input"}}}function Rn(t){return{type:"number",scope:"layout",title:t,min:0,max:100,display:{type:"range-control"}}}function zc(){return Object.fromEntries(Fe.map((t,e)=>{const n=De[e],o=`${t} column`;return[n,Bc(o)]}))}function Dc(){const t={};for(const e of Fe)t[`${e}ColumnWidth`]=Rn(`${e} column width`),t[`${e}ColumnPaddingLeft`]=Rn(`${e} column padding left`),t[`${e}ColumnPaddingRight`]=Rn(`${e} column padding right`),t[`${e}ColumnPaddingBottom`]=Rn(`${e} column padding bottom`);return t}function Ti(t={}){const e={columns:5,wrapperWidth:1,columnsOrder:[...De]};for(const n of Fe)e[`${n}ColumnWidth`]=.2,e[`${n}ColumnPaddingLeft`]=0,e[`${n}ColumnPaddingRight`]=0,e[`${n}ColumnPaddingBottom`]=0;return{...e,...t}}function jc(t){return{[Et(t,"FontFamily")]:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},[Et(t,"FontSettings")]:{...Le.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},[Et(t,"FontSize")]:{...Le.fontSize,scope:"layout",title:"Font Size",display:{type:"font-size"}},[Et(t,"LineHeight")]:{...Le.lineHeight,scope:"layout",title:"Line Height",display:{type:"line-height-input"}},[Et(t,"LetterSpacing")]:{...Le.letterSpacing,scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},[Et(t,"WordSpacing")]:{...Le.wordSpacing,scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},[Et(t,"TextAppearance")]:{...Le.textAppearance,scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}}}}const Vc=qe.reduce((t,e)=>({...t,...jc(e)}),{}),Kc=qe.reduce((t,e)=>({...t,[Et(e,"FontFamily")]:"Arial",[Et(e,"FontSettings")]:{fontWeight:400,fontStyle:"normal"},[Et(e,"LetterSpacing")]:0,[Et(e,"WordSpacing")]:0,[Et(e,"TextAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Li(t){const{textFontSize:e,textLineHeight:n}=t;return qe.reduce((o,i)=>(e!==void 0&&(o[Et(i,"FontSize")]=e),n!==void 0&&(o[Et(i,"LineHeight")]=n),o),{})}const Uc=Fe.map(t=>`${t} column`),Gc=qe.map((t,e)=>({type:"group",title:Uc[e],items:[Et(t,"FontFamily"),Et(t,"FontSettings"),{type:"row",items:[Et(t,"FontSize"),Et(t,"LineHeight"),Et(t,"LetterSpacing"),Et(t,"WordSpacing")]},Et(t,"TextAppearance")]})),Yc=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],qc=["cutLabel","cutCellMinHeight","showCut"],Xc=[...Fe.flatMap(t=>[`${t}ColumnWidth`,`${t}ColumnPaddingLeft`,`${t}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"];function tn(t,e,n){return n.map(o=>({if:{name:t,value:e},then:{name:`properties.${o}.display.visible`,value:!1}}))}function ho(t,e){const n=t?` ${t}`:"";return{AColumn:`AColumn${n}`,BColumnWidth:`BColumnWidth${n}`,CColumnWidth:`CColumnWidth${n}`,DColumnWidth:`DColumnWidth${n}`,EColumnWidth:`EColumnWidth${n}`,image:e,link:""}}const Zc=[ho("",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"}),ho("2",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"}),ho("3",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"})],Jc=[...Fe.flatMap(t=>[`${t}ColumnWidth`,`${t}ColumnPaddingLeft`,`${t}ColumnPaddingRight`,`${t}ColumnPaddingBottom`]),"columnsOrder"],Qc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{...zc(),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:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Zc}},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:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell 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:"Cut",display:{type:"toggle-numeric-input",enum:["Off","On"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},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"}},...Dc(),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"}},textFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},textFontSettings:{...Le.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},...Vc,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:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Kc,backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:Ti({type:"B",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.043,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043,...Li({textFontSize:.043,textLineHeight:.043})}),d:Ti({type:"A",textPaddingLR:.01,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01,...Li({textFontSize:.01,textLineHeight:.01})})},displayRules:[...tn("cut",0,qc),...tn("type","A",["textPaddingLR"]),...tn("type","B",Xc),...tn("type","A",["rowPaddingTopB"]),...tn("type","A",Fe.map(t=>`${t}ColumnPaddingBottom`))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Jc]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["entryHoverEffect"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]},{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"All text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]},...Gc]}],paletteBookmark:{items:[...Yc],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},td={element:Oc,id:"list",name:"Default List",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Qc,sourceCode:Nc},ed=[Ws,Os,Tl,Al,Vl,ql,ec,pc,td];exports.components=ed;exports.isSchemaV1=Cr;
|