@cntrl-site/components 1.0.9-0 → 1.0.9-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),b=require("react"),be=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),kr=require("react-dom");function Co(e){return e.type==="object"&&e.version===1}const wo="ControlSlider-module__wrapper___sHEkd",$o="ControlSlider-module__hoverArrow___A-dOH",To="ControlSlider-module__sliderItem___QQSkR",_o="ControlSlider-module__sliderImage___9hRl-",Lo="ControlSlider-module__arrow___05ghY",Eo="ControlSlider-module__arrowVertical___tBfVN",Ao="ControlSlider-module__nextArrow___-30Yc",Io="ControlSlider-module__arrowInner___aEra3",Fo="ControlSlider-module__arrowIcon___S4ztF",ko="ControlSlider-module__arrowImg___2dwJW",Ro="ControlSlider-module__mirror___brd6U",Po="ControlSlider-module__pagination___bicLF",Mo="ControlSlider-module__paginationInner___bT-P-",Wo="ControlSlider-module__paginationVertical___zYqKw",Ho="ControlSlider-module__paginationItem___nTRbk",Oo="ControlSlider-module__dot___p1Qun",No="ControlSlider-module__activeDot___LHFaj",jo="ControlSlider-module__paginationInsideBottom___R3FWn",zo="ControlSlider-module__paginationInsideTop___V-qb-",Vo="ControlSlider-module__paginationOutsideBottom___14w8D",Bo="ControlSlider-module__paginationOutsideTop___SCLqB",Do="ControlSlider-module__paginationInsideLeft___yOBRZ",Go="ControlSlider-module__paginationInsideRight___Rtt3o",qo="ControlSlider-module__paginationOutsideLeft___lahaw",Uo="ControlSlider-module__paginationOutsideRight___EtuQa",Xo="ControlSlider-module__imgWrapper___UjEgB",Yo="ControlSlider-module__captionBlock___dJ6-j",Ko="ControlSlider-module__captionTextWrapper___HFlpf",Zo="ControlSlider-module__captionText___uGBVc",Jo="ControlSlider-module__active___WZK4G",Qo="ControlSlider-module__withPointerEvents___t-18M",ei="ControlSlider-module__topLeftAlignment___zjnGM",ti="ControlSlider-module__topCenterAlignment___gD1xW",ni="ControlSlider-module__topRightAlignment___NMapS",ri="ControlSlider-module__middleLeftAlignment___OnUrY",oi="ControlSlider-module__middleCenterAlignment___Tdkl0",ii="ControlSlider-module__middleRightAlignment___wEbfX",ai="ControlSlider-module__bottomLeftAlignment___cTP2-",si="ControlSlider-module__bottomCenterAlignment___c54fB",li="ControlSlider-module__bottomRightAlignment___kEwrz",ci="ControlSlider-module__clickOverlay___DZA28",pi="ControlSlider-module__contain___pLyq7",ui="ControlSlider-module__cover___KdDat",Q={wrapper:wo,hoverArrow:$o,sliderItem:To,sliderImage:_o,arrow:Lo,arrowVertical:Eo,nextArrow:Ao,arrowInner:Io,arrowIcon:Fo,arrowImg:ko,mirror:Ro,pagination:Po,paginationInner:Mo,paginationVertical:Wo,paginationItem:Ho,dot:Oo,activeDot:No,paginationInsideBottom:jo,paginationInsideTop:zo,paginationOutsideBottom:Vo,paginationOutsideTop:Bo,paginationInsideLeft:Do,paginationInsideRight:Go,paginationOutsideLeft:qo,paginationOutsideRight:Uo,imgWrapper:Xo,captionBlock:Yo,captionTextWrapper:Ko,captionText:Zo,active:Jo,withPointerEvents:Qo,topLeftAlignment:ei,topCenterAlignment:ti,topRightAlignment:ni,middleLeftAlignment:ri,middleCenterAlignment:oi,middleRightAlignment:ii,bottomLeftAlignment:ai,bottomCenterAlignment:si,bottomRightAlignment:li,clickOverlay:ci,contain:pi,cover:ui};function di(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mi(e,t,n){return t&&di(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var sr="(prefers-reduced-motion: reduce)",yt=1,gi=2,xt=3,wt=4,Ht=5,Qt=6,rn=7,fi={CREATED:yt,MOUNTED:gi,IDLE:xt,MOVING:wt,SCROLLING:Ht,DRAGGING:Qt,DESTROYED:rn};function Xe(e){e.length=0}function rt(e,t,n){return Array.prototype.slice.call(e,t,n)}function xe(e){return e.bind.apply(e,[null].concat(rt(arguments,1)))}var Rr=setTimeout,En=function(){};function lr(e){return requestAnimationFrame(e)}function cn(e,t){return typeof t===e}function At(e){return!On(e)&&cn("object",e)}var Hn=Array.isArray,Pr=xe(cn,"function"),tt=xe(cn,"string"),Ot=xe(cn,"undefined");function On(e){return e===null}function Mr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Nt(e){return Hn(e)?e:[e]}function Re(e,t){Nt(e).forEach(t)}function Nn(e,t){return e.indexOf(t)>-1}function en(e,t){return e.push.apply(e,Nt(t)),e}function Ge(e,t,n){e&&Re(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Ne(e,t){Ge(e,tt(t)?t.split(" "):t,!0)}function jt(e,t){Re(t,e.appendChild.bind(e))}function jn(e,t){Re(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function It(e,t){return Mr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Wr(e,t){var n=e?rt(e.children):[];return t?n.filter(function(r){return It(r,t)}):n}function zt(e,t){return t?Wr(e,t)[0]:e.firstElementChild}var Ft=Object.keys;function ct(e,t,n){return e&&(n?Ft(e).reverse():Ft(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function kt(e){return rt(arguments,1).forEach(function(t){ct(t,function(n,r){e[r]=t[r]})}),e}function Je(e){return rt(arguments,1).forEach(function(t){ct(t,function(n,r){Hn(n)?e[r]=n.slice():At(n)?e[r]=Je({},At(e[r])?e[r]:{},n):e[r]=n})}),e}function cr(e,t){Re(t||Ft(e),function(n){delete e[n]})}function je(e,t){Re(e,function(n){Re(t,function(r){n&&n.removeAttribute(r)})})}function le(e,t,n){At(t)?ct(t,function(r,o){le(e,o,r)}):Re(e,function(r){On(n)||n===""?je(r,t):r.setAttribute(t,String(n))})}function vt(e,t,n){var r=document.createElement(e);return t&&(tt(t)?Ne(r,t):le(r,t)),n&&jt(n,r),r}function We(e,t,n){if(Ot(n))return getComputedStyle(e)[t];On(n)||(e.style[t]=""+n)}function Rt(e,t){We(e,"display",t)}function Hr(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function He(e,t){return e.getAttribute(t)}function pr(e,t){return e&&e.classList.contains(t)}function Ie(e){return e.getBoundingClientRect()}function pt(e){Re(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Or(e){return zt(new DOMParser().parseFromString(e,"text/html").body)}function De(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Nr(e,t){return e&&e.querySelector(t)}function zn(e,t){return t?rt(e.querySelectorAll(t)):[]}function qe(e,t){Ge(e,t,!1)}function An(e){return e.timeStamp}function st(e){return tt(e)?e:e?e+"px":""}var Vt="splide",Vn="data-"+Vt;function Lt(e,t){if(!e)throw new Error("["+Vt+"] "+(t||""))}var nt=Math.min,on=Math.max,an=Math.floor,Pt=Math.ceil,Ee=Math.abs;function jr(e,t,n){return Ee(e-t)<n}function tn(e,t,n,r){var o=nt(t,n),s=on(t,n);return r?o<e&&e<s:o<=e&&e<=s}function ft(e,t,n){var r=nt(t,n),o=on(t,n);return nt(on(r,e),o)}function In(e){return+(e>0)-+(e<0)}function Fn(e,t){return Re(t,function(n){e=e.replace("%s",""+n)}),e}function Bn(e){return e<10?"0"+e:""+e}var ur={};function hi(e){return""+e+Bn(ur[e]=(ur[e]||0)+1)}function zr(){var e=[];function t(i,p,c,m){o(i,p,function(l,_,g){var h="addEventListener"in l,u=h?l.removeEventListener.bind(l,_,c,m):l.removeListener.bind(l,c);h?l.addEventListener(_,c,m):l.addListener(c),e.push([l,_,g,c,u])})}function n(i,p,c){o(i,p,function(m,l,_){e=e.filter(function(g){return g[0]===m&&g[1]===l&&g[2]===_&&(!c||g[3]===c)?(g[4](),!1):!0})})}function r(i,p,c){var m,l=!0;return typeof CustomEvent=="function"?m=new CustomEvent(p,{bubbles:l,detail:c}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(p,l,!1,c)),i.dispatchEvent(m),m}function o(i,p,c){Re(i,function(m){m&&Re(p,function(l){l.split(" ").forEach(function(_){var g=_.split(".");c(m,g[0],g[1])})})})}function s(){e.forEach(function(i){i[4]()}),Xe(e)}return{bind:t,unbind:n,dispatch:r,destroy:s}}var ot="mounted",kn="ready",Ye="move",$t="moved",Dn="click",Vr="active",Br="inactive",Dr="visible",Gr="hidden",we="refresh",_e="updated",St="resize",pn="resized",qr="drag",Ur="dragging",Xr="dragged",un="scroll",dt="scrolled",yi="overflow",Gn="destroy",Yr="arrows:mounted",Kr="arrows:updated",Zr="pagination:mounted",Jr="pagination:updated",qn="navigation:mounted",Un="autoplay:play",Qr="autoplay:playing",Xn="autoplay:pause",Yn="lazyload:loaded",eo="sk",to="sh",sn="ei";function Se(e){var t=e?e.event.bus:document.createDocumentFragment(),n=zr();function r(s,i){n.bind(t,Nt(s).join(" "),function(p){i.apply(i,Hn(p.detail)?p.detail:[])})}function o(s){n.dispatch(t,s,rt(arguments,1))}return e&&e.event.on(Gn,n.destroy),kt(n,{bus:t,on:r,off:xe(n.unbind,t),emit:o})}function dn(e,t,n,r){var o=Date.now,s,i=0,p,c=!0,m=0;function l(){if(!c){if(i=e?nt((o()-s)/e,1):1,n&&n(i),i>=1&&(t(),s=o(),r&&++m>=r))return g();p=lr(l)}}function _(v){v||u(),s=o()-(v?i*e:0),c=!1,p=lr(l)}function g(){c=!0}function h(){s=o(),i=0,n&&n(i)}function u(){p&&cancelAnimationFrame(p),i=0,p=0,c=!0}function d(v){e=v}function x(){return c}return{start:_,rewind:h,pause:g,cancel:u,set:d,isPaused:x}}function vi(e){var t=e;function n(o){t=o}function r(o){return Nn(Nt(o),t)}return{set:n,is:r}}function bi(e,t){var n=dn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function xi(e,t,n){var r=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},i=zr(),p=[];function c(){var u=n.mediaQuery==="min";Ft(o).sort(function(d,x){return u?+d-+x:+x-+d}).forEach(function(d){l(o[d],"("+(u?"min":"max")+"-width:"+d+"px)")}),l(s,sr),_()}function m(u){u&&i.destroy()}function l(u,d){var x=matchMedia(d);i.bind(x,"change",_),p.push([u,x])}function _(){var u=r.is(rn),d=n.direction,x=p.reduce(function(v,S){return Je(v,S[1].matches?S[0]:{})},{});cr(n),h(x),n.destroy?e.destroy(n.destroy==="completely"):u?(m(!0),e.mount()):d!==n.direction&&e.refresh()}function g(u){matchMedia(sr).matches&&(u?Je(n,s):cr(n,Ft(s)))}function h(u,d,x){Je(n,u),d&&Je(Object.getPrototypeOf(n),u),(x||!r.is(yt))&&e.emit(_e,n)}return{setup:c,destroy:m,reduce:g,set:h}}var mn="Arrow",gn=mn+"Left",fn=mn+"Right",no=mn+"Up",ro=mn+"Down",dr="rtl",hn="ttb",Cn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[no,fn],ArrowRight:[ro,gn]};function Si(e,t,n){function r(s,i,p){p=p||n.direction;var c=p===dr&&!i?1:p===hn?0:-1;return Cn[s]&&Cn[s][c]||s.replace(/width|left|right/i,function(m,l){var _=Cn[m.toLowerCase()][c]||m;return l>0?_.charAt(0).toUpperCase()+_.slice(1):_})}function o(s){return s*(n.direction===dr?1:-1)}return{resolve:r,orient:o}}var Ue="role",bt="tabindex",Ci="disabled",Oe="aria-",Bt=Oe+"controls",oo=Oe+"current",mr=Oe+"selected",Fe=Oe+"label",Kn=Oe+"labelledby",io=Oe+"hidden",Zn=Oe+"orientation",Mt=Oe+"roledescription",gr=Oe+"live",fr=Oe+"busy",hr=Oe+"atomic",Jn=[Ue,bt,Ci,Bt,oo,Fe,Kn,io,Zn,Mt],ze=Vt+"__",it="is-",wn=Vt,yr=ze+"track",wi=ze+"list",yn=ze+"slide",ao=yn+"--clone",$i=yn+"__container",Qn=ze+"arrows",vn=ze+"arrow",so=vn+"--prev",lo=vn+"--next",bn=ze+"pagination",co=bn+"__page",Ti=ze+"progress",_i=Ti+"__bar",Li=ze+"toggle",Ei=ze+"spinner",Ai=ze+"sr",Ii=it+"initialized",ut=it+"active",po=it+"prev",uo=it+"next",Rn=it+"visible",Pn=it+"loading",mo=it+"focus-in",go=it+"overflow",Fi=[ut,Rn,po,uo,Pn,mo,go],ki={slide:yn,clone:ao,arrows:Qn,arrow:vn,prev:so,next:lo,pagination:bn,page:co,spinner:Ei};function Ri(e,t){if(Pr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!It(n,t);)n=n.parentElement;return n}var Pi=5,vr=200,fo="touchstart mousedown",$n="touchmove mousemove",Tn="touchend touchcancel mouseup click";function Mi(e,t,n){var r=Se(e),o=r.on,s=r.bind,i=e.root,p=n.i18n,c={},m=[],l=[],_=[],g,h,u;function d(){L(),z(),S()}function x(){o(we,v),o(we,d),o(_e,S),s(document,fo+" keydown",function(f){u=f.type==="keydown"},{capture:!0}),s(i,"focusin",function(){Ge(i,mo,!!u)})}function v(f){var C=Jn.concat("style");Xe(m),qe(i,l),qe(g,_),je([g,h],C),je(i,f?C:["style",Mt])}function S(){qe(i,l),qe(g,_),l=T(wn),_=T(yr),Ne(i,l),Ne(g,_),le(i,Fe,n.label),le(i,Kn,n.labelledby)}function L(){g=P("."+yr),h=zt(g,"."+wi),Lt(g&&h,"A track/list element is missing."),en(m,Wr(h,"."+yn+":not(."+ao+")")),ct({arrows:Qn,pagination:bn,prev:so,next:lo,bar:_i,toggle:Li},function(f,C){c[C]=P("."+f)}),kt(c,{root:i,track:g,list:h,slides:m})}function z(){var f=i.id||hi(Vt),C=n.role;i.id=f,g.id=g.id||f+"-track",h.id=h.id||f+"-list",!He(i,Ue)&&i.tagName!=="SECTION"&&C&&le(i,Ue,C),le(i,Mt,p.carousel),le(h,Ue,"presentation")}function P(f){var C=Nr(i,f);return C&&Ri(C,"."+wn)===i?C:void 0}function T(f){return[f+"--"+n.type,f+"--"+n.direction,n.drag&&f+"--draggable",n.isNavigation&&f+"--nav",f===wn&&ut]}return kt(c,{setup:d,mount:x,destroy:v})}var Ct="slide",Tt="loop",Dt="fade";function Wi(e,t,n,r){var o=Se(e),s=o.on,i=o.emit,p=o.bind,c=e.Components,m=e.root,l=e.options,_=l.isNavigation,g=l.updateOnMove,h=l.i18n,u=l.pagination,d=l.slideFocus,x=c.Direction.resolve,v=He(r,"style"),S=He(r,Fe),L=n>-1,z=zt(r,"."+$i),P;function T(){L||(r.id=m.id+"-slide"+Bn(t+1),le(r,Ue,u?"tabpanel":"group"),le(r,Mt,h.slide),le(r,Fe,S||Fn(h.slideLabel,[t+1,e.length]))),f()}function f(){p(r,"click",xe(i,Dn,F)),p(r,"keydown",xe(i,eo,F)),s([$t,to,dt],I),s(qn,E),g&&s(Ye,j)}function C(){P=!0,o.destroy(),qe(r,Fi),je(r,Jn),le(r,"style",v),le(r,Fe,S||"")}function E(){var k=e.splides.map(function(A){var W=A.splide.Components.Slides.getAt(t);return W?W.slide.id:""}).join(" ");le(r,Fe,Fn(h.slideX,(L?n:t)+1)),le(r,Bt,k),le(r,Ue,d?"button":""),d&&je(r,Mt)}function j(){P||I()}function I(){if(!P){var k=e.index;O(),M(),Ge(r,po,t===k-1),Ge(r,uo,t===k+1)}}function O(){var k=q();k!==pr(r,ut)&&(Ge(r,ut,k),le(r,oo,_&&k||""),i(k?Vr:Br,F))}function M(){var k=y(),A=!k&&(!q()||L);if(e.state.is([wt,Ht])||le(r,io,A||""),le(zn(r,l.focusableNodes||""),bt,A?-1:""),d&&le(r,bt,A?-1:0),k!==pr(r,Rn)&&(Ge(r,Rn,k),i(k?Dr:Gr,F)),!k&&document.activeElement===r){var W=c.Slides.getAt(e.index);W&&Hr(W.slide)}}function V(k,A,W){We(W&&z||r,k,A)}function q(){var k=e.index;return k===t||l.cloneStatus&&k===n}function y(){if(e.is(Dt))return q();var k=Ie(c.Elements.track),A=Ie(r),W=x("left",!0),Z=x("right",!0);return an(k[W])<=Pt(A[W])&&an(A[Z])<=Pt(k[Z])}function R(k,A){var W=Ee(k-t);return!L&&(l.rewind||e.is(Tt))&&(W=nt(W,e.length-W)),W<=A}var F={index:t,slideIndex:n,slide:r,container:z,isClone:L,mount:T,destroy:C,update:I,style:V,isWithin:R};return F}function Hi(e,t,n){var r=Se(e),o=r.on,s=r.emit,i=r.bind,p=t.Elements,c=p.slides,m=p.list,l=[];function _(){g(),o(we,h),o(we,g)}function g(){c.forEach(function(I,O){d(I,O,-1)})}function h(){P(function(I){I.destroy()}),Xe(l)}function u(){P(function(I){I.update()})}function d(I,O,M){var V=Wi(e,O,M,I);V.mount(),l.push(V),l.sort(function(q,y){return q.index-y.index})}function x(I){return I?T(function(O){return!O.isClone}):l}function v(I){var O=t.Controller,M=O.toIndex(I),V=O.hasFocus()?1:n.perPage;return T(function(q){return tn(q.index,M,M+V-1)})}function S(I){return T(I)[0]}function L(I,O){Re(I,function(M){if(tt(M)&&(M=Or(M)),Mr(M)){var V=c[O];V?jn(M,V):jt(m,M),Ne(M,n.classes.slide),C(M,xe(s,St))}}),s(we)}function z(I){pt(T(I).map(function(O){return O.slide})),s(we)}function P(I,O){x(O).forEach(I)}function T(I){return l.filter(Pr(I)?I:function(O){return tt(I)?It(O.slide,I):Nn(Nt(I),O.index)})}function f(I,O,M){P(function(V){V.style(I,O,M)})}function C(I,O){var M=zn(I,"img"),V=M.length;V?M.forEach(function(q){i(q,"load error",function(){--V||O()})}):O()}function E(I){return I?c.length:l.length}function j(){return l.length>n.perPage}return{mount:_,destroy:h,update:u,register:d,get:x,getIn:v,getAt:S,add:L,remove:z,forEach:P,filter:T,style:f,getLength:E,isEnough:j}}function Oi(e,t,n){var r=Se(e),o=r.on,s=r.bind,i=r.emit,p=t.Slides,c=t.Direction.resolve,m=t.Elements,l=m.root,_=m.track,g=m.list,h=p.getAt,u=p.style,d,x,v;function S(){L(),s(window,"resize load",bi(xe(i,St))),o([_e,we],L),o(St,z)}function L(){d=n.direction===hn,We(l,"maxWidth",st(n.width)),We(_,c("paddingLeft"),P(!1)),We(_,c("paddingRight"),P(!0)),z(!0)}function z(F){var k=Ie(l);(F||x.width!==k.width||x.height!==k.height)&&(We(_,"height",T()),u(c("marginRight"),st(n.gap)),u("width",C()),u("height",E(),!0),x=k,i(pn),v!==(v=R())&&(Ge(l,go,v),i(yi,v)))}function P(F){var k=n.padding,A=c(F?"right":"left");return k&&st(k[A]||(At(k)?0:k))||"0px"}function T(){var F="";return d&&(F=f(),Lt(F,"height or heightRatio is missing."),F="calc("+F+" - "+P(!1)+" - "+P(!0)+")"),F}function f(){return st(n.height||Ie(g).width*n.heightRatio)}function C(){return n.autoWidth?null:st(n.fixedWidth)||(d?"":j())}function E(){return st(n.fixedHeight)||(d?n.autoHeight?null:j():f())}function j(){var F=st(n.gap);return"calc((100%"+(F&&" + "+F)+")/"+(n.perPage||1)+(F&&" - "+F)+")"}function I(){return Ie(g)[c("width")]}function O(F,k){var A=h(F||0);return A?Ie(A.slide)[c("width")]+(k?0:q()):0}function M(F,k){var A=h(F);if(A){var W=Ie(A.slide)[c("right")],Z=Ie(g)[c("left")];return Ee(W-Z)+(k?0:q())}return 0}function V(F){return M(e.length-1)-M(0)+O(0,F)}function q(){var F=h(0);return F&&parseFloat(We(F.slide,c("marginRight")))||0}function y(F){return parseFloat(We(_,c("padding"+(F?"Right":"Left"))))||0}function R(){return e.is(Dt)||V(!0)>I()}return{mount:S,resize:z,listSize:I,slideSize:O,sliderSize:V,totalSize:M,getPadding:y,isOverflow:R}}var Ni=2;function ji(e,t,n){var r=Se(e),o=r.on,s=t.Elements,i=t.Slides,p=t.Direction.resolve,c=[],m;function l(){o(we,_),o([_e,St],h),(m=x())&&(u(m),t.Layout.resize(!0))}function _(){g(),l()}function g(){pt(c),Xe(c),r.destroy()}function h(){var v=x();m!==v&&(m<v||!v)&&r.emit(we)}function u(v){var S=i.get().slice(),L=S.length;if(L){for(;S.length<v;)en(S,S);en(S.slice(-v),S.slice(0,v)).forEach(function(z,P){var T=P<v,f=d(z.slide,P);T?jn(f,S[0].slide):jt(s.list,f),en(c,f),i.register(f,P-v+(T?0:L),z.index)})}}function d(v,S){var L=v.cloneNode(!0);return Ne(L,n.classes.clone),L.id=e.root.id+"-clone"+Bn(S+1),L}function x(){var v=n.clones;if(!e.is(Tt))v=0;else if(Ot(v)){var S=n[p("fixedWidth")]&&t.Layout.slideSize(0),L=S&&Pt(Ie(s.track)[p("width")]/S);v=L||n[p("autoWidth")]&&e.length||n.perPage*Ni}return v}return{mount:l,destroy:g}}function zi(e,t,n){var r=Se(e),o=r.on,s=r.emit,i=e.state.set,p=t.Layout,c=p.slideSize,m=p.getPadding,l=p.totalSize,_=p.listSize,g=p.sliderSize,h=t.Direction,u=h.resolve,d=h.orient,x=t.Elements,v=x.list,S=x.track,L;function z(){L=t.Transition,o([ot,pn,_e,we],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),f(e.index),t.Slides.update())}function T(A,W,Z,se){A!==W&&F(A>Z)&&(I(),C(j(V(),A>Z),!0)),i(wt),s(Ye,W,Z,A),L.start(W,function(){i(xt),s($t,W,Z,A),se&&se()})}function f(A){C(M(A,!0))}function C(A,W){if(!e.is(Dt)){var Z=W?A:E(A);We(v,"transform","translate"+u("X")+"("+Z+"px)"),A!==Z&&s(to)}}function E(A){if(e.is(Tt)){var W=O(A),Z=W>t.Controller.getEnd(),se=W<0;(se||Z)&&(A=j(A,Z))}return A}function j(A,W){var Z=A-R(W),se=g();return A-=d(se*(Pt(Ee(Z)/se)||1))*(W?1:-1),A}function I(){C(V(),!0),L.cancel()}function O(A){for(var W=t.Slides.get(),Z=0,se=1/0,ne=0;ne<W.length;ne++){var ce=W[ne].index,H=Ee(M(ce,!0)-A);if(H<=se)se=H,Z=ce;else break}return Z}function M(A,W){var Z=d(l(A-1)-y(A));return W?q(Z):Z}function V(){var A=u("left");return Ie(v)[A]-Ie(S)[A]+d(m(!1))}function q(A){return n.trimSpace&&e.is(Ct)&&(A=ft(A,0,d(g(!0)-_()))),A}function y(A){var W=n.focus;return W==="center"?(_()-c(A,!0))/2:+W*c(A)||0}function R(A){return M(A?t.Controller.getEnd():0,!!n.trimSpace)}function F(A){var W=d(j(V(),A));return A?W>=0:W<=v[u("scrollWidth")]-Ie(S)[u("width")]}function k(A,W){W=Ot(W)?V():W;var Z=A!==!0&&d(W)<d(R(!1)),se=A!==!1&&d(W)>d(R(!0));return Z||se}return{mount:z,move:T,jump:f,translate:C,shift:j,cancel:I,toIndex:O,toPosition:M,getPosition:V,getLimit:R,exceededLimit:k,reposition:P}}function Vi(e,t,n){var r=Se(e),o=r.on,s=r.emit,i=t.Move,p=i.getPosition,c=i.getLimit,m=i.toPosition,l=t.Slides,_=l.isEnough,g=l.getLength,h=n.omitEnd,u=e.is(Tt),d=e.is(Ct),x=xe(V,!1),v=xe(V,!0),S=n.start||0,L,z=S,P,T,f;function C(){E(),o([_e,we,sn],E),o(pn,j)}function E(){P=g(!0),T=n.perMove,f=n.perPage,L=F();var H=ft(S,0,h?L:P-1);H!==S&&(S=H,i.reposition())}function j(){L!==F()&&s(sn)}function I(H,ee,he){if(!ce()){var me=M(H),ge=R(me);ge>-1&&(ee||ge!==S)&&(Z(ge),i.move(me,ge,z,he))}}function O(H,ee,he,me){t.Scroll.scroll(H,ee,he,function(){var ge=R(i.toIndex(p()));Z(h?nt(ge,L):ge),me&&me()})}function M(H){var ee=S;if(tt(H)){var he=H.match(/([+\-<>])(\d+)?/)||[],me=he[1],ge=he[2];me==="+"||me==="-"?ee=q(S+ +(""+me+(+ge||1)),S):me===">"?ee=ge?k(+ge):x(!0):me==="<"&&(ee=v(!0))}else ee=u?H:ft(H,0,L);return ee}function V(H,ee){var he=T||(ne()?1:f),me=q(S+he*(H?-1:1),S,!(T||ne()));return me===-1&&d&&!jr(p(),c(!H),1)?H?0:L:ee?me:R(me)}function q(H,ee,he){if(_()||ne()){var me=y(H);me!==H&&(ee=H,H=me,he=!1),H<0||H>L?!T&&(tn(0,H,ee,!0)||tn(L,ee,H,!0))?H=k(A(H)):u?H=he?H<0?-(P%f||f):P:H:n.rewind?H=H<0?L:0:H=-1:he&&H!==ee&&(H=k(A(ee)+(H<ee?-1:1)))}else H=-1;return H}function y(H){if(d&&n.trimSpace==="move"&&H!==S)for(var ee=p();ee===m(H,!0)&&tn(H,0,e.length-1,!n.rewind);)H<S?--H:++H;return H}function R(H){return u?(H+P)%P||0:H}function F(){for(var H=P-(ne()||u&&T?1:f);h&&H-- >0;)if(m(P-1,!0)!==m(H,!0)){H++;break}return ft(H,0,P-1)}function k(H){return ft(ne()?H:f*H,0,L)}function A(H){return ne()?nt(H,L):an((H>=L?P-1:H)/f)}function W(H){var ee=i.toIndex(H);return d?ft(ee,0,L):ee}function Z(H){H!==S&&(z=S,S=H)}function se(H){return H?z:S}function ne(){return!Ot(n.focus)||n.isNavigation}function ce(){return e.state.is([wt,Ht])&&!!n.waitForTransition}return{mount:C,go:I,scroll:O,getNext:x,getPrev:v,getAdjacent:V,getEnd:F,setIndex:Z,getIndex:se,toIndex:k,toPage:A,toDest:W,hasFocus:ne,isBusy:ce}}var Bi="http://www.w3.org/2000/svg",Di="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",Xt=40;function Gi(e,t,n){var r=Se(e),o=r.on,s=r.bind,i=r.emit,p=n.classes,c=n.i18n,m=t.Elements,l=t.Controller,_=m.arrows,g=m.track,h=_,u=m.prev,d=m.next,x,v,S={};function L(){P(),o(_e,z)}function z(){T(),L()}function P(){var O=n.arrows;O&&!(u&&d)&&E(),u&&d&&(kt(S,{prev:u,next:d}),Rt(h,O?"":"none"),Ne(h,v=Qn+"--"+n.direction),O&&(f(),I(),le([u,d],Bt,g.id),i(Yr,u,d)))}function T(){r.destroy(),qe(h,v),x?(pt(_?[u,d]:h),u=d=null):je([u,d],Jn)}function f(){o([ot,$t,we,dt,sn],I),s(d,"click",xe(C,">")),s(u,"click",xe(C,"<"))}function C(O){l.go(O,!0)}function E(){h=_||vt("div",p.arrows),u=j(!0),d=j(!1),x=!0,jt(h,[u,d]),!_&&jn(h,g)}function j(O){var M='<button class="'+p.arrow+" "+(O?p.prev:p.next)+'" type="button"><svg xmlns="'+Bi+'" viewBox="0 0 '+Xt+" "+Xt+'" width="'+Xt+'" height="'+Xt+'" focusable="false"><path d="'+(n.arrowPath||Di)+'" />';return Or(M)}function I(){if(u&&d){var O=e.index,M=l.getPrev(),V=l.getNext(),q=M>-1&&O<M?c.last:c.prev,y=V>-1&&O>V?c.first:c.next;u.disabled=M<0,d.disabled=V<0,le(u,Fe,q),le(d,Fe,y),i(Kr,u,d,M,V)}}return{arrows:S,mount:L,destroy:T,update:I}}var qi=Vn+"-interval";function Ui(e,t,n){var r=Se(e),o=r.on,s=r.bind,i=r.emit,p=dn(n.interval,e.go.bind(e,">"),f),c=p.isPaused,m=t.Elements,l=t.Elements,_=l.root,g=l.toggle,h=n.autoplay,u,d,x=h==="pause";function v(){h&&(S(),g&&le(g,Bt,m.track.id),x||L(),T())}function S(){n.pauseOnHover&&s(_,"mouseenter mouseleave",function(E){u=E.type==="mouseenter",P()}),n.pauseOnFocus&&s(_,"focusin focusout",function(E){d=E.type==="focusin",P()}),g&&s(g,"click",function(){x?L():z(!0)}),o([Ye,un,we],p.rewind),o(Ye,C)}function L(){c()&&t.Slides.isEnough()&&(p.start(!n.resetProgress),d=u=x=!1,T(),i(Un))}function z(E){E===void 0&&(E=!0),x=!!E,T(),c()||(p.pause(),i(Xn))}function P(){x||(u||d?z(!1):L())}function T(){g&&(Ge(g,ut,!x),le(g,Fe,n.i18n[x?"play":"pause"]))}function f(E){var j=m.bar;j&&We(j,"width",E*100+"%"),i(Qr,E)}function C(E){var j=t.Slides.getAt(E);p.set(j&&+He(j.slide,qi)||n.interval)}return{mount:v,destroy:p.cancel,play:L,pause:z,isPaused:c}}function Xi(e,t,n){var r=Se(e),o=r.on;function s(){n.cover&&(o(Yn,xe(p,!0)),o([ot,_e,we],xe(i,!0)))}function i(c){t.Slides.forEach(function(m){var l=zt(m.container||m.slide,"img");l&&l.src&&p(c,l,m)})}function p(c,m,l){l.style("background",c?'center/cover no-repeat url("'+m.src+'")':"",!0),Rt(m,c?"none":"")}return{mount:s,destroy:xe(i,!1)}}var Yi=10,Ki=600,Zi=.6,Ji=1.5,Qi=800;function ea(e,t,n){var r=Se(e),o=r.on,s=r.emit,i=e.state.set,p=t.Move,c=p.getPosition,m=p.getLimit,l=p.exceededLimit,_=p.translate,g=e.is(Ct),h,u,d=1;function x(){o(Ye,z),o([_e,we],P)}function v(f,C,E,j,I){var O=c();if(z(),E&&(!g||!l())){var M=t.Layout.sliderSize(),V=In(f)*M*an(Ee(f)/M)||0;f=p.toPosition(t.Controller.toDest(f%M))+V}var q=jr(O,f,1);d=1,C=q?0:C||on(Ee(f-O)/Ji,Qi),u=j,h=dn(C,S,xe(L,O,f,I),1),i(Ht),s(un),h.start()}function S(){i(xt),u&&u(),s(dt)}function L(f,C,E,j){var I=c(),O=f+(C-f)*T(j),M=(O-I)*d;_(I+M),g&&!E&&l()&&(d*=Zi,Ee(M)<Yi&&v(m(l(!0)),Ki,!1,u,!0))}function z(){h&&h.cancel()}function P(){h&&!h.isPaused()&&(z(),S())}function T(f){var C=n.easingFunc;return C?C(f):1-Math.pow(1-f,4)}return{mount:x,destroy:z,scroll:v,cancel:P}}var ht={passive:!1,capture:!0};function ta(e,t,n){var r=Se(e),o=r.on,s=r.emit,i=r.bind,p=r.unbind,c=e.state,m=t.Move,l=t.Scroll,_=t.Controller,g=t.Elements.track,h=t.Media.reduce,u=t.Direction,d=u.resolve,x=u.orient,v=m.getPosition,S=m.exceededLimit,L,z,P,T,f,C=!1,E,j,I;function O(){i(g,$n,En,ht),i(g,Tn,En,ht),i(g,fo,V,ht),i(g,"click",R,{capture:!0}),i(g,"dragstart",De),o([ot,_e],M)}function M(){var N=n.drag;fe(!N),T=N==="free"}function V(N){if(E=!1,!j){var w=ge(N);me(N.target)&&(w||!N.button)&&(_.isBusy()?De(N,!0):(I=w?g:window,f=c.is([wt,Ht]),P=null,i(I,$n,q,ht),i(I,Tn,y,ht),m.cancel(),l.cancel(),F(N)))}}function q(N){if(c.is(Qt)||(c.set(Qt),s(qr)),N.cancelable)if(f){m.translate(L+he(ne(N)));var w=ce(N)>vr,D=C!==(C=S());(w||D)&&F(N),E=!0,s(Ur),De(N)}else W(N)&&(f=A(N),De(N))}function y(N){c.is(Qt)&&(c.set(xt),s(Xr)),f&&(k(N),De(N)),p(I,$n,q),p(I,Tn,y),f=!1}function R(N){!j&&E&&De(N,!0)}function F(N){P=z,z=N,L=v()}function k(N){var w=Z(N),D=se(w),K=n.rewind&&n.rewindByDrag;h(!1),T?_.scroll(D,0,n.snap):e.is(Dt)?_.go(x(In(w))<0?K?"<":"-":K?">":"+"):e.is(Ct)&&C&&K?_.go(S(!0)?">":"<"):_.go(_.toDest(D),!0),h(!0)}function A(N){var w=n.dragMinThreshold,D=At(w),K=D&&w.mouse||0,J=(D?w.touch:+w)||10;return Ee(ne(N))>(ge(N)?J:K)}function W(N){return Ee(ne(N))>Ee(ne(N,!0))}function Z(N){if(e.is(Tt)||!C){var w=ce(N);if(w&&w<vr)return ne(N)/w}return 0}function se(N){return v()+In(N)*nt(Ee(N)*(n.flickPower||600),T?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function ne(N,w){return ee(N,w)-ee(H(N),w)}function ce(N){return An(N)-An(H(N))}function H(N){return z===N&&P||z}function ee(N,w){return(ge(N)?N.changedTouches[0]:N)["page"+d(w?"Y":"X")]}function he(N){return N/(C&&e.is(Ct)?Pi:1)}function me(N){var w=n.noDrag;return!It(N,"."+co+", ."+vn)&&(!w||!It(N,w))}function ge(N){return typeof TouchEvent<"u"&&N instanceof TouchEvent}function U(){return f}function fe(N){j=N}return{mount:O,disable:fe,isDragging:U}}var na={Spacebar:" ",Right:fn,Left:gn,Up:no,Down:ro};function er(e){return e=tt(e)?e:e.key,na[e]||e}var br="keydown";function ra(e,t,n){var r=Se(e),o=r.on,s=r.bind,i=r.unbind,p=e.root,c=t.Direction.resolve,m,l;function _(){g(),o(_e,h),o(_e,g),o(Ye,d)}function g(){var v=n.keyboard;v&&(m=v==="global"?window:p,s(m,br,x))}function h(){i(m,br)}function u(v){l=v}function d(){var v=l;l=!0,Rr(function(){l=v})}function x(v){if(!l){var S=er(v);S===c(gn)?e.go("<"):S===c(fn)&&e.go(">")}}return{mount:_,destroy:h,disable:u}}var Et=Vn+"-lazy",nn=Et+"-srcset",oa="["+Et+"], ["+nn+"]";function ia(e,t,n){var r=Se(e),o=r.on,s=r.off,i=r.bind,p=r.emit,c=n.lazyLoad==="sequential",m=[$t,dt],l=[];function _(){n.lazyLoad&&(g(),o(we,g))}function g(){Xe(l),h(),c?v():(s(m),o(m,u),u())}function h(){t.Slides.forEach(function(S){zn(S.slide,oa).forEach(function(L){var z=He(L,Et),P=He(L,nn);if(z!==L.src||P!==L.srcset){var T=n.classes.spinner,f=L.parentElement,C=zt(f,"."+T)||vt("span",T,f);l.push([L,S,C]),L.src||Rt(L,"none")}})})}function u(){l=l.filter(function(S){var L=n.perPage*((n.preloadPages||1)+1)-1;return S[1].isWithin(e.index,L)?d(S):!0}),l.length||s(m)}function d(S){var L=S[0];Ne(S[1].slide,Pn),i(L,"load error",xe(x,S)),le(L,"src",He(L,Et)),le(L,"srcset",He(L,nn)),je(L,Et),je(L,nn)}function x(S,L){var z=S[0],P=S[1];qe(P.slide,Pn),L.type!=="error"&&(pt(S[2]),Rt(z,""),p(Yn,z,P),p(St)),c&&v()}function v(){l.length&&d(l.shift())}return{mount:_,destroy:xe(Xe,l),check:u}}function aa(e,t,n){var r=Se(e),o=r.on,s=r.emit,i=r.bind,p=t.Slides,c=t.Elements,m=t.Controller,l=m.hasFocus,_=m.getIndex,g=m.go,h=t.Direction.resolve,u=c.pagination,d=[],x,v;function S(){L(),o([_e,we,sn],S);var j=n.pagination;u&&Rt(u,j?"":"none"),j&&(o([Ye,un,dt],E),z(),E(),s(Zr,{list:x,items:d},C(e.index)))}function L(){x&&(pt(u?rt(x.children):x),qe(x,v),Xe(d),x=null),r.destroy()}function z(){var j=e.length,I=n.classes,O=n.i18n,M=n.perPage,V=l()?m.getEnd()+1:Pt(j/M);x=u||vt("ul",I.pagination,c.track.parentElement),Ne(x,v=bn+"--"+f()),le(x,Ue,"tablist"),le(x,Fe,O.select),le(x,Zn,f()===hn?"vertical":"");for(var q=0;q<V;q++){var y=vt("li",null,x),R=vt("button",{class:I.page,type:"button"},y),F=p.getIn(q).map(function(A){return A.slide.id}),k=!l()&&M>1?O.pageX:O.slideX;i(R,"click",xe(P,q)),n.paginationKeyboard&&i(R,"keydown",xe(T,q)),le(y,Ue,"presentation"),le(R,Ue,"tab"),le(R,Bt,F.join(" ")),le(R,Fe,Fn(k,q+1)),le(R,bt,-1),d.push({li:y,button:R,page:q})}}function P(j){g(">"+j,!0)}function T(j,I){var O=d.length,M=er(I),V=f(),q=-1;M===h(fn,!1,V)?q=++j%O:M===h(gn,!1,V)?q=(--j+O)%O:M==="Home"?q=0:M==="End"&&(q=O-1);var y=d[q];y&&(Hr(y.button),g(">"+q),De(I,!0))}function f(){return n.paginationDirection||n.direction}function C(j){return d[m.toPage(j)]}function E(){var j=C(_(!0)),I=C(_());if(j){var O=j.button;qe(O,ut),je(O,mr),le(O,bt,-1)}if(I){var M=I.button;Ne(M,ut),le(M,mr,!0),le(M,bt,"")}s(Jr,{list:x,items:d},j,I)}return{items:d,mount:S,destroy:L,getAt:C,update:E}}var sa=[" ","Enter"];function la(e,t,n){var r=n.isNavigation,o=n.slideFocus,s=[];function i(){e.splides.forEach(function(u){u.isParent||(m(e,u.splide),m(u.splide,e))}),r&&l()}function p(){s.forEach(function(u){u.destroy()}),Xe(s)}function c(){p(),i()}function m(u,d){var x=Se(u);x.on(Ye,function(v,S,L){d.go(d.is(Tt)?L:v)}),s.push(x)}function l(){var u=Se(e),d=u.on;d(Dn,g),d(eo,h),d([ot,_e],_),s.push(u),u.emit(qn,e.splides)}function _(){le(t.Elements.list,Zn,n.direction===hn?"vertical":"")}function g(u){e.go(u.index)}function h(u,d){Nn(sa,er(d))&&(g(u),De(d))}return{setup:xe(t.Media.set,{slideFocus:Ot(o)?r:o},!0),mount:i,destroy:p,remount:c}}function ca(e,t,n){var r=Se(e),o=r.bind,s=0;function i(){n.wheel&&o(t.Elements.track,"wheel",p,ht)}function p(m){if(m.cancelable){var l=m.deltaY,_=l<0,g=An(m),h=n.wheelMinThreshold||0,u=n.wheelSleep||0;Ee(l)>h&&g-s>u&&(e.go(_?"<":">"),s=g),c(_)&&De(m)}}function c(m){return!n.releaseWheel||e.state.is(wt)||t.Controller.getAdjacent(m)!==-1}return{mount:i}}var pa=90;function ua(e,t,n){var r=Se(e),o=r.on,s=t.Elements.track,i=n.live&&!n.isNavigation,p=vt("span",Ai),c=dn(pa,xe(l,!1));function m(){i&&(g(!t.Autoplay.isPaused()),le(s,hr,!0),p.textContent="…",o(Un,xe(g,!0)),o(Xn,xe(g,!1)),o([$t,dt],xe(l,!0)))}function l(h){le(s,fr,h),h?(jt(s,p),c.start()):(pt(p),c.cancel())}function _(){je(s,[gr,hr,fr]),pt(p)}function g(h){i&&le(s,gr,h?"off":"polite")}return{mount:m,disable:g,destroy:_}}var da=Object.freeze({__proto__:null,Media:xi,Direction:Si,Elements:Mi,Slides:Hi,Layout:Oi,Clones:ji,Move:zi,Controller:Vi,Arrows:Gi,Autoplay:Ui,Cover:Xi,Scroll:ea,Drag:ta,Keyboard:ra,LazyLoad:ia,Pagination:aa,Sync:la,Wheel:ca,Live:ua}),ma={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"},ga={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:ma,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function fa(e,t,n){var r=t.Slides;function o(){Se(e).on([ot,we],s)}function s(){r.forEach(function(p){p.style("transform","translateX(-"+100*p.index+"%)")})}function i(p,c){r.style("transition","opacity "+n.speed+"ms "+n.easing),Rr(c)}return{mount:o,start:i,cancel:En}}function ha(e,t,n){var r=t.Move,o=t.Controller,s=t.Scroll,i=t.Elements.list,p=xe(We,i,"transition"),c;function m(){Se(e).bind(i,"transitionend",function(h){h.target===i&&c&&(_(),c())})}function l(h,u){var d=r.toPosition(h,!0),x=r.getPosition(),v=g(h);Ee(d-x)>=1&&v>=1?n.useScroll?s.scroll(d,v,!1,u):(p("transform "+v+"ms "+n.easing),r.translate(d,!0),c=u):(r.jump(h),u())}function _(){p(""),s.cancel()}function g(h){var u=n.rewindSpeed;if(e.is(Ct)&&u){var d=o.getIndex(!0),x=o.getEnd();if(d===0&&h>=x||d>=x&&h===0)return u}return n.speed}return{mount:m,start:l,cancel:_}}var ya=(function(){function e(n,r){this.event=Se(),this.Components={},this.state=vi(yt),this.splides=[],this._o={},this._E={};var o=tt(n)?Nr(document,n):n;Lt(o,o+" is invalid."),this.root=o,r=Je({label:He(o,Fe)||"",labelledby:He(o,Kn)||""},ga,e.defaults,r||{});try{Je(r,JSON.parse(He(o,Vn)))}catch{Lt(!1,"Invalid JSON")}this._o=Object.create(Je({},r))}var t=e.prototype;return t.mount=function(r,o){var s=this,i=this.state,p=this.Components;Lt(i.is([yt,rn]),"Already mounted!"),i.set(yt),this._C=p,this._T=o||this._T||(this.is(Dt)?fa:ha),this._E=r||this._E;var c=kt({},da,this._E,{Transition:this._T});return ct(c,function(m,l){var _=m(s,p,s._o);p[l]=_,_.setup&&_.setup()}),ct(p,function(m){m.mount&&m.mount()}),this.emit(ot),Ne(this.root,Ii),i.set(xt),this.emit(kn),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(xt)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(rt(arguments,1))),this},t.add=function(r,o){return this._C.Slides.add(r,o),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(we),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,s=this.state;return s.is(yt)?Se(this).on(kn,this.destroy.bind(this,r)):(ct(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(Gn),o.destroy(),r&&Xe(this.splides),s.set(rn)),this},mi(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),tr=ya;tr.defaults={};tr.STATES=fi;var xr=[[ot,"onMounted"],[kn,"onReady"],[Ye,"onMove"],[$t,"onMoved"],[Dn,"onClick"],[Vr,"onActive"],[Br,"onInactive"],[Dr,"onVisible"],[Gr,"onHidden"],[we,"onRefresh"],[_e,"onUpdated"],[St,"onResize"],[pn,"onResized"],[qr,"onDrag"],[Ur,"onDragging"],[Xr,"onDragged"],[un,"onScroll"],[dt,"onScrolled"],[Gn,"onDestroy"],[Yr,"onArrowsMounted"],[Kr,"onArrowsUpdated"],[Zr,"onPaginationMounted"],[Jr,"onPaginationUpdated"],[qn,"onNavigationMounted"],[Un,"onAutoplayPlay"],[Qr,"onAutoplayPlaying"],[Xn,"onAutoplayPause"],[Yn,"onLazyLoadLoaded"]];function nr(...e){return e.filter(Boolean).join(" ")}function ln(e){return e!==null&&typeof e=="object"}function Mn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!Mn(n,t[r]));if(ln(e)&&ln(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Mn(e[o],t[o]))}return e===t}function va(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function ba(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function Wn(e,t){const n=e;return ba(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():ln(r)?n[o]=Wn(ln(n[o])?n[o]:{},r):n[o]=r}),n}var xa=({children:e,className:t,...n})=>b.createElement("div",{className:nr("splide__track",t),...n},b.createElement("ul",{className:"splide__list"},e)),rr=class extends b.Component{constructor(){super(...arguments),this.splideRef=b.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new tr(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Wn({},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&&!Mn(this.options,e)&&(this.splide.options=e,this.options=Wn({},e));const t=this.getSlides();va(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){xr.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:r,...o}=this.props;return b.createElement(t,{className:nr("splide",e),ref:this.splideRef,...this.omit(o,["options",...xr.map(s=>s[1])])},n?b.createElement(xa,null,r):r)}},or=({children:e,className:t,...n})=>b.createElement("li",{className:nr("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),b=require("react"),ve=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Rr=require("react-dom");function Co(e){return e.type==="object"&&e.version===1}const wo="ControlSlider-module__wrapper___sHEkd",$o="ControlSlider-module__hoverArrow___A-dOH",To="ControlSlider-module__sliderItem___QQSkR",_o="ControlSlider-module__sliderImage___9hRl-",Lo="ControlSlider-module__arrow___05ghY",Eo="ControlSlider-module__arrowVertical___tBfVN",Ao="ControlSlider-module__nextArrow___-30Yc",Io="ControlSlider-module__arrowInner___aEra3",Fo="ControlSlider-module__arrowIcon___S4ztF",ko="ControlSlider-module__arrowImg___2dwJW",Ro="ControlSlider-module__mirror___brd6U",Po="ControlSlider-module__pagination___bicLF",Mo="ControlSlider-module__paginationInner___bT-P-",Wo="ControlSlider-module__paginationVertical___zYqKw",Ho="ControlSlider-module__paginationItem___nTRbk",Oo="ControlSlider-module__dot___p1Qun",No="ControlSlider-module__activeDot___LHFaj",jo="ControlSlider-module__paginationInsideBottom___R3FWn",zo="ControlSlider-module__paginationInsideTop___V-qb-",Vo="ControlSlider-module__paginationOutsideBottom___14w8D",Bo="ControlSlider-module__paginationOutsideTop___SCLqB",Do="ControlSlider-module__paginationInsideLeft___yOBRZ",Go="ControlSlider-module__paginationInsideRight___Rtt3o",qo="ControlSlider-module__paginationOutsideLeft___lahaw",Uo="ControlSlider-module__paginationOutsideRight___EtuQa",Xo="ControlSlider-module__imgWrapper___UjEgB",Yo="ControlSlider-module__captionBlock___dJ6-j",Ko="ControlSlider-module__captionTextWrapper___HFlpf",Zo="ControlSlider-module__captionText___uGBVc",Jo="ControlSlider-module__active___WZK4G",Qo="ControlSlider-module__withPointerEvents___t-18M",ei="ControlSlider-module__topLeftAlignment___zjnGM",ti="ControlSlider-module__topCenterAlignment___gD1xW",ni="ControlSlider-module__topRightAlignment___NMapS",ri="ControlSlider-module__middleLeftAlignment___OnUrY",oi="ControlSlider-module__middleCenterAlignment___Tdkl0",ii="ControlSlider-module__middleRightAlignment___wEbfX",ai="ControlSlider-module__bottomLeftAlignment___cTP2-",si="ControlSlider-module__bottomCenterAlignment___c54fB",li="ControlSlider-module__bottomRightAlignment___kEwrz",ci="ControlSlider-module__clickOverlay___DZA28",pi="ControlSlider-module__contain___pLyq7",ui="ControlSlider-module__cover___KdDat",Q={wrapper:wo,hoverArrow:$o,sliderItem:To,sliderImage:_o,arrow:Lo,arrowVertical:Eo,nextArrow:Ao,arrowInner:Io,arrowIcon:Fo,arrowImg:ko,mirror:Ro,pagination:Po,paginationInner:Mo,paginationVertical:Wo,paginationItem:Ho,dot:Oo,activeDot:No,paginationInsideBottom:jo,paginationInsideTop:zo,paginationOutsideBottom:Vo,paginationOutsideTop:Bo,paginationInsideLeft:Do,paginationInsideRight:Go,paginationOutsideLeft:qo,paginationOutsideRight:Uo,imgWrapper:Xo,captionBlock:Yo,captionTextWrapper:Ko,captionText:Zo,active:Jo,withPointerEvents:Qo,topLeftAlignment:ei,topCenterAlignment:ti,topRightAlignment:ni,middleLeftAlignment:ri,middleCenterAlignment:oi,middleRightAlignment:ii,bottomLeftAlignment:ai,bottomCenterAlignment:si,bottomRightAlignment:li,clickOverlay:ci,contain:pi,cover:ui};function di(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mi(e,t,n){return t&&di(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var lr="(prefers-reduced-motion: reduce)",bt=1,gi=2,Ct=3,Tt=4,Nt=5,Qt=6,rn=7,fi={CREATED:bt,MOUNTED:gi,IDLE:Ct,MOVING:Tt,SCROLLING:Nt,DRAGGING:Qt,DESTROYED:rn};function Ke(e){e.length=0}function it(e,t,n){return Array.prototype.slice.call(e,t,n)}function be(e){return e.bind.apply(e,[null].concat(it(arguments,1)))}var Pr=setTimeout,An=function(){};function cr(e){return requestAnimationFrame(e)}function cn(e,t){return typeof t===e}function Ft(e){return!Nn(e)&&cn("object",e)}var On=Array.isArray,Mr=be(cn,"function"),rt=be(cn,"string"),jt=be(cn,"undefined");function Nn(e){return e===null}function Wr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function zt(e){return On(e)?e:[e]}function Re(e,t){zt(e).forEach(t)}function jn(e,t){return e.indexOf(t)>-1}function en(e,t){return e.push.apply(e,zt(t)),e}function Ue(e,t,n){e&&Re(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function je(e,t){Ue(e,rt(t)?t.split(" "):t,!0)}function Vt(e,t){Re(t,e.appendChild.bind(e))}function zn(e,t){Re(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function kt(e,t){return Wr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Hr(e,t){var n=e?it(e.children):[];return t?n.filter(function(r){return kt(r,t)}):n}function Bt(e,t){return t?Hr(e,t)[0]:e.firstElementChild}var Rt=Object.keys;function pt(e,t,n){return e&&(n?Rt(e).reverse():Rt(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function Pt(e){return it(arguments,1).forEach(function(t){pt(t,function(n,r){e[r]=t[r]})}),e}function et(e){return it(arguments,1).forEach(function(t){pt(t,function(n,r){On(n)?e[r]=n.slice():Ft(n)?e[r]=et({},Ft(e[r])?e[r]:{},n):e[r]=n})}),e}function pr(e,t){Re(t||Rt(e),function(n){delete e[n]})}function ze(e,t){Re(e,function(n){Re(t,function(r){n&&n.removeAttribute(r)})})}function le(e,t,n){Ft(t)?pt(t,function(r,o){le(e,o,r)}):Re(e,function(r){Nn(n)||n===""?ze(r,t):r.setAttribute(t,String(n))})}function xt(e,t,n){var r=document.createElement(e);return t&&(rt(t)?je(r,t):le(r,t)),n&&Vt(n,r),r}function We(e,t,n){if(jt(n))return getComputedStyle(e)[t];Nn(n)||(e.style[t]=""+n)}function Mt(e,t){We(e,"display",t)}function Or(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function He(e,t){return e.getAttribute(t)}function ur(e,t){return e&&e.classList.contains(t)}function Ie(e){return e.getBoundingClientRect()}function ut(e){Re(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Nr(e){return Bt(new DOMParser().parseFromString(e,"text/html").body)}function qe(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function jr(e,t){return e&&e.querySelector(t)}function Vn(e,t){return t?it(e.querySelectorAll(t)):[]}function Xe(e,t){Ue(e,t,!1)}function In(e){return e.timeStamp}function lt(e){return rt(e)?e:e?e+"px":""}var Dt="splide",Bn="data-"+Dt;function At(e,t){if(!e)throw new Error("["+Dt+"] "+(t||""))}var ot=Math.min,on=Math.max,an=Math.floor,Wt=Math.ceil,Ee=Math.abs;function zr(e,t,n){return Ee(e-t)<n}function tn(e,t,n,r){var o=ot(t,n),s=on(t,n);return r?o<e&&e<s:o<=e&&e<=s}function yt(e,t,n){var r=ot(t,n),o=on(t,n);return ot(on(r,e),o)}function Fn(e){return+(e>0)-+(e<0)}function kn(e,t){return Re(t,function(n){e=e.replace("%s",""+n)}),e}function Dn(e){return e<10?"0"+e:""+e}var dr={};function hi(e){return""+e+Dn(dr[e]=(dr[e]||0)+1)}function Vr(){var e=[];function t(i,p,c,d){o(i,p,function(l,L,y){var g="addEventListener"in l,u=g?l.removeEventListener.bind(l,L,c,d):l.removeListener.bind(l,c);g?l.addEventListener(L,c,d):l.addListener(c),e.push([l,L,y,c,u])})}function n(i,p,c){o(i,p,function(d,l,L){e=e.filter(function(y){return y[0]===d&&y[1]===l&&y[2]===L&&(!c||y[3]===c)?(y[4](),!1):!0})})}function r(i,p,c){var d,l=!0;return typeof CustomEvent=="function"?d=new CustomEvent(p,{bubbles:l,detail:c}):(d=document.createEvent("CustomEvent"),d.initCustomEvent(p,l,!1,c)),i.dispatchEvent(d),d}function o(i,p,c){Re(i,function(d){d&&Re(p,function(l){l.split(" ").forEach(function(L){var y=L.split(".");c(d,y[0],y[1])})})})}function s(){e.forEach(function(i){i[4]()}),Ke(e)}return{bind:t,unbind:n,dispatch:r,destroy:s}}var at="mounted",Rn="ready",Ze="move",_t="moved",Gn="click",Br="active",Dr="inactive",Gr="visible",qr="hidden",Te="refresh",Le="updated",wt="resize",pn="resized",Ur="drag",Xr="dragging",Yr="dragged",un="scroll",mt="scrolled",yi="overflow",qn="destroy",Kr="arrows:mounted",Zr="arrows:updated",Jr="pagination:mounted",Qr="pagination:updated",Un="navigation:mounted",Xn="autoplay:play",eo="autoplay:playing",Yn="autoplay:pause",Kn="lazyload:loaded",to="sk",no="sh",sn="ei";function Ce(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Vr();function r(s,i){n.bind(t,zt(s).join(" "),function(p){i.apply(i,On(p.detail)?p.detail:[])})}function o(s){n.dispatch(t,s,it(arguments,1))}return e&&e.event.on(qn,n.destroy),Pt(n,{bus:t,on:r,off:be(n.unbind,t),emit:o})}function dn(e,t,n,r){var o=Date.now,s,i=0,p,c=!0,d=0;function l(){if(!c){if(i=e?ot((o()-s)/e,1):1,n&&n(i),i>=1&&(t(),s=o(),r&&++d>=r))return y();p=cr(l)}}function L(h){h||u(),s=o()-(h?i*e:0),c=!1,p=cr(l)}function y(){c=!0}function g(){s=o(),i=0,n&&n(i)}function u(){p&&cancelAnimationFrame(p),i=0,p=0,c=!0}function f(h){e=h}function x(){return c}return{start:L,rewind:g,pause:y,cancel:u,set:f,isPaused:x}}function vi(e){var t=e;function n(o){t=o}function r(o){return jn(zt(o),t)}return{set:n,is:r}}function bi(e,t){var n=dn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function xi(e,t,n){var r=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},i=Vr(),p=[];function c(){var u=n.mediaQuery==="min";Rt(o).sort(function(f,x){return u?+f-+x:+x-+f}).forEach(function(f){l(o[f],"("+(u?"min":"max")+"-width:"+f+"px)")}),l(s,lr),L()}function d(u){u&&i.destroy()}function l(u,f){var x=matchMedia(f);i.bind(x,"change",L),p.push([u,x])}function L(){var u=r.is(rn),f=n.direction,x=p.reduce(function(h,S){return et(h,S[1].matches?S[0]:{})},{});pr(n),g(x),n.destroy?e.destroy(n.destroy==="completely"):u?(d(!0),e.mount()):f!==n.direction&&e.refresh()}function y(u){matchMedia(lr).matches&&(u?et(n,s):pr(n,Rt(s)))}function g(u,f,x){et(n,u),f&&et(Object.getPrototypeOf(n),u),(x||!r.is(bt))&&e.emit(Le,n)}return{setup:c,destroy:d,reduce:y,set:g}}var mn="Arrow",gn=mn+"Left",fn=mn+"Right",ro=mn+"Up",oo=mn+"Down",mr="rtl",hn="ttb",wn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ro,fn],ArrowRight:[oo,gn]};function Si(e,t,n){function r(s,i,p){p=p||n.direction;var c=p===mr&&!i?1:p===hn?0:-1;return wn[s]&&wn[s][c]||s.replace(/width|left|right/i,function(d,l){var L=wn[d.toLowerCase()][c]||d;return l>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function o(s){return s*(n.direction===mr?1:-1)}return{resolve:r,orient:o}}var Ye="role",St="tabindex",Ci="disabled",Oe="aria-",Gt=Oe+"controls",io=Oe+"current",gr=Oe+"selected",Fe=Oe+"label",Zn=Oe+"labelledby",ao=Oe+"hidden",Jn=Oe+"orientation",Ht=Oe+"roledescription",fr=Oe+"live",hr=Oe+"busy",yr=Oe+"atomic",Qn=[Ye,St,Ci,Gt,io,Fe,Zn,ao,Jn,Ht],Ve=Dt+"__",st="is-",$n=Dt,vr=Ve+"track",wi=Ve+"list",yn=Ve+"slide",so=yn+"--clone",$i=yn+"__container",er=Ve+"arrows",vn=Ve+"arrow",lo=vn+"--prev",co=vn+"--next",bn=Ve+"pagination",po=bn+"__page",Ti=Ve+"progress",_i=Ti+"__bar",Li=Ve+"toggle",Ei=Ve+"spinner",Ai=Ve+"sr",Ii=st+"initialized",dt=st+"active",uo=st+"prev",mo=st+"next",Pn=st+"visible",Mn=st+"loading",go=st+"focus-in",fo=st+"overflow",Fi=[dt,Pn,uo,mo,Mn,go,fo],ki={slide:yn,clone:so,arrows:er,arrow:vn,prev:lo,next:co,pagination:bn,page:po,spinner:Ei};function Ri(e,t){if(Mr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!kt(n,t);)n=n.parentElement;return n}var Pi=5,br=200,ho="touchstart mousedown",Tn="touchmove mousemove",_n="touchend touchcancel mouseup click";function Mi(e,t,n){var r=Ce(e),o=r.on,s=r.bind,i=e.root,p=n.i18n,c={},d=[],l=[],L=[],y,g,u;function f(){_(),V(),S()}function x(){o(Te,h),o(Te,f),o(Le,S),s(document,ho+" keydown",function(m){u=m.type==="keydown"},{capture:!0}),s(i,"focusin",function(){Ue(i,go,!!u)})}function h(m){var C=Qn.concat("style");Ke(d),Xe(i,l),Xe(y,L),ze([y,g],C),ze(i,m?C:["style",Ht])}function S(){Xe(i,l),Xe(y,L),l=T($n),L=T(vr),je(i,l),je(y,L),le(i,Fe,n.label),le(i,Zn,n.labelledby)}function _(){y=R("."+vr),g=Bt(y,"."+wi),At(y&&g,"A track/list element is missing."),en(d,Hr(g,"."+yn+":not(."+so+")")),pt({arrows:er,pagination:bn,prev:lo,next:co,bar:_i,toggle:Li},function(m,C){c[C]=R("."+m)}),Pt(c,{root:i,track:y,list:g,slides:d})}function V(){var m=i.id||hi(Dt),C=n.role;i.id=m,y.id=y.id||m+"-track",g.id=g.id||m+"-list",!He(i,Ye)&&i.tagName!=="SECTION"&&C&&le(i,Ye,C),le(i,Ht,p.carousel),le(g,Ye,"presentation")}function R(m){var C=jr(i,m);return C&&Ri(C,"."+$n)===i?C:void 0}function T(m){return[m+"--"+n.type,m+"--"+n.direction,n.drag&&m+"--draggable",n.isNavigation&&m+"--nav",m===$n&&dt]}return Pt(c,{setup:f,mount:x,destroy:h})}var $t="slide",Lt="loop",qt="fade";function Wi(e,t,n,r){var o=Ce(e),s=o.on,i=o.emit,p=o.bind,c=e.Components,d=e.root,l=e.options,L=l.isNavigation,y=l.updateOnMove,g=l.i18n,u=l.pagination,f=l.slideFocus,x=c.Direction.resolve,h=He(r,"style"),S=He(r,Fe),_=n>-1,V=Bt(r,"."+$i),R;function T(){_||(r.id=d.id+"-slide"+Dn(t+1),le(r,Ye,u?"tabpanel":"group"),le(r,Ht,g.slide),le(r,Fe,S||kn(g.slideLabel,[t+1,e.length]))),m()}function m(){p(r,"click",be(i,Gn,F)),p(r,"keydown",be(i,to,F)),s([_t,no,mt],I),s(Un,E),y&&s(Ze,N)}function C(){R=!0,o.destroy(),Xe(r,Fi),ze(r,Qn),le(r,"style",h),le(r,Fe,S||"")}function E(){var k=e.splides.map(function(A){var H=A.splide.Components.Slides.getAt(t);return H?H.slide.id:""}).join(" ");le(r,Fe,kn(g.slideX,(_?n:t)+1)),le(r,Gt,k),le(r,Ye,f?"button":""),f&&ze(r,Ht)}function N(){R||I()}function I(){if(!R){var k=e.index;W(),O(),Ue(r,uo,t===k-1),Ue(r,mo,t===k+1)}}function W(){var k=U();k!==ur(r,dt)&&(Ue(r,dt,k),le(r,io,L&&k||""),i(k?Br:Dr,F))}function O(){var k=v(),A=!k&&(!U()||_);if(e.state.is([Tt,Nt])||le(r,ao,A||""),le(Vn(r,l.focusableNodes||""),St,A?-1:""),f&&le(r,St,A?-1:0),k!==ur(r,Pn)&&(Ue(r,Pn,k),i(k?Gr:qr,F)),!k&&document.activeElement===r){var H=c.Slides.getAt(e.index);H&&Or(H.slide)}}function z(k,A,H){We(H&&V||r,k,A)}function U(){var k=e.index;return k===t||l.cloneStatus&&k===n}function v(){if(e.is(qt))return U();var k=Ie(c.Elements.track),A=Ie(r),H=x("left",!0),Z=x("right",!0);return an(k[H])<=Wt(A[H])&&an(A[Z])<=Wt(k[Z])}function P(k,A){var H=Ee(k-t);return!_&&(l.rewind||e.is(Lt))&&(H=ot(H,e.length-H)),H<=A}var F={index:t,slideIndex:n,slide:r,container:V,isClone:_,mount:T,destroy:C,update:I,style:z,isWithin:P};return F}function Hi(e,t,n){var r=Ce(e),o=r.on,s=r.emit,i=r.bind,p=t.Elements,c=p.slides,d=p.list,l=[];function L(){y(),o(Te,g),o(Te,y)}function y(){c.forEach(function(I,W){f(I,W,-1)})}function g(){R(function(I){I.destroy()}),Ke(l)}function u(){R(function(I){I.update()})}function f(I,W,O){var z=Wi(e,W,O,I);z.mount(),l.push(z),l.sort(function(U,v){return U.index-v.index})}function x(I){return I?T(function(W){return!W.isClone}):l}function h(I){var W=t.Controller,O=W.toIndex(I),z=W.hasFocus()?1:n.perPage;return T(function(U){return tn(U.index,O,O+z-1)})}function S(I){return T(I)[0]}function _(I,W){Re(I,function(O){if(rt(O)&&(O=Nr(O)),Wr(O)){var z=c[W];z?zn(O,z):Vt(d,O),je(O,n.classes.slide),C(O,be(s,wt))}}),s(Te)}function V(I){ut(T(I).map(function(W){return W.slide})),s(Te)}function R(I,W){x(W).forEach(I)}function T(I){return l.filter(Mr(I)?I:function(W){return rt(I)?kt(W.slide,I):jn(zt(I),W.index)})}function m(I,W,O){R(function(z){z.style(I,W,O)})}function C(I,W){var O=Vn(I,"img"),z=O.length;z?O.forEach(function(U){i(U,"load error",function(){--z||W()})}):W()}function E(I){return I?c.length:l.length}function N(){return l.length>n.perPage}return{mount:L,destroy:g,update:u,register:f,get:x,getIn:h,getAt:S,add:_,remove:V,forEach:R,filter:T,style:m,getLength:E,isEnough:N}}function Oi(e,t,n){var r=Ce(e),o=r.on,s=r.bind,i=r.emit,p=t.Slides,c=t.Direction.resolve,d=t.Elements,l=d.root,L=d.track,y=d.list,g=p.getAt,u=p.style,f,x,h;function S(){_(),s(window,"resize load",bi(be(i,wt))),o([Le,Te],_),o(wt,V)}function _(){f=n.direction===hn,We(l,"maxWidth",lt(n.width)),We(L,c("paddingLeft"),R(!1)),We(L,c("paddingRight"),R(!0)),V(!0)}function V(F){var k=Ie(l);(F||x.width!==k.width||x.height!==k.height)&&(We(L,"height",T()),u(c("marginRight"),lt(n.gap)),u("width",C()),u("height",E(),!0),x=k,i(pn),h!==(h=P())&&(Ue(l,fo,h),i(yi,h)))}function R(F){var k=n.padding,A=c(F?"right":"left");return k&&lt(k[A]||(Ft(k)?0:k))||"0px"}function T(){var F="";return f&&(F=m(),At(F,"height or heightRatio is missing."),F="calc("+F+" - "+R(!1)+" - "+R(!0)+")"),F}function m(){return lt(n.height||Ie(y).width*n.heightRatio)}function C(){return n.autoWidth?null:lt(n.fixedWidth)||(f?"":N())}function E(){return lt(n.fixedHeight)||(f?n.autoHeight?null:N():m())}function N(){var F=lt(n.gap);return"calc((100%"+(F&&" + "+F)+")/"+(n.perPage||1)+(F&&" - "+F)+")"}function I(){return Ie(y)[c("width")]}function W(F,k){var A=g(F||0);return A?Ie(A.slide)[c("width")]+(k?0:U()):0}function O(F,k){var A=g(F);if(A){var H=Ie(A.slide)[c("right")],Z=Ie(y)[c("left")];return Ee(H-Z)+(k?0:U())}return 0}function z(F){return O(e.length-1)-O(0)+W(0,F)}function U(){var F=g(0);return F&&parseFloat(We(F.slide,c("marginRight")))||0}function v(F){return parseFloat(We(L,c("padding"+(F?"Right":"Left"))))||0}function P(){return e.is(qt)||z(!0)>I()}return{mount:S,resize:V,listSize:I,slideSize:W,sliderSize:z,totalSize:O,getPadding:v,isOverflow:P}}var Ni=2;function ji(e,t,n){var r=Ce(e),o=r.on,s=t.Elements,i=t.Slides,p=t.Direction.resolve,c=[],d;function l(){o(Te,L),o([Le,wt],g),(d=x())&&(u(d),t.Layout.resize(!0))}function L(){y(),l()}function y(){ut(c),Ke(c),r.destroy()}function g(){var h=x();d!==h&&(d<h||!h)&&r.emit(Te)}function u(h){var S=i.get().slice(),_=S.length;if(_){for(;S.length<h;)en(S,S);en(S.slice(-h),S.slice(0,h)).forEach(function(V,R){var T=R<h,m=f(V.slide,R);T?zn(m,S[0].slide):Vt(s.list,m),en(c,m),i.register(m,R-h+(T?0:_),V.index)})}}function f(h,S){var _=h.cloneNode(!0);return je(_,n.classes.clone),_.id=e.root.id+"-clone"+Dn(S+1),_}function x(){var h=n.clones;if(!e.is(Lt))h=0;else if(jt(h)){var S=n[p("fixedWidth")]&&t.Layout.slideSize(0),_=S&&Wt(Ie(s.track)[p("width")]/S);h=_||n[p("autoWidth")]&&e.length||n.perPage*Ni}return h}return{mount:l,destroy:y}}function zi(e,t,n){var r=Ce(e),o=r.on,s=r.emit,i=e.state.set,p=t.Layout,c=p.slideSize,d=p.getPadding,l=p.totalSize,L=p.listSize,y=p.sliderSize,g=t.Direction,u=g.resolve,f=g.orient,x=t.Elements,h=x.list,S=x.track,_;function V(){_=t.Transition,o([at,pn,Le,Te],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),m(e.index),t.Slides.update())}function T(A,H,Z,se){A!==H&&F(A>Z)&&(I(),C(N(z(),A>Z),!0)),i(Tt),s(Ze,H,Z,A),_.start(H,function(){i(Ct),s(_t,H,Z,A),se&&se()})}function m(A){C(O(A,!0))}function C(A,H){if(!e.is(qt)){var Z=H?A:E(A);We(h,"transform","translate"+u("X")+"("+Z+"px)"),A!==Z&&s(no)}}function E(A){if(e.is(Lt)){var H=W(A),Z=H>t.Controller.getEnd(),se=H<0;(se||Z)&&(A=N(A,Z))}return A}function N(A,H){var Z=A-P(H),se=y();return A-=f(se*(Wt(Ee(Z)/se)||1))*(H?1:-1),A}function I(){C(z(),!0),_.cancel()}function W(A){for(var H=t.Slides.get(),Z=0,se=1/0,re=0;re<H.length;re++){var pe=H[re].index,M=Ee(O(pe,!0)-A);if(M<=se)se=M,Z=pe;else break}return Z}function O(A,H){var Z=f(l(A-1)-v(A));return H?U(Z):Z}function z(){var A=u("left");return Ie(h)[A]-Ie(S)[A]+f(d(!1))}function U(A){return n.trimSpace&&e.is($t)&&(A=yt(A,0,f(y(!0)-L()))),A}function v(A){var H=n.focus;return H==="center"?(L()-c(A,!0))/2:+H*c(A)||0}function P(A){return O(A?t.Controller.getEnd():0,!!n.trimSpace)}function F(A){var H=f(N(z(),A));return A?H>=0:H<=h[u("scrollWidth")]-Ie(S)[u("width")]}function k(A,H){H=jt(H)?z():H;var Z=A!==!0&&f(H)<f(P(!1)),se=A!==!1&&f(H)>f(P(!0));return Z||se}return{mount:V,move:T,jump:m,translate:C,shift:N,cancel:I,toIndex:W,toPosition:O,getPosition:z,getLimit:P,exceededLimit:k,reposition:R}}function Vi(e,t,n){var r=Ce(e),o=r.on,s=r.emit,i=t.Move,p=i.getPosition,c=i.getLimit,d=i.toPosition,l=t.Slides,L=l.isEnough,y=l.getLength,g=n.omitEnd,u=e.is(Lt),f=e.is($t),x=be(z,!1),h=be(z,!0),S=n.start||0,_,V=S,R,T,m;function C(){E(),o([Le,Te,sn],E),o(pn,N)}function E(){R=y(!0),T=n.perMove,m=n.perPage,_=F();var M=yt(S,0,g?_:R-1);M!==S&&(S=M,i.reposition())}function N(){_!==F()&&s(sn)}function I(M,ne,fe){if(!pe()){var me=O(M),ge=P(me);ge>-1&&(ne||ge!==S)&&(Z(ge),i.move(me,ge,V,fe))}}function W(M,ne,fe,me){t.Scroll.scroll(M,ne,fe,function(){var ge=P(i.toIndex(p()));Z(g?ot(ge,_):ge),me&&me()})}function O(M){var ne=S;if(rt(M)){var fe=M.match(/([+\-<>])(\d+)?/)||[],me=fe[1],ge=fe[2];me==="+"||me==="-"?ne=U(S+ +(""+me+(+ge||1)),S):me===">"?ne=ge?k(+ge):x(!0):me==="<"&&(ne=h(!0))}else ne=u?M:yt(M,0,_);return ne}function z(M,ne){var fe=T||(re()?1:m),me=U(S+fe*(M?-1:1),S,!(T||re()));return me===-1&&f&&!zr(p(),c(!M),1)?M?0:_:ne?me:P(me)}function U(M,ne,fe){if(L()||re()){var me=v(M);me!==M&&(ne=M,M=me,fe=!1),M<0||M>_?!T&&(tn(0,M,ne,!0)||tn(_,ne,M,!0))?M=k(A(M)):u?M=fe?M<0?-(R%m||m):R:M:n.rewind?M=M<0?_:0:M=-1:fe&&M!==ne&&(M=k(A(ne)+(M<ne?-1:1)))}else M=-1;return M}function v(M){if(f&&n.trimSpace==="move"&&M!==S)for(var ne=p();ne===d(M,!0)&&tn(M,0,e.length-1,!n.rewind);)M<S?--M:++M;return M}function P(M){return u?(M+R)%R||0:M}function F(){for(var M=R-(re()||u&&T?1:m);g&&M-- >0;)if(d(R-1,!0)!==d(M,!0)){M++;break}return yt(M,0,R-1)}function k(M){return yt(re()?M:m*M,0,_)}function A(M){return re()?ot(M,_):an((M>=_?R-1:M)/m)}function H(M){var ne=i.toIndex(M);return f?yt(ne,0,_):ne}function Z(M){M!==S&&(V=S,S=M)}function se(M){return M?V:S}function re(){return!jt(n.focus)||n.isNavigation}function pe(){return e.state.is([Tt,Nt])&&!!n.waitForTransition}return{mount:C,go:I,scroll:W,getNext:x,getPrev:h,getAdjacent:z,getEnd:F,setIndex:Z,getIndex:se,toIndex:k,toPage:A,toDest:H,hasFocus:re,isBusy:pe}}var Bi="http://www.w3.org/2000/svg",Di="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",Xt=40;function Gi(e,t,n){var r=Ce(e),o=r.on,s=r.bind,i=r.emit,p=n.classes,c=n.i18n,d=t.Elements,l=t.Controller,L=d.arrows,y=d.track,g=L,u=d.prev,f=d.next,x,h,S={};function _(){R(),o(Le,V)}function V(){T(),_()}function R(){var W=n.arrows;W&&!(u&&f)&&E(),u&&f&&(Pt(S,{prev:u,next:f}),Mt(g,W?"":"none"),je(g,h=er+"--"+n.direction),W&&(m(),I(),le([u,f],Gt,y.id),i(Kr,u,f)))}function T(){r.destroy(),Xe(g,h),x?(ut(L?[u,f]:g),u=f=null):ze([u,f],Qn)}function m(){o([at,_t,Te,mt,sn],I),s(f,"click",be(C,">")),s(u,"click",be(C,"<"))}function C(W){l.go(W,!0)}function E(){g=L||xt("div",p.arrows),u=N(!0),f=N(!1),x=!0,Vt(g,[u,f]),!L&&zn(g,y)}function N(W){var O='<button class="'+p.arrow+" "+(W?p.prev:p.next)+'" type="button"><svg xmlns="'+Bi+'" viewBox="0 0 '+Xt+" "+Xt+'" width="'+Xt+'" height="'+Xt+'" focusable="false"><path d="'+(n.arrowPath||Di)+'" />';return Nr(O)}function I(){if(u&&f){var W=e.index,O=l.getPrev(),z=l.getNext(),U=O>-1&&W<O?c.last:c.prev,v=z>-1&&W>z?c.first:c.next;u.disabled=O<0,f.disabled=z<0,le(u,Fe,U),le(f,Fe,v),i(Zr,u,f,O,z)}}return{arrows:S,mount:_,destroy:T,update:I}}var qi=Bn+"-interval";function Ui(e,t,n){var r=Ce(e),o=r.on,s=r.bind,i=r.emit,p=dn(n.interval,e.go.bind(e,">"),m),c=p.isPaused,d=t.Elements,l=t.Elements,L=l.root,y=l.toggle,g=n.autoplay,u,f,x=g==="pause";function h(){g&&(S(),y&&le(y,Gt,d.track.id),x||_(),T())}function S(){n.pauseOnHover&&s(L,"mouseenter mouseleave",function(E){u=E.type==="mouseenter",R()}),n.pauseOnFocus&&s(L,"focusin focusout",function(E){f=E.type==="focusin",R()}),y&&s(y,"click",function(){x?_():V(!0)}),o([Ze,un,Te],p.rewind),o(Ze,C)}function _(){c()&&t.Slides.isEnough()&&(p.start(!n.resetProgress),f=u=x=!1,T(),i(Xn))}function V(E){E===void 0&&(E=!0),x=!!E,T(),c()||(p.pause(),i(Yn))}function R(){x||(u||f?V(!1):_())}function T(){y&&(Ue(y,dt,!x),le(y,Fe,n.i18n[x?"play":"pause"]))}function m(E){var N=d.bar;N&&We(N,"width",E*100+"%"),i(eo,E)}function C(E){var N=t.Slides.getAt(E);p.set(N&&+He(N.slide,qi)||n.interval)}return{mount:h,destroy:p.cancel,play:_,pause:V,isPaused:c}}function Xi(e,t,n){var r=Ce(e),o=r.on;function s(){n.cover&&(o(Kn,be(p,!0)),o([at,Le,Te],be(i,!0)))}function i(c){t.Slides.forEach(function(d){var l=Bt(d.container||d.slide,"img");l&&l.src&&p(c,l,d)})}function p(c,d,l){l.style("background",c?'center/cover no-repeat url("'+d.src+'")':"",!0),Mt(d,c?"none":"")}return{mount:s,destroy:be(i,!1)}}var Yi=10,Ki=600,Zi=.6,Ji=1.5,Qi=800;function ea(e,t,n){var r=Ce(e),o=r.on,s=r.emit,i=e.state.set,p=t.Move,c=p.getPosition,d=p.getLimit,l=p.exceededLimit,L=p.translate,y=e.is($t),g,u,f=1;function x(){o(Ze,V),o([Le,Te],R)}function h(m,C,E,N,I){var W=c();if(V(),E&&(!y||!l())){var O=t.Layout.sliderSize(),z=Fn(m)*O*an(Ee(m)/O)||0;m=p.toPosition(t.Controller.toDest(m%O))+z}var U=zr(W,m,1);f=1,C=U?0:C||on(Ee(m-W)/Ji,Qi),u=N,g=dn(C,S,be(_,W,m,I),1),i(Nt),s(un),g.start()}function S(){i(Ct),u&&u(),s(mt)}function _(m,C,E,N){var I=c(),W=m+(C-m)*T(N),O=(W-I)*f;L(I+O),y&&!E&&l()&&(f*=Zi,Ee(O)<Yi&&h(d(l(!0)),Ki,!1,u,!0))}function V(){g&&g.cancel()}function R(){g&&!g.isPaused()&&(V(),S())}function T(m){var C=n.easingFunc;return C?C(m):1-Math.pow(1-m,4)}return{mount:x,destroy:V,scroll:h,cancel:R}}var vt={passive:!1,capture:!0};function ta(e,t,n){var r=Ce(e),o=r.on,s=r.emit,i=r.bind,p=r.unbind,c=e.state,d=t.Move,l=t.Scroll,L=t.Controller,y=t.Elements.track,g=t.Media.reduce,u=t.Direction,f=u.resolve,x=u.orient,h=d.getPosition,S=d.exceededLimit,_,V,R,T,m,C=!1,E,N,I;function W(){i(y,Tn,An,vt),i(y,_n,An,vt),i(y,ho,z,vt),i(y,"click",P,{capture:!0}),i(y,"dragstart",qe),o([at,Le],O)}function O(){var j=n.drag;de(!j),T=j==="free"}function z(j){if(E=!1,!N){var w=ge(j);me(j.target)&&(w||!j.button)&&(L.isBusy()?qe(j,!0):(I=w?y:window,m=c.is([Tt,Nt]),R=null,i(I,Tn,U,vt),i(I,_n,v,vt),d.cancel(),l.cancel(),F(j)))}}function U(j){if(c.is(Qt)||(c.set(Qt),s(Ur)),j.cancelable)if(m){d.translate(_+fe(re(j)));var w=pe(j)>br,G=C!==(C=S());(w||G)&&F(j),E=!0,s(Xr),qe(j)}else H(j)&&(m=A(j),qe(j))}function v(j){c.is(Qt)&&(c.set(Ct),s(Yr)),m&&(k(j),qe(j)),p(I,Tn,U),p(I,_n,v),m=!1}function P(j){!N&&E&&qe(j,!0)}function F(j){R=V,V=j,_=h()}function k(j){var w=Z(j),G=se(w),K=n.rewind&&n.rewindByDrag;g(!1),T?L.scroll(G,0,n.snap):e.is(qt)?L.go(x(Fn(w))<0?K?"<":"-":K?">":"+"):e.is($t)&&C&&K?L.go(S(!0)?">":"<"):L.go(L.toDest(G),!0),g(!0)}function A(j){var w=n.dragMinThreshold,G=Ft(w),K=G&&w.mouse||0,J=(G?w.touch:+w)||10;return Ee(re(j))>(ge(j)?J:K)}function H(j){return Ee(re(j))>Ee(re(j,!0))}function Z(j){if(e.is(Lt)||!C){var w=pe(j);if(w&&w<br)return re(j)/w}return 0}function se(j){return h()+Fn(j)*ot(Ee(j)*(n.flickPower||600),T?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(j,w){return ne(j,w)-ne(M(j),w)}function pe(j){return In(j)-In(M(j))}function M(j){return V===j&&R||V}function ne(j,w){return(ge(j)?j.changedTouches[0]:j)["page"+f(w?"Y":"X")]}function fe(j){return j/(C&&e.is($t)?Pi:1)}function me(j){var w=n.noDrag;return!kt(j,"."+po+", ."+vn)&&(!w||!kt(j,w))}function ge(j){return typeof TouchEvent<"u"&&j instanceof TouchEvent}function D(){return m}function de(j){N=j}return{mount:W,disable:de,isDragging:D}}var na={Spacebar:" ",Right:fn,Left:gn,Up:ro,Down:oo};function tr(e){return e=rt(e)?e:e.key,na[e]||e}var xr="keydown";function ra(e,t,n){var r=Ce(e),o=r.on,s=r.bind,i=r.unbind,p=e.root,c=t.Direction.resolve,d,l;function L(){y(),o(Le,g),o(Le,y),o(Ze,f)}function y(){var h=n.keyboard;h&&(d=h==="global"?window:p,s(d,xr,x))}function g(){i(d,xr)}function u(h){l=h}function f(){var h=l;l=!0,Pr(function(){l=h})}function x(h){if(!l){var S=tr(h);S===c(gn)?e.go("<"):S===c(fn)&&e.go(">")}}return{mount:L,destroy:g,disable:u}}var It=Bn+"-lazy",nn=It+"-srcset",oa="["+It+"], ["+nn+"]";function ia(e,t,n){var r=Ce(e),o=r.on,s=r.off,i=r.bind,p=r.emit,c=n.lazyLoad==="sequential",d=[_t,mt],l=[];function L(){n.lazyLoad&&(y(),o(Te,y))}function y(){Ke(l),g(),c?h():(s(d),o(d,u),u())}function g(){t.Slides.forEach(function(S){Vn(S.slide,oa).forEach(function(_){var V=He(_,It),R=He(_,nn);if(V!==_.src||R!==_.srcset){var T=n.classes.spinner,m=_.parentElement,C=Bt(m,"."+T)||xt("span",T,m);l.push([_,S,C]),_.src||Mt(_,"none")}})})}function u(){l=l.filter(function(S){var _=n.perPage*((n.preloadPages||1)+1)-1;return S[1].isWithin(e.index,_)?f(S):!0}),l.length||s(d)}function f(S){var _=S[0];je(S[1].slide,Mn),i(_,"load error",be(x,S)),le(_,"src",He(_,It)),le(_,"srcset",He(_,nn)),ze(_,It),ze(_,nn)}function x(S,_){var V=S[0],R=S[1];Xe(R.slide,Mn),_.type!=="error"&&(ut(S[2]),Mt(V,""),p(Kn,V,R),p(wt)),c&&h()}function h(){l.length&&f(l.shift())}return{mount:L,destroy:be(Ke,l),check:u}}function aa(e,t,n){var r=Ce(e),o=r.on,s=r.emit,i=r.bind,p=t.Slides,c=t.Elements,d=t.Controller,l=d.hasFocus,L=d.getIndex,y=d.go,g=t.Direction.resolve,u=c.pagination,f=[],x,h;function S(){_(),o([Le,Te,sn],S);var N=n.pagination;u&&Mt(u,N?"":"none"),N&&(o([Ze,un,mt],E),V(),E(),s(Jr,{list:x,items:f},C(e.index)))}function _(){x&&(ut(u?it(x.children):x),Xe(x,h),Ke(f),x=null),r.destroy()}function V(){var N=e.length,I=n.classes,W=n.i18n,O=n.perPage,z=l()?d.getEnd()+1:Wt(N/O);x=u||xt("ul",I.pagination,c.track.parentElement),je(x,h=bn+"--"+m()),le(x,Ye,"tablist"),le(x,Fe,W.select),le(x,Jn,m()===hn?"vertical":"");for(var U=0;U<z;U++){var v=xt("li",null,x),P=xt("button",{class:I.page,type:"button"},v),F=p.getIn(U).map(function(A){return A.slide.id}),k=!l()&&O>1?W.pageX:W.slideX;i(P,"click",be(R,U)),n.paginationKeyboard&&i(P,"keydown",be(T,U)),le(v,Ye,"presentation"),le(P,Ye,"tab"),le(P,Gt,F.join(" ")),le(P,Fe,kn(k,U+1)),le(P,St,-1),f.push({li:v,button:P,page:U})}}function R(N){y(">"+N,!0)}function T(N,I){var W=f.length,O=tr(I),z=m(),U=-1;O===g(fn,!1,z)?U=++N%W:O===g(gn,!1,z)?U=(--N+W)%W:O==="Home"?U=0:O==="End"&&(U=W-1);var v=f[U];v&&(Or(v.button),y(">"+U),qe(I,!0))}function m(){return n.paginationDirection||n.direction}function C(N){return f[d.toPage(N)]}function E(){var N=C(L(!0)),I=C(L());if(N){var W=N.button;Xe(W,dt),ze(W,gr),le(W,St,-1)}if(I){var O=I.button;je(O,dt),le(O,gr,!0),le(O,St,"")}s(Qr,{list:x,items:f},N,I)}return{items:f,mount:S,destroy:_,getAt:C,update:E}}var sa=[" ","Enter"];function la(e,t,n){var r=n.isNavigation,o=n.slideFocus,s=[];function i(){e.splides.forEach(function(u){u.isParent||(d(e,u.splide),d(u.splide,e))}),r&&l()}function p(){s.forEach(function(u){u.destroy()}),Ke(s)}function c(){p(),i()}function d(u,f){var x=Ce(u);x.on(Ze,function(h,S,_){f.go(f.is(Lt)?_:h)}),s.push(x)}function l(){var u=Ce(e),f=u.on;f(Gn,y),f(to,g),f([at,Le],L),s.push(u),u.emit(Un,e.splides)}function L(){le(t.Elements.list,Jn,n.direction===hn?"vertical":"")}function y(u){e.go(u.index)}function g(u,f){jn(sa,tr(f))&&(y(u),qe(f))}return{setup:be(t.Media.set,{slideFocus:jt(o)?r:o},!0),mount:i,destroy:p,remount:c}}function ca(e,t,n){var r=Ce(e),o=r.bind,s=0;function i(){n.wheel&&o(t.Elements.track,"wheel",p,vt)}function p(d){if(d.cancelable){var l=d.deltaY,L=l<0,y=In(d),g=n.wheelMinThreshold||0,u=n.wheelSleep||0;Ee(l)>g&&y-s>u&&(e.go(L?"<":">"),s=y),c(L)&&qe(d)}}function c(d){return!n.releaseWheel||e.state.is(Tt)||t.Controller.getAdjacent(d)!==-1}return{mount:i}}var pa=90;function ua(e,t,n){var r=Ce(e),o=r.on,s=t.Elements.track,i=n.live&&!n.isNavigation,p=xt("span",Ai),c=dn(pa,be(l,!1));function d(){i&&(y(!t.Autoplay.isPaused()),le(s,yr,!0),p.textContent="…",o(Xn,be(y,!0)),o(Yn,be(y,!1)),o([_t,mt],be(l,!0)))}function l(g){le(s,hr,g),g?(Vt(s,p),c.start()):(ut(p),c.cancel())}function L(){ze(s,[fr,yr,hr]),ut(p)}function y(g){i&&le(s,fr,g?"off":"polite")}return{mount:d,disable:y,destroy:L}}var da=Object.freeze({__proto__:null,Media:xi,Direction:Si,Elements:Mi,Slides:Hi,Layout:Oi,Clones:ji,Move:zi,Controller:Vi,Arrows:Gi,Autoplay:Ui,Cover:Xi,Scroll:ea,Drag:ta,Keyboard:ra,LazyLoad:ia,Pagination:aa,Sync:la,Wheel:ca,Live:ua}),ma={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"},ga={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:ma,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function fa(e,t,n){var r=t.Slides;function o(){Ce(e).on([at,Te],s)}function s(){r.forEach(function(p){p.style("transform","translateX(-"+100*p.index+"%)")})}function i(p,c){r.style("transition","opacity "+n.speed+"ms "+n.easing),Pr(c)}return{mount:o,start:i,cancel:An}}function ha(e,t,n){var r=t.Move,o=t.Controller,s=t.Scroll,i=t.Elements.list,p=be(We,i,"transition"),c;function d(){Ce(e).bind(i,"transitionend",function(g){g.target===i&&c&&(L(),c())})}function l(g,u){var f=r.toPosition(g,!0),x=r.getPosition(),h=y(g);Ee(f-x)>=1&&h>=1?n.useScroll?s.scroll(f,h,!1,u):(p("transform "+h+"ms "+n.easing),r.translate(f,!0),c=u):(r.jump(g),u())}function L(){p(""),s.cancel()}function y(g){var u=n.rewindSpeed;if(e.is($t)&&u){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&g>=x||f>=x&&g===0)return u}return n.speed}return{mount:d,start:l,cancel:L}}var ya=(function(){function e(n,r){this.event=Ce(),this.Components={},this.state=vi(bt),this.splides=[],this._o={},this._E={};var o=rt(n)?jr(document,n):n;At(o,o+" is invalid."),this.root=o,r=et({label:He(o,Fe)||"",labelledby:He(o,Zn)||""},ga,e.defaults,r||{});try{et(r,JSON.parse(He(o,Bn)))}catch{At(!1,"Invalid JSON")}this._o=Object.create(et({},r))}var t=e.prototype;return t.mount=function(r,o){var s=this,i=this.state,p=this.Components;At(i.is([bt,rn]),"Already mounted!"),i.set(bt),this._C=p,this._T=o||this._T||(this.is(qt)?fa:ha),this._E=r||this._E;var c=Pt({},da,this._E,{Transition:this._T});return pt(c,function(d,l){var L=d(s,p,s._o);p[l]=L,L.setup&&L.setup()}),pt(p,function(d){d.mount&&d.mount()}),this.emit(at),je(this.root,Ii),i.set(Ct),this.emit(Rn),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(Ct)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(it(arguments,1))),this},t.add=function(r,o){return this._C.Slides.add(r,o),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(Te),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,s=this.state;return s.is(bt)?Ce(this).on(Rn,this.destroy.bind(this,r)):(pt(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(qn),o.destroy(),r&&Ke(this.splides),s.set(rn)),this},mi(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),nr=ya;nr.defaults={};nr.STATES=fi;var Sr=[[at,"onMounted"],[Rn,"onReady"],[Ze,"onMove"],[_t,"onMoved"],[Gn,"onClick"],[Br,"onActive"],[Dr,"onInactive"],[Gr,"onVisible"],[qr,"onHidden"],[Te,"onRefresh"],[Le,"onUpdated"],[wt,"onResize"],[pn,"onResized"],[Ur,"onDrag"],[Xr,"onDragging"],[Yr,"onDragged"],[un,"onScroll"],[mt,"onScrolled"],[qn,"onDestroy"],[Kr,"onArrowsMounted"],[Zr,"onArrowsUpdated"],[Jr,"onPaginationMounted"],[Qr,"onPaginationUpdated"],[Un,"onNavigationMounted"],[Xn,"onAutoplayPlay"],[eo,"onAutoplayPlaying"],[Yn,"onAutoplayPause"],[Kn,"onLazyLoadLoaded"]];function rr(...e){return e.filter(Boolean).join(" ")}function ln(e){return e!==null&&typeof e=="object"}function Wn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!Wn(n,t[r]));if(ln(e)&&ln(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Wn(e[o],t[o]))}return e===t}function va(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function ba(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function Hn(e,t){const n=e;return ba(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():ln(r)?n[o]=Hn(ln(n[o])?n[o]:{},r):n[o]=r}),n}var xa=({children:e,className:t,...n})=>b.createElement("div",{className:rr("splide__track",t),...n},b.createElement("ul",{className:"splide__list"},e)),or=class extends b.Component{constructor(){super(...arguments),this.splideRef=b.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new nr(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Hn({},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&&!Wn(this.options,e)&&(this.splide.options=e,this.options=Hn({},e));const t=this.getSlides();va(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){Sr.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:r,...o}=this.props;return b.createElement(t,{className:rr("splide",e),ref:this.splideRef,...this.omit(o,["options",...Sr.map(s=>s[1])])},n?b.createElement(xa,null,r):r)}},ir=({children:e,className:t,...n})=>b.createElement("li",{className:rr("splide__slide",t),...n},e);/*!
2
2
  * Splide.js
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const Sa="RichTextRenderer-module__link___BWeZ2",Ca={link:Sa},wa=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(r=>/^\d/.test(r))},xn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>wa(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Qe(e){const{color:t,...n}=e;return n}function ke(e,t){var n,r,o;return{fontFamily:xn(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:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(o=e.textAppearance)==null?void 0:o.fontVariant,color:e.color}}const Wt=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?a.jsx("a",{className:Ca.link,href:r.value,target:r.target,children:t(r.children)},o):a.jsx("span",{style:$a(r),children:r.text},o));return a.jsx(a.Fragment,{children:e.map((n,r)=>{const o=n.children;return a.jsx("div",{children:t(o)},r)})})};function $a(e){return{...e.fontFamily&&{fontFamily:xn(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 Ta="SvgImage-module__svg___q3xE-",_a="SvgImage-module__img___VsTm-",Sr={svg:Ta,img:_a},La=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Ea=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,et=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r="",style:o})=>{const[s,i]=b.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return b.useEffect(()=>{if(typeof window<"u"&&window.CSS){const p=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(p)}},[]),!La(e)||!s?a.jsx("img",{src:e,alt:"",className:be(Sr.img,r),style:o}):a.jsx("span",{"data-supports-mask":s,className:be(Sr.svg,r),style:{"--svg":Ea(e),"--fill":t,"--hover-fill":n,...o??{}}})},Aa={"top-left":Q.topLeftAlignment,"top-center":Q.topCenterAlignment,"top-right":Q.topRightAlignment,"middle-left":Q.middleLeftAlignment,"middle-center":Q.middleCenterAlignment,"middle-right":Q.middleRightAlignment,"bottom-left":Q.bottomLeftAlignment,"bottom-center":Q.bottomCenterAlignment,"bottom-right":Q.bottomRightAlignment};function Ia({settings:e,content:t,styles:n,isEditor:r}){const[o,s]=b.useState(null),{widthSettings:i,fontSettings:p,letterSpacing:c,textAlign:m,wordSpacing:l,fontSizeLineHeight:_,textAppearance:g,color:h}=n.imageCaption,[u,d]=b.useState(void 0),[x,v]=b.useState(null),[S,L]=b.useState(0),[z,P]=b.useState(0),{direction:T,transition:f,controls:C,pagination:E,imageCaption:j,triggers:I}=e,O=b.useRef(f.type),{x:M,y:V}=e.controls.offset,q=y=>{o&&o.go(y)};return b.useEffect(()=>{if(!x)return;const y=new ResizeObserver(R=>{if(!o)return;const[F]=R;d({width:Math.round(F.contentRect.width),height:Math.round(F.contentRect.height)})});return y.observe(x),()=>y.unobserve(x)},[x]),b.useEffect(()=>{!o||O.current===f.type||(P(y=>y+1),O.current=f.type)},[f.type]),a.jsx("div",{className:be(Q.wrapper,{[Q.editor]:r}),ref:v,children:a.jsxs("div",{className:Q.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:f.backgroundColor&&f.type==="fade in"?f.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:be(Q.captionBlock),children:a.jsx("div",{className:Q.captionTextWrapper,children:t.map((y,R)=>a.jsx("div",{className:be(Q.captionText,Aa[j.alignment],{[Q.withPointerEvents]:R===S&&r,[Q.active]:R===S}),style:{fontFamily:xn(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:i.sizing==="auto"?"max-content":$.scalingValue(i.width,r),letterSpacing:$.scalingValue(c,r),wordSpacing:$.scalingValue(l,r),textAlign:m,fontSize:$.scalingValue(_.fontSize,r),lineHeight:$.scalingValue(_.lineHeight,r),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:h,transitionDuration:f.duration?`${Math.round(parseInt(f.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:Q.captionTextInner,style:{"--link-hover-color":j.linkHoverColor,"--link-color":j.linkColor,position:"relative",top:$.scalingValue(j.offset.y,r),left:$.scalingValue(j.offset.x,r)},children:a.jsx(Wt,{content:y.imageCaption})})},R))})}),a.jsx(rr,{onMove:y=>{L(y.index)},ref:s,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:T==="horiz"||f.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:f.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((y,R)=>a.jsx(or,{children:a.jsx("div",{className:Q.sliderItem,children:a.jsx("div",{className:Q.imgWrapper,children:a.jsx("img",{className:be(Q.sliderImage,{[Q.contain]:y.image.objectFit==="contain",[Q.cover]:y.image.objectFit==="cover"}),src:y.image.url,alt:y.image.name??""})})})},R))},z),C.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:be(Q.arrow,{[Q.arrowVertical]:T==="vert",[Q.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{onClick:()=>{q("-1")},className:Q.arrowInner,style:{transform:`translate(${$.scalingValue(M,r)}, ${$.scalingValue(V*(T==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(et,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:be(Q.arrowImg,Q.mirror)}),!C.arrowsImgUrl&&a.jsx(Cr,{color:C.color,className:be(Q.arrowIcon,Q.arrowImg,Q.mirror)})]})}),a.jsx("div",{className:be(Q.arrow,Q.nextArrow,{[Q.arrowVertical]:T==="vert",[Q.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{className:Q.arrowInner,onClick:()=>q("+1"),style:{transform:`translate(${$.scalingValue(M*(T==="horiz"?-1:1),r)}, ${$.scalingValue(V,r)}) scale(${e.controls.scale/100}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(et,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:Q.arrowImg}),!C.arrowsImgUrl&&a.jsx(Cr,{color:C.color,className:be(Q.arrowIcon,Q.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:Q.clickOverlay,onClick:()=>{o&&o.go("+1")}}),E.isActive&&a.jsx("div",{className:be(Q.pagination,{[Q.paginationInsideBottom]:E.position==="inside-1"&&T==="horiz",[Q.paginationInsideTop]:E.position==="inside-2"&&T==="horiz",[Q.paginationOutsideBottom]:E.position==="outside-1"&&T==="horiz",[Q.paginationOutsideTop]:E.position==="outside-2"&&T==="horiz",[Q.paginationInsideLeft]:E.position==="inside-1"&&T==="vert",[Q.paginationInsideRight]:E.position==="inside-2"&&T==="vert",[Q.paginationOutsideLeft]:E.position==="outside-1"&&T==="vert",[Q.paginationOutsideRight]:E.position==="outside-2"&&T==="vert",[Q.paginationVertical]:T==="vert"}),children:a.jsx("div",{className:Q.paginationInner,style:{backgroundColor:E.colors[2],transform:`scale(${E.scale/100}) translate(${$.scalingValue(E.offset.x,r)}, ${$.scalingValue(E.offset.y,r)}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:t.map((y,R)=>a.jsx("button",{onClick:()=>{o&&o.go(R)},className:be(Q.paginationItem),children:a.jsx("div",{className:be(Q.dot,{[Q.activeDot]:R===S}),style:{backgroundColor:R===S?E.colors[0]:E.colors[1],"--pagination-hover-color":E.hover}})},R))})})]})})}function Cr({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,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:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Fa={element:Ia,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},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:"outside-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",Ra="ImageRevealSlider-module__image___Qjt-e",Pa="ImageRevealSlider-module__link___N-iLG",Ma="ImageRevealSlider-module__cursor___2U03d",gt={imageRevealSlider:ka,image:Ra,link:Pa,cursor:Ma};function wr(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const s=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*s,p=s/2,c=i/2;if(e>=r.x-p&&e<=r.x+p&&t>=r.y-c&&t<=r.y+c)return!0}return!1}function _n(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Wa(e,t,n,r){let o,s;if(t==="custom"){o=n;const i=await _n(e);s=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await _n(e);s=i.height/i.width*o}else{const i=await _n(e);o=i.width,s=i.height}return{width:o,height:s,finalWidth:`${o}px`}}function Ha({settings:e,content:t,isEditor:n}){const[r,o]=b.useState(null),[s,i]=b.useState([]),[p,c]=b.useState(0),m=b.useRef(0),[l,_]=b.useState({x:0,y:0}),[g,h]=b.useState(1),[u,d]=b.useState("none"),x=b.useRef({x:0,y:0}),[v,S]=b.useState(!1),{sizeType:L,imageWidth:z,randomRangeImageWidth:P}=e.imageSize,{revealPosition:T,visible:f}=e.position,{cursorType:C,target:E,defaultCursorScale:j,defaultCursor:I,hoverCursorScale:O,hoverCursor:M}=e.cursor;b.useEffect(()=>{if(!r)return;const y=(k,A)=>{const W=r.getBoundingClientRect(),Z=k-W.left,se=A-W.top;if(_({x:Z,y:se}),C==="system"){d("none"),h(1);return}const ne=Z,ce=se,H=document.elementFromPoint(W.left+ne,W.top+ce);if(H&&H.closest("a")){d("none"),h(1);return}const ee=wr(ne,ce,s)||E==="area"?{img:M??"none",scale:O}:{img:I??"none",scale:j};d(ee.img),h(ee.scale)},R=k=>{k.stopPropagation(),x.current={x:k.clientX,y:k.clientY},y(k.clientX,k.clientY)},F=()=>{v&&y(x.current.x,x.current.y)};return r.addEventListener("mousemove",R),window.addEventListener("scroll",F,!0),()=>{r.removeEventListener("mousemove",R),window.removeEventListener("scroll",F,!0)}},[r,v,l,C,E,M,I,O,j,s]),b.useEffect(()=>{v||(d("none"),h(0))},[v]);const V=async(y,R,F,k={})=>{const{width:A,height:W,finalWidth:Z}=await Wa(y.image.url,L,z,P);let se=0,ne=0;T==="same"?(se=R/2,ne=F/2):(se=k.x??Math.random()*R,ne=k.y??Math.random()*F);const ce=Math.min(Math.max(se,A/2),R-A/2),H=Math.min(Math.max(ne,W/2),F-W/2);return{id:m.current++,url:y.image.url,link:y.link,name:y.image.name,x:ce,y:H,width:Z}};b.useEffect(()=>{if(!r||t.length===0)return;const y=r.getBoundingClientRect(),R=y.width,F=y.height,k=[];(async()=>{const W=t[0],Z=await V(W,R,F);k.push(Z),i(k),c(1)})()},[L,z,P,T,r]),b.useEffect(()=>{f==="last One"&&i(y=>y.length>0?[y[y.length-1]]:[])},[f]);const q=async y=>{if(!r)return;const R=r.getBoundingClientRect(),F=y.clientX-R.left,k=y.clientY-R.top;if(E==="image"&&!wr(F,k,s))return;let A=0,W=0;T==="on Click"?(A=F,W=k):T==="same"?(A=R.width/2,W=R.height/2):(A=Math.random()*R.width,W=Math.random()*R.height);const Z=t[p],se=await V(Z,R.width,R.height,{x:A,y:W});i(ne=>f==="all"?[...ne,se]:[se]),c(ne=>ne>=t.length-1?0:ne+1)};return a.jsxs("div",{ref:o,onClick:q,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:gt.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[s.map(y=>a.jsx("div",{className:gt.wrapper,style:{top:`${y.y}px`,left:`${y.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:y.width??"auto",height:"auto",cursor:u==="none"?"default":"none"},children:E==="area"&&y.link?a.jsx("a",{href:y.link,target:"_blank",className:gt.link,children:a.jsx("img",{src:y.url,alt:y.name,className:gt.image},y.id)}):a.jsx("img",{src:y.url,alt:y.name,className:gt.image},y.id)},y.id)),v&&a.jsx("div",{className:gt.cursor,style:{left:`${l.x}px`,top:`${l.y}px`,transform:`translate(-50%, -50%) scale(${g})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Oa={element:Ha,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{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:""}]}}}},Na="LightBox-module__hidden___9s-9x",ja="LightBox-module__heroImage___sTxNF",za="LightBox-module__background___rm9ml",Va="LightBox-module__editor___4ACaY",Ba="LightBox-module__contentStyle___Bgnsq",Da="LightBox-module__imageStyle___tLIlB",Ga="LightBox-module__imgWrapper___LuFUp",qa="LightBox-module__contain___8-yaS",Ua="LightBox-module__cover___hNvOG",Xa="LightBox-module__caption___b6L2I",Ya="LightBox-module__captionTextInner___rCGNH",Ka="LightBox-module__lightboxSplide___XFuWC",Za="LightBox-module__arrow___iz38X",Ja="LightBox-module__arrowVertical___Zfz81",Qa="LightBox-module__nextArrow___zkAQN",es="LightBox-module__arrowInner___p48sW",ts="LightBox-module__arrowIcon___3VaFf",ns="LightBox-module__arrowImg___pNV88",rs="LightBox-module__mirror___pjeXc",os="LightBox-module__thumbsWrapper___GB-nU",is="LightBox-module__thumbsContainerVertical___wttk5",as="LightBox-module__thumbsContainer___osSma",ss="LightBox-module__thumbsAlignStart___MO6tY",ls="LightBox-module__thumbsAlignCenter___Q4sUx",cs="LightBox-module__thumbsAlignEnd___p4y9R",ps="LightBox-module__thumbItem___HvnF3",us="LightBox-module__closeButton___g2khP",ds="LightBox-module__fadeIn___0m5GW",ms="LightBox-module__slideInLeft___gPYwC",gs="LightBox-module__slideInRight___S-pPp",fs="LightBox-module__slideInTop___DFdAj",hs="LightBox-module__slideInBottom___m27kZ",ys="LightBox-module__fadeOut___55qBR",vs="LightBox-module__slideOutLeft___NvU7P",bs="LightBox-module__slideOutRight___SK7eC",xs="LightBox-module__slideOutTop___Vgg0z",Ss="LightBox-module__slideOutBottom___nJ0Ef",Cs="LightBox-module__scaleSlide___vZriG",G={hidden:Na,heroImage:ja,background:za,editor:Va,contentStyle:Ba,imageStyle:Da,imgWrapper:Ga,contain:qa,cover:Ua,caption:Xa,captionTextInner:Ya,lightboxSplide:Ka,arrow:Za,arrowVertical:Ja,nextArrow:Qa,arrowInner:es,arrowIcon:ts,arrowImg:ns,mirror:rs,thumbsWrapper:os,thumbsContainerVertical:is,thumbsContainer:as,thumbsAlignStart:ss,thumbsAlignCenter:ls,thumbsAlignEnd:cs,thumbItem:ps,closeButton:us,fadeIn:ds,slideInLeft:ms,slideInRight:gs,slideInTop:fs,slideInBottom:hs,fadeOut:ys,slideOutLeft:vs,slideOutRight:bs,slideOutTop:xs,slideOutBottom:Ss,scaleSlide:Cs},Yt=(e,t,n)=>{const r={},[o,s]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),s==="left"?(r.left="0",r.right="auto"):s==="center"?(r.left="50%",r.right="auto"):s==="right"&&(r.left="auto",r.right="0"),o==="middle"&&s==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:s==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:r.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,r};function ho(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 $r(e){const t=e.getBoundingClientRect(),n=ho(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,i=e.naturalHeight,p=r/o,c=s/i;let m,l;c>p?(m=r,l=r/c):(l=o,m=o*c);const _=t.left+n.left,g=t.top+n.top,h=(r-m)/2+_,u=(o-l)/2+g;return{x:h,y:u,width:m,height:l}}function Tr(e){const t=e.getBoundingClientRect(),n=ho(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function _r(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function ws(e,t){const n=(()=>{if(e==="fade in")return G.fadeIn;if(e==="slide in"||e==="mix")switch(t){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})(),r=(()=>{if(e==="fade in"||e==="mix")return G.fadeIn;if(e==="slide in")switch(t){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(e==="fade in"||e==="mix")return G.fadeOut;if(e==="slide in")switch(t){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})(),s=(()=>{if(e==="fade in")return G.fadeOut;if(e==="slide in"||e==="mix")switch(t){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:r,backdropDisappearClass:o,disappearClass:s}}const $s=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:s})=>{const[i,p]=b.useState(!1),{url:c}=e.thumbnailBlock.cover;return b.useEffect(()=>{o==="close"&&p(!1),o==="open"&&p(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:c,alt:"Cover",className:G.heroImage,onClick:()=>p(!0)}),a.jsx(Ts,{isOpen:i,onClose:()=>p(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:s})]})},Ts=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:s,isEditor:i,metadata:p})=>{var N;const[c,m]=b.useState(0),[l,_]=b.useState(0),[g,h]=b.useState(!1),[u,d]=b.useState(!1),[x,v]=b.useState({}),S=b.useRef(null),L=b.useRef(null),z=b.useRef(null),P=b.useRef(!1),T=b.useRef(null),f=b.useRef(null),C=b.useRef(null),E=b.useRef(null),j=b.useRef(!1),I=b.useRef(null),[O,M]=b.useState(!1),{appear:V,triggers:q,slider:y,thumbnail:R,controls:F,area:k,caption:A,layout:W}=o.lightboxBlock,{appearClass:Z,backdropAppearClass:se,backdropDisappearClass:ne,disappearClass:ce}=ws(V.type,V.direction),H=(p==null?void 0:p.itemId)??null;b.useEffect(()=>{const w=()=>{setTimeout(()=>{var K,J;(J=(K=S.current)==null?void 0:K.splide)==null||J.refresh()},16)},D=()=>{_(K=>K+1)};return window.addEventListener("ArticleEditor.Layout:change",w),window.addEventListener("ArticleEditor.ComponentContent:change",D),()=>{window.removeEventListener("ArticleEditor.Layout:change",w),window.removeEventListener("ArticleEditor.ComponentContent:change",D)}},[]),b.useEffect(()=>{if(!e||!R.isActive){M(!1);return}const w=I.current;if(!w)return;const D=()=>{y.direction==="horiz"?M(w.scrollWidth>w.clientWidth):M(w.scrollHeight>w.clientHeight)};D();const K=new ResizeObserver(D);return K.observe(w),()=>K.disconnect()},[e,R.isActive,n.length,x,y.direction]);const ee=b.useCallback(()=>{const w=window.matchMedia("(max-width: 768px)").matches,D=_r(k.color);w&&!i&&D>.9&&(document.body.style.backgroundColor=""),h(!0),P.current=!0;const K=J=>{J.target===T.current&&J.animationName&&(T.current&&f.current&&T.current.removeEventListener("animationend",f.current),f.current=null,P.current&&(P.current=!1,t()),h(!1))};T.current&&(f.current=K,T.current.addEventListener("animationend",K))},[t,k.color,i]),he=(w,D,K)=>{var J,ae;if(w){if(q.type==="click"&&q.switch==="image")q.repeat==="close"&&c===n.length-1?ee():(J=S.current)==null||J.go("+1");else if(q.type==="click"&&q.switch==="50/50"){const oe=w.getBoundingClientRect(),te=D-oe.left,pe=K-oe.top,B=oe.width,Y=oe.height;let X;y.direction==="horiz"?X=te<B/2?"-1":"+1":X=pe<Y/2?"-1":"+1",(ae=S.current)==null||ae.go(X)}}},me=w=>{if(j.current){j.current=!1;return}const D=n[c],K=(D==null?void 0:D.image.objectFit)==="cover";let J,ae;if("changedTouches"in w&&w.changedTouches.length>0)J=w.changedTouches[0].clientX,ae=w.changedTouches[0].clientY;else if("clientX"in w)J=w.clientX,ae=w.clientY;else return;let oe;if(K&&z.current){const te=Tr(z.current);oe=J>=te.left&&J<=te.right&&ae>=te.top&&ae<=te.bottom}else{const te=z.current?$r(z.current):null;if(!te){w.target===w.currentTarget&&ee();return}oe=J>=te.x&&J<=te.x+te.width&&ae>=te.y&&ae<=te.y+te.height}oe?he(z.current,J,ae):ee()},ge=w=>{const D=w.target;(D.classList.contains(G.thumbsWrapper)||D.classList.contains(G.thumbsContainer))&&me(w)};b.useEffect(()=>{if(!e)return;const w=D=>{var K,J;if(D.key==="Escape"){ee();return}if(D.key==="ArrowRight"){m(ae=>(ae+1)%Math.max(n.length,1)),(K=S.current)==null||K.go("+1");return}D.key==="ArrowLeft"&&(m(ae=>(ae-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=S.current)==null||J.go("-1"))};return window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}},[e,ee,n.length]),b.useEffect(()=>{if(e){if(m(0),_(D=>D+1),P.current=!1,h(!1),d(!1),v({}),!H)return;const w=new CustomEvent("page-overlay",{detail:{itemId:H}});window.dispatchEvent(w)}return()=>{T.current&&f.current&&(T.current.removeEventListener("animationend",f.current),f.current=null),d(!1)}},[e,H]),b.useEffect(()=>{L.current!==null&&L.current!==y.type&&_(w=>w+1),L.current=y.type},[y.type]),b.useEffect(()=>{if(!e)return;const w=document.body.style.overflow,D=window.matchMedia("(max-width: 768px)").matches,K=_r(k.color);document.body.style.overflow="hidden",d(!1);const J=oe=>{oe.target===T.current&&!P.current&&oe.animationName&&(D&&!i&&K>.9&&(document.body.style.backgroundColor=k.color),d(!0),T.current&&C.current&&T.current.removeEventListener("animationend",C.current),C.current=null)};T.current&&(C.current=J,T.current.addEventListener("animationend",J));const ae=oe=>{const te=oe.target;te&&(te.closest(`.${G.thumbsWrapper}`)||te.closest(`.${G.thumbsContainer}`))||y.type!=="slide"&&oe.preventDefault()};return document.addEventListener("touchmove",ae,{passive:!1}),()=>{document.body.style.overflow=w,document.removeEventListener("touchmove",ae),T.current&&C.current&&(T.current.removeEventListener("animationend",C.current),C.current=null),d(!1)}},[e,i,k.color,y.type]),b.useEffect(()=>{if(!e)return;const w=D=>{var J,ae;if(P.current){D.stopPropagation();return}if(j.current){j.current=!1;return}const K=D.target;if(!(K&&(K.closest(`.${G.thumbsContainer}`)||K.closest(`.${G.thumbItem}`)))){if(y.type==="slide"&&q.type==="drag"&&((ae=(J=S.current)==null?void 0:J.splide)!=null&&ae.root)){const oe=S.current.splide.root;if(K&&(oe.contains(K)||oe===K))return}if(D.touches.length===0&&D.changedTouches.length>0){const oe=n[c],te=(oe==null?void 0:oe.image.objectFit)==="cover",pe=D.changedTouches[0];let B;if(te&&z.current){const Y=Tr(z.current);B=pe.clientX>=Y.left&&pe.clientX<=Y.right&&pe.clientY>=Y.top&&pe.clientY<=Y.bottom}else{const Y=z.current?$r(z.current):null;if(!Y)return;B=pe.clientX>=Y.x&&pe.clientX<=Y.x+Y.width&&pe.clientY>=Y.y&&pe.clientY<=Y.y+Y.height}if(!B){D.stopPropagation(),P.current=!0;const Y=X=>{X.stopPropagation(),X.preventDefault(),document.removeEventListener("click",Y,!0)};document.addEventListener("click",Y,!0),ee()}}}};return document.addEventListener("touchend",w,{passive:!0}),()=>{document.removeEventListener("touchend",w)}},[e,ee,c,n]);const U=(y.type==="scale"||y.type==="fade")&&y.direction==="vert"&&q.type==="drag";b.useEffect(()=>{var X,ie;if(!e||!U||!((ie=(X=S.current)==null?void 0:X.splide)!=null&&ie.root))return;const w=S.current.splide.root,D=30,K=(re,de)=>{if(E.current){const Ce=Math.abs(re-E.current.x),$e=Math.abs(de-E.current.y);(Ce>0||$e>0)&&(j.current=!0)}},J=re=>{E.current&&(re.preventDefault(),K(re.clientX,re.clientY))},ae=re=>{E.current&&re.touches.length>0&&(re.preventDefault(),K(re.touches[0].clientX,re.touches[0].clientY))},oe=(re,de)=>{if(!E.current||!S.current){E.current=null;return}const Ce=Math.abs(re-E.current.x),$e=Math.abs(de-E.current.y);$e>D&&$e>Ce&&S.current.go(de<E.current.y?"+1":"-1"),E.current=null},te=re=>{E.current&&oe(re.clientX,re.clientY),document.removeEventListener("pointerup",te),document.removeEventListener("pointercancel",te),document.removeEventListener("pointermove",J)},pe=re=>{if(E.current){if(re.changedTouches.length>0){const de=re.changedTouches[0];oe(de.clientX,de.clientY)}document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),document.removeEventListener("touchmove",ae)}},B=re=>{E.current={x:re.clientX,y:re.clientY},j.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",te),document.addEventListener("pointercancel",te)},Y=re=>{re.touches.length>0&&(E.current={x:re.touches[0].clientX,y:re.touches[0].clientY},j.current=!1,document.addEventListener("touchmove",ae,{passive:!1}),document.addEventListener("touchend",pe),document.addEventListener("touchcancel",pe))};return w.addEventListener("pointerdown",B),w.addEventListener("touchstart",Y),()=>{w.removeEventListener("pointerdown",B),w.removeEventListener("touchstart",Y),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",te),document.removeEventListener("pointercancel",te),document.removeEventListener("touchmove",ae),document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),E.current=null,j.current=!1}},[e,U,l]);const fe={backgroundColor:k.color,backdropFilter:`blur(${k.blur}px)`,animationDuration:`${parseInt(V.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:kr.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:T,className:be(G.background,g?ne:se,{[G.editor]:i},{[G.hidden]:!e}),style:{...fe,...u&&!i&&!g?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?T:null,className:be(G.contentStyle,g?ce:Z,{[G.editor]:i},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(V.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(rr,{onMove:w=>m(w.index),ref:S,className:G.lightboxSplide,options:{arrows:!1,speed:y.duration?parseInt(y.duration):500,direction:y.direction==="horiz"||y.type==="fade"||y.type==="scale"?"ltr":"ttb",pagination:!1,drag:q.type==="drag"&&!U,perPage:1,width:"100%",height:"100%",type:y.type==="fade"||y.type==="scale"?"fade":"loop",padding:0,rewind:q.repeat!=="close",start:0},style:{"--splide-speed":y.duration},children:n.map((w,D)=>{const K=Yt(W.position,W.offset,i),J=`${$.scalingValue(W.padding.top,i)} ${$.scalingValue(W.padding.right,i)} ${$.scalingValue(W.padding.bottom,i)} ${$.scalingValue(W.padding.left,i)}`,ae=y.type==="scale"?(()=>{const{transform:oe,...te}=K;return{...te,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":oe||"none"}})():{...K,position:"absolute",padding:J,boxSizing:"border-box"};return a.jsx(or,{children:a.jsx("div",{className:G.imgWrapper,onClick:me,children:a.jsx("img",{ref:D===c?z:null,className:be(G.imageStyle,{[G.contain]:w.image.objectFit==="contain",[G.cover]:w.image.objectFit==="cover",[G.scaleSlide]:y.type==="scale"}),src:w.image.url,alt:w.image.name??"",style:{...ae,pointerEvents:w.image.objectFit==="contain"?"none":"auto"}})})},D)})},l),F.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:be(G.arrow,{[G.arrowVertical]:y.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${$.scalingValue(F.offset.x,i)}, ${$.scalingValue(F.offset.y*(y.direction==="horiz"?1:-1),i)}) scale(${F.scale}) rotate(${y.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=S.current)==null?void 0:w.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&a.jsx(et,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:be(G.arrowImg,G.mirror)}),!F.arrowsImgUrl&&a.jsx(Lr,{color:F.color,className:be(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:be(G.arrow,G.nextArrow,{[G.arrowVertical]:y.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${$.scalingValue(F.offset.x*(y.direction==="horiz"?-1:1),i)}, ${$.scalingValue(F.offset.y,i)}) scale(${F.scale}) rotate(${y.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=S.current)==null?void 0:w.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&a.jsx(et,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:G.arrowImg}),!F.arrowsImgUrl&&a.jsx(Lr,{color:F.color,className:be(G.arrowIcon,G.arrowImg)})]})})]}),k.closeIconUrl&&(()=>{const w=Yt(k.closeIconAlign,k.closeIconOffset,i),D=`scale(${k.closeIconScale})`,K=w.transform?`${w.transform} ${D}`:D;return a.jsx("button",{className:G.closeButton,style:{...w,transform:K},onClick:ee,"aria-label":"Close lightbox",children:a.jsx(et,{url:k.closeIconUrl,fill:k.closeIconColor??"#000000",hoverFill:k.closeIconHover??"#cccccc"})})})(),A&&A.isActive&&r.imageCaption&&((N=n[c])==null?void 0:N.imageCaption)&&(()=>{const{widthSettings:w,fontSettings:D,letterSpacing:K,textAlign:J,wordSpacing:ae,fontSizeLineHeight:oe,textAppearance:te,color:pe}=r.imageCaption;return a.jsx("div",{className:G.caption,style:{...Yt(A.alignment,A.offset,i),fontFamily:xn(D.fontFamily),fontWeight:D.fontWeight,fontStyle:D.fontStyle,width:w.sizing==="auto"?"max-content":$.scalingValue(w.width,i),letterSpacing:$.scalingValue(K,i),wordSpacing:$.scalingValue(ae,i),textAlign:J,fontSize:$.scalingValue(oe.fontSize,i),lineHeight:$.scalingValue(oe.lineHeight,i),textTransform:te.textTransform??"none",textDecoration:te.textDecoration??"none",fontVariant:te.fontVariant??"normal",color:pe},onClick:B=>B.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":A.linkColor,"--link-hover-color":A.linkHoverColor},children:a.jsx(Wt,{content:n[c].imageCaption})})})})(),R.isActive&&(()=>{const[w,D]=R.position.split("-"),K=y.direction==="horiz"?`${w}-left`:R.position,J=Yt(K,R.offset,i),ae=()=>{if(y.direction==="horiz"){if(D==="left")return"flex-start";if(D==="center")return"center";if(D==="right")return"flex-end"}else{if(w==="top")return"flex-start";if(w==="middle")return"center";if(w==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:I,className:G.thumbsWrapper,onClick:oe=>ge(oe),style:{position:i?"absolute":"fixed",...J,...y.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:be(G.thumbsContainer,{[G.thumbsContainerVertical]:y.direction==="vert",[G.thumbsAlignStart]:R.align==="start",[G.thumbsAlignCenter]:R.align==="center",[G.thumbsAlignEnd]:R.align==="end"}),style:{gap:$.scalingValue(R.grid.gap,i),justifyContent:O?"flex-start":ae()},children:n.map((oe,te)=>{const pe=te===c,B=x[te],X=R.grid.size*(pe?R.activeState.scale:1),ie=()=>{if(R.fit!=="fit")return{};if(!B)return y.direction==="horiz"?{height:$.scalingValue(X,i)}:{width:$.scalingValue(X,i)};const re=B.width/B.height;if(y.direction==="horiz"){const de=X,Ce=de*re;return{width:$.scalingValue(Ce,i),height:$.scalingValue(de,i)}}else{const de=X,Ce=de/re;return{width:$.scalingValue(de,i),height:$.scalingValue(Ce,i)}}};return a.jsx("button",{className:G.thumbItem,style:{...y.direction==="horiz"&&R.fit!=="fit"?{height:$.scalingValue(X,i)}:{},...y.direction==="vert"&&R.fit!=="fit"?{width:$.scalingValue(X,i)}:{},...R.fit==="cover"?{width:$.scalingValue(X,i),height:$.scalingValue(X,i)}:{},...ie(),transition:pe?"all 0.25s ease-out":"none",opacity:pe?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:re=>{var de;re.stopPropagation(),m(te),(de=S.current)==null||de.go(te)},onMouseEnter:()=>{var re;R.triggers==="hov"&&((re=S.current)==null||re.go(te))},children:a.jsx("img",{src:oe.image.url,alt:oe.image.name??"",onLoad:re=>{const de=re.currentTarget;de.naturalWidth&&de.naturalHeight&&v(Ce=>({...Ce,[te]:{width:de.naturalWidth,height:de.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${oe.image.name}-${te}`)})})})})()]})]}),document.getElementById(s))};function Lr({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,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:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const _s={element:$s,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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 Kt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ls(e){return`
6
+ */const Sa="RichTextRenderer-module__link___BWeZ2",Ca={link:Sa},wa=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(r=>/^\d/.test(r))},xn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>wa(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function tt(e){const{color:t,...n}=e;return n}function ke(e,t){var n,r,o;return{fontFamily:xn(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:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(o=e.textAppearance)==null?void 0:o.fontVariant,color:e.color}}const Ot=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?a.jsx("a",{className:Ca.link,href:r.value,target:r.target,children:t(r.children)},o):a.jsx("span",{style:$a(r),children:r.text},o));return a.jsx(a.Fragment,{children:e.map((n,r)=>{const o=n.children;return a.jsx("div",{children:t(o)},r)})})};function $a(e){return{...e.fontFamily&&{fontFamily:xn(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 Ta="SvgImage-module__svg___q3xE-",_a="SvgImage-module__img___VsTm-",Cr={svg:Ta,img:_a},La=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Ea=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,nt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r="",style:o})=>{const[s,i]=b.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return b.useEffect(()=>{if(typeof window<"u"&&window.CSS){const p=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(p)}},[]),!La(e)||!s?a.jsx("img",{src:e,alt:"",className:ve(Cr.img,r),style:o}):a.jsx("span",{"data-supports-mask":s,className:ve(Cr.svg,r),style:{"--svg":Ea(e),"--fill":t,"--hover-fill":n,...o??{}}})},Aa={"top-left":Q.topLeftAlignment,"top-center":Q.topCenterAlignment,"top-right":Q.topRightAlignment,"middle-left":Q.middleLeftAlignment,"middle-center":Q.middleCenterAlignment,"middle-right":Q.middleRightAlignment,"bottom-left":Q.bottomLeftAlignment,"bottom-center":Q.bottomCenterAlignment,"bottom-right":Q.bottomRightAlignment};function Ia({settings:e,content:t,styles:n,isEditor:r}){const[o,s]=b.useState(null),{widthSettings:i,fontSettings:p,letterSpacing:c,textAlign:d,wordSpacing:l,fontSizeLineHeight:L,textAppearance:y,color:g}=n.imageCaption,[u,f]=b.useState(void 0),[x,h]=b.useState(null),[S,_]=b.useState(0),[V,R]=b.useState(0),{direction:T,transition:m,controls:C,pagination:E,imageCaption:N,triggers:I}=e,W=b.useRef(m.type),{x:O,y:z}=e.controls.offset,U=v=>{o&&o.go(v)};return b.useEffect(()=>{if(!x)return;const v=new ResizeObserver(P=>{if(!o)return;const[F]=P;f({width:Math.round(F.contentRect.width),height:Math.round(F.contentRect.height)})});return v.observe(x),()=>v.unobserve(x)},[x]),b.useEffect(()=>{!o||W.current===m.type||(R(v=>v+1),W.current=m.type)},[m.type]),a.jsx("div",{className:ve(Q.wrapper,{[Q.editor]:r}),ref:h,children:a.jsxs("div",{className:Q.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:m.backgroundColor&&m.type==="fade in"?m.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ve(Q.captionBlock),children:a.jsx("div",{className:Q.captionTextWrapper,children:t.map((v,P)=>a.jsx("div",{className:ve(Q.captionText,Aa[N.alignment],{[Q.withPointerEvents]:P===S&&r,[Q.active]:P===S}),style:{fontFamily:xn(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:i.sizing==="auto"?"max-content":$.scalingValue(i.width,r),letterSpacing:$.scalingValue(c,r),wordSpacing:$.scalingValue(l,r),textAlign:d,fontSize:$.scalingValue(L.fontSize,r),lineHeight:$.scalingValue(L.lineHeight,r),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:g,transitionDuration:m.duration?`${Math.round(parseInt(m.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:Q.captionTextInner,style:{"--link-hover-color":N.linkHoverColor,"--link-color":N.linkColor,position:"relative",top:$.scalingValue(N.offset.y,r),left:$.scalingValue(N.offset.x,r)},children:a.jsx(Ot,{content:v.imageCaption})})},P))})}),a.jsx(or,{onMove:v=>{_(v.index)},ref:s,options:{arrows:!1,speed:m.duration?parseInt(m.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:T==="horiz"||m.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:m.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((v,P)=>a.jsx(ir,{children:a.jsx("div",{className:Q.sliderItem,children:a.jsx("div",{className:Q.imgWrapper,children:a.jsx("img",{className:ve(Q.sliderImage,{[Q.contain]:v.image.objectFit==="contain",[Q.cover]:v.image.objectFit==="cover"}),src:v.image.url,alt:v.image.name??""})})})},P))},V),C.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(Q.arrow,{[Q.arrowVertical]:T==="vert",[Q.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{onClick:()=>{U("-1")},className:Q.arrowInner,style:{transform:`translate(${$.scalingValue(O,r)}, ${$.scalingValue(z*(T==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(nt,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ve(Q.arrowImg,Q.mirror)}),!C.arrowsImgUrl&&a.jsx(wr,{color:C.color,className:ve(Q.arrowIcon,Q.arrowImg,Q.mirror)})]})}),a.jsx("div",{className:ve(Q.arrow,Q.nextArrow,{[Q.arrowVertical]:T==="vert",[Q.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{className:Q.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${$.scalingValue(O*(T==="horiz"?-1:1),r)}, ${$.scalingValue(z,r)}) scale(${e.controls.scale/100}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(nt,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:Q.arrowImg}),!C.arrowsImgUrl&&a.jsx(wr,{color:C.color,className:ve(Q.arrowIcon,Q.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:Q.clickOverlay,onClick:()=>{o&&o.go("+1")}}),E.isActive&&a.jsx("div",{className:ve(Q.pagination,{[Q.paginationInsideBottom]:E.position==="inside-1"&&T==="horiz",[Q.paginationInsideTop]:E.position==="inside-2"&&T==="horiz",[Q.paginationOutsideBottom]:E.position==="outside-1"&&T==="horiz",[Q.paginationOutsideTop]:E.position==="outside-2"&&T==="horiz",[Q.paginationInsideLeft]:E.position==="inside-1"&&T==="vert",[Q.paginationInsideRight]:E.position==="inside-2"&&T==="vert",[Q.paginationOutsideLeft]:E.position==="outside-1"&&T==="vert",[Q.paginationOutsideRight]:E.position==="outside-2"&&T==="vert",[Q.paginationVertical]:T==="vert"}),children:a.jsx("div",{className:Q.paginationInner,style:{backgroundColor:E.colors[2],transform:`scale(${E.scale/100}) translate(${$.scalingValue(E.offset.x,r)}, ${$.scalingValue(E.offset.y,r)}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:t.map((v,P)=>a.jsx("button",{onClick:()=>{o&&o.go(P)},className:ve(Q.paginationItem),children:a.jsx("div",{className:ve(Q.dot,{[Q.activeDot]:P===S}),style:{backgroundColor:P===S?E.colors[0]:E.colors[1],"--pagination-hover-color":E.hover}})},P))})})]})})}function wr({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,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:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Fa={element:Ia,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},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:"outside-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",Ra="ImageRevealSlider-module__image___Qjt-e",Pa="ImageRevealSlider-module__link___N-iLG",Ma="ImageRevealSlider-module__cursor___2U03d",ht={imageRevealSlider:ka,image:Ra,link:Pa,cursor:Ma};function $r(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const s=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*s,p=s/2,c=i/2;if(e>=r.x-p&&e<=r.x+p&&t>=r.y-c&&t<=r.y+c)return!0}return!1}function Ln(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Wa(e,t,n,r){let o,s;if(t==="custom"){o=n;const i=await Ln(e);s=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await Ln(e);s=i.height/i.width*o}else{const i=await Ln(e);o=i.width,s=i.height}return{width:o,height:s,finalWidth:`${o}px`}}function Ha({settings:e,content:t,isEditor:n}){const[r,o]=b.useState(null),[s,i]=b.useState([]),[p,c]=b.useState(0),d=b.useRef(0),[l,L]=b.useState({x:0,y:0}),[y,g]=b.useState(1),[u,f]=b.useState("none"),x=b.useRef({x:0,y:0}),[h,S]=b.useState(!1),{sizeType:_,imageWidth:V,randomRangeImageWidth:R}=e.imageSize,{revealPosition:T,visible:m}=e.position,{cursorType:C,target:E,defaultCursorScale:N,defaultCursor:I,hoverCursorScale:W,hoverCursor:O}=e.cursor;b.useEffect(()=>{if(!r)return;const v=(k,A)=>{const H=r.getBoundingClientRect(),Z=k-H.left,se=A-H.top;if(L({x:Z,y:se}),C==="system"){f("none"),g(1);return}const re=Z,pe=se,M=document.elementFromPoint(H.left+re,H.top+pe);if(M&&M.closest("a")){f("none"),g(1);return}const ne=$r(re,pe,s)||E==="area"?{img:O??"none",scale:W}:{img:I??"none",scale:N};f(ne.img),g(ne.scale)},P=k=>{k.stopPropagation(),x.current={x:k.clientX,y:k.clientY},v(k.clientX,k.clientY)},F=()=>{h&&v(x.current.x,x.current.y)};return r.addEventListener("mousemove",P),window.addEventListener("scroll",F,!0),()=>{r.removeEventListener("mousemove",P),window.removeEventListener("scroll",F,!0)}},[r,h,l,C,E,O,I,W,N,s]),b.useEffect(()=>{h||(f("none"),g(0))},[h]);const z=async(v,P,F,k={})=>{const{width:A,height:H,finalWidth:Z}=await Wa(v.image.url,_,V,R);let se=0,re=0;T==="same"?(se=P/2,re=F/2):(se=k.x??Math.random()*P,re=k.y??Math.random()*F);const pe=Math.min(Math.max(se,A/2),P-A/2),M=Math.min(Math.max(re,H/2),F-H/2);return{id:d.current++,url:v.image.url,link:v.link,name:v.image.name,x:pe,y:M,width:Z}};b.useEffect(()=>{if(!r||t.length===0)return;const v=r.getBoundingClientRect(),P=v.width,F=v.height,k=[];(async()=>{const H=t[0],Z=await z(H,P,F);k.push(Z),i(k),c(1)})()},[_,V,R,T,r]),b.useEffect(()=>{m==="last One"&&i(v=>v.length>0?[v[v.length-1]]:[])},[m]);const U=async v=>{if(!r)return;const P=r.getBoundingClientRect(),F=v.clientX-P.left,k=v.clientY-P.top;if(E==="image"&&!$r(F,k,s))return;let A=0,H=0;T==="on Click"?(A=F,H=k):T==="same"?(A=P.width/2,H=P.height/2):(A=Math.random()*P.width,H=Math.random()*P.height);const Z=t[p],se=await z(Z,P.width,P.height,{x:A,y:H});i(re=>m==="all"?[...re,se]:[se]),c(re=>re>=t.length-1?0:re+1)};return a.jsxs("div",{ref:o,onClick:U,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:ht.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[s.map(v=>a.jsx("div",{className:ht.wrapper,style:{top:`${v.y}px`,left:`${v.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:v.width??"auto",height:"auto",cursor:u==="none"?"default":"none"},children:E==="area"&&v.link?a.jsx("a",{href:v.link,target:"_blank",className:ht.link,children:a.jsx("img",{src:v.url,alt:v.name,className:ht.image},v.id)}):a.jsx("img",{src:v.url,alt:v.name,className:ht.image},v.id)},v.id)),h&&a.jsx("div",{className:ht.cursor,style:{left:`${l.x}px`,top:`${l.y}px`,transform:`translate(-50%, -50%) scale(${y})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Oa={element:Ha,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{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:""}]}}}},Na="LightBox-module__hidden___9s-9x",ja="LightBox-module__heroImage___sTxNF",za="LightBox-module__background___rm9ml",Va="LightBox-module__editor___4ACaY",Ba="LightBox-module__contentStyle___Bgnsq",Da="LightBox-module__imageStyle___tLIlB",Ga="LightBox-module__imgWrapper___LuFUp",qa="LightBox-module__contain___8-yaS",Ua="LightBox-module__cover___hNvOG",Xa="LightBox-module__caption___b6L2I",Ya="LightBox-module__captionTextInner___rCGNH",Ka="LightBox-module__lightboxSplide___XFuWC",Za="LightBox-module__arrow___iz38X",Ja="LightBox-module__arrowVertical___Zfz81",Qa="LightBox-module__nextArrow___zkAQN",es="LightBox-module__arrowInner___p48sW",ts="LightBox-module__arrowIcon___3VaFf",ns="LightBox-module__arrowImg___pNV88",rs="LightBox-module__mirror___pjeXc",os="LightBox-module__thumbsWrapper___GB-nU",is="LightBox-module__thumbsContainerVertical___wttk5",as="LightBox-module__thumbsContainer___osSma",ss="LightBox-module__thumbsAlignStart___MO6tY",ls="LightBox-module__thumbsAlignCenter___Q4sUx",cs="LightBox-module__thumbsAlignEnd___p4y9R",ps="LightBox-module__thumbItem___HvnF3",us="LightBox-module__closeButton___g2khP",ds="LightBox-module__fadeIn___0m5GW",ms="LightBox-module__slideInLeft___gPYwC",gs="LightBox-module__slideInRight___S-pPp",fs="LightBox-module__slideInTop___DFdAj",hs="LightBox-module__slideInBottom___m27kZ",ys="LightBox-module__fadeOut___55qBR",vs="LightBox-module__slideOutLeft___NvU7P",bs="LightBox-module__slideOutRight___SK7eC",xs="LightBox-module__slideOutTop___Vgg0z",Ss="LightBox-module__slideOutBottom___nJ0Ef",Cs="LightBox-module__scaleSlide___vZriG",q={hidden:Na,heroImage:ja,background:za,editor:Va,contentStyle:Ba,imageStyle:Da,imgWrapper:Ga,contain:qa,cover:Ua,caption:Xa,captionTextInner:Ya,lightboxSplide:Ka,arrow:Za,arrowVertical:Ja,nextArrow:Qa,arrowInner:es,arrowIcon:ts,arrowImg:ns,mirror:rs,thumbsWrapper:os,thumbsContainerVertical:is,thumbsContainer:as,thumbsAlignStart:ss,thumbsAlignCenter:ls,thumbsAlignEnd:cs,thumbItem:ps,closeButton:us,fadeIn:ds,slideInLeft:ms,slideInRight:gs,slideInTop:fs,slideInBottom:hs,fadeOut:ys,slideOutLeft:vs,slideOutRight:bs,slideOutTop:xs,slideOutBottom:Ss,scaleSlide:Cs},Yt=(e,t,n)=>{const r={},[o,s]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),s==="left"?(r.left="0",r.right="auto"):s==="center"?(r.left="50%",r.right="auto"):s==="right"&&(r.left="auto",r.right="0"),o==="middle"&&s==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:s==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:r.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,r};function yo(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 Tr(e){const t=e.getBoundingClientRect(),n=yo(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,i=e.naturalHeight,p=r/o,c=s/i;let d,l;c>p?(d=r,l=r/c):(l=o,d=o*c);const L=t.left+n.left,y=t.top+n.top,g=(r-d)/2+L,u=(o-l)/2+y;return{x:g,y:u,width:d,height:l}}function _r(e){const t=e.getBoundingClientRect(),n=yo(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Lr(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function ws(e,t){const n=(()=>{if(e==="fade in")return q.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return q.slideInLeft;case"right":return q.slideInRight;case"top":return q.slideInTop;case"bottom":return q.slideInBottom;default:return q.slideInRight}return q.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return q.fadeIn;if(e==="slide in")switch(t){case"left":return q.slideInLeft;case"right":return q.slideInRight;case"top":return q.slideInTop;case"bottom":return q.slideInBottom;default:return q.slideInRight}return q.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return q.fadeOut;if(e==="slide in")switch(t){case"left":return q.slideOutLeft;case"right":return q.slideOutRight;case"top":return q.slideOutTop;case"bottom":return q.slideOutBottom;default:return q.slideOutRight}return q.fadeOut})(),s=(()=>{if(e==="fade in")return q.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return q.slideOutLeft;case"right":return q.slideOutRight;case"top":return q.slideOutTop;case"bottom":return q.slideOutBottom;default:return q.slideOutRight}return q.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:s}}const $s=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:s})=>{const[i,p]=b.useState(!1),{url:c}=e.thumbnailBlock.cover;return b.useEffect(()=>{o==="close"&&p(!1),o==="open"&&p(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:c,alt:"Cover",className:q.heroImage,onClick:()=>p(!0)}),a.jsx(Ts,{isOpen:i,onClose:()=>p(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:s})]})},Ts=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:s,isEditor:i,metadata:p})=>{var j;const[c,d]=b.useState(0),[l,L]=b.useState(0),[y,g]=b.useState(!1),[u,f]=b.useState(!1),[x,h]=b.useState({}),S=b.useRef(null),_=b.useRef(null),V=b.useRef(null),R=b.useRef(!1),T=b.useRef(null),m=b.useRef(null),C=b.useRef(null),E=b.useRef(null),N=b.useRef(!1),I=b.useRef(null),[W,O]=b.useState(!1),{appear:z,triggers:U,slider:v,thumbnail:P,controls:F,area:k,caption:A,layout:H}=o.lightboxBlock,{appearClass:Z,backdropAppearClass:se,backdropDisappearClass:re,disappearClass:pe}=ws(z.type,z.direction),M=(p==null?void 0:p.itemId)??null;b.useEffect(()=>{const w=()=>{setTimeout(()=>{var K,J;(J=(K=S.current)==null?void 0:K.splide)==null||J.refresh()},16)},G=()=>{L(K=>K+1)};return window.addEventListener("ArticleEditor.Layout:change",w),window.addEventListener("ArticleEditor.ComponentContent:change",G),()=>{window.removeEventListener("ArticleEditor.Layout:change",w),window.removeEventListener("ArticleEditor.ComponentContent:change",G)}},[]),b.useEffect(()=>{if(!e||!P.isActive){O(!1);return}const w=I.current;if(!w)return;const G=()=>{v.direction==="horiz"?O(w.scrollWidth>w.clientWidth):O(w.scrollHeight>w.clientHeight)};G();const K=new ResizeObserver(G);return K.observe(w),()=>K.disconnect()},[e,P.isActive,n.length,x,v.direction]);const ne=b.useCallback(()=>{const w=window.matchMedia("(max-width: 768px)").matches,G=Lr(k.color);w&&!i&&G>.9&&(document.body.style.backgroundColor=""),g(!0),R.current=!0;const K=J=>{J.target===T.current&&J.animationName&&(T.current&&m.current&&T.current.removeEventListener("animationend",m.current),m.current=null,R.current&&(R.current=!1,t()),g(!1))};T.current&&(m.current=K,T.current.addEventListener("animationend",K))},[t,k.color,i]),fe=(w,G,K)=>{var J,ie;if(w){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&c===n.length-1?ne():(J=S.current)==null||J.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const oe=w.getBoundingClientRect(),te=G-oe.left,ce=K-oe.top,B=oe.width,Y=oe.height;let X;v.direction==="horiz"?X=te<B/2?"-1":"+1":X=ce<Y/2?"-1":"+1",(ie=S.current)==null||ie.go(X)}}},me=w=>{if(N.current){N.current=!1;return}const G=n[c],K=(G==null?void 0:G.image.objectFit)==="cover";let J,ie;if("changedTouches"in w&&w.changedTouches.length>0)J=w.changedTouches[0].clientX,ie=w.changedTouches[0].clientY;else if("clientX"in w)J=w.clientX,ie=w.clientY;else return;let oe;if(K&&V.current){const te=_r(V.current);oe=J>=te.left&&J<=te.right&&ie>=te.top&&ie<=te.bottom}else{const te=V.current?Tr(V.current):null;if(!te){w.target===w.currentTarget&&ne();return}oe=J>=te.x&&J<=te.x+te.width&&ie>=te.y&&ie<=te.y+te.height}oe?fe(V.current,J,ie):ne()},ge=w=>{const G=w.target;(G.classList.contains(q.thumbsWrapper)||G.classList.contains(q.thumbsContainer))&&me(w)};b.useEffect(()=>{if(!e)return;const w=G=>{var K,J;if(G.key==="Escape"){ne();return}if(G.key==="ArrowRight"){d(ie=>(ie+1)%Math.max(n.length,1)),(K=S.current)==null||K.go("+1");return}G.key==="ArrowLeft"&&(d(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=S.current)==null||J.go("-1"))};return window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}},[e,ne,n.length]),b.useEffect(()=>{if(e){if(d(0),L(G=>G+1),R.current=!1,g(!1),f(!1),h({}),!M)return;const w=new CustomEvent("page-overlay",{detail:{itemId:M}});window.dispatchEvent(w)}return()=>{T.current&&m.current&&(T.current.removeEventListener("animationend",m.current),m.current=null),f(!1)}},[e,M]),b.useEffect(()=>{_.current!==null&&_.current!==v.type&&L(w=>w+1),_.current=v.type},[v.type]),b.useEffect(()=>{if(!e)return;const w=document.body.style.overflow,G=window.matchMedia("(max-width: 768px)").matches,K=Lr(k.color);document.body.style.overflow="hidden",f(!1);const J=oe=>{oe.target===T.current&&!R.current&&oe.animationName&&(G&&!i&&K>.9&&(document.body.style.backgroundColor=k.color),f(!0),T.current&&C.current&&T.current.removeEventListener("animationend",C.current),C.current=null)};T.current&&(C.current=J,T.current.addEventListener("animationend",J));const ie=oe=>{const te=oe.target;te&&(te.closest(`.${q.thumbsWrapper}`)||te.closest(`.${q.thumbsContainer}`))||v.type!=="slide"&&oe.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=w,document.removeEventListener("touchmove",ie),T.current&&C.current&&(T.current.removeEventListener("animationend",C.current),C.current=null),f(!1)}},[e,i,k.color,v.type]),b.useEffect(()=>{if(!e)return;const w=G=>{var J,ie;if(R.current){G.stopPropagation();return}if(N.current){N.current=!1;return}const K=G.target;if(!(K&&(K.closest(`.${q.thumbsContainer}`)||K.closest(`.${q.thumbItem}`)))){if(v.type==="slide"&&U.type==="drag"&&((ie=(J=S.current)==null?void 0:J.splide)!=null&&ie.root)){const oe=S.current.splide.root;if(K&&(oe.contains(K)||oe===K))return}if(G.touches.length===0&&G.changedTouches.length>0){const oe=n[c],te=(oe==null?void 0:oe.image.objectFit)==="cover",ce=G.changedTouches[0];let B;if(te&&V.current){const Y=_r(V.current);B=ce.clientX>=Y.left&&ce.clientX<=Y.right&&ce.clientY>=Y.top&&ce.clientY<=Y.bottom}else{const Y=V.current?Tr(V.current):null;if(!Y)return;B=ce.clientX>=Y.x&&ce.clientX<=Y.x+Y.width&&ce.clientY>=Y.y&&ce.clientY<=Y.y+Y.height}if(!B){G.stopPropagation(),R.current=!0;const Y=X=>{X.stopPropagation(),X.preventDefault(),document.removeEventListener("click",Y,!0)};document.addEventListener("click",Y,!0),ne()}}}};return document.addEventListener("touchend",w,{passive:!0}),()=>{document.removeEventListener("touchend",w)}},[e,ne,c,n]);const D=(v.type==="scale"||v.type==="fade")&&v.direction==="vert"&&U.type==="drag";b.useEffect(()=>{var X,ae;if(!e||!D||!((ae=(X=S.current)==null?void 0:X.splide)!=null&&ae.root))return;const w=S.current.splide.root,G=30,K=(ee,ue)=>{if(E.current){const we=Math.abs(ee-E.current.x),$e=Math.abs(ue-E.current.y);(we>0||$e>0)&&(N.current=!0)}},J=ee=>{E.current&&(ee.preventDefault(),K(ee.clientX,ee.clientY))},ie=ee=>{E.current&&ee.touches.length>0&&(ee.preventDefault(),K(ee.touches[0].clientX,ee.touches[0].clientY))},oe=(ee,ue)=>{if(!E.current||!S.current){E.current=null;return}const we=Math.abs(ee-E.current.x),$e=Math.abs(ue-E.current.y);$e>G&&$e>we&&S.current.go(ue<E.current.y?"+1":"-1"),E.current=null},te=ee=>{E.current&&oe(ee.clientX,ee.clientY),document.removeEventListener("pointerup",te),document.removeEventListener("pointercancel",te),document.removeEventListener("pointermove",J)},ce=ee=>{if(E.current){if(ee.changedTouches.length>0){const ue=ee.changedTouches[0];oe(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),document.removeEventListener("touchmove",ie)}},B=ee=>{E.current={x:ee.clientX,y:ee.clientY},N.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",te),document.addEventListener("pointercancel",te)},Y=ee=>{ee.touches.length>0&&(E.current={x:ee.touches[0].clientX,y:ee.touches[0].clientY},N.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",ce),document.addEventListener("touchcancel",ce))};return w.addEventListener("pointerdown",B),w.addEventListener("touchstart",Y),()=>{w.removeEventListener("pointerdown",B),w.removeEventListener("touchstart",Y),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",te),document.removeEventListener("pointercancel",te),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),E.current=null,N.current=!1}},[e,D,l]);const de={backgroundColor:k.color,backdropFilter:`blur(${k.blur}px)`,animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Rr.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:T,className:ve(q.background,y?re:se,{[q.editor]:i},{[q.hidden]:!e}),style:{...de,...u&&!i&&!y?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?T:null,className:ve(q.contentStyle,y?pe:Z,{[q.editor]:i},{[q.hidden]:!e}),style:{animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(or,{onMove:w=>d(w.index),ref:S,className:q.lightboxSplide,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,direction:v.direction==="horiz"||v.type==="fade"||v.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!D,perPage:1,width:"100%",height:"100%",type:v.type==="fade"||v.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":v.duration},children:n.map((w,G)=>{const K=Yt(H.position,H.offset,i),J=`${$.scalingValue(H.padding.top,i)} ${$.scalingValue(H.padding.right,i)} ${$.scalingValue(H.padding.bottom,i)} ${$.scalingValue(H.padding.left,i)}`,ie=v.type==="scale"?(()=>{const{transform:oe,...te}=K;return{...te,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":oe||"none"}})():{...K,position:"absolute",padding:J,boxSizing:"border-box"};return a.jsx(ir,{children:a.jsx("div",{className:q.imgWrapper,onClick:me,children:a.jsx("img",{ref:G===c?V:null,className:ve(q.imageStyle,{[q.contain]:w.image.objectFit==="contain",[q.cover]:w.image.objectFit==="cover",[q.scaleSlide]:v.type==="scale"}),src:w.image.url,alt:w.image.name??"",style:{...ie,pointerEvents:w.image.objectFit==="contain"?"none":"auto"}})})},G)})},l),F.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(q.arrow,{[q.arrowVertical]:v.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:q.arrowInner,style:{transform:`translate(${$.scalingValue(F.offset.x,i)}, ${$.scalingValue(F.offset.y*(v.direction==="horiz"?1:-1),i)}) scale(${F.scale}) rotate(${v.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=S.current)==null?void 0:w.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&a.jsx(nt,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:ve(q.arrowImg,q.mirror)}),!F.arrowsImgUrl&&a.jsx(Er,{color:F.color,className:ve(q.arrowIcon,q.arrowImg,q.mirror)})]})}),a.jsx("div",{className:ve(q.arrow,q.nextArrow,{[q.arrowVertical]:v.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:q.arrowInner,style:{transform:`translate(${$.scalingValue(F.offset.x*(v.direction==="horiz"?-1:1),i)}, ${$.scalingValue(F.offset.y,i)}) scale(${F.scale}) rotate(${v.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=S.current)==null?void 0:w.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&a.jsx(nt,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:q.arrowImg}),!F.arrowsImgUrl&&a.jsx(Er,{color:F.color,className:ve(q.arrowIcon,q.arrowImg)})]})})]}),k.closeIconUrl&&(()=>{const w=Yt(k.closeIconAlign,k.closeIconOffset,i),G=`scale(${k.closeIconScale})`,K=w.transform?`${w.transform} ${G}`:G;return a.jsx("button",{className:q.closeButton,style:{...w,transform:K},onClick:ne,"aria-label":"Close lightbox",children:a.jsx(nt,{url:k.closeIconUrl,fill:k.closeIconColor??"#000000",hoverFill:k.closeIconHover??"#cccccc"})})})(),A&&A.isActive&&r.imageCaption&&((j=n[c])==null?void 0:j.imageCaption)&&(()=>{const{widthSettings:w,fontSettings:G,letterSpacing:K,textAlign:J,wordSpacing:ie,fontSizeLineHeight:oe,textAppearance:te,color:ce}=r.imageCaption;return a.jsx("div",{className:q.caption,style:{...Yt(A.alignment,A.offset,i),fontFamily:xn(G.fontFamily),fontWeight:G.fontWeight,fontStyle:G.fontStyle,width:w.sizing==="auto"?"max-content":$.scalingValue(w.width,i),letterSpacing:$.scalingValue(K,i),wordSpacing:$.scalingValue(ie,i),textAlign:J,fontSize:$.scalingValue(oe.fontSize,i),lineHeight:$.scalingValue(oe.lineHeight,i),textTransform:te.textTransform??"none",textDecoration:te.textDecoration??"none",fontVariant:te.fontVariant??"normal",color:ce},onClick:B=>B.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:q.captionTextInner,style:{"--link-color":A.linkColor,"--link-hover-color":A.linkHoverColor},children:a.jsx(Ot,{content:n[c].imageCaption})})})})(),P.isActive&&(()=>{const[w,G]=P.position.split("-"),K=v.direction==="horiz"?`${w}-left`:P.position,J=Yt(K,P.offset,i),ie=()=>{if(v.direction==="horiz"){if(G==="left")return"flex-start";if(G==="center")return"center";if(G==="right")return"flex-end"}else{if(w==="top")return"flex-start";if(w==="middle")return"center";if(w==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:I,className:q.thumbsWrapper,onClick:oe=>ge(oe),style:{position:i?"absolute":"fixed",...J,...v.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ve(q.thumbsContainer,{[q.thumbsContainerVertical]:v.direction==="vert",[q.thumbsAlignStart]:P.align==="start",[q.thumbsAlignCenter]:P.align==="center",[q.thumbsAlignEnd]:P.align==="end"}),style:{gap:$.scalingValue(P.grid.gap,i),justifyContent:W?"flex-start":ie()},children:n.map((oe,te)=>{const ce=te===c,B=x[te],X=P.grid.size*(ce?P.activeState.scale:1),ae=()=>{if(P.fit!=="fit")return{};if(!B)return v.direction==="horiz"?{height:$.scalingValue(X,i)}:{width:$.scalingValue(X,i)};const ee=B.width/B.height;if(v.direction==="horiz"){const ue=X,we=ue*ee;return{width:$.scalingValue(we,i),height:$.scalingValue(ue,i)}}else{const ue=X,we=ue/ee;return{width:$.scalingValue(ue,i),height:$.scalingValue(we,i)}}};return a.jsx("button",{className:q.thumbItem,style:{...v.direction==="horiz"&&P.fit!=="fit"?{height:$.scalingValue(X,i)}:{},...v.direction==="vert"&&P.fit!=="fit"?{width:$.scalingValue(X,i)}:{},...P.fit==="cover"?{width:$.scalingValue(X,i),height:$.scalingValue(X,i)}:{},...ae(),transition:ce?"all 0.25s ease-out":"none",opacity:ce?P.activeState.opacity/100:P.opacity/100,"--thumb-hover":P.activeState.opacity/100},onClick:ee=>{var ue;ee.stopPropagation(),d(te),(ue=S.current)==null||ue.go(te)},onMouseEnter:()=>{var ee;P.triggers==="hov"&&((ee=S.current)==null||ee.go(te))},children:a.jsx("img",{src:oe.image.url,alt:oe.image.name??"",onLoad:ee=>{const ue=ee.currentTarget;ue.naturalWidth&&ue.naturalHeight&&h(we=>({...we,[te]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:P.fit==="cover"?"cover":"contain",...P.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...P.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${oe.image.name}-${te}`)})})})})()]})]}),document.getElementById(s))};function Er({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,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:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const _s={element:$s,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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 Kt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ls(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
@@ -139,7 +139,7 @@
139
139
  position: relative;
140
140
  height: auto;
141
141
  }
142
- `}function Es({settings:e,isEditor:t,metadata:n,activeEvent:r}){const{prefix:o}=$.useScopedStyles(),{type:s="A",fieldsToShow:i=2,fields:p=[],buttonLabel:c,gap:m,fieldsGap:l,buttonCorners:_,buttonStroke:g,buttonPadding:h,isButtonFullWidth:u,inputCorners:d,inputStroke:x,inputPadding:v,inputColor:S,inputTextColor:L,inputBorderColor:z,placeholderColor:P,buttonColor:T,buttonTextColor:f,buttonBorderColor:C,labelTextColor:E,successColor:j,errorColor:I,fontFamily:O,inputFontSettings:M,inputFontSize:V,inputLineHeight:q,inputLetterSpacing:y,inputWordSpacing:R,inputTextAppearance:F,buttonFontSettings:k,buttonFontSize:A,buttonLineHeight:W,buttonLetterSpacing:Z,buttonWordSpacing:se,buttonTextAppearance:ne,labelFontSettings:ce,labelFontSize:H,labelLineHeight:ee,labelLetterSpacing:he,labelWordSpacing:me,labelTextAppearance:ge,statusFontSettings:U,statusFontSize:fe,statusLineHeight:N,statusLetterSpacing:w,statusWordSpacing:D,statusTextAppearance:K,successMessage:J,errorMessage:ae,stateOverrides:oe}=e,te=s==="B",pe=p.slice(0,Math.min(i,p.length)),B={fontSettings:{fontFamily:O,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:V??.01,lineHeight:q,letterSpacing:y??0,wordSpacing:R??0,textAppearance:F,color:L},Y=Qe(ke(B,t)),X=$.scalingValue(x??0,t),ie=$.scalingValue((q??V??.01)+((v==null?void 0:v.top)??0)+((v==null?void 0:v.bottom)??0)+(s==="C"?x??0:(x??0)*2),t),re={...Y,borderStyle:"solid",borderRadius:s==="C"?0:$.scalingValue(d??0,t),...s==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:X,borderLeftWidth:0}:{borderWidth:X},paddingTop:$.scalingValue((v==null?void 0:v.top)??0,t),paddingRight:$.scalingValue((v==null?void 0:v.right)??0,t),paddingBottom:$.scalingValue((v==null?void 0:v.bottom)??0,t),paddingLeft:$.scalingValue((v==null?void 0:v.left)??0,t),height:ie,minHeight:ie},de={fontSettings:{fontFamily:O,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:A??.01,lineHeight:W,letterSpacing:Z??0,wordSpacing:se??0,textAppearance:ne,color:f},Ce=Qe(ke(de,t)),$e=$.scalingValue(g??0,t),Ke={fontSettings:{fontFamily:O,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:H??.01,lineHeight:ee,letterSpacing:he??0,wordSpacing:me??0,textAppearance:ge,color:E},Pe=ke(Ke,t),ue={fontSettings:{fontFamily:O,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:fe??.01,lineHeight:N,letterSpacing:w??0,wordSpacing:D??0,textAppearance:K,color:j},Le=Qe(ke(ue,t)),Ae=$.buildColorVars(o,{inputColor:S,inputTextColor:L,inputBorderColor:z,placeholderColor:P!=null&&P.trim()?P:"#cccccc",buttonColor:T,buttonTextColor:f,buttonBorderColor:C,labelTextColor:E,successColor:j,errorColor:I},As,Is,oe),[ye,Te]=b.useState(()=>Object.fromEntries(pe.map(ve=>[ve.name,""]))),[Gt,at]=b.useState("idle"),[yo,qt]=b.useState(null),Sn=r==="success"?"success":r==="error"?"error":Gt,vo=r==="error"?ae:yo,Ut=r==="filled",_t=b.useMemo(()=>{if(!Ut)return ye;let ve=null;for(const Ve of pe)(ye[Ve.name]??"").trim().length>0||(ve=ve??{...ye},ve[Ve.name]="Filled");return ve??ye},[ye,Ut,pe]),bo=Sn==="error"?$.getFormFieldValidationError(pe,_t):null,xo=`${r&&r!=="default"?`${o}-state-${r}`:""}`.trim(),ir=n==null?void 0:n.submitUrl,ar=(ve,Ve)=>{Te(Be=>({...Be,[ve]:Ve}))},So=async ve=>{ve.preventDefault();const Ve=Object.fromEntries(pe.map(Me=>{var mt;return[Me.name,((mt=ye[Me.name])==null?void 0:mt.trim())??""]}).filter(([,Me])=>Me));if(!ir){at("error"),qt("No integrations were found for this form.");return}if(Object.keys(Ve).length===0)return;const Be=$.getFormFieldValidationError(pe,ye);if(Be){at("error"),qt(Be);return}at("submitting"),qt(null);try{const Me=await fetch(ir,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ve)});if(!Me.ok){const mt=await Me.text();throw new Error(mt||`Request failed: ${Me.status}`)}at("success"),Te(Object.fromEntries(pe.map(mt=>[mt.name,""])))}catch(Me){at("error"),qt(Me instanceof Error?Me.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${o}-type-${s} ${xo}`.trim(),style:Ae,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ls(o)}}),a.jsxs("form",{onSubmit:So,className:`${o}-form`,style:{gap:$.scalingValue(m??0,t)},children:[a.jsx("div",{className:`${o}-fields`,style:{gap:$.scalingValue(l??0,t)},children:pe.map((ve,Ve)=>a.jsxs("div",{className:`${o}-field-group${te?` ${o}-labeled`:""}`,children:[te&&a.jsx("span",{className:`${o}-field-label`,style:Pe?{...Pe,lineHeight:Pe.fontSize}:void 0,children:ve.label||ve.name}),ve.type==="textarea"?a.jsx("textarea",{name:ve.name,autoComplete:"off",value:_t[ve.name]??"",onChange:Be=>ar(ve.name,Be.target.value),placeholder:ve.placeholder,className:`${o}-input`,style:re,rows:1,"data-filled":Ut||(_t[ve.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:ve.type==="phone"?"tel":ve.type==="email"?"email":"text",name:ve.name,autoComplete:"off",value:_t[ve.name]??"",onChange:Be=>ar(ve.name,Be.target.value),placeholder:ve.placeholder,required:ve.isRequired??ve.type==="email",className:`${o}-input`,style:re,"data-filled":Ut||(_t[ve.name]??"").trim().length>0})]},Ve))}),a.jsx("div",{className:`${o}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:$.scalingValue(_??0,t),borderWidth:$e,paddingTop:$.scalingValue((h==null?void 0:h.top)??0,t),paddingRight:$.scalingValue((h==null?void 0:h.right)??0,t),paddingBottom:$.scalingValue((h==null?void 0:h.bottom)??0,t),paddingLeft:$.scalingValue((h==null?void 0:h.left)??0,t),...Ce,...u?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${o}-overlay-anchor`,style:u?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Gt==="submitting"?"...":c})})})]}),Sn==="success"&&a.jsx("p",{className:`${o}-success`,style:{...Le},children:J}),Sn==="error"&&a.jsx("p",{className:`${o}-error`,style:{...Le},role:"alert",children:bo??vo??ae})]})}const As={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"},Is=["hover","focus","filled","success","error"],Fs=`import React, { useMemo, useState } from 'react';\r
142
+ `}function Es({settings:e,isEditor:t,metadata:n,activeEvent:r}){const{prefix:o}=$.useScopedStyles(),{type:s="A",fieldsToShow:i=2,fields:p=[],buttonLabel:c,gap:d,fieldsGap:l,buttonCorners:L,buttonStroke:y,buttonPadding:g,isButtonFullWidth:u,inputCorners:f,inputStroke:x,inputPadding:h,inputColor:S,inputTextColor:_,inputBorderColor:V,placeholderColor:R,buttonColor:T,buttonTextColor:m,buttonBorderColor:C,labelTextColor:E,successColor:N,errorColor:I,fontFamily:W,inputFontSettings:O,inputFontSize:z,inputLineHeight:U,inputLetterSpacing:v,inputWordSpacing:P,inputTextAppearance:F,buttonFontSettings:k,buttonFontSize:A,buttonLineHeight:H,buttonLetterSpacing:Z,buttonWordSpacing:se,buttonTextAppearance:re,labelFontSettings:pe,labelFontSize:M,labelLineHeight:ne,labelLetterSpacing:fe,labelWordSpacing:me,labelTextAppearance:ge,statusFontSettings:D,statusFontSize:de,statusLineHeight:j,statusLetterSpacing:w,statusWordSpacing:G,statusTextAppearance:K,successMessage:J,errorMessage:ie,stateOverrides:oe}=e,te=s==="B",ce=p.slice(0,Math.min(i,p.length)),B={fontSettings:{fontFamily:W,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:z??.01,lineHeight:U,letterSpacing:v??0,wordSpacing:P??0,textAppearance:F,color:_},Y=tt(ke(B,t)),X=$.scalingValue(x??0,t),ae=$.scalingValue((U??z??.01)+((h==null?void 0:h.top)??0)+((h==null?void 0:h.bottom)??0)+(s==="C"?x??0:(x??0)*2),t),ee={...Y,borderStyle:"solid",borderRadius:s==="C"?0:$.scalingValue(f??0,t),...s==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:X,borderLeftWidth:0}:{borderWidth:X},paddingTop:$.scalingValue((h==null?void 0:h.top)??0,t),paddingRight:$.scalingValue((h==null?void 0:h.right)??0,t),paddingBottom:$.scalingValue((h==null?void 0:h.bottom)??0,t),paddingLeft:$.scalingValue((h==null?void 0:h.left)??0,t),height:ae,minHeight:ae},ue={fontSettings:{fontFamily:W,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:A??.01,lineHeight:H,letterSpacing:Z??0,wordSpacing:se??0,textAppearance:re,color:m},we=tt(ke(ue,t)),$e=$.scalingValue(y??0,t),Je={fontSettings:{fontFamily:W,fontWeight:(pe==null?void 0:pe.fontWeight)??400,fontStyle:(pe==null?void 0:pe.fontStyle)??"normal"},fontSize:M??.01,lineHeight:ne,letterSpacing:fe??0,wordSpacing:me??0,textAppearance:ge,color:E},Ne=ke(Je,t),xe={fontSettings:{fontFamily:W,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:de??.01,lineHeight:j,letterSpacing:w??0,wordSpacing:G??0,textAppearance:K,color:N},he=tt(ke(xe,t)),Pe=$.buildColorVars(o,{inputColor:S,inputTextColor:_,inputBorderColor:V,placeholderColor:R!=null&&R.trim()?R:"#cccccc",buttonColor:T,buttonTextColor:m,buttonBorderColor:C,labelTextColor:E,successColor:N,errorColor:I},As,Is,oe),[Se,_e]=b.useState(()=>Object.fromEntries(ce.map(ye=>[ye.name,""]))),[Be,Ae]=b.useState("idle"),[Sn,gt]=b.useState(null),Cn=r==="success"?"success":r==="error"?"error":Be,vo=r==="error"?ie:Sn,Ut=r==="filled",Et=b.useMemo(()=>{if(!Ut)return Se;let ye=null;for(const De of ce)(Se[De.name]??"").trim().length>0||(ye=ye??{...Se},ye[De.name]="Filled");return ye??Se},[Se,Ut,ce]),bo=Cn==="error"?$.getFormFieldValidationError(ce,Et):null,xo=`${r&&r!=="default"?`${o}-state-${r}`:""}`.trim(),ar=n==null?void 0:n.submitUrl,sr=(ye,De)=>{_e(Ge=>({...Ge,[ye]:De}))},So=async ye=>{ye.preventDefault();const De=Object.fromEntries(ce.map(Me=>{var ft;return[Me.name,((ft=Se[Me.name])==null?void 0:ft.trim())??""]}).filter(([,Me])=>Me));if(!ar){Ae("error"),gt("No integrations were found for this form.");return}if(Object.keys(De).length===0)return;const Ge=$.getFormFieldValidationError(ce,Se);if(Ge){Ae("error"),gt(Ge);return}Ae("submitting"),gt(null);try{const Me=await fetch(ar,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(De)});if(!Me.ok){const ft=await Me.text();throw new Error(ft||`Request failed: ${Me.status}`)}Ae("success"),_e(Object.fromEntries(ce.map(ft=>[ft.name,""])))}catch(Me){Ae("error"),gt(Me instanceof Error?Me.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${o}-type-${s} ${xo}`.trim(),style:Pe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ls(o)}}),a.jsxs("form",{onSubmit:So,className:`${o}-form`,style:{gap:$.scalingValue(d??0,t)},children:[a.jsx("div",{className:`${o}-fields`,style:{gap:$.scalingValue(l??0,t)},children:ce.map((ye,De)=>a.jsxs("div",{className:`${o}-field-group${te?` ${o}-labeled`:""}`,children:[te&&a.jsx("span",{className:`${o}-field-label`,style:Ne?{...Ne,lineHeight:Ne.fontSize}:void 0,children:ye.label||ye.name}),ye.type==="textarea"?a.jsx("textarea",{name:ye.name,autoComplete:"off",value:Et[ye.name]??"",onChange:Ge=>sr(ye.name,Ge.target.value),placeholder:ye.placeholder,className:`${o}-input`,style:ee,rows:1,"data-filled":Ut||(Et[ye.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:ye.type==="phone"?"tel":ye.type==="email"?"email":"text",name:ye.name,autoComplete:"off",value:Et[ye.name]??"",onChange:Ge=>sr(ye.name,Ge.target.value),placeholder:ye.placeholder,required:ye.isRequired??ye.type==="email",className:`${o}-input`,style:ee,"data-filled":Ut||(Et[ye.name]??"").trim().length>0})]},De))}),a.jsx("div",{className:`${o}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:$.scalingValue(L??0,t),borderWidth:$e,paddingTop:$.scalingValue((g==null?void 0:g.top)??0,t),paddingRight:$.scalingValue((g==null?void 0:g.right)??0,t),paddingBottom:$.scalingValue((g==null?void 0:g.bottom)??0,t),paddingLeft:$.scalingValue((g==null?void 0:g.left)??0,t),...we,...u?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${o}-overlay-anchor`,style:u?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Be==="submitting"?"...":c})})})]}),Cn==="success"&&a.jsx("p",{className:`${o}-success`,style:{...he},children:J}),Cn==="error"&&a.jsx("p",{className:`${o}-error`,style:{...he},role:"alert",children:bo??vo??ie})]})}const As={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"},Is=["hover","focus","filled","success","error"],Fs=`import React, { useMemo, useState } from 'react';\r
143
143
  import { CommonComponentProps } from '../props';\r
144
144
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
145
145
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';\r
@@ -931,7 +931,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
931
931
  font-size: ${Jt(14)};
932
932
  color: var(--${e}-error-error-color, var(--${e}-error-color));
933
933
  }
934
- `}const Hs=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=$.useScopedStyles(),{fields:s=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:i,buttonLabel:p,fieldsToShow:c=1,fontFamily:m,inputFontSettings:l,inputFontSize:_,inputLineHeight:g,inputLetterSpacing:h,inputWordSpacing:u,inputTextAppearance:d,buttonFontSettings:x,buttonFontSize:v,buttonLineHeight:S,buttonLetterSpacing:L,buttonWordSpacing:z,buttonTextAppearance:P,statusFontSettings:T,statusFontSize:f,statusLineHeight:C,statusLetterSpacing:E,statusWordSpacing:j,statusTextAppearance:I,iconMaxWidth:O,minHeight:M,corners:V,stroke:q,stateOverrides:y,inputPadding:R,buttonPadding:F,successMessage:k="Thanks for subscribing!",errorMessage:A="Please, fill all required fields."}=e,W=s.slice(0,Math.min(c,s.length)),[Z,se]=b.useState(()=>Object.fromEntries(W.map(ue=>[ue.name,""]))),[ne,ce]=b.useState("idle"),[H,ee]=b.useState(null),he=r==="success"?"success":r==="error"?"error":ne,me=r==="error"?A:H,ge=r==="filled",U=b.useMemo(()=>{if(!ge)return Z;let ue=null;for(const Le of W)(Z[Le.name]??"").trim().length>0||(ue=ue??{...Z},ue[Le.name]="Filled");return ue??Z},[ge,Z,W]),fe=he==="error"?$.getFormFieldValidationError(W,U):null,N=r&&r!=="default"?`${o}-state-${r}`:"",w=W.some(ue=>(U[ue.name]??"").trim().length>0),D=N!==`${o}-state-filled`&&w?`${o}-state-filled`:"",K=`${N} ${D}`.trim(),J=n==null?void 0:n.submitUrl,ae=p??"",oe=(i==null?void 0:i.icon)??"",te=(i==null?void 0:i.mode)==="On",pe=ae||"Submit",B={fontSettings:{fontFamily:m,fontWeight:(l==null?void 0:l.fontWeight)??400,fontStyle:(l==null?void 0:l.fontStyle)??"normal"},fontSize:_??.01,lineHeight:g,letterSpacing:h??0,wordSpacing:u??0,textAppearance:d,color:e.inputTextColor??"#111111"},Y={fontSettings:{fontFamily:m,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:v??.01,lineHeight:S,letterSpacing:L??0,wordSpacing:z??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},X={fontSettings:{fontFamily:m,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:f??.01,lineHeight:C,letterSpacing:E??0,wordSpacing:j??0,textAppearance:I,color:e.successColor??"#22c55e"},ie=Qe(ke(B,t)),re=Qe(ke(Y,t)),de=Qe(ke(X,t)),Ce=$.buildColorVars(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(B==null?void 0:B.color)??"#111111",buttonTextColor:e.buttonTextColor??(Y==null?void 0:Y.color)??"#ffffff"},Os,Ns,y),$e={borderRadius:$.scalingValue(V,t),borderWidth:$.scalingValue(q,t),borderStyle:"solid"},Ke={borderLeftWidth:$.scalingValue(q,t)},Pe=async ue=>{ue.preventDefault();const Le=Object.fromEntries(W.map(ye=>{var Te;return[ye.name,((Te=Z[ye.name])==null?void 0:Te.trim())??""]}).filter(([,ye])=>ye));if(!J){ce("error"),ee("No integrations were found for this form.");return}if(Object.keys(Le).length===0)return;const Ae=$.getFormFieldValidationError(W,Z);if(Ae){ce("error"),ee(Ae);return}ce("submitting"),ee(null);try{const ye=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Le)});if(!ye.ok){const Te=await ye.text();throw new Error(Te||`Request failed: ${ye.status}`)}ce("success"),se(Object.fromEntries(W.map(Te=>[Te.name,""])))}catch(ye){ce("error"),ee(ye instanceof Error?ye.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${K}`.trim(),style:Ce,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ws(o)}}),a.jsxs("form",{onSubmit:Pe,className:`${o}-form`,style:{...$e,height:$.scalingValue(M,t),minHeight:$.scalingValue(M,t)},children:[a.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:W.map(ue=>a.jsx("input",{type:ue.type==="email"?"email":ue.type==="phone"?"tel":"text",name:ue.name,autoComplete:"off",value:U[ue.name]??"",onChange:Le=>se(Ae=>({...Ae,[ue.name]:Le.target.value})),placeholder:ue.placeholder,required:ue.isRequired??ue.type==="email",className:`${o}-input`,style:{...ie,paddingRight:$.scalingValue(R.right,t),paddingLeft:$.scalingValue(R.left,t),paddingTop:$.scalingValue(R.top,t),paddingBottom:$.scalingValue(R.bottom,t)}},ue.name))}),a.jsx("div",{className:`${o}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":pe,style:{...re,...Ke,paddingRight:$.scalingValue(F.right,t),paddingLeft:$.scalingValue(F.left,t),paddingTop:$.scalingValue(F.top,t),paddingBottom:$.scalingValue(F.bottom,t)},children:ne==="submitting"?"...":te?oe&&a.jsx(et,{url:oe,className:`${o}-submitBtnIcon`,style:{maxWidth:$.scalingValue(O??0,t)},fill:`var(--${o}-button-text-color)`,hoverFill:`var(--${o}-button-text-color)`}):ae})})]}),he==="success"&&a.jsx("p",{className:`${o}-success`,style:{...de},children:k}),he==="error"&&a.jsx("p",{className:`${o}-error`,style:{...de},role:"alert",children:fe??me??A})]})},Os={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"},Ns=["hover","focus","filled","success","error"],js=`import React, { useMemo, useState } from 'react';\r
934
+ `}const Hs=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=$.useScopedStyles(),{fields:s=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:i,buttonLabel:p,fieldsToShow:c=1,fontFamily:d,inputFontSettings:l,inputFontSize:L,inputLineHeight:y,inputLetterSpacing:g,inputWordSpacing:u,inputTextAppearance:f,buttonFontSettings:x,buttonFontSize:h,buttonLineHeight:S,buttonLetterSpacing:_,buttonWordSpacing:V,buttonTextAppearance:R,statusFontSettings:T,statusFontSize:m,statusLineHeight:C,statusLetterSpacing:E,statusWordSpacing:N,statusTextAppearance:I,iconMaxWidth:W,minHeight:O,corners:z,stroke:U,stateOverrides:v,inputPadding:P,buttonPadding:F,successMessage:k="Thanks for subscribing!",errorMessage:A="Please, fill all required fields."}=e,H=s.slice(0,Math.min(c,s.length)),[Z,se]=b.useState(()=>Object.fromEntries(H.map(xe=>[xe.name,""]))),[re,pe]=b.useState("idle"),[M,ne]=b.useState(null),fe=r==="success"?"success":r==="error"?"error":re,me=r==="error"?A:M,ge=r==="filled",D=b.useMemo(()=>{if(!ge)return Z;let xe=null;for(const he of H)(Z[he.name]??"").trim().length>0||(xe=xe??{...Z},xe[he.name]="Filled");return xe??Z},[ge,Z,H]),de=fe==="error"?$.getFormFieldValidationError(H,D):null,j=r&&r!=="default"?`${o}-state-${r}`:"",w=H.some(xe=>(D[xe.name]??"").trim().length>0),G=j!==`${o}-state-filled`&&w?`${o}-state-filled`:"",K=`${j} ${G}`.trim(),J=n==null?void 0:n.submitUrl,ie=p??"",oe=(i==null?void 0:i.icon)??"",te=(i==null?void 0:i.mode)==="On",ce=ie||"Submit",B={fontSettings:{fontFamily:d,fontWeight:(l==null?void 0:l.fontWeight)??400,fontStyle:(l==null?void 0:l.fontStyle)??"normal"},fontSize:L??.01,lineHeight:y,letterSpacing:g??0,wordSpacing:u??0,textAppearance:f,color:e.inputTextColor??"#111111"},Y={fontSettings:{fontFamily:d,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:h??.01,lineHeight:S,letterSpacing:_??0,wordSpacing:V??0,textAppearance:R,color:e.buttonTextColor??"#ffffff"},X={fontSettings:{fontFamily:d,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:m??.01,lineHeight:C,letterSpacing:E??0,wordSpacing:N??0,textAppearance:I,color:e.successColor??"#22c55e"},ae=tt(ke(B,t)),ee=tt(ke(Y,t)),ue=tt(ke(X,t)),we=$.buildColorVars(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(B==null?void 0:B.color)??"#111111",buttonTextColor:e.buttonTextColor??(Y==null?void 0:Y.color)??"#ffffff"},Os,Ns,v),$e={borderRadius:$.scalingValue(z,t),borderWidth:$.scalingValue(U,t),borderStyle:"solid"},Je={borderLeftWidth:$.scalingValue(U,t)},Ne=async xe=>{xe.preventDefault();const he=Object.fromEntries(H.map(Se=>{var _e;return[Se.name,((_e=Z[Se.name])==null?void 0:_e.trim())??""]}).filter(([,Se])=>Se));if(!J){pe("error"),ne("No integrations were found for this form.");return}if(Object.keys(he).length===0)return;const Pe=$.getFormFieldValidationError(H,Z);if(Pe){pe("error"),ne(Pe);return}pe("submitting"),ne(null);try{const Se=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(he)});if(!Se.ok){const _e=await Se.text();throw new Error(_e||`Request failed: ${Se.status}`)}pe("success"),se(Object.fromEntries(H.map(_e=>[_e.name,""])))}catch(Se){pe("error"),ne(Se instanceof Error?Se.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${K}`.trim(),style:we,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ws(o)}}),a.jsxs("form",{onSubmit:Ne,className:`${o}-form`,style:{...$e,height:$.scalingValue(O,t),minHeight:$.scalingValue(O,t)},children:[a.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:H.map(xe=>a.jsx("input",{type:xe.type==="email"?"email":xe.type==="phone"?"tel":"text",name:xe.name,autoComplete:"off",value:D[xe.name]??"",onChange:he=>se(Pe=>({...Pe,[xe.name]:he.target.value})),placeholder:xe.placeholder,required:xe.isRequired??xe.type==="email",className:`${o}-input`,style:{...ae,paddingRight:$.scalingValue(P.right,t),paddingLeft:$.scalingValue(P.left,t),paddingTop:$.scalingValue(P.top,t),paddingBottom:$.scalingValue(P.bottom,t)}},xe.name))}),a.jsx("div",{className:`${o}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":ce,style:{...ee,...Je,paddingRight:$.scalingValue(F.right,t),paddingLeft:$.scalingValue(F.left,t),paddingTop:$.scalingValue(F.top,t),paddingBottom:$.scalingValue(F.bottom,t)},children:re==="submitting"?"...":te?oe&&a.jsx(nt,{url:oe,className:`${o}-submitBtnIcon`,style:{maxWidth:$.scalingValue(W??0,t)},fill:`var(--${o}-button-text-color)`,hoverFill:`var(--${o}-button-text-color)`}):ie})})]}),fe==="success"&&a.jsx("p",{className:`${o}-success`,style:{...ue},children:k}),fe==="error"&&a.jsx("p",{className:`${o}-error`,style:{...ue},role:"alert",children:de??me??A})]})},Os={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"},Ns=["hover","focus","filled","success","error"],js=`import React, { useMemo, useState } from 'react';\r
935
935
  import { CommonComponentProps } from '../props';\r
936
936
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
937
937
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';\r
@@ -1503,7 +1503,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {\r
1503
1503
  };\r
1504
1504
  \r
1505
1505
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
1506
- `,zs="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>'),Vs=[{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."}],Ln={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bs=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Ds={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:{...Ln.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:{...Ln.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:{...Ln.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:Vs,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:zs},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:[...Bs],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"]},Gs={element:Hs,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{width:400,height:60},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:Ds,sourceCode:js};function Er(e){return`
1506
+ `,zs="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>'),Vs=[{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."}],En={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bs=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Ds={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:{...En.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:{...En.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:{...En.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:Vs,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:zs},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:[...Bs],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"]},Gs={element:Hs,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{width:400,height:60},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:Ds,sourceCode:js};function Ar(e){return`
1507
1507
  .${e}-marquee-wrapper {
1508
1508
  overflow: hidden;
1509
1509
  width: 100%;
@@ -1590,7 +1590,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
1590
1590
  pointer-events: auto;
1591
1591
  z-index: 10;
1592
1592
  }
1593
- `}const qs=30,Us=({settings:e,content:t,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=$.useScopedStyles(),{autoplay:s,align:i,speed:p,direction:c,pauseOnHover:m,gap:l,cardWidth:_,corners:g,stroke:h,strokeColor:u,bgColor:d,padding:x,logoMarginTop:v,logoWidth:S,logoHeight:L,captionMarginTop:z}=e,P=s==="on"&&!r,T=P,f=Math.max(0,p)*qs,C=B=>$.scalingValue(B,n??!1),E=b.useRef(null),j=b.useRef(null),I=b.useRef(null),[O,M]=b.useState(0),[V,q]=b.useState(0),[y,R]=b.useState(0),F=T&&m==="on",[k,A]=b.useState(!1),W=b.useRef(null),[Z,se]=b.useState(0),[ne,ce]=b.useState(0),H=b.useRef(null),ee=B=>{var X,ie,re,de,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${B}FontFamily`])??"Arial",fontWeight:((X=e==null?void 0:e[`${B}FontSettings`])==null?void 0:X.fontWeight)??400,fontStyle:((ie=e==null?void 0:e[`${B}FontSettings`])==null?void 0:ie.fontStyle)??"normal"},textAppearance:{textTransform:((re=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:re.textTransform)??"none",textDecoration:((de=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:de.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${B}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${B}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${B}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${B}LineHeight`])??.01,color:(e==null?void 0:e[`${B}Color`])??"#000000"}},he=ee("text"),me=ee("caption"),ge=b.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(B=>{var Y,X;return(((Y=B.text)==null?void 0:Y.length)??0)>0||(((X=B.caption)==null?void 0:X.length)??0)>0}),[t]),U=b.useMemo(()=>!P||(t==null?void 0:t.length)===0?1:V<=0||O<=0?2:Math.max(2,Math.ceil(O/V)+1),[P,t==null?void 0:t.length,V,O]);b.useLayoutEffect(()=>{if(!P)return;const B=E.current,Y=I.current;if(!B||!Y)return;let X=0;const ie=()=>{const Ce=B.getBoundingClientRect().width,$e=Y.getBoundingClientRect().width,Ke=H.current,Pe=typeof Ke=="number"&&Math.abs(Ke-$e)<=.25;if(H.current=$e,M(Ce),typeof $e=="number"&&$e>0&&V<=0){q($e);return}Pe&&$e!==V?q($e):!Pe&&V<=0&&(cancelAnimationFrame(X),X=requestAnimationFrame(ie))},re=()=>{cancelAnimationFrame(X),X=requestAnimationFrame(ie)};re();const de=new ResizeObserver(re);return de.observe(B),de.observe(Y),()=>{cancelAnimationFrame(X),de.disconnect()}},[P,V]),b.useLayoutEffect(()=>{const B=j.current;if(!P||!B||!T)return;const Y=V>0?V:0,X=Y>0&&f>0?Y/f*1e3:0,ie=`${Math.max(0,X)/1e3}s`;B.style.setProperty("--marquee-distance",`${Y}px`),B.style.setProperty("--marquee-duration",ie)},[P,T,f,V]),b.useLayoutEffect(()=>{if(!P){R(0);return}const B=j.current;if(!B)return;const Y=()=>{const ie=B.getBoundingClientRect().height;R(ie>0?ie:0)};Y();const X=new ResizeObserver(Y);return X.observe(B),()=>{X.disconnect()}},[P,U,t,n,l,_,x,h,g,S,L]);const fe=()=>{F&&A(!0)},N=()=>{F&&A(!1)},w=b.useMemo(()=>{switch(i){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[i]),D=b.useMemo(()=>{switch(i){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[i]),K=b.useCallback((B,Y,X,ie)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[a.jsx("div",{"data-controls":ie==null?void 0:ie.controlsName,"data-controls-axis":"y",className:`${o}-control`,style:{height:C((ie==null?void 0:ie.marginTop)??0)}}),a.jsx("div",{...ie!=null&&ie.dataMeasureKind?{"data-testimonial-measure":ie.dataMeasureKind}:{},style:{...ke(B,n),textAlign:D,pointerEvents:"auto",...typeof(ie==null?void 0:ie.minHeightPx)=="number"&&ie.minHeightPx>0?{minHeight:ie.minHeightPx}:{}},children:a.jsx(Wt,{content:Y})})]},X),[w,D,n]),J=b.useCallback((B,Y,X)=>{var ie,re,de;return a.jsxs("div",{style:{padding:`${C(x.top)} ${C(x.right)} ${C(x.bottom)} ${C(x.left)}`,width:C(_+h*2),height:"100%",borderRadius:C(g),border:`${C(h)} solid ${u}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${o}-cover`,style:{background:d}}),a.jsxs("div",{className:`${o}-elements-overlay`,style:{alignItems:w,textAlign:D},children:[B.text&&K(he,B.text,"text",X!=null&&X.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(X==null?void 0:X.textMinHeightPx)=="number"&&X.textMinHeightPx>0?{minHeightPx:X.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${o}-control`,style:{height:C(v)}}),a.jsx("div",{style:{width:C(S),height:C(L)},children:((ie=B.logo)==null?void 0:ie.url)&&a.jsx("img",{src:B.logo.url,alt:((re=B.logo)==null?void 0:re.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((de=B.logo)==null?void 0:de.objectFit)||"contain"}})})]}),B.caption&&K(me,B.caption,"caption",{controlsName:"captionMarginTop",marginTop:z,...X!=null&&X.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(X==null?void 0:X.captionMinHeightPx)=="number"&&X.captionMinHeightPx>0?{minHeightPx:X.captionMinHeightPx}:{}})]})]},Y)},[d,z,me,_,g,L,v,S,w,D,x.bottom,x.left,x.right,x.top,K,h,u,he,n]),ae=b.useCallback(B=>{se(B.maxTextPx),ce(B.maxCaptionPx)},[]);b.useLayoutEffect(()=>{if(!ge){ae({maxTextPx:0,maxCaptionPx:0});return}const B=W.current;if(!B)return;const Y=()=>{$.readTestimonialTextMeasure(B,ae)};Y();const X=new ResizeObserver(Y);return X.observe(B),()=>{X.disconnect()}},[ge,ae,t,J]);const oe=ge?{textMinHeightPx:Z,captionMinHeightPx:ne}:void 0,te=ge?a.jsx("div",{ref:W,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((B,Y)=>J(B,`measure-${Y}`,{dataMeasureAttrs:!0}))}):null,pe=(B,Y)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[J(B,`card-${Y}`,oe),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${C(l)})`,width:C(l),height:"100%",pointerEvents:"auto",zIndex:2}})]},Y);return P&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:E,className:be(`${o}-wrapper`,`${o}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...y>0?{height:y}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Er(o)}}),te,a.jsx("div",{ref:j,className:`${o}-marquee-track`,"data-direction":c,onMouseEnter:fe,onMouseLeave:N,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...F?{"--marquee-play-state":k?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:U},(B,Y)=>a.jsx("div",{ref:Y===0?I:void 0,className:`${o}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:C(l),paddingRight:C(l)},"aria-hidden":Y>0,children:t==null?void 0:t.map((X,ie)=>pe(X,`${Y}-${ie}`))},`set-${Y}`))})]}):a.jsxs("div",{className:`${o}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Er(o)}}),te,a.jsx("div",{style:{gap:C(l),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((B,Y)=>pe(B,Y))})]})},Xs=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
1593
+ `}const qs=30,Us=({settings:e,content:t,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=$.useScopedStyles(),{autoplay:s,align:i,speed:p,direction:c,pauseOnHover:d,gap:l,cardWidth:L,corners:y,stroke:g,strokeColor:u,bgColor:f,padding:x,logoMarginTop:h,logoWidth:S,logoHeight:_,captionMarginTop:V}=e,R=s==="on"&&!r,T=R,m=Math.max(0,p)*qs,C=B=>$.scalingValue(B,n??!1),E=b.useRef(null),N=b.useRef(null),I=b.useRef(null),[W,O]=b.useState(0),[z,U]=b.useState(0),[v,P]=b.useState(0),F=T&&d==="on",[k,A]=b.useState(!1),H=b.useRef(null),[Z,se]=b.useState(0),[re,pe]=b.useState(0),M=b.useRef(null),ne=B=>{var X,ae,ee,ue,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${B}FontFamily`])??"Arial",fontWeight:((X=e==null?void 0:e[`${B}FontSettings`])==null?void 0:X.fontWeight)??400,fontStyle:((ae=e==null?void 0:e[`${B}FontSettings`])==null?void 0:ae.fontStyle)??"normal"},textAppearance:{textTransform:((ee=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:ee.textTransform)??"none",textDecoration:((ue=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:ue.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:we.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${B}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${B}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${B}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${B}LineHeight`])??.01,color:(e==null?void 0:e[`${B}Color`])??"#000000"}},fe=ne("text"),me=ne("caption"),ge=b.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(B=>{var Y,X;return(((Y=B.text)==null?void 0:Y.length)??0)>0||(((X=B.caption)==null?void 0:X.length)??0)>0}),[t]),D=b.useMemo(()=>!R||(t==null?void 0:t.length)===0?1:z<=0||W<=0?2:Math.max(2,Math.ceil(W/z)+1),[R,t==null?void 0:t.length,z,W]);b.useLayoutEffect(()=>{if(!R)return;const B=E.current,Y=I.current;if(!B||!Y)return;let X=0;const ae=()=>{const we=B.getBoundingClientRect().width,$e=Y.getBoundingClientRect().width,Je=M.current,Ne=typeof Je=="number"&&Math.abs(Je-$e)<=.25;if(M.current=$e,O(we),typeof $e=="number"&&$e>0&&z<=0){U($e);return}Ne&&$e!==z?U($e):!Ne&&z<=0&&(cancelAnimationFrame(X),X=requestAnimationFrame(ae))},ee=()=>{cancelAnimationFrame(X),X=requestAnimationFrame(ae)};ee();const ue=new ResizeObserver(ee);return ue.observe(B),ue.observe(Y),()=>{cancelAnimationFrame(X),ue.disconnect()}},[R,z]),b.useLayoutEffect(()=>{const B=N.current;if(!R||!B||!T)return;const Y=z>0?z:0,X=Y>0&&m>0?Y/m*1e3:0,ae=`${Math.max(0,X)/1e3}s`;B.style.setProperty("--marquee-distance",`${Y}px`),B.style.setProperty("--marquee-duration",ae)},[R,T,m,z]),b.useLayoutEffect(()=>{if(!R){P(0);return}const B=N.current;if(!B)return;const Y=()=>{const ae=B.getBoundingClientRect().height;P(ae>0?ae:0)};Y();const X=new ResizeObserver(Y);return X.observe(B),()=>{X.disconnect()}},[R,D,t,n,l,L,x,g,y,S,_]);const de=()=>{F&&A(!0)},j=()=>{F&&A(!1)},w=b.useMemo(()=>{switch(i){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[i]),G=b.useMemo(()=>{switch(i){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[i]),K=b.useCallback((B,Y,X,ae)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[a.jsx("div",{"data-controls":ae==null?void 0:ae.controlsName,"data-controls-axis":"y",className:`${o}-control`,style:{height:C((ae==null?void 0:ae.marginTop)??0)}}),a.jsx("div",{...ae!=null&&ae.dataMeasureKind?{"data-testimonial-measure":ae.dataMeasureKind}:{},style:{...ke(B,n),textAlign:G,pointerEvents:"auto",...typeof(ae==null?void 0:ae.minHeightPx)=="number"&&ae.minHeightPx>0?{minHeight:ae.minHeightPx}:{}},children:a.jsx(Ot,{content:Y})})]},X),[w,G,n]),J=b.useCallback((B,Y,X)=>{var ae,ee,ue;return a.jsxs("div",{style:{padding:`${C(x.top)} ${C(x.right)} ${C(x.bottom)} ${C(x.left)}`,width:C(L+g*2),height:"100%",borderRadius:C(y),border:`${C(g)} solid ${u}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${o}-cover`,style:{background:f}}),a.jsxs("div",{className:`${o}-elements-overlay`,style:{alignItems:w,textAlign:G},children:[B.text&&K(fe,B.text,"text",X!=null&&X.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(X==null?void 0:X.textMinHeightPx)=="number"&&X.textMinHeightPx>0?{minHeightPx:X.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${o}-control`,style:{height:C(h)}}),a.jsx("div",{style:{width:C(S),height:C(_)},children:((ae=B.logo)==null?void 0:ae.url)&&a.jsx("img",{src:B.logo.url,alt:((ee=B.logo)==null?void 0:ee.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ue=B.logo)==null?void 0:ue.objectFit)||"contain"}})})]}),B.caption&&K(me,B.caption,"caption",{controlsName:"captionMarginTop",marginTop:V,...X!=null&&X.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(X==null?void 0:X.captionMinHeightPx)=="number"&&X.captionMinHeightPx>0?{minHeightPx:X.captionMinHeightPx}:{}})]})]},Y)},[f,V,me,L,y,_,h,S,w,G,x.bottom,x.left,x.right,x.top,K,g,u,fe,n]),ie=b.useCallback(B=>{se(B.maxTextPx),pe(B.maxCaptionPx)},[]);b.useLayoutEffect(()=>{if(!ge){ie({maxTextPx:0,maxCaptionPx:0});return}const B=H.current;if(!B)return;const Y=()=>{$.readTestimonialTextMeasure(B,ie)};Y();const X=new ResizeObserver(Y);return X.observe(B),()=>{X.disconnect()}},[ge,ie,t,J]);const oe=ge?{textMinHeightPx:Z,captionMinHeightPx:re}:void 0,te=ge?a.jsx("div",{ref:H,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((B,Y)=>J(B,`measure-${Y}`,{dataMeasureAttrs:!0}))}):null,ce=(B,Y)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[J(B,`card-${Y}`,oe),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${C(l)})`,width:C(l),height:"100%",pointerEvents:"auto",zIndex:2}})]},Y);return R&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:E,className:ve(`${o}-wrapper`,`${o}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...v>0?{height:v}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ar(o)}}),te,a.jsx("div",{ref:N,className:`${o}-marquee-track`,"data-direction":c,onMouseEnter:de,onMouseLeave:j,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...F?{"--marquee-play-state":k?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:D},(B,Y)=>a.jsx("div",{ref:Y===0?I:void 0,className:`${o}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:C(l),paddingRight:C(l)},"aria-hidden":Y>0,children:t==null?void 0:t.map((X,ae)=>ce(X,`${Y}-${ae}`))},`set-${Y}`))})]}):a.jsxs("div",{className:`${o}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ar(o)}}),te,a.jsx("div",{style:{gap:C(l),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((B,Y)=>ce(B,Y))})]})},Xs=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
1594
1594
  import cn from 'classnames';\r
1595
1595
  import { CommonComponentProps } from '../props';\r
1596
1596
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';\r
@@ -2186,7 +2186,7 @@ type TestimonialsSettings = {\r
2186
2186
  logoHeight: number;\r
2187
2187
  captionMarginTop: number;\r
2188
2188
  };\r
2189
- `,Ar={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ys={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:"switch-toggle-2",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"range-control"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"range-control"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"range-control"}},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:"range-control"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"range-control"}},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:{...Ar.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:{...Ar.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:["speed","pauseOnHover"]},{type:"row",items:["align","direction"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners","stroke"]},{type:"group",title:"",items:["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"}]}]}]}},Ks={element:Us,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonials.png"},defaultSize:{width:"100%",height:320},schema:Ys,sourceCode:Xs,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Zs(e){return`
2189
+ `,Ir={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ys={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:"switch-toggle-2",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"range-control"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"range-control"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"range-control"}},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:"range-control"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"range-control"}},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:{...Ir.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:{...Ir.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:["speed","pauseOnHover"]},{type:"row",items:["align","direction"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners","stroke"]},{type:"group",title:"",items:["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"}]}]}]}},Ks={element:Us,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonials.png"},defaultSize:{width:"100%",height:320},schema:Ys,sourceCode:Xs,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Zs(e){return`
2190
2190
  .${e}-container {
2191
2191
  position: relative;
2192
2192
  overflow-x: clip;
@@ -2310,7 +2310,7 @@ type TestimonialsSettings = {\r
2310
2310
  width: 100%;
2311
2311
  height: 100%;
2312
2312
  }
2313
- `}const Js=({settings:e,content:t,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=$.useScopedStyles(),s=t||[],{autoplay:i,delay:p,align:c,width:m,imageMarginTop:l,textMarginTop:_,captionMarginTop:g,imageWidth:h,imageHeight:u,controlsWidth:d,controlsColor:x,controlsHoverColor:v}=e,S=i==="on"&&!r,[L,z]=b.useState(0),[P,T]=b.useState(null),[f,C]=b.useState(!1),E=b.useRef(null),j=b.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),I=b.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);b.useEffect(()=>{z(0),T(null),C(!1)},[s.length]);const O=s[L],M=P===null?null:s[P],V=U=>{var N,w,D,K,J;return{fontSettings:{fontFamily:(e==null?void 0:e[`${U}FontFamily`])??"Arial",fontWeight:((N=e==null?void 0:e[`${U}FontSettings`])==null?void 0:N.fontWeight)??400,fontStyle:((w=e==null?void 0:e[`${U}FontSettings`])==null?void 0:w.fontStyle)??"normal"},textAppearance:{textTransform:((D=e==null?void 0:e[`${U}TextAppearance`])==null?void 0:D.textTransform)??"none",textDecoration:((K=e==null?void 0:e[`${U}TextAppearance`])==null?void 0:K.textDecoration)??"none",fontVariant:((J=e==null?void 0:e[`${U}TextAppearance`])==null?void 0:J.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${U}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${U}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${U}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${U}WordSpacing`])??0,color:(e==null?void 0:e[`${U}Color`])??"#000000"}},q=V("text"),y=V("caption"),R=s.length>1&&s.some(U=>{var fe,N;return(((fe=U.text)==null?void 0:fe.length)??0)>0||(((N=U.caption)==null?void 0:N.length)??0)>0}),F=b.useRef(null),[k,A]=b.useState(0),[W,Z]=b.useState(0),se=e.controls??{mode:"Off",icon:null},ne=s.length>1,ce=b.useCallback((U,fe)=>!ne||fe===U?U:(E.current&&window.clearTimeout(E.current),T(U),C(!0),E.current=window.setTimeout(()=>{T(null),C(!1),E.current=null},300),fe),[ne]),H=b.useCallback(()=>{ne&&z(U=>ce(U,(U-1+s.length)%s.length))},[ne,ce,s.length]),ee=b.useCallback(()=>{ne&&z(U=>ce(U,(U+1)%s.length))},[ne,ce,s.length]);b.useEffect(()=>{if(!S||!ne)return;const U=Math.max(300,Number.isFinite(p*1e3)?p*1e3:0),fe=window.setInterval(()=>{z(N=>ce(N,(N+1)%s.length))},U);return()=>{window.clearInterval(fe)}},[S,ne,ce,s.length,p]),b.useEffect(()=>()=>{E.current&&window.clearTimeout(E.current)},[]);const he=(U,fe)=>{var K,J,ae,oe;const N=fe==null?void 0:fe.textMinHeightPx,w=fe==null?void 0:fe.captionMinHeightPx,D=fe==null?void 0:fe.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[U.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:j,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${o}-control`,style:{height:$.scalingValue(_??0,n??!1)}}),a.jsx("div",{...D&&{"data-testimonial-measure":"text"},style:{...ke(q,n),...N&&N>0?{minHeight:N}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Wt,{content:U.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:j,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${o}-control`,style:{height:$.scalingValue(l??0,n??!1)}}),a.jsx("div",{style:{width:$.scalingValue(h??0,n??!1),height:$.scalingValue(u??0,n??!1)},children:((K=U.image)==null?void 0:K.url)&&a.jsx("img",{src:(J=U.image)==null?void 0:J.url,alt:((ae=U.image)==null?void 0:ae.name)??"",className:`${o}-icon`,style:{objectFit:((oe=U.image)==null?void 0:oe.objectFit)||"contain"}})})]}),U.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:j,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${o}-control`,style:{height:$.scalingValue(g??0,n??!1)}}),a.jsx("div",{...D?{"data-testimonial-measure":"caption"}:{},style:{...ke(y,n),...w&&w>0?{minHeight:w}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Wt,{content:U.caption})})]})]})},me=b.useCallback(U=>{A(U.maxTextPx),Z(U.maxCaptionPx)},[]);if(b.useLayoutEffect(()=>{if(!R){me({maxTextPx:0,maxCaptionPx:0});return}const U=F.current;if(!U)return;const fe=()=>{$.readTestimonialTextMeasure(U,me)};fe();const N=new ResizeObserver(fe);return N.observe(U),()=>{N.disconnect()}},[R,me,t]),!O)return a.jsx(a.Fragment,{});const ge=R?{textMinHeightPx:k,captionMinHeightPx:W}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${o}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Zs(o)}}),a.jsxs("div",{className:`${o}-wrapper`,style:{width:$.scalingValue(m??0,n??!1),alignItems:j},children:[R&&a.jsx("div",{ref:F,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((U,fe)=>a.jsx("div",{style:{width:"100%"},children:he(U,{dataMeasureAttrs:!0})},fe))}),a.jsxs("div",{className:`${o}-fade-stack`,children:[M&&f&&a.jsx("div",{className:be(`${o}-fade-item-prev`,`${o}-fade-out`),children:he(M,ge)}),a.jsx("div",{className:be(`${o}-fade-item-current`,f?`${o}-fade-in`:void 0),children:he(O,ge)})]})]}),se.mode==="On"&&a.jsxs("div",{className:`${o}-controls`,children:[a.jsx("div",{className:`${o}-arrow`,style:{width:$.scalingValue(d??.02,n??!1),height:$.scalingValue(d??.02,n??!1),"--arrow-hover-color":v},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:H,disabled:!ne,"aria-label":"Previous testimonial",children:se.icon&&a.jsx(et,{url:se.icon,fill:x,hoverFill:v,className:be(`${o}-arrow-img`,`${o}-mirror`)})})}),a.jsx("div",{className:be(`${o}-arrow`,`${o}-next-arrow`),style:{width:$.scalingValue(d??.02,n??!1),height:$.scalingValue(d??.02,n??!1),"--arrow-hover-color":v},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:ee,disabled:!ne,"aria-label":"Next testimonial",children:se.icon&&a.jsx(et,{url:se.icon,fill:x,hoverFill:v,className:`${o}-arrow-img`})})})]})]})})},Qs=`import cn from 'classnames';\r
2313
+ `}const Js=({settings:e,content:t,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=$.useScopedStyles(),s=t||[],{autoplay:i,delay:p,align:c,width:d,imageMarginTop:l,textMarginTop:L,captionMarginTop:y,imageWidth:g,imageHeight:u,controlsWidth:f,controlsColor:x,controlsHoverColor:h}=e,S=i==="on"&&!r,[_,V]=b.useState(0),[R,T]=b.useState(null),[m,C]=b.useState(!1),E=b.useRef(null),N=b.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),I=b.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);b.useEffect(()=>{V(0),T(null),C(!1)},[s.length]);const W=s[_],O=R===null?null:s[R],z=D=>{var j,w,G,K,J;return{fontSettings:{fontFamily:(e==null?void 0:e[`${D}FontFamily`])??"Arial",fontWeight:((j=e==null?void 0:e[`${D}FontSettings`])==null?void 0:j.fontWeight)??400,fontStyle:((w=e==null?void 0:e[`${D}FontSettings`])==null?void 0:w.fontStyle)??"normal"},textAppearance:{textTransform:((G=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:G.textTransform)??"none",textDecoration:((K=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:K.textDecoration)??"none",fontVariant:((J=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:J.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${D}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${D}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${D}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${D}WordSpacing`])??0,color:(e==null?void 0:e[`${D}Color`])??"#000000"}},U=z("text"),v=z("caption"),P=s.length>1&&s.some(D=>{var de,j;return(((de=D.text)==null?void 0:de.length)??0)>0||(((j=D.caption)==null?void 0:j.length)??0)>0}),F=b.useRef(null),[k,A]=b.useState(0),[H,Z]=b.useState(0),se=e.controls??{mode:"Off",icon:null},re=s.length>1,pe=b.useCallback((D,de)=>!re||de===D?D:(E.current&&window.clearTimeout(E.current),T(D),C(!0),E.current=window.setTimeout(()=>{T(null),C(!1),E.current=null},300),de),[re]),M=b.useCallback(()=>{re&&V(D=>pe(D,(D-1+s.length)%s.length))},[re,pe,s.length]),ne=b.useCallback(()=>{re&&V(D=>pe(D,(D+1)%s.length))},[re,pe,s.length]);b.useEffect(()=>{if(!S||!re)return;const D=Math.max(300,Number.isFinite(p*1e3)?p*1e3:0),de=window.setInterval(()=>{V(j=>pe(j,(j+1)%s.length))},D);return()=>{window.clearInterval(de)}},[S,re,pe,s.length,p]),b.useEffect(()=>()=>{E.current&&window.clearTimeout(E.current)},[]);const fe=(D,de)=>{var K,J,ie,oe;const j=de==null?void 0:de.textMinHeightPx,w=de==null?void 0:de.captionMinHeightPx,G=de==null?void 0:de.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[D.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:N,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${o}-control`,style:{height:$.scalingValue(L??0,n??!1)}}),a.jsx("div",{...G&&{"data-testimonial-measure":"text"},style:{...ke(U,n),...j&&j>0?{minHeight:j}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ot,{content:D.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:N,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${o}-control`,style:{height:$.scalingValue(l??0,n??!1)}}),a.jsx("div",{style:{width:$.scalingValue(g??0,n??!1),height:$.scalingValue(u??0,n??!1)},children:((K=D.image)==null?void 0:K.url)&&a.jsx("img",{src:(J=D.image)==null?void 0:J.url,alt:((ie=D.image)==null?void 0:ie.name)??"",className:`${o}-icon`,style:{objectFit:((oe=D.image)==null?void 0:oe.objectFit)||"contain"}})})]}),D.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:N,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${o}-control`,style:{height:$.scalingValue(y??0,n??!1)}}),a.jsx("div",{...G?{"data-testimonial-measure":"caption"}:{},style:{...ke(v,n),...w&&w>0?{minHeight:w}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ot,{content:D.caption})})]})]})},me=b.useCallback(D=>{A(D.maxTextPx),Z(D.maxCaptionPx)},[]);if(b.useLayoutEffect(()=>{if(!P){me({maxTextPx:0,maxCaptionPx:0});return}const D=F.current;if(!D)return;const de=()=>{$.readTestimonialTextMeasure(D,me)};de();const j=new ResizeObserver(de);return j.observe(D),()=>{j.disconnect()}},[P,me,t]),!W)return a.jsx(a.Fragment,{});const ge=P?{textMinHeightPx:k,captionMinHeightPx:H}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${o}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Zs(o)}}),a.jsxs("div",{className:`${o}-wrapper`,style:{width:$.scalingValue(d??0,n??!1),alignItems:N},children:[P&&a.jsx("div",{ref:F,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((D,de)=>a.jsx("div",{style:{width:"100%"},children:fe(D,{dataMeasureAttrs:!0})},de))}),a.jsxs("div",{className:`${o}-fade-stack`,children:[O&&m&&a.jsx("div",{className:ve(`${o}-fade-item-prev`,`${o}-fade-out`),children:fe(O,ge)}),a.jsx("div",{className:ve(`${o}-fade-item-current`,m?`${o}-fade-in`:void 0),children:fe(W,ge)})]})]}),se.mode==="On"&&a.jsxs("div",{className:`${o}-controls`,children:[a.jsx("div",{className:`${o}-arrow`,style:{width:$.scalingValue(f??.02,n??!1),height:$.scalingValue(f??.02,n??!1),"--arrow-hover-color":h},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:M,disabled:!re,"aria-label":"Previous testimonial",children:se.icon&&a.jsx(nt,{url:se.icon,fill:x,hoverFill:h,className:ve(`${o}-arrow-img`,`${o}-mirror`)})})}),a.jsx("div",{className:ve(`${o}-arrow`,`${o}-next-arrow`),style:{width:$.scalingValue(f??.02,n??!1),height:$.scalingValue(f??.02,n??!1),"--arrow-hover-color":h},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:ne,disabled:!re,"aria-label":"Next testimonial",children:se.icon&&a.jsx(nt,{url:se.icon,fill:x,hoverFill:h,className:`${o}-arrow-img`})})})]})]})})},Qs=`import cn from 'classnames';\r
2314
2314
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
2315
2315
  import { CommonComponentProps } from '../props';\r
2316
2316
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';\r
@@ -2802,7 +2802,7 @@ type TestimonialsSettings = {\r
2802
2802
  icon?: string | null;\r
2803
2803
  };\r
2804
2804
  };\r
2805
- `,el="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>'),Ir={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},tl={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:"step-control"},step:1,min:1,max:8},align:{type:"string",scope:"common",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"range-control"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"range-control"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"range-control"}},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:"range-control"}},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:{...Ir.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:{...Ir.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:el},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:["controls",{type:"group",title:"",items:["delay","width"]}]},{type:"row",items:["controlsWidth","align"]},{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"}]}]}]}},nl={element:Js,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonialsSingle.png"},defaultSize:{width:700,height:300},schema:tl,sourceCode:Qs,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function rl(){return window.navigator.platform==="Win32"||window.navigator.platform==="Win64"?'"InputMono-Regular", monospace':'"DepartureMono-Regular", monospace'}function ol(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function il(e){return`
2805
+ `,el="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>'),Fr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},tl={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:"step-control"},step:1,min:1,max:8},align:{type:"string",scope:"common",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"range-control"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"range-control"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"range-control"}},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:"range-control"}},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:{...Fr.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:{...Fr.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:el},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:["controls",{type:"group",title:"",items:["delay","width"]}]},{type:"row",items:["controlsWidth","align"]},{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"}]}]}]}},nl={element:Js,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonialsSingle.png"},defaultSize:{width:700,height:300},schema:tl,sourceCode:Qs,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function rl(){return window.navigator.platform==="Win32"||window.navigator.platform==="Win64"?'"InputMono-Regular", monospace':'"DepartureMono-Regular", monospace'}function ol(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function il(e){return`
2806
2806
  .${e}-wrapper {
2807
2807
  display: grid;
2808
2808
  align-items: start;
@@ -2814,11 +2814,27 @@ type TestimonialsSettings = {\r
2814
2814
  justify-content: center;
2815
2815
  align-items: center;
2816
2816
  }
2817
+ .${e}-item-inner {
2818
+ display: flex;
2819
+ flex-direction: column;
2820
+ align-items: center;
2821
+ outline: 1px solid #ccc;
2822
+ }
2823
+ .${e}-item-inner-hidden {
2824
+ display: flex;
2825
+ flex-direction: column;
2826
+ align-items: center;
2827
+ }
2817
2828
  .${e}-item-image-wrapper {
2818
2829
  display: flex;
2819
2830
  justify-content: center;
2820
2831
  align-items: center;
2821
2832
  }
2833
+ .${e}-item-image-link {
2834
+ width: 100%;
2835
+ height: 100%;
2836
+ display: block;
2837
+ }
2822
2838
  .${e}-item-image {
2823
2839
  width: 100%;
2824
2840
  height: 100%;
@@ -2872,623 +2888,647 @@ type TestimonialsSettings = {\r
2872
2888
  pointer-events: auto;
2873
2889
  z-index: 10;
2874
2890
  }
2875
- `}const Ze=500,lt="cubic-bezier(0.22, 1, 0.36, 1)";function al({images:e,index:t,imageDisplay:n,originRect:r,reverseClose:o,onClose:s,onPrev:i,onNext:p}){const c=b.useRef(null),m=b.useRef(null),[l,_]=b.useState(null),[g,h]=b.useState(r?"opening":"open"),[u,d]=b.useState(!0),x=b.useRef(t),v=b.useCallback(()=>{const f=c.current,C=m.current;if(!f||!C)return;const E=f.getBoundingClientRect(),j=E.width,I=E.height,O=C.naturalWidth,M=C.naturalHeight;if(!j||!I||!O||!M)return;if(n==="Cover"){_({width:j,height:I,left:E.left,top:E.top});return}const V=O/M,q=j/I;if(V>q){const y=j/V;_({width:j,height:y,left:E.left,top:E.top+(I-y)/2})}else{const y=I*V;_({width:y,height:I,left:E.left+(j-y)/2,top:E.top})}},[n]);b.useEffect(()=>{v();const f=c.current;if(!f)return;const C=new ResizeObserver(()=>v());return C.observe(f),()=>C.disconnect()},[v,t]),b.useEffect(()=>{if(g!=="opening"||!l)return;const f={id:0};return f.id=requestAnimationFrame(()=>{f.id=requestAnimationFrame(()=>h("open"))}),()=>cancelAnimationFrame(f.id)},[g,l]),b.useEffect(()=>{if(g!=="closing")return;const f=setTimeout(()=>s(),Ze);return()=>clearTimeout(f)},[g,s]),b.useEffect(()=>{x.current!==t&&d(!1),x.current=t},[t]);const S=()=>{g!=="closing"&&h("closing")},L=g==="open",z=g==="closing",P=z&&o&&!!r,T=g==="opening"?r??l:P?r:l;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:S,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:L?1:0,transition:`opacity ${Ze}ms ${lt}`,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:c,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:L?1:0,transition:`opacity ${Ze}ms ${lt}`,fontFamily:rl()},children:e.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:t+1}),a.jsx("p",{children:"/"}),a.jsx("p",{children:e.length})]})})]}),T&&a.jsx("img",{ref:m,src:e[t],onLoad:v,style:{position:"fixed",top:T.top,left:T.left,width:T.width,height:T.height,objectFit:n==="Cover"?"cover":"contain",opacity:z&&!P?0:1,transition:z&&!P?`opacity ${Ze}ms ${lt}`:P||u?`top ${Ze}ms ${lt}, left ${Ze}ms ${lt}, width ${Ze}ms ${lt}, height ${Ze}ms ${lt}`:"none",pointerEvents:"none",zIndex:9998}}),L&&l&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:l.top,left:l.left,width:l.width/2,height:l.height,cursor:"w-resize",zIndex:9999},onClick:f=>{f.stopPropagation(),i()}}),a.jsx("div",{style:{position:"fixed",top:l.top,left:l.left+l.width/2,width:l.width/2,height:l.height,cursor:"e-resize",zIndex:9999},onClick:f=>{f.stopPropagation(),p()}})]})]})}function sl({settings:e,content:t,isEditor:n,metadata:r,activeEvent:o}){const{prefix:s}=$.useScopedStyles(),{type:i="A",gridLayout:p,textBoxWidth:c,verticalGap:m,entriesCount:l,lightbox:_,imageDisplay:g,slider:h,sliderTiming:u,direction:d,transition:x,titleMarginTop:v,subtitleMarginTop:S,titleColor:L,subtitleColor:z,titleFontFamily:P,titleFontSettings:T,titleFontSize:f,titleLineHeight:C,titleLetterSpacing:E,titleWordSpacing:j,titleTextAppearance:I,subtitleFontFamily:O,subtitleFontSettings:M,subtitleFontSize:V,subtitleLineHeight:q,subtitleLetterSpacing:y,subtitleWordSpacing:R,subtitleTextAppearance:F}=e,k={fontSettings:{fontFamily:P,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:f??.01,lineHeight:C,letterSpacing:E??0,wordSpacing:j??0,textAppearance:I,color:L},W={...Qe(ke(k,n))},Z={fontSettings:{fontFamily:O,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:V??.01,lineHeight:q,letterSpacing:y??0,wordSpacing:R??0,textAppearance:F,color:z},ne={...Qe(ke(Z,n))},ce=$.buildColorVars(s,{titleColor:L,subtitleColor:z},ll,cl),ee=`${o&&o!=="default"?`${s}-state-${o}`:""}`.trim(),he=l===0?1/0:l,me=(t??[]).slice(0,he),ge=p.entryWidth??.2,U=(g==null?void 0:g.display)==="Cover",fe=(g==null?void 0:g.ratioValue)??"1:1",N=(g==null?void 0:g.reversed)??!1,[w,D]=fe.split(":").map(Number),K=N?D:w,J=N?w:D,ae=`${K} / ${J}`,oe=K>=J,te={objectFit:U?"cover":"contain",...U&&{aspectRatio:ae,width:oe?"100%":"auto",height:oe?"auto":"100%"}},[pe,B]=b.useState("ltr"),[Y,X]=b.useState(!1),[ie,re]=b.useState([]),[de,Ce]=b.useState(0),[$e,Ke]=b.useState(null),Pe=(ue,Le,Ae)=>{if(_==="Off")return;const ye=ue.currentTarget.getBoundingClientRect();Ke({top:ye.top,left:ye.left,width:ye.width,height:ye.height}),re(Le),Ce(Ae),X(!0)};return b.useEffect(()=>{if(!Y||_!=="On"||typeof document>"u")return;const ue=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ue}},[Y,_]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:il(s)}}),a.jsx("div",{style:ce,children:a.jsx("div",{className:`${s}-wrapper ${s}-type-${i} ${ee}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:$.scalingValue(m??0,n),columnGap:$.scalingValue(p.horizontalGap??0,n),width:$.scalingValue(p.wrapperWidth??0,n)},children:me.map((ue,Le)=>{var Ae;return a.jsxs("div",{className:`${s}-item`.trim(),children:[a.jsx("div",{className:`${s}-item-image-wrapper`,style:{width:$.scalingValue(ge??0,n),height:$.scalingValue(ge??0,n)},children:(((Ae=ue.image)==null?void 0:Ae.length)??0)===0?null:h==="Off"?a.jsx("img",{src:ue.image[0].url,alt:ue.image[0].name,className:`${s}-item-image`.trim(),style:te,onClick:ye=>Pe(ye,ue.image.map(Te=>Te.url),0)}):a.jsx(rr,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:u*1e3,width:"100%",height:"100%",speed:500,type:x==="Fade"?"fade":"loop",rewind:x==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:x==="Fade"?"ltr":d!=="Random"?d==="Horizontal"?"ltr":"ttb":pe},onMoved:ye=>{if(d!=="Random"||x==="Fade")return;const Te=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";B(Te),setTimeout(()=>{ye.refresh()},0)},children:ue.image.map((ye,Te)=>a.jsx(or,{children:a.jsx("img",{src:ye.url,alt:ye.name,className:`${s}-item-image`.trim(),style:te,onClick:Gt=>Pe(Gt,ue.image.map(at=>at.url),Te)})},Te))},`${x}-${ge}-${d}-${u}`)}),a.jsx("div",{"data-controls":"titleMarginTop",className:`${s}-control`,style:{height:$.scalingValue(v??0,n)}}),a.jsx("p",{className:`${s}-item-title`.trim(),style:{width:`calc(${$.scalingValue(ge??0,n)} * (${c} / 100))`,...W},children:ue.title}),i==="B"&&a.jsx("div",{"data-controls":"subtitleMarginTop",className:`${s}-control`,style:{height:$.scalingValue(S??0,n)}}),i==="B"&&a.jsx("p",{className:`${s}-item-subtitle`.trim(),style:{width:`calc(${$.scalingValue(ge??0,n)} * (${c} / 100))`,...ne},children:ue.subtitle})]},Le)})})}),Y&&typeof document&&document.getElementById("grid-component-lightbox-portal")&&_==="On"&&kr.createPortal(a.jsx("div",{"data-selection":"none",children:a.jsx(al,{images:ie,index:de,imageDisplay:g.display,originRect:$e,reverseClose:h==="Off",onClose:()=>X(!1),onPrev:()=>Ce(ue=>(ue-1+ie.length)%ie.length),onNext:()=>Ce(ue=>(ue+1)%ie.length)})}),document.body)]})}const ll={titleColor:"title-color",subtitleColor:"subtitle-color"},cl=["hover","focus","filled","success","error"],pl=`import { Splide, SplideSlide } from '@splidejs/react-splide';\r
2876
- import '@splidejs/react-splide/css/core';\r
2877
- import { CommonComponentProps } from '../props';\r
2878
- import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
2879
- import { useCallback, useEffect, useRef, useState } from 'react';\r
2880
- import { createPortal } from 'react-dom';\r
2881
- import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';\r
2882
- import { getFontBasedOnSystem } from '../utils/getMainFontBaseOnSystem';\r
2883
- \r
2884
- function sv(px: number): string {\r
2885
- return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;\r
2886
- }\r
2887
- \r
2888
- function getCSS(P: string): string {\r
2889
- return \`\r
2890
- .\${P}-wrapper {\r
2891
- display: grid;\r
2892
- align-items: start;\r
2893
- min-height: \${sv(48)};\r
2894
- }\r
2895
- .\${P}-item {\r
2896
- display: flex;\r
2897
- flex-direction: column;\r
2898
- justify-content: center;\r
2899
- align-items: center;\r
2900
- }\r
2901
- .\${P}-item-image-wrapper {\r
2902
- display: flex;\r
2903
- justify-content: center;\r
2904
- align-items: center;\r
2905
- }\r
2906
- .\${P}-item-image {\r
2907
- width: 100%;\r
2908
- height: 100%;\r
2909
- display: block;\r
2910
- }\r
2911
- .\${P}-item-slider,\r
2912
- .\${P}-item-slider .splide__track,\r
2913
- .\${P}-item-slider .splide__list,\r
2914
- .\${P}-item-slider .splide__slide {\r
2915
- width: 100%;\r
2916
- height: 100%;\r
2917
- }\r
2918
- .\${P}-item-slider .splide__slide {\r
2919
- display: flex;\r
2920
- justify-content: center;\r
2921
- align-items: center;\r
2922
- }\r
2923
- .\${P}-item-title {\r
2924
- white-space: normal;\r
2925
- overflow-wrap: anywhere;\r
2926
- word-break: break-word;\r
2927
- text-align: center;\r
2928
- margin-bottom: 0px;\r
2929
- margin-top: 0px;\r
2930
- color: var(--\${P}-title-color);\r
2931
- }\r
2932
- .\${P}-item-subtitle {\r
2933
- white-space: normal;\r
2934
- overflow-wrap: anywhere;\r
2935
- word-break: break-word;\r
2936
- text-align: center;\r
2937
- margin-bottom: 0px;\r
2938
- margin-top: 0px;\r
2939
- color: var(--\${P}-subtitle-color);\r
2940
- }\r
2941
- \r
2942
- .\${P}-control {\r
2943
- position: relative;\r
2944
- z-index: 2;\r
2945
- width: 100%;\r
2946
- }\r
2947
- \r
2948
- .\${P}-control::before {\r
2949
- content: "";\r
2950
- position: absolute;\r
2951
- top: 0;\r
2952
- left: 0;\r
2953
- width: 100%;\r
2954
- height: 100%;\r
2955
- min-height: 20px;\r
2956
- pointer-events: auto;\r
2957
- z-index: 10;\r
2958
- }\r
2959
- \`;\r
2960
- }\r
2961
- \r
2962
- type GridProps = {\r
2963
- settings: GridSettings;\r
2964
- content?: any;\r
2965
- isEditor?: boolean;\r
2966
- activeEvent: string | undefined;\r
2967
- onUpdateSettings?: (settings: GridSettings) => void;\r
2968
- } & CommonComponentProps;\r
2969
- \r
2970
- type AnimRect = { top: number; left: number; width: number; height: number };\r
2971
- \r
2972
- type LightboxProps = {\r
2973
- images: string[];\r
2974
- index: number;\r
2975
- imageDisplay: 'Fit' | 'Cover';\r
2976
- originRect: AnimRect | null;\r
2977
- reverseClose: boolean;\r
2978
- onClose: () => void;\r
2979
- onPrev: () => void;\r
2980
- onNext: () => void;\r
2981
- };\r
2982
- \r
2983
- const LIGHTBOX_ANIM_MS = 500;\r
2984
- const LIGHTBOX_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\r
2985
- \r
2986
- function Lightbox({ images, index, imageDisplay, originRect, reverseClose, onClose, onPrev, onNext }: LightboxProps) {\r
2987
- const ghostRef = useRef<HTMLDivElement>(null);\r
2988
- const imgRef = useRef<HTMLImageElement>(null);\r
2989
- const [finalRect, setFinalRect] = useState<AnimRect | null>(null);\r
2990
- const [phase, setPhase] = useState<'opening' | 'open' | 'closing'>(originRect ? 'opening' : 'open');\r
2991
- const [transitionsEnabled, setTransitionsEnabled] = useState(true);\r
2992
- const prevIndexRef = useRef(index);\r
2993
- \r
2994
- const computeFinalRect = useCallback(() => {\r
2995
- const ghost = ghostRef.current;\r
2996
- const img = imgRef.current;\r
2997
- if (!ghost || !img) return;\r
2998
- const cb = ghost.getBoundingClientRect();\r
2999
- const cw = cb.width;\r
3000
- const ch = cb.height;\r
3001
- const nw = img.naturalWidth;\r
3002
- const nh = img.naturalHeight;\r
3003
- if (!cw || !ch || !nw || !nh) return;\r
3004
- if (imageDisplay === 'Cover') {\r
3005
- setFinalRect({ width: cw, height: ch, left: cb.left, top: cb.top });\r
3006
- return;\r
3007
- }\r
3008
- const ir = nw / nh;\r
3009
- const cr = cw / ch;\r
3010
- if (ir > cr) {\r
3011
- const dh = cw / ir;\r
3012
- setFinalRect({ width: cw, height: dh, left: cb.left, top: cb.top + (ch - dh) / 2 });\r
3013
- } else {\r
3014
- const dw = ch * ir;\r
3015
- setFinalRect({ width: dw, height: ch, left: cb.left + (cw - dw) / 2, top: cb.top });\r
3016
- }\r
3017
- }, [imageDisplay]);\r
3018
- \r
3019
- useEffect(() => {\r
3020
- computeFinalRect();\r
3021
- const c = ghostRef.current;\r
3022
- if (!c) return;\r
3023
- const ro = new ResizeObserver(() => computeFinalRect());\r
3024
- ro.observe(c);\r
3025
- return () => ro.disconnect();\r
3026
- }, [computeFinalRect, index]);\r
3027
- \r
3028
- useEffect(() => {\r
3029
- if (phase !== 'opening' || !finalRect) return;\r
3030
- const handle = { id: 0 };\r
3031
- handle.id = requestAnimationFrame(() => {\r
3032
- handle.id = requestAnimationFrame(() => setPhase('open'));\r
3033
- });\r
3034
- return () => cancelAnimationFrame(handle.id);\r
3035
- }, [phase, finalRect]);\r
3036
- \r
3037
- useEffect(() => {\r
3038
- if (phase !== 'closing') return;\r
3039
- const t = setTimeout(() => onClose(), LIGHTBOX_ANIM_MS);\r
3040
- return () => clearTimeout(t);\r
3041
- }, [phase, onClose]);\r
3042
- \r
3043
- useEffect(() => {\r
3044
- if (prevIndexRef.current !== index) {\r
3045
- setTransitionsEnabled(false);\r
3046
- }\r
3047
- prevIndexRef.current = index;\r
3048
- }, [index]);\r
3049
- \r
3050
- const handleClose = () => {\r
3051
- if (phase === 'closing') return;\r
3052
- setPhase('closing');\r
3053
- };\r
3054
- \r
3055
- const isOpen = phase === 'open';\r
3056
- const isClosing = phase === 'closing';\r
3057
- const reverseAnimateClose = isClosing && reverseClose && !!originRect;\r
3058
- const animatedRect = phase === 'opening'\r
3059
- ? (originRect ?? finalRect)\r
3060
- : reverseAnimateClose\r
3061
- ? originRect\r
3062
- : finalRect;\r
3063
- \r
3064
- return (\r
3065
- <div\r
3066
- style={{\r
3067
- position: 'fixed',\r
3068
- top: 0,\r
3069
- left: 0,\r
3070
- width: '100vw',\r
3071
- height: '100vh',\r
3072
- zIndex: 9997,\r
3073
- }}\r
3074
- onClick={handleClose}\r
3075
- >\r
3076
- <div\r
3077
- style={{\r
3078
- position: 'absolute',\r
3079
- inset: 0,\r
3080
- background: 'rgba(28,31,34,0.9)',\r
3081
- opacity: isOpen ? 1 : 0,\r
3082
- transition: \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`,\r
3083
- pointerEvents: 'none',\r
3084
- }}\r
3085
- />\r
3086
- <div\r
3087
- style={{\r
3088
- position: 'relative',\r
3089
- width: '100%',\r
3090
- height: '100%',\r
3091
- display: 'flex',\r
3092
- flexDirection: 'column',\r
3093
- alignItems: 'center',\r
3094
- justifyContent: 'center',\r
3095
- }}\r
3096
- >\r
3097
- <div style={{ height: '10%' }}></div>\r
3098
- <div\r
3099
- style={{\r
3100
- width: '70%',\r
3101
- height: '80%',\r
3102
- display: 'flex',\r
3103
- justifyContent: 'center',\r
3104
- alignItems: 'center'\r
3105
- }}>\r
3106
- <div ref={ghostRef} style={{ width: '100%', height: '100%' }} />\r
3107
- </div>\r
3108
- <div\r
3109
- style={{\r
3110
- display: 'flex',\r
3111
- flexDirection: 'row',\r
3112
- justifyContent: 'center',\r
3113
- alignItems: 'center',\r
3114
- height: '10%',\r
3115
- color: '#E6E6E6',\r
3116
- letterSpacing: '-0.6px',\r
3117
- lineHeight: '16px',\r
3118
- opacity: isOpen ? 1 : 0,\r
3119
- transition: \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`,\r
3120
- fontFamily: getFontBasedOnSystem(),\r
3121
- }}\r
3122
- >\r
3123
- {images.length > 1 &&\r
3124
- <>\r
3125
- <p>{index + 1}</p>\r
3126
- <p>/</p>\r
3127
- <p>{images.length}</p>\r
3128
- </>\r
3129
- }\r
3130
- </div>\r
3131
- </div>\r
3132
- \r
3133
- {animatedRect && (\r
3134
- <img\r
3135
- ref={imgRef}\r
3136
- src={images[index]}\r
3137
- onLoad={computeFinalRect}\r
3138
- style={{\r
3139
- position: 'fixed',\r
3140
- top: animatedRect.top,\r
3141
- left: animatedRect.left,\r
3142
- width: animatedRect.width,\r
3143
- height: animatedRect.height,\r
3144
- objectFit: imageDisplay === 'Cover' ? 'cover' : 'contain',\r
3145
- opacity: isClosing && !reverseAnimateClose ? 0 : 1,\r
3146
- transition: isClosing && !reverseAnimateClose\r
3147
- ? \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`\r
3148
- : (reverseAnimateClose || transitionsEnabled)\r
3149
- ? \`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}\`\r
3150
- : 'none',\r
3151
- pointerEvents: 'none',\r
3152
- zIndex: 9998,\r
3153
- }}\r
3154
- />\r
3155
- )}\r
3156
- \r
3157
- {isOpen && finalRect && (\r
3158
- <>\r
3159
- <div\r
3160
- style={{\r
3161
- position: 'fixed',\r
3162
- top: finalRect.top,\r
3163
- left: finalRect.left,\r
3164
- width: finalRect.width / 2,\r
3165
- height: finalRect.height,\r
3166
- cursor: 'w-resize',\r
3167
- zIndex: 9999,\r
3168
- }}\r
3169
- onClick={(e) => {\r
3170
- e.stopPropagation();\r
3171
- onPrev();\r
3172
- }}\r
3173
- />\r
3174
- <div\r
3175
- style={{\r
3176
- position: 'fixed',\r
3177
- top: finalRect.top,\r
3178
- left: finalRect.left + finalRect.width / 2,\r
3179
- width: finalRect.width / 2,\r
3180
- height: finalRect.height,\r
3181
- cursor: 'e-resize',\r
3182
- zIndex: 9999,\r
3183
- }}\r
3184
- onClick={(e) => {\r
3185
- e.stopPropagation();\r
3186
- onNext();\r
3187
- }}\r
3188
- />\r
3189
- </>\r
3190
- )}\r
3191
- </div>\r
3192
- );\r
3193
- }\r
3194
- \r
3195
- export function Grid({ settings, content, isEditor, metadata, activeEvent }: GridProps) {\r
3196
- const { prefix: P } = useScopedStyles();\r
3197
- const {\r
3198
- type = 'A',\r
3199
- gridLayout,\r
3200
- textBoxWidth,\r
3201
- verticalGap,\r
3202
- entriesCount,\r
3203
- lightbox,\r
3204
- imageDisplay,\r
3205
- slider,\r
3206
- sliderTiming,\r
3207
- direction,\r
3208
- transition,\r
3209
- titleMarginTop,\r
3210
- subtitleMarginTop,\r
3211
- titleColor,\r
3212
- subtitleColor,\r
3213
- titleFontFamily,\r
3214
- titleFontSettings,\r
3215
- titleFontSize,\r
3216
- titleLineHeight,\r
3217
- titleLetterSpacing,\r
3218
- titleWordSpacing,\r
3219
- titleTextAppearance,\r
3220
- subtitleFontFamily,\r
3221
- subtitleFontSettings,\r
3222
- subtitleFontSize,\r
3223
- subtitleLineHeight,\r
3224
- subtitleLetterSpacing,\r
3225
- subtitleWordSpacing,\r
3226
- subtitleTextAppearance,\r
3227
- } = settings;\r
3228
- \r
3229
- const resolvedTitleTextStyle: TextStyles = {\r
3230
- fontSettings: {\r
3231
- fontFamily: titleFontFamily,\r
3232
- fontWeight: titleFontSettings?.fontWeight ?? 400,\r
3233
- fontStyle: titleFontSettings?.fontStyle ?? 'normal',\r
3234
- },\r
3235
- fontSize: titleFontSize ?? 0.01,\r
3236
- lineHeight: titleLineHeight,\r
3237
- letterSpacing: titleLetterSpacing ?? 0,\r
3238
- wordSpacing: titleWordSpacing ?? 0,\r
3239
- textAppearance: titleTextAppearance,\r
3240
- color: titleColor,\r
3241
- };\r
3242
- const titleTypographyCss = omitTextColors(textStylesToCss(resolvedTitleTextStyle, isEditor));\r
3243
- const titleFieldCss = {\r
3244
- ...titleTypographyCss,\r
3245
- } as React.CSSProperties;\r
3246
- \r
3247
- const resolvedSubtitleTextStyle: TextStyles = {\r
3248
- fontSettings: {\r
3249
- fontFamily: subtitleFontFamily,\r
3250
- fontWeight: subtitleFontSettings?.fontWeight ?? 400,\r
3251
- fontStyle: subtitleFontSettings?.fontStyle ?? 'normal',\r
3252
- },\r
3253
- fontSize: subtitleFontSize ?? 0.01,\r
3254
- lineHeight: subtitleLineHeight,\r
3255
- letterSpacing: subtitleLetterSpacing ?? 0,\r
3256
- wordSpacing: subtitleWordSpacing ?? 0,\r
3257
- textAppearance: subtitleTextAppearance,\r
3258
- color: subtitleColor,\r
3259
- };\r
3260
- const subtitleTypographyCss = omitTextColors(textStylesToCss(resolvedSubtitleTextStyle, isEditor));\r
3261
- const subtitleFieldCss = {\r
3262
- ...subtitleTypographyCss,\r
3263
- } as React.CSSProperties;\r
3264
- \r
3265
- const colorVars = buildColorVars(P, {\r
3266
- titleColor,\r
3267
- subtitleColor,\r
3268
- }, COLOR_VAR_MAP, STATE_KEYS);\r
3269
- \r
3270
- const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';\r
3271
- const wrapperStateClasses = \`\${stateClass}\`.trim();\r
3272
- \r
3273
- const resEntriesCount = entriesCount === 0 ? Infinity : entriesCount;\r
3274
- \r
3275
- const cropContent = (content ?? []).slice(0, resEntriesCount);\r
3276
- \r
3277
- const size = gridLayout.entryWidth ?? 0.2;\r
3278
- \r
3279
- const isCover = imageDisplay?.display === 'Cover';\r
3280
- const ratioValue = imageDisplay?.ratioValue ?? '1:1';\r
3281
- const ratioReversed = imageDisplay?.reversed ?? false;\r
3282
- const [rW, rH] = ratioValue.split(':').map(Number);\r
3283
- const effW = ratioReversed ? rH : rW;\r
3284
- const effH = ratioReversed ? rW : rH;\r
3285
- const aspectRatio = \`\${effW} / \${effH}\`;\r
3286
- const isLandscape = effW >= effH;\r
3287
- \r
3288
- const imageStyle: React.CSSProperties = {\r
3289
- objectFit: isCover ? 'cover' : 'contain',\r
3290
- ...(isCover && {\r
3291
- aspectRatio,\r
3292
- width: isLandscape ? '100%' : 'auto',\r
3293
- height: isLandscape ? 'auto' : '100%',\r
3294
- }),\r
3295
- };\r
3296
- \r
3297
- const [dir, setDir] = useState('ltr');\r
3298
- \r
3299
- const [lightboxOpen, setLightboxOpen] = useState(false);\r
3300
- const [lightboxImages, setLightboxImages] = useState<string[]>([]);\r
3301
- const [lightboxIndex, setLightboxIndex] = useState(0);\r
3302
- const [lightboxOriginRect, setLightboxOriginRect] = useState<AnimRect | null>(null);\r
3303
- \r
3304
- const openLightbox = (e: React.MouseEvent<HTMLImageElement>, urls: string[], idx: number) => {\r
3305
- if (lightbox === 'Off') return;\r
3306
- const r = e.currentTarget.getBoundingClientRect();\r
3307
- setLightboxOriginRect({ top: r.top, left: r.left, width: r.width, height: r.height });\r
3308
- setLightboxImages(urls);\r
3309
- setLightboxIndex(idx);\r
3310
- setLightboxOpen(true);\r
3311
- };\r
3312
- \r
3313
- useEffect(() => {\r
3314
- if (!lightboxOpen || lightbox !== 'On') return;\r
3315
- if (typeof document === 'undefined') return;\r
3316
- const prevOverflow = document.body.style.overflow;\r
3317
- document.body.style.overflow = 'hidden';\r
3318
- return () => {\r
3319
- document.body.style.overflow = prevOverflow;\r
3320
- };\r
3321
- }, [lightboxOpen, lightbox]);\r
3322
- \r
3323
- return (\r
3324
- <>\r
3325
- <style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />\r
3326
- <div style={colorVars}>\r
3327
- <div\r
3328
- className={\`\${P}-wrapper \${P}-type-\${type} \${wrapperStateClasses}\`.trim()}\r
3329
- style={{\r
3330
- gridTemplateColumns: \`repeat(\${gridLayout.columnsCount}, minmax(0, 1fr))\`,\r
3331
- rowGap: scalingValue(verticalGap ?? 0, isEditor),\r
3332
- columnGap: scalingValue(gridLayout.horizontalGap ?? 0, isEditor),\r
3333
- width: scalingValue(gridLayout.wrapperWidth ?? 0, isEditor)\r
3334
- }}>\r
3335
- {cropContent.map((item, index) => (\r
3336
- <div\r
3337
- key={index}\r
3338
- className={\`\${P}-item\`.trim()}\r
3339
- >\r
3340
- <div className={\`\${P}-item-image-wrapper\`} style={{ width: scalingValue(size ?? 0, isEditor), height: scalingValue(size ?? 0, isEditor) }}>\r
3341
- {(item.image?.length ?? 0) === 0\r
3342
- ? null\r
3343
- : slider === 'Off'\r
3344
- ?\r
3345
- <img\r
3346
- src={item.image[0].url}\r
3347
- alt={item.image[0].name}\r
3348
- className={\`\${P}-item-image\`.trim()}\r
3349
- style={imageStyle}\r
3350
- onClick={(e) => openLightbox(e, item.image.map((i: any) => i.url), 0)}\r
3351
- />\r
3352
- :\r
3353
- <Splide\r
3354
- key={\`\${transition}-\${size}-\${direction}-\${sliderTiming}\`}\r
3355
- className={\`\${P}-item-slider\`}\r
3356
- options={{\r
3357
- arrows: false,\r
3358
- pagination: false,\r
3359
- drag: false,\r
3360
- perPage: 1,\r
3361
- autoplay: true,\r
3362
- interval: sliderTiming * 1000,\r
3363
- width: '100%',\r
3364
- height: '100%',\r
3365
- speed: 500,\r
3366
- type: transition === 'Fade' ? 'fade' : 'loop',\r
3367
- rewind: transition === 'Fade',\r
3368
- pauseOnHover: false,\r
3369
- pauseOnFocus: false,\r
3370
- direction: transition === 'Fade' ? 'ltr' : direction !== 'Random'\r
3371
- ? direction === 'Horizontal'\r
3372
- ? 'ltr'\r
3373
- : 'ttb'\r
3374
- : dir,\r
3375
- }}\r
3376
- onMoved={(splide) => {\r
3377
- if (direction !== 'Random' || transition === 'Fade') return;\r
3378
- const next = Math.random() > 0.5 ? Math.random() > 0.5 ? 'rtl' : 'ltr' : Math.random() > 0.5 ? 'btt' : 'ttb';\r
3379
- setDir(next);\r
3380
- \r
3381
- setTimeout(() => {\r
3382
- splide.refresh();\r
3383
- }, 0);\r
3384
- }}\r
3385
- >\r
3386
- {item.image.map((img: { url: string; name?: string }, imgIndex: number) => (\r
3387
- <SplideSlide key={imgIndex}>\r
3388
- <img\r
3389
- src={img.url}\r
3390
- alt={img.name}\r
3391
- className={\`\${P}-item-image\`.trim()}\r
3392
- style={imageStyle}\r
3393
- onClick={(e) => openLightbox(e, item.image.map((i: any) => i.url), imgIndex)}\r
3394
- />\r
3395
- </SplideSlide>\r
3396
- ))}\r
3397
- </Splide>\r
3398
- }\r
3399
- </div>\r
3400
- <div\r
3401
- data-controls="titleMarginTop"\r
3402
- className={\`\${P}-control\`}\r
3403
- style={{ height: scalingValue(titleMarginTop ?? 0, isEditor) }}\r
3404
- />\r
3405
- <p className={\`\${P}-item-title\`.trim()} style={{ width: \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`, ...titleFieldCss }}>\r
3406
- {item.title}\r
3407
- </p>\r
3408
- {type === 'B' && <div\r
3409
- data-controls="subtitleMarginTop"\r
3410
- className={\`\${P}-control\`}\r
3411
- style={{ height: scalingValue(subtitleMarginTop ?? 0, isEditor) }}\r
3412
- />}\r
3413
- {type === 'B' && <p className={\`\${P}-item-subtitle\`.trim()} style={{ width: \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`, ...subtitleFieldCss }}>\r
3414
- {item.subtitle}\r
3415
- </p>}\r
3416
- </div>\r
3417
- ))}\r
3418
- </div>\r
3419
- </div>\r
3420
- {lightboxOpen && typeof document && document.getElementById("grid-component-lightbox-portal") && lightbox === 'On' &&\r
3421
- createPortal(\r
3422
- <div data-selection="none">\r
3423
- <Lightbox\r
3424
- images={lightboxImages}\r
3425
- index={lightboxIndex}\r
3426
- imageDisplay={imageDisplay.display}\r
3427
- originRect={lightboxOriginRect}\r
3428
- reverseClose={slider === 'Off'}\r
3429
- onClose={() => setLightboxOpen(false)}\r
3430
- onPrev={() => setLightboxIndex((prev) => (prev - 1 + lightboxImages.length) % lightboxImages.length)}\r
3431
- onNext={() => setLightboxIndex((prev) => (prev + 1) % lightboxImages.length)}\r
3432
- />\r
3433
- </div>,\r
3434
- document.body\r
3435
- )}\r
3436
- </>\r
3437
- );\r
3438
- }\r
3439
- \r
3440
- type GridLayoutConfig = {\r
3441
- entryWidth: number;\r
3442
- horizontalGap: number;\r
3443
- wrapperWidth: number;\r
3444
- columnsCount: number;\r
3445
- lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;\r
3446
- };\r
3447
- \r
3448
- type GridSettings = {\r
3449
- type: 'A' | 'B';\r
3450
- gridLayout: GridLayoutConfig;\r
3451
- textBoxWidth: number;\r
3452
- verticalGap: number;\r
3453
- entriesCount: number;\r
3454
- lightbox: 'On' | 'Off';\r
3455
- imageDisplay: {\r
3456
- display: 'Fit' | 'Cover';\r
3457
- ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';\r
3458
- reversed: boolean;\r
3459
- };\r
3460
- slider: 'On' | 'Off';\r
3461
- sliderTiming: number;\r
3462
- direction: 'Horizontal' | 'Vertical' | 'Random',\r
3463
- transition: 'Fade' | 'Slide',\r
3464
- titleMarginTop: number;\r
3465
- subtitleMarginTop: number;\r
3466
- titleColor: string;\r
3467
- subtitleColor: string;\r
3468
- titleFontFamily: string;\r
3469
- titleFontSettings?: { fontWeight: number; fontStyle: string };\r
3470
- titleFontSize?: number;\r
3471
- titleLineHeight?: number;\r
3472
- titleLetterSpacing?: number;\r
3473
- titleWordSpacing?: number;\r
3474
- titleTextAppearance?: TextStyles['textAppearance'];\r
3475
- subtitleFontFamily: string;\r
3476
- subtitleFontSettings?: { fontWeight: number; fontStyle: string };\r
3477
- subtitleFontSize?: number;\r
3478
- subtitleLineHeight?: number;\r
3479
- subtitleLetterSpacing?: number;\r
3480
- subtitleWordSpacing?: number;\r
3481
- subtitleTextAppearance?: TextStyles['textAppearance'];\r
3482
- };\r
3483
- \r
3484
- type ColorKeys =\r
3485
- | 'titleColor'\r
3486
- | 'subtitleColor'\r
3487
- \r
3488
- const COLOR_VAR_MAP: Record<ColorKeys, string> = {\r
3489
- titleColor: 'title-color',\r
3490
- subtitleColor: 'subtitle-color',\r
3491
- };\r
3492
- \r
3493
- const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
3494
- `,Fr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ul=["titleColor","subtitleColor"],dl={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"]}},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"}]},{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"}]},{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"}]}]}},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:{entryWidth:{type:"number",title:"E"},horizontalGap:{type:"number",title:"G"},wrapperWidth:{type:"number",title:"W"},columnsCount:{type:"number",title:"C",min:1,max:4}}}},textBoxWidth:{type:"number",scope:"layout",title:"Textbox 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 (S)",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:{...Fr.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:{...Fr.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","gridLayout",{type:"group",title:"",items:[{type:"row",title:"",items:[{type:"row",title:"",items:["textBoxWidth"]},{type:"row",title:"",items:["verticalGap"]}]},{type:"row",title:"",items:[{type:"row",title:"",items:["entriesCount"]},{type:"row",title:"",items:["lightbox"]}]}]},{type:"group",title:"Image",items:[{type:"row",title:"",items:[{type:"row",title:"",items:["imageDisplay"]}]}]},{type:"group",title:"Slider",items:[{type:"row",title:"",items:[{type:"row",title:"",items:["slider"]},{type:"row",title:"",items:["sliderTiming"]}]},{type:"row",title:"",items:[{type:"row",title:"",items:["direction"]},{type:"row",title:"",items:["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:[...ul],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},ml={element:sl,id:"grid",name:"Neptune",category:"grids",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:dl,sourceCode:pl},gl=[Fa,Oa,_s,Ms,Gs,Ks,nl,ml];exports.components=gl;exports.isSchemaV1=Co;
2891
+ `}const Qe=500,ct="cubic-bezier(0.22, 1, 0.36, 1)";function al({images:e,index:t,imageDisplay:n,originRect:r,reverseClose:o,onClose:s,onPrev:i,onNext:p}){const c=b.useRef(null),d=b.useRef(null),[l,L]=b.useState(null),[y,g]=b.useState(r?"opening":"open"),[u,f]=b.useState(!0),x=b.useRef(t),h=b.useCallback(()=>{const m=c.current,C=d.current;if(!m||!C)return;const E=m.getBoundingClientRect(),N=E.width,I=E.height,W=C.naturalWidth,O=C.naturalHeight;if(!N||!I||!W||!O)return;if(n==="Cover"){L({width:N,height:I,left:E.left,top:E.top});return}const z=W/O,U=N/I;if(z>U){const v=N/z;L({width:N,height:v,left:E.left,top:E.top+(I-v)/2})}else{const v=I*z;L({width:v,height:I,left:E.left+(N-v)/2,top:E.top})}},[n]);b.useEffect(()=>{h();const m=c.current;if(!m)return;const C=new ResizeObserver(()=>h());return C.observe(m),()=>C.disconnect()},[h,t]),b.useEffect(()=>{if(y!=="opening"||!l)return;const m={id:0};return m.id=requestAnimationFrame(()=>{m.id=requestAnimationFrame(()=>g("open"))}),()=>cancelAnimationFrame(m.id)},[y,l]),b.useEffect(()=>{if(y!=="closing")return;const m=setTimeout(()=>s(),Qe);return()=>clearTimeout(m)},[y,s]),b.useEffect(()=>{x.current!==t&&f(!1),x.current=t},[t]);const S=()=>{y!=="closing"&&g("closing")},_=y==="open",V=y==="closing",R=V&&o&&!!r,T=y==="opening"?r??l:R?r:l;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:S,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:_?1:0,transition:`opacity ${Qe}ms ${ct}`,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:c,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:_?1:0,transition:`opacity ${Qe}ms ${ct}`,fontFamily:rl()},children:e.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:t+1}),a.jsx("p",{children:"/"}),a.jsx("p",{children:e.length})]})})]}),T&&a.jsx("img",{ref:d,src:e[t],onLoad:h,style:{position:"fixed",top:T.top,left:T.left,width:T.width,height:T.height,objectFit:n==="Cover"?"cover":"contain",opacity:V&&!R?0:1,transition:V&&!R?`opacity ${Qe}ms ${ct}`:R||u?`top ${Qe}ms ${ct}, left ${Qe}ms ${ct}, width ${Qe}ms ${ct}, height ${Qe}ms ${ct}`:"none",pointerEvents:"none",zIndex:9998}}),_&&l&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:l.top,left:l.left,width:l.width/2,height:l.height,cursor:"w-resize",zIndex:9999},onClick:m=>{m.stopPropagation(),i()}}),a.jsx("div",{style:{position:"fixed",top:l.top,left:l.left+l.width/2,width:l.width/2,height:l.height,cursor:"e-resize",zIndex:9999},onClick:m=>{m.stopPropagation(),p()}})]})]})}function sl({settings:e,content:t,isEditor:n,isPreviewMode:r,metadata:o,activeEvent:s}){const{prefix:i}=$.useScopedStyles(),{type:p="A",gridLayout:c,textBoxWidth:d,verticalGap:l,entriesCount:L,lightbox:y,imageDisplay:g,slider:u,sliderTiming:f,direction:x,transition:h,titleMarginTop:S,subtitleMarginTop:_,titleColor:V,subtitleColor:R,titleFontFamily:T,titleFontSettings:m,titleFontSize:C,titleLineHeight:E,titleLetterSpacing:N,titleWordSpacing:I,titleTextAppearance:W,subtitleFontFamily:O,subtitleFontSettings:z,subtitleFontSize:U,subtitleLineHeight:v,subtitleLetterSpacing:P,subtitleWordSpacing:F,subtitleTextAppearance:k}=e,A={fontSettings:{fontFamily:T,fontWeight:(m==null?void 0:m.fontWeight)??400,fontStyle:(m==null?void 0:m.fontStyle)??"normal"},fontSize:C??.01,lineHeight:E,letterSpacing:N??0,wordSpacing:I??0,textAppearance:W,color:V},Z={...tt(ke(A,n))},se={fontSettings:{fontFamily:O,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:U??.01,lineHeight:v,letterSpacing:P??0,wordSpacing:F??0,textAppearance:k,color:R},pe={...tt(ke(se,n))},M=$.buildColorVars(i,{titleColor:V,subtitleColor:R},ll,cl),fe=`${s&&s!=="default"?`${i}-state-${s}`:""}`.trim(),me=L===0?1/0:L,ge=(t??[]).slice(0,me),D=c.entryWidth??.2,de=(g==null?void 0:g.display)==="Cover",j=(g==null?void 0:g.ratioValue)??"1:1",w=(g==null?void 0:g.reversed)??!1,[G,K]=j.split(":").map(Number),J=w?K:G,ie=w?G:K,oe=`${J} / ${ie}`,te=J>=ie,ce={objectFit:de?"cover":"contain",...de&&{aspectRatio:oe,width:te?"100%":"auto",height:te?"auto":"100%"}},[B,Y]=b.useState("ltr"),[X,ae]=b.useState(!1),[ee,ue]=b.useState([]),[we,$e]=b.useState(0),[Je,Ne]=b.useState(null),xe=(he,Pe,Se)=>{if(y==="Off")return;const _e=he.currentTarget.getBoundingClientRect();Ne({top:_e.top,left:_e.left,width:_e.width,height:_e.height}),ue(Pe),$e(Se),ae(!0)};return b.useEffect(()=>{if(!X||y!=="On"||typeof document>"u")return;const he=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=he}},[X,y]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:il(i)}}),a.jsx("div",{style:M,children:a.jsx("div",{className:`${i}-wrapper ${i}-type-${p} ${fe}`.trim(),style:{gridTemplateColumns:`repeat(${c.columnsCount}, minmax(0, 1fr))`,rowGap:$.scalingValue(l??0,n),columnGap:$.scalingValue(c.horizontalGap??0,n),width:$.scalingValue(c.wrapperWidth??0,n)},children:ge.map((he,Pe)=>{var Se,_e;return a.jsx("div",{className:`${i}-item`.trim(),children:a.jsx("div",{className:r?`${i}-item-inner`:`${i}-item-inner-hidden`,style:{width:`calc(${$.scalingValue(D??0,n)} * (${d} / 100))`},children:a.jsxs("a",{href:(((Se=he.link)==null?void 0:Se.length)??0)>0&&y==="Off"?he.link:void 0,target:"_blank",className:`${i}-item-image-link`,children:[a.jsx("div",{className:`${i}-item-image-wrapper`,style:{width:$.scalingValue(D??0,n),height:$.scalingValue(D??0,n)},children:(((_e=he.image)==null?void 0:_e.length)??0)===0?null:u==="Off"?a.jsx("img",{src:he.image[0].url,alt:he.image[0].name,className:`${i}-item-image`.trim(),style:ce,onClick:Be=>xe(Be,he.image.map(Ae=>Ae.url),0)}):a.jsx(or,{className:`${i}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:f*1e3,width:"100%",height:"100%",speed:500,type:h==="Fade"?"fade":"loop",rewind:h==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:h==="Fade"?"ltr":x!=="Random"?x==="Horizontal"?"ltr":"ttb":B},onMoved:Be=>{if(x!=="Random"||h==="Fade")return;const Ae=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";Y(Ae),setTimeout(()=>{Be.refresh()},0)},children:he.image.map((Be,Ae)=>a.jsx(ir,{children:a.jsx("img",{src:Be.url,alt:Be.name,className:`${i}-item-image`.trim(),style:ce,onClick:Sn=>xe(Sn,he.image.map(gt=>gt.url),Ae)})},Ae))},`${h}-${D}-${x}-${f}`)}),a.jsx("div",{"data-controls":"titleMarginTop",className:`${i}-control`,style:{height:$.scalingValue(S??0,n),width:$.scalingValue(D*d/100,n)}}),a.jsx("p",{className:`${i}-item-title`.trim(),style:{width:`calc(${$.scalingValue(D??0,n)} * (${d} / 100))`,...Z},children:he.title}),p==="B"&&a.jsx("div",{"data-controls":"subtitleMarginTop",className:`${i}-control`,style:{height:$.scalingValue(_??0,n),width:$.scalingValue(D*d/100,n)}}),p==="B"&&a.jsx("p",{className:`${i}-item-subtitle`.trim(),style:{width:`calc(${$.scalingValue(D??0,n)} * (${d} / 100))`,...pe},children:he.subtitle})]})})},Pe)})})}),X&&typeof document&&document.getElementById("grid-component-lightbox-portal")&&y==="On"&&Rr.createPortal(a.jsx("div",{"data-selection":"none",children:a.jsx(al,{images:ee,index:we,imageDisplay:g.display,originRect:Je,reverseClose:u==="Off",onClose:()=>ae(!1),onPrev:()=>$e(he=>(he-1+ee.length)%ee.length),onNext:()=>$e(he=>(he+1)%ee.length)})}),document.body)]})}const ll={titleColor:"title-color",subtitleColor:"subtitle-color"},cl=["hover","focus","filled","success","error"],pl=`import { Splide, SplideSlide } from '@splidejs/react-splide';
2892
+ import '@splidejs/react-splide/css/core';
2893
+ import { CommonComponentProps } from '../props';
2894
+ import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
2895
+ import { useCallback, useEffect, useRef, useState } from 'react';
2896
+ import { createPortal } from 'react-dom';
2897
+ import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
2898
+ import { getFontBasedOnSystem } from '../utils/getMainFontBaseOnSystem';
2899
+
2900
+ function sv(px: number): string {
2901
+ return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
2902
+ }
2903
+
2904
+ function getCSS(P: string): string {
2905
+ return \`
2906
+ .\${P}-wrapper {
2907
+ display: grid;
2908
+ align-items: start;
2909
+ min-height: \${sv(48)};
2910
+ }
2911
+ .\${P}-item {
2912
+ display: flex;
2913
+ flex-direction: column;
2914
+ justify-content: center;
2915
+ align-items: center;
2916
+ }
2917
+ .\${P}-item-inner {
2918
+ display: flex;
2919
+ flex-direction: column;
2920
+ align-items: center;
2921
+ outline: 1px solid #ccc;
2922
+ }
2923
+ .\${P}-item-inner-hidden {
2924
+ display: flex;
2925
+ flex-direction: column;
2926
+ align-items: center;
2927
+ }
2928
+ .\${P}-item-image-wrapper {
2929
+ display: flex;
2930
+ justify-content: center;
2931
+ align-items: center;
2932
+ }
2933
+ .\${P}-item-image-link {
2934
+ width: 100%;
2935
+ height: 100%;
2936
+ display: block;
2937
+ }
2938
+ .\${P}-item-image {
2939
+ width: 100%;
2940
+ height: 100%;
2941
+ display: block;
2942
+ }
2943
+ .\${P}-item-slider,
2944
+ .\${P}-item-slider .splide__track,
2945
+ .\${P}-item-slider .splide__list,
2946
+ .\${P}-item-slider .splide__slide {
2947
+ width: 100%;
2948
+ height: 100%;
2949
+ }
2950
+ .\${P}-item-slider .splide__slide {
2951
+ display: flex;
2952
+ justify-content: center;
2953
+ align-items: center;
2954
+ }
2955
+ .\${P}-item-title {
2956
+ white-space: normal;
2957
+ overflow-wrap: anywhere;
2958
+ word-break: break-word;
2959
+ text-align: center;
2960
+ margin-bottom: 0px;
2961
+ margin-top: 0px;
2962
+ color: var(--\${P}-title-color);
2963
+ }
2964
+ .\${P}-item-subtitle {
2965
+ white-space: normal;
2966
+ overflow-wrap: anywhere;
2967
+ word-break: break-word;
2968
+ text-align: center;
2969
+ margin-bottom: 0px;
2970
+ margin-top: 0px;
2971
+ color: var(--\${P}-subtitle-color);
2972
+ }
2973
+
2974
+ .\${P}-control {
2975
+ position: relative;
2976
+ z-index: 2;
2977
+ width: 100%;
2978
+ }
2979
+
2980
+ .\${P}-control::before {
2981
+ content: "";
2982
+ position: absolute;
2983
+ top: 0;
2984
+ left: 0;
2985
+ width: 100%;
2986
+ height: 100%;
2987
+ min-height: 20px;
2988
+ pointer-events: auto;
2989
+ z-index: 10;
2990
+ }
2991
+ \`;
2992
+ }
2993
+
2994
+ type GridProps = {
2995
+ settings: GridSettings;
2996
+ content?: any;
2997
+ isEditor?: boolean;
2998
+ isPreviewMode?: boolean;
2999
+ activeEvent: string | undefined;
3000
+ onUpdateSettings?: (settings: GridSettings) => void;
3001
+ } & CommonComponentProps;
3002
+
3003
+ type AnimRect = { top: number; left: number; width: number; height: number };
3004
+
3005
+ type LightboxProps = {
3006
+ images: string[];
3007
+ index: number;
3008
+ imageDisplay: 'Fit' | 'Cover';
3009
+ originRect: AnimRect | null;
3010
+ reverseClose: boolean;
3011
+ onClose: () => void;
3012
+ onPrev: () => void;
3013
+ onNext: () => void;
3014
+ };
3015
+
3016
+ const LIGHTBOX_ANIM_MS = 500;
3017
+ const LIGHTBOX_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';
3018
+
3019
+ function Lightbox({ images, index, imageDisplay, originRect, reverseClose, onClose, onPrev, onNext }: LightboxProps) {
3020
+ const ghostRef = useRef<HTMLDivElement>(null);
3021
+ const imgRef = useRef<HTMLImageElement>(null);
3022
+ const [finalRect, setFinalRect] = useState<AnimRect | null>(null);
3023
+ const [phase, setPhase] = useState<'opening' | 'open' | 'closing'>(originRect ? 'opening' : 'open');
3024
+ const [transitionsEnabled, setTransitionsEnabled] = useState(true);
3025
+ const prevIndexRef = useRef(index);
3026
+
3027
+ const computeFinalRect = useCallback(() => {
3028
+ const ghost = ghostRef.current;
3029
+ const img = imgRef.current;
3030
+ if (!ghost || !img) return;
3031
+ const cb = ghost.getBoundingClientRect();
3032
+ const cw = cb.width;
3033
+ const ch = cb.height;
3034
+ const nw = img.naturalWidth;
3035
+ const nh = img.naturalHeight;
3036
+ if (!cw || !ch || !nw || !nh) return;
3037
+ if (imageDisplay === 'Cover') {
3038
+ setFinalRect({ width: cw, height: ch, left: cb.left, top: cb.top });
3039
+ return;
3040
+ }
3041
+ const ir = nw / nh;
3042
+ const cr = cw / ch;
3043
+ if (ir > cr) {
3044
+ const dh = cw / ir;
3045
+ setFinalRect({ width: cw, height: dh, left: cb.left, top: cb.top + (ch - dh) / 2 });
3046
+ } else {
3047
+ const dw = ch * ir;
3048
+ setFinalRect({ width: dw, height: ch, left: cb.left + (cw - dw) / 2, top: cb.top });
3049
+ }
3050
+ }, [imageDisplay]);
3051
+
3052
+ useEffect(() => {
3053
+ computeFinalRect();
3054
+ const c = ghostRef.current;
3055
+ if (!c) return;
3056
+ const ro = new ResizeObserver(() => computeFinalRect());
3057
+ ro.observe(c);
3058
+ return () => ro.disconnect();
3059
+ }, [computeFinalRect, index]);
3060
+
3061
+ useEffect(() => {
3062
+ if (phase !== 'opening' || !finalRect) return;
3063
+ const handle = { id: 0 };
3064
+ handle.id = requestAnimationFrame(() => {
3065
+ handle.id = requestAnimationFrame(() => setPhase('open'));
3066
+ });
3067
+ return () => cancelAnimationFrame(handle.id);
3068
+ }, [phase, finalRect]);
3069
+
3070
+ useEffect(() => {
3071
+ if (phase !== 'closing') return;
3072
+ const t = setTimeout(() => onClose(), LIGHTBOX_ANIM_MS);
3073
+ return () => clearTimeout(t);
3074
+ }, [phase, onClose]);
3075
+
3076
+ useEffect(() => {
3077
+ if (prevIndexRef.current !== index) {
3078
+ setTransitionsEnabled(false);
3079
+ }
3080
+ prevIndexRef.current = index;
3081
+ }, [index]);
3082
+
3083
+ const handleClose = () => {
3084
+ if (phase === 'closing') return;
3085
+ setPhase('closing');
3086
+ };
3087
+
3088
+ const isOpen = phase === 'open';
3089
+ const isClosing = phase === 'closing';
3090
+ const reverseAnimateClose = isClosing && reverseClose && !!originRect;
3091
+ const animatedRect = phase === 'opening'
3092
+ ? (originRect ?? finalRect)
3093
+ : reverseAnimateClose
3094
+ ? originRect
3095
+ : finalRect;
3096
+
3097
+ return (
3098
+ <div
3099
+ style={{
3100
+ position: 'fixed',
3101
+ top: 0,
3102
+ left: 0,
3103
+ width: '100vw',
3104
+ height: '100vh',
3105
+ zIndex: 9997,
3106
+ }}
3107
+ onClick={handleClose}
3108
+ >
3109
+ <div
3110
+ style={{
3111
+ position: 'absolute',
3112
+ inset: 0,
3113
+ background: 'rgba(28,31,34,0.9)',
3114
+ opacity: isOpen ? 1 : 0,
3115
+ transition: \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`,
3116
+ pointerEvents: 'none',
3117
+ }}
3118
+ />
3119
+ <div
3120
+ style={{
3121
+ position: 'relative',
3122
+ width: '100%',
3123
+ height: '100%',
3124
+ display: 'flex',
3125
+ flexDirection: 'column',
3126
+ alignItems: 'center',
3127
+ justifyContent: 'center',
3128
+ }}
3129
+ >
3130
+ <div style={{ height: '10%' }}></div>
3131
+ <div
3132
+ style={{
3133
+ width: '70%',
3134
+ height: '80%',
3135
+ display: 'flex',
3136
+ justifyContent: 'center',
3137
+ alignItems: 'center'
3138
+ }}>
3139
+ <div ref={ghostRef} style={{ width: '100%', height: '100%' }} />
3140
+ </div>
3141
+ <div
3142
+ style={{
3143
+ display: 'flex',
3144
+ flexDirection: 'row',
3145
+ justifyContent: 'center',
3146
+ alignItems: 'center',
3147
+ height: '10%',
3148
+ color: '#E6E6E6',
3149
+ letterSpacing: '-0.6px',
3150
+ lineHeight: '16px',
3151
+ opacity: isOpen ? 1 : 0,
3152
+ transition: \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`,
3153
+ fontFamily: getFontBasedOnSystem(),
3154
+ }}
3155
+ >
3156
+ {images.length > 1 &&
3157
+ <>
3158
+ <p>{index + 1}</p>
3159
+ <p>/</p>
3160
+ <p>{images.length}</p>
3161
+ </>
3162
+ }
3163
+ </div>
3164
+ </div>
3165
+
3166
+ {animatedRect && (
3167
+ <img
3168
+ ref={imgRef}
3169
+ src={images[index]}
3170
+ onLoad={computeFinalRect}
3171
+ style={{
3172
+ position: 'fixed',
3173
+ top: animatedRect.top,
3174
+ left: animatedRect.left,
3175
+ width: animatedRect.width,
3176
+ height: animatedRect.height,
3177
+ objectFit: imageDisplay === 'Cover' ? 'cover' : 'contain',
3178
+ opacity: isClosing && !reverseAnimateClose ? 0 : 1,
3179
+ transition: isClosing && !reverseAnimateClose
3180
+ ? \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
3181
+ : (reverseAnimateClose || transitionsEnabled)
3182
+ ? \`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}\`
3183
+ : 'none',
3184
+ pointerEvents: 'none',
3185
+ zIndex: 9998,
3186
+ }}
3187
+ />
3188
+ )}
3189
+
3190
+ {isOpen && finalRect && (
3191
+ <>
3192
+ <div
3193
+ style={{
3194
+ position: 'fixed',
3195
+ top: finalRect.top,
3196
+ left: finalRect.left,
3197
+ width: finalRect.width / 2,
3198
+ height: finalRect.height,
3199
+ cursor: 'w-resize',
3200
+ zIndex: 9999,
3201
+ }}
3202
+ onClick={(e) => {
3203
+ e.stopPropagation();
3204
+ onPrev();
3205
+ }}
3206
+ />
3207
+ <div
3208
+ style={{
3209
+ position: 'fixed',
3210
+ top: finalRect.top,
3211
+ left: finalRect.left + finalRect.width / 2,
3212
+ width: finalRect.width / 2,
3213
+ height: finalRect.height,
3214
+ cursor: 'e-resize',
3215
+ zIndex: 9999,
3216
+ }}
3217
+ onClick={(e) => {
3218
+ e.stopPropagation();
3219
+ onNext();
3220
+ }}
3221
+ />
3222
+ </>
3223
+ )}
3224
+ </div>
3225
+ );
3226
+ }
3227
+
3228
+ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, activeEvent }: GridProps) {
3229
+ const { prefix: P } = useScopedStyles();
3230
+ const {
3231
+ type = 'A',
3232
+ gridLayout,
3233
+ textBoxWidth,
3234
+ verticalGap,
3235
+ entriesCount,
3236
+ lightbox,
3237
+ imageDisplay,
3238
+ slider,
3239
+ sliderTiming,
3240
+ direction,
3241
+ transition,
3242
+ titleMarginTop,
3243
+ subtitleMarginTop,
3244
+ titleColor,
3245
+ subtitleColor,
3246
+ titleFontFamily,
3247
+ titleFontSettings,
3248
+ titleFontSize,
3249
+ titleLineHeight,
3250
+ titleLetterSpacing,
3251
+ titleWordSpacing,
3252
+ titleTextAppearance,
3253
+ subtitleFontFamily,
3254
+ subtitleFontSettings,
3255
+ subtitleFontSize,
3256
+ subtitleLineHeight,
3257
+ subtitleLetterSpacing,
3258
+ subtitleWordSpacing,
3259
+ subtitleTextAppearance,
3260
+ } = settings;
3261
+
3262
+ const resolvedTitleTextStyle: TextStyles = {
3263
+ fontSettings: {
3264
+ fontFamily: titleFontFamily,
3265
+ fontWeight: titleFontSettings?.fontWeight ?? 400,
3266
+ fontStyle: titleFontSettings?.fontStyle ?? 'normal',
3267
+ },
3268
+ fontSize: titleFontSize ?? 0.01,
3269
+ lineHeight: titleLineHeight,
3270
+ letterSpacing: titleLetterSpacing ?? 0,
3271
+ wordSpacing: titleWordSpacing ?? 0,
3272
+ textAppearance: titleTextAppearance,
3273
+ color: titleColor,
3274
+ };
3275
+ const titleTypographyCss = omitTextColors(textStylesToCss(resolvedTitleTextStyle, isEditor));
3276
+ const titleFieldCss = {
3277
+ ...titleTypographyCss,
3278
+ } as React.CSSProperties;
3279
+
3280
+ const resolvedSubtitleTextStyle: TextStyles = {
3281
+ fontSettings: {
3282
+ fontFamily: subtitleFontFamily,
3283
+ fontWeight: subtitleFontSettings?.fontWeight ?? 400,
3284
+ fontStyle: subtitleFontSettings?.fontStyle ?? 'normal',
3285
+ },
3286
+ fontSize: subtitleFontSize ?? 0.01,
3287
+ lineHeight: subtitleLineHeight,
3288
+ letterSpacing: subtitleLetterSpacing ?? 0,
3289
+ wordSpacing: subtitleWordSpacing ?? 0,
3290
+ textAppearance: subtitleTextAppearance,
3291
+ color: subtitleColor,
3292
+ };
3293
+ const subtitleTypographyCss = omitTextColors(textStylesToCss(resolvedSubtitleTextStyle, isEditor));
3294
+ const subtitleFieldCss = {
3295
+ ...subtitleTypographyCss,
3296
+ } as React.CSSProperties;
3297
+
3298
+ const colorVars = buildColorVars(P, {
3299
+ titleColor,
3300
+ subtitleColor,
3301
+ }, COLOR_VAR_MAP, STATE_KEYS);
3302
+
3303
+ const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
3304
+ const wrapperStateClasses = \`\${stateClass}\`.trim();
3305
+
3306
+ const resEntriesCount = entriesCount === 0 ? Infinity : entriesCount;
3307
+
3308
+ const cropContent = (content ?? []).slice(0, resEntriesCount);
3309
+
3310
+ const size = gridLayout.entryWidth ?? 0.2;
3311
+
3312
+ const isCover = imageDisplay?.display === 'Cover';
3313
+ const ratioValue = imageDisplay?.ratioValue ?? '1:1';
3314
+ const ratioReversed = imageDisplay?.reversed ?? false;
3315
+ const [rW, rH] = ratioValue.split(':').map(Number);
3316
+ const effW = ratioReversed ? rH : rW;
3317
+ const effH = ratioReversed ? rW : rH;
3318
+ const aspectRatio = \`\${effW} / \${effH}\`;
3319
+ const isLandscape = effW >= effH;
3320
+
3321
+ const imageStyle: React.CSSProperties = {
3322
+ objectFit: isCover ? 'cover' : 'contain',
3323
+ ...(isCover && {
3324
+ aspectRatio,
3325
+ width: isLandscape ? '100%' : 'auto',
3326
+ height: isLandscape ? 'auto' : '100%',
3327
+ }),
3328
+ };
3329
+
3330
+ const [dir, setDir] = useState('ltr');
3331
+
3332
+ const [lightboxOpen, setLightboxOpen] = useState(false);
3333
+ const [lightboxImages, setLightboxImages] = useState<string[]>([]);
3334
+ const [lightboxIndex, setLightboxIndex] = useState(0);
3335
+ const [lightboxOriginRect, setLightboxOriginRect] = useState<AnimRect | null>(null);
3336
+
3337
+ const openLightbox = (e: React.MouseEvent<HTMLImageElement>, urls: string[], idx: number) => {
3338
+ if (lightbox === 'Off') return;
3339
+ const r = e.currentTarget.getBoundingClientRect();
3340
+ setLightboxOriginRect({ top: r.top, left: r.left, width: r.width, height: r.height });
3341
+ setLightboxImages(urls);
3342
+ setLightboxIndex(idx);
3343
+ setLightboxOpen(true);
3344
+ };
3345
+
3346
+ useEffect(() => {
3347
+ if (!lightboxOpen || lightbox !== 'On') return;
3348
+ if (typeof document === 'undefined') return;
3349
+ const prevOverflow = document.body.style.overflow;
3350
+ document.body.style.overflow = 'hidden';
3351
+ return () => {
3352
+ document.body.style.overflow = prevOverflow;
3353
+ };
3354
+ }, [lightboxOpen, lightbox]);
3355
+
3356
+ return (
3357
+ <>
3358
+ <style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
3359
+ <div style={colorVars}>
3360
+ <div
3361
+ className={\`\${P}-wrapper \${P}-type-\${type} \${wrapperStateClasses}\`.trim()}
3362
+ style={{
3363
+ gridTemplateColumns: \`repeat(\${gridLayout.columnsCount}, minmax(0, 1fr))\`,
3364
+ rowGap: scalingValue(verticalGap ?? 0, isEditor),
3365
+ columnGap: scalingValue(gridLayout.horizontalGap ?? 0, isEditor),
3366
+ width: scalingValue(gridLayout.wrapperWidth ?? 0, isEditor)
3367
+ }}>
3368
+ {cropContent.map((item, index) => (
3369
+ <div
3370
+ key={index}
3371
+ className={\`\${P}-item\`.trim()}
3372
+ >
3373
+ <div
3374
+ className={isPreviewMode ? \`\${P}-item-inner\` : \`\${P}-item-inner-hidden\`}
3375
+ style={{ width: \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\` }}
3376
+ >
3377
+ <a href={(item.link?.length ?? 0) > 0 && lightbox === 'Off' ? item.link : undefined} target='_blank' className={\`\${P}-item-image-link\`}>
3378
+ <div className={\`\${P}-item-image-wrapper\`} style={{ width: scalingValue(size ?? 0, isEditor), height: scalingValue(size ?? 0, isEditor) }}>
3379
+ {(item.image?.length ?? 0) === 0
3380
+ ? null
3381
+ : slider === 'Off'
3382
+ ?
3383
+ <img
3384
+ src={item.image[0].url}
3385
+ alt={item.image[0].name}
3386
+ className={\`\${P}-item-image\`.trim()}
3387
+ style={imageStyle}
3388
+ onClick={(e) => openLightbox(e, item.image.map((i: any) => i.url), 0)}
3389
+ />
3390
+ :
3391
+ <Splide
3392
+ key={\`\${transition}-\${size}-\${direction}-\${sliderTiming}\`}
3393
+ className={\`\${P}-item-slider\`}
3394
+ options={{
3395
+ arrows: false,
3396
+ pagination: false,
3397
+ drag: false,
3398
+ perPage: 1,
3399
+ autoplay: true,
3400
+ interval: sliderTiming * 1000,
3401
+ width: '100%',
3402
+ height: '100%',
3403
+ speed: 500,
3404
+ type: transition === 'Fade' ? 'fade' : 'loop',
3405
+ rewind: transition === 'Fade',
3406
+ pauseOnHover: false,
3407
+ pauseOnFocus: false,
3408
+ direction: transition === 'Fade' ? 'ltr' : direction !== 'Random'
3409
+ ? direction === 'Horizontal'
3410
+ ? 'ltr'
3411
+ : 'ttb'
3412
+ : dir,
3413
+ }}
3414
+ onMoved={(splide) => {
3415
+ if (direction !== 'Random' || transition === 'Fade') return;
3416
+ const next = Math.random() > 0.5 ? Math.random() > 0.5 ? 'rtl' : 'ltr' : Math.random() > 0.5 ? 'btt' : 'ttb';
3417
+ setDir(next);
3418
+
3419
+ setTimeout(() => {
3420
+ splide.refresh();
3421
+ }, 0);
3422
+ }}
3423
+ >
3424
+ {item.image.map((img: { url: string; name?: string }, imgIndex: number) => (
3425
+ <SplideSlide key={imgIndex}>
3426
+ <img
3427
+ src={img.url}
3428
+ alt={img.name}
3429
+ className={\`\${P}-item-image\`.trim()}
3430
+ style={imageStyle}
3431
+ onClick={(e) => openLightbox(e, item.image.map((i: any) => i.url), imgIndex)}
3432
+ />
3433
+ </SplideSlide>
3434
+ ))}
3435
+ </Splide>
3436
+ }
3437
+ </div>
3438
+ <div
3439
+ data-controls="titleMarginTop"
3440
+ className={\`\${P}-control\`}
3441
+ style={{ height: scalingValue(titleMarginTop ?? 0, isEditor), width: scalingValue(size * textBoxWidth / 100, isEditor) }}
3442
+ />
3443
+ <p className={\`\${P}-item-title\`.trim()} style={{ width: \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`, ...titleFieldCss }}>
3444
+ {item.title}
3445
+ </p>
3446
+ {type === 'B' && <div
3447
+ data-controls="subtitleMarginTop"
3448
+ className={\`\${P}-control\`}
3449
+ style={{ height: scalingValue(subtitleMarginTop ?? 0, isEditor), width: scalingValue(size * textBoxWidth / 100, isEditor) }}
3450
+ />}
3451
+ {type === 'B' && <p className={\`\${P}-item-subtitle\`.trim()} style={{ width: \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`, ...subtitleFieldCss }}>
3452
+ {item.subtitle}
3453
+ </p>}
3454
+ </a>
3455
+ </div>
3456
+ </div>
3457
+ ))}
3458
+ </div>
3459
+ </div>
3460
+ {lightboxOpen && typeof document && document.getElementById("grid-component-lightbox-portal") && lightbox === 'On' &&
3461
+ createPortal(
3462
+ <div data-selection="none">
3463
+ <Lightbox
3464
+ images={lightboxImages}
3465
+ index={lightboxIndex}
3466
+ imageDisplay={imageDisplay.display}
3467
+ originRect={lightboxOriginRect}
3468
+ reverseClose={slider === 'Off'}
3469
+ onClose={() => setLightboxOpen(false)}
3470
+ onPrev={() => setLightboxIndex((prev) => (prev - 1 + lightboxImages.length) % lightboxImages.length)}
3471
+ onNext={() => setLightboxIndex((prev) => (prev + 1) % lightboxImages.length)}
3472
+ />
3473
+ </div>,
3474
+ document.body
3475
+ )}
3476
+ </>
3477
+ );
3478
+ }
3479
+
3480
+ type GridLayoutConfig = {
3481
+ entryWidth: number;
3482
+ horizontalGap: number;
3483
+ wrapperWidth: number;
3484
+ columnsCount: number;
3485
+ lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
3486
+ };
3487
+
3488
+ type GridSettings = {
3489
+ type: 'A' | 'B';
3490
+ gridLayout: GridLayoutConfig;
3491
+ textBoxWidth: number;
3492
+ verticalGap: number;
3493
+ entriesCount: number;
3494
+ lightbox: 'On' | 'Off';
3495
+ imageDisplay: {
3496
+ display: 'Fit' | 'Cover';
3497
+ ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
3498
+ reversed: boolean;
3499
+ };
3500
+ slider: 'On' | 'Off';
3501
+ sliderTiming: number;
3502
+ direction: 'Horizontal' | 'Vertical' | 'Random',
3503
+ transition: 'Fade' | 'Slide',
3504
+ titleMarginTop: number;
3505
+ subtitleMarginTop: number;
3506
+ titleColor: string;
3507
+ subtitleColor: string;
3508
+ titleFontFamily: string;
3509
+ titleFontSettings?: { fontWeight: number; fontStyle: string };
3510
+ titleFontSize?: number;
3511
+ titleLineHeight?: number;
3512
+ titleLetterSpacing?: number;
3513
+ titleWordSpacing?: number;
3514
+ titleTextAppearance?: TextStyles['textAppearance'];
3515
+ subtitleFontFamily: string;
3516
+ subtitleFontSettings?: { fontWeight: number; fontStyle: string };
3517
+ subtitleFontSize?: number;
3518
+ subtitleLineHeight?: number;
3519
+ subtitleLetterSpacing?: number;
3520
+ subtitleWordSpacing?: number;
3521
+ subtitleTextAppearance?: TextStyles['textAppearance'];
3522
+ };
3523
+
3524
+ type ColorKeys =
3525
+ | 'titleColor'
3526
+ | 'subtitleColor'
3527
+
3528
+ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
3529
+ titleColor: 'title-color',
3530
+ subtitleColor: 'subtitle-color',
3531
+ };
3532
+
3533
+ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
3534
+ `,kr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ul=["titleColor","subtitleColor"],dl={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:{entryWidth:{type:"number",title:"E"},horizontalGap:{type:"number",title:"G"},wrapperWidth:{type:"number",title:"W"},columnsCount:{type:"number",title:"C",min:1,max:4}}}},textBoxWidth:{type:"number",scope:"layout",title:"Textbox 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 (S)",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:{...kr.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:{...kr.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","gridLayout",{type:"group",title:"",items:[{type:"row",title:"",items:[{type:"row",title:"",items:["textBoxWidth"]},{type:"row",title:"",items:["verticalGap"]}]},{type:"row",title:"",items:[{type:"row",title:"",items:["entriesCount"]},{type:"row",title:"",items:["lightbox"]}]}]},{type:"group",title:"Image",items:[{type:"row",title:"",items:[{type:"row",title:"",items:["imageDisplay"]}]}]},{type:"group",title:"Slider",items:[{type:"row",title:"",items:[{type:"row",title:"",items:["slider"]},{type:"row",title:"",items:["sliderTiming"]}]},{type:"row",title:"",items:[{type:"row",title:"",items:["direction"]},{type:"row",title:"",items:["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:[...ul],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},ml={element:sl,id:"grid",name:"Neptune",category:"grids",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:dl,sourceCode:pl},gl=[Fa,Oa,_s,Ms,Gs,Ks,nl,ml];exports.components=gl;exports.isSchemaV1=Co;