@cntrl-site/components 1.0.12-alpha.0 → 1.0.12-alpha.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 +20 -20
- package/dist/index.mjs +10 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),ve=require("classnames"),T=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Bi=require("react-dom");function Nr(e){return e.type==="object"&&e.version===1}const Or="ControlSlider-module__wrapper___sHEkd",Hr="ControlSlider-module__hoverArrow___A-dOH",Br="ControlSlider-module__sliderItem___QQSkR",Vr="ControlSlider-module__sliderImage___9hRl-",Dr="ControlSlider-module__arrow___05ghY",zr="ControlSlider-module__arrowVertical___tBfVN",jr="ControlSlider-module__nextArrow___-30Yc",Kr="ControlSlider-module__arrowInner___aEra3",Ur="ControlSlider-module__arrowIcon___S4ztF",qr="ControlSlider-module__arrowImg___2dwJW",Gr="ControlSlider-module__mirror___brd6U",Yr="ControlSlider-module__pagination___bicLF",Xr="ControlSlider-module__paginationInner___bT-P-",Zr="ControlSlider-module__paginationVertical___zYqKw",Jr="ControlSlider-module__paginationItem___nTRbk",Qr="ControlSlider-module__dot___p1Qun",ea="ControlSlider-module__activeDot___LHFaj",ta="ControlSlider-module__paginationInsideBottom___R3FWn",na="ControlSlider-module__paginationInsideTop___V-qb-",oa="ControlSlider-module__paginationOutsideBottom___14w8D",ia="ControlSlider-module__paginationOutsideTop___SCLqB",ra="ControlSlider-module__paginationInsideLeft___yOBRZ",aa="ControlSlider-module__paginationInsideRight___Rtt3o",sa="ControlSlider-module__paginationOutsideLeft___lahaw",la="ControlSlider-module__paginationOutsideRight___EtuQa",ca="ControlSlider-module__imgWrapper___UjEgB",da="ControlSlider-module__captionBlock___dJ6-j",ua="ControlSlider-module__captionTextWrapper___HFlpf",pa="ControlSlider-module__captionText___uGBVc",ma="ControlSlider-module__active___WZK4G",ga="ControlSlider-module__withPointerEvents___t-18M",ha="ControlSlider-module__topLeftAlignment___zjnGM",fa="ControlSlider-module__topCenterAlignment___gD1xW",ya="ControlSlider-module__topRightAlignment___NMapS",va="ControlSlider-module__middleLeftAlignment___OnUrY",ba="ControlSlider-module__middleCenterAlignment___Tdkl0",xa="ControlSlider-module__middleRightAlignment___wEbfX",Ca="ControlSlider-module__bottomLeftAlignment___cTP2-",Sa="ControlSlider-module__bottomCenterAlignment___c54fB",wa="ControlSlider-module__bottomRightAlignment___kEwrz",$a="ControlSlider-module__clickOverlay___DZA28",Ta="ControlSlider-module__contain___pLyq7",La="ControlSlider-module__cover___KdDat",ae={wrapper:Or,hoverArrow:Hr,sliderItem:Br,sliderImage:Vr,arrow:Dr,arrowVertical:zr,nextArrow:jr,arrowInner:Kr,arrowIcon:Ur,arrowImg:qr,mirror:Gr,pagination:Yr,paginationInner:Xr,paginationVertical:Zr,paginationItem:Jr,dot:Qr,activeDot:ea,paginationInsideBottom:ta,paginationInsideTop:na,paginationOutsideBottom:oa,paginationOutsideTop:ia,paginationInsideLeft:ra,paginationInsideRight:aa,paginationOutsideLeft:sa,paginationOutsideRight:la,imgWrapper:ca,captionBlock:da,captionTextWrapper:ua,captionText:pa,active:ma,withPointerEvents:ga,topLeftAlignment:ha,topCenterAlignment:fa,topRightAlignment:ya,middleLeftAlignment:va,middleCenterAlignment:ba,middleRightAlignment:xa,bottomLeftAlignment:Ca,bottomCenterAlignment:Sa,bottomRightAlignment:wa,clickOverlay:$a,contain:Ta,cover:La};function Ea(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _a(e,t,n){return t&&Ea(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var li="(prefers-reduced-motion: reduce)",Ut=1,Pa=2,Yt=3,nn=4,Cn=5,On=6,Kn=7,Aa={CREATED:Ut,MOUNTED:Pa,IDLE:Yt,MOVING:nn,SCROLLING:Cn,DRAGGING:On,DESTROYED:Kn};function vt(e){e.length=0}function _t(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ee(e){return e.bind.apply(e,[null].concat(_t(arguments,1)))}var Vi=setTimeout,So=function(){};function ci(e){return requestAnimationFrame(e)}function Xn(e,t){return typeof t===e}function un(e){return!Fo(e)&&Xn("object",e)}var Io=Array.isArray,Di=Ee(Xn,"function"),Tt=Ee(Xn,"string"),Sn=Ee(Xn,"undefined");function Fo(e){return e===null}function zi(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function wn(e){return Io(e)?e:[e]}function tt(e,t){wn(e).forEach(t)}function Ro(e,t){return e.indexOf(t)>-1}function Hn(e,t){return e.push.apply(e,wn(t)),e}function gt(e,t,n){e&&tt(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function ct(e,t){gt(e,Tt(t)?t.split(" "):t,!0)}function $n(e,t){tt(t,e.appendChild.bind(e))}function ko(e,t){tt(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function pn(e,t){return zi(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ji(e,t){var n=e?_t(e.children):[];return t?n.filter(function(o){return pn(o,t)}):n}function Tn(e,t){return t?ji(e,t)[0]:e.firstElementChild}var mn=Object.keys;function Nt(e,t,n){return e&&(n?mn(e).reverse():mn(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function gn(e){return _t(arguments,1).forEach(function(t){Nt(t,function(n,o){e[o]=t[o]})}),e}function wt(e){return _t(arguments,1).forEach(function(t){Nt(t,function(n,o){Io(n)?e[o]=n.slice():un(n)?e[o]=wt({},un(e[o])?e[o]:{},n):e[o]=n})}),e}function di(e,t){tt(t||mn(e),function(n){delete e[n]})}function dt(e,t){tt(e,function(n){tt(t,function(o){n&&n.removeAttribute(o)})})}function fe(e,t,n){un(t)?Nt(t,function(o,i){fe(e,i,o)}):tt(e,function(o){Fo(n)||n===""?dt(o,t):o.setAttribute(t,String(n))})}function qt(e,t,n){var o=document.createElement(e);return t&&(Tt(t)?ct(o,t):fe(o,t)),n&&$n(n,o),o}function at(e,t,n){if(Sn(n))return getComputedStyle(e)[t];Fo(n)||(e.style[t]=""+n)}function hn(e,t){at(e,"display",t)}function Ki(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function st(e,t){return e.getAttribute(t)}function ui(e,t){return e&&e.classList.contains(t)}function Je(e){return e.getBoundingClientRect()}function Ot(e){tt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ui(e){return Tn(new DOMParser().parseFromString(e,"text/html").body)}function mt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function qi(e,t){return e&&e.querySelector(t)}function Mo(e,t){return t?_t(e.querySelectorAll(t)):[]}function ht(e,t){gt(e,t,!1)}function wo(e){return e.timeStamp}function Rt(e){return Tt(e)?e:e?e+"px":""}var Ln="splide",No="data-"+Ln;function cn(e,t){if(!e)throw new Error("["+Ln+"] "+(t||""))}var Lt=Math.min,Un=Math.max,qn=Math.floor,fn=Math.ceil,ze=Math.abs;function Gi(e,t,n){return ze(e-t)<n}function Bn(e,t,n,o){var i=Lt(t,n),l=Un(t,n);return o?i<e&&e<l:i<=e&&e<=l}function jt(e,t,n){var o=Lt(t,n),i=Un(t,n);return Lt(Un(o,e),i)}function $o(e){return+(e>0)-+(e<0)}function To(e,t){return tt(t,function(n){e=e.replace("%s",""+n)}),e}function Oo(e){return e<10?"0"+e:""+e}var pi={};function Wa(e){return""+e+Oo(pi[e]=(pi[e]||0)+1)}function Yi(){var e=[];function t(r,s,c,p){i(r,s,function(d,$,h){var f="addEventListener"in d,m=f?d.removeEventListener.bind(d,$,c,p):d.removeListener.bind(d,c);f?d.addEventListener($,c,p):d.addListener(c),e.push([d,$,h,c,m])})}function n(r,s,c){i(r,s,function(p,d,$){e=e.filter(function(h){return h[0]===p&&h[1]===d&&h[2]===$&&(!c||h[3]===c)?(h[4](),!1):!0})})}function o(r,s,c){var p,d=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:d,detail:c}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,d,!1,c)),r.dispatchEvent(p),p}function i(r,s,c){tt(r,function(p){p&&tt(s,function(d){d.split(" ").forEach(function($){var h=$.split(".");c(p,h[0],h[1])})})})}function l(){e.forEach(function(r){r[4]()}),vt(e)}return{bind:t,unbind:n,dispatch:o,destroy:l}}var Pt="mounted",Lo="ready",bt="move",on="moved",Ho="click",Xi="active",Zi="inactive",Ji="visible",Qi="hidden",Ie="refresh",De="updated",Xt="resize",Zn="resized",er="drag",tr="dragging",nr="dragged",Jn="scroll",Vt="scrolled",Ia="overflow",Bo="destroy",or="arrows:mounted",ir="arrows:updated",rr="pagination:mounted",ar="pagination:updated",Vo="navigation:mounted",Do="autoplay:play",sr="autoplay:playing",zo="autoplay:pause",jo="lazyload:loaded",lr="sk",cr="sh",Gn="ei";function _e(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Yi();function o(l,r){n.bind(t,wn(l).join(" "),function(s){r.apply(r,Io(s.detail)?s.detail:[])})}function i(l){n.dispatch(t,l,_t(arguments,1))}return e&&e.event.on(Bo,n.destroy),gn(n,{bus:t,on:o,off:Ee(n.unbind,t),emit:i})}function Qn(e,t,n,o){var i=Date.now,l,r=0,s,c=!0,p=0;function d(){if(!c){if(r=e?Lt((i()-l)/e,1):1,n&&n(r),r>=1&&(t(),l=i(),o&&++p>=o))return h();s=ci(d)}}function $(y){y||m(),l=i()-(y?r*e:0),c=!1,s=ci(d)}function h(){c=!0}function f(){l=i(),r=0,n&&n(r)}function m(){s&&cancelAnimationFrame(s),r=0,s=0,c=!0}function g(y){e=y}function C(){return c}return{start:$,rewind:f,pause:h,cancel:m,set:g,isPaused:C}}function Fa(e){var t=e;function n(i){t=i}function o(i){return Ro(wn(i),t)}return{set:n,is:o}}function Ra(e,t){var n=Qn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ka(e,t,n){var o=e.state,i=n.breakpoints||{},l=n.reducedMotion||{},r=Yi(),s=[];function c(){var m=n.mediaQuery==="min";mn(i).sort(function(g,C){return m?+g-+C:+C-+g}).forEach(function(g){d(i[g],"("+(m?"min":"max")+"-width:"+g+"px)")}),d(l,li),$()}function p(m){m&&r.destroy()}function d(m,g){var C=matchMedia(g);r.bind(C,"change",$),s.push([m,C])}function $(){var m=o.is(Kn),g=n.direction,C=s.reduce(function(y,x){return wt(y,x[1].matches?x[0]:{})},{});di(n),f(C),n.destroy?e.destroy(n.destroy==="completely"):m?(p(!0),e.mount()):g!==n.direction&&e.refresh()}function h(m){matchMedia(li).matches&&(m?wt(n,l):di(n,mn(l)))}function f(m,g,C){wt(n,m),g&&wt(Object.getPrototypeOf(n),m),(C||!o.is(Ut))&&e.emit(De,n)}return{setup:c,destroy:p,reduce:h,set:f}}var eo="Arrow",to=eo+"Left",no=eo+"Right",dr=eo+"Up",ur=eo+"Down",mi="rtl",oo="ttb",po={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[dr,no],ArrowRight:[ur,to]};function Ma(e,t,n){function o(l,r,s){s=s||n.direction;var c=s===mi&&!r?1:s===oo?0:-1;return po[l]&&po[l][c]||l.replace(/width|left|right/i,function(p,d){var $=po[p.toLowerCase()][c]||p;return d>0?$.charAt(0).toUpperCase()+$.slice(1):$})}function i(l){return l*(n.direction===mi?1:-1)}return{resolve:o,orient:i}}var ft="role",Gt="tabindex",Na="disabled",lt="aria-",En=lt+"controls",pr=lt+"current",gi=lt+"selected",Qe=lt+"label",Ko=lt+"labelledby",mr=lt+"hidden",Uo=lt+"orientation",yn=lt+"roledescription",hi=lt+"live",fi=lt+"busy",yi=lt+"atomic",qo=[ft,Gt,Na,En,pr,Qe,Ko,mr,Uo,yn],ut=Ln+"__",At="is-",mo=Ln,vi=ut+"track",Oa=ut+"list",io=ut+"slide",gr=io+"--clone",Ha=io+"__container",Go=ut+"arrows",ro=ut+"arrow",hr=ro+"--prev",fr=ro+"--next",ao=ut+"pagination",yr=ao+"__page",Ba=ut+"progress",Va=Ba+"__bar",Da=ut+"toggle",za=ut+"spinner",ja=ut+"sr",Ka=At+"initialized",Ht=At+"active",vr=At+"prev",br=At+"next",Eo=At+"visible",_o=At+"loading",xr=At+"focus-in",Cr=At+"overflow",Ua=[Ht,Eo,vr,br,_o,xr,Cr],qa={slide:io,clone:gr,arrows:Go,arrow:ro,prev:hr,next:fr,pagination:ao,page:yr,spinner:za};function Ga(e,t){if(Di(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!pn(n,t);)n=n.parentElement;return n}var Ya=5,bi=200,Sr="touchstart mousedown",go="touchmove mousemove",ho="touchend touchcancel mouseup click";function Xa(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=e.root,s=n.i18n,c={},p=[],d=[],$=[],h,f,m;function g(){P(),L(),x()}function C(){i(Ie,y),i(Ie,g),i(De,x),l(document,Sr+" keydown",function(v){m=v.type==="keydown"},{capture:!0}),l(r,"focusin",function(){gt(r,xr,!!m)})}function y(v){var w=qo.concat("style");vt(p),ht(r,d),ht(h,$),dt([h,f],w),dt(r,v?w:["style",yn])}function x(){ht(r,d),ht(h,$),d=E(mo),$=E(vi),ct(r,d),ct(h,$),fe(r,Qe,n.label),fe(r,Ko,n.labelledby)}function P(){h=_("."+vi),f=Tn(h,"."+Oa),cn(h&&f,"A track/list element is missing."),Hn(p,ji(f,"."+io+":not(."+gr+")")),Nt({arrows:Go,pagination:ao,prev:hr,next:fr,bar:Va,toggle:Da},function(v,w){c[w]=_("."+v)}),gn(c,{root:r,track:h,list:f,slides:p})}function L(){var v=r.id||Wa(Ln),w=n.role;r.id=v,h.id=h.id||v+"-track",f.id=f.id||v+"-list",!st(r,ft)&&r.tagName!=="SECTION"&&w&&fe(r,ft,w),fe(r,yn,s.carousel),fe(f,ft,"presentation")}function _(v){var w=qi(r,v);return w&&Ga(w,"."+mo)===r?w:void 0}function E(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===mo&&Ht]}return gn(c,{setup:g,mount:C,destroy:y})}var Zt="slide",rn="loop",_n="fade";function Za(e,t,n,o){var i=_e(e),l=i.on,r=i.emit,s=i.bind,c=e.Components,p=e.root,d=e.options,$=d.isNavigation,h=d.updateOnMove,f=d.i18n,m=d.pagination,g=d.slideFocus,C=c.Direction.resolve,y=st(o,"style"),x=st(o,Qe),P=n>-1,L=Tn(o,"."+Ha),_;function E(){P||(o.id=p.id+"-slide"+Oo(t+1),fe(o,ft,m?"tabpanel":"group"),fe(o,yn,f.slide),fe(o,Qe,x||To(f.slideLabel,[t+1,e.length]))),v()}function v(){s(o,"click",Ee(r,Ho,k)),s(o,"keydown",Ee(r,lr,k)),l([on,cr,Vt],A),l(Vo,R),h&&l(bt,V)}function w(){_=!0,i.destroy(),ht(o,Ua),dt(o,qo),fe(o,"style",y),fe(o,Qe,x||"")}function R(){var M=e.splides.map(function(W){var B=W.splide.Components.Slides.getAt(t);return B?B.slide.id:""}).join(" ");fe(o,Qe,To(f.slideX,(P?n:t)+1)),fe(o,En,M),fe(o,ft,g?"button":""),g&&dt(o,yn)}function V(){_||A()}function A(){if(!_){var M=e.index;H(),D(),gt(o,vr,t===M-1),gt(o,br,t===M+1)}}function H(){var M=U();M!==ui(o,Ht)&&(gt(o,Ht,M),fe(o,pr,$&&M||""),r(M?Xi:Zi,k))}function D(){var M=S(),W=!M&&(!U()||P);if(e.state.is([nn,Cn])||fe(o,mr,W||""),fe(Mo(o,d.focusableNodes||""),Gt,W?-1:""),g&&fe(o,Gt,W?-1:0),M!==ui(o,Eo)&&(gt(o,Eo,M),r(M?Ji:Qi,k)),!M&&document.activeElement===o){var B=c.Slides.getAt(e.index);B&&Ki(B.slide)}}function j(M,W,B){at(B&&L||o,M,W)}function U(){var M=e.index;return M===t||d.cloneStatus&&M===n}function S(){if(e.is(_n))return U();var M=Je(c.Elements.track),W=Je(o),B=C("left",!0),ee=C("right",!0);return qn(M[B])<=fn(W[B])&&qn(W[ee])<=fn(M[ee])}function N(M,W){var B=ze(M-t);return!P&&(d.rewind||e.is(rn))&&(B=Lt(B,e.length-B)),B<=W}var k={index:t,slideIndex:n,slide:o,container:L,isClone:P,mount:E,destroy:w,update:A,style:j,isWithin:N};return k}function Ja(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=t.Elements,c=s.slides,p=s.list,d=[];function $(){h(),i(Ie,f),i(Ie,h)}function h(){c.forEach(function(A,H){g(A,H,-1)})}function f(){_(function(A){A.destroy()}),vt(d)}function m(){_(function(A){A.update()})}function g(A,H,D){var j=Za(e,H,D,A);j.mount(),d.push(j),d.sort(function(U,S){return U.index-S.index})}function C(A){return A?E(function(H){return!H.isClone}):d}function y(A){var H=t.Controller,D=H.toIndex(A),j=H.hasFocus()?1:n.perPage;return E(function(U){return Bn(U.index,D,D+j-1)})}function x(A){return E(A)[0]}function P(A,H){tt(A,function(D){if(Tt(D)&&(D=Ui(D)),zi(D)){var j=c[H];j?ko(D,j):$n(p,D),ct(D,n.classes.slide),w(D,Ee(l,Xt))}}),l(Ie)}function L(A){Ot(E(A).map(function(H){return H.slide})),l(Ie)}function _(A,H){C(H).forEach(A)}function E(A){return d.filter(Di(A)?A:function(H){return Tt(A)?pn(H.slide,A):Ro(wn(A),H.index)})}function v(A,H,D){_(function(j){j.style(A,H,D)})}function w(A,H){var D=Mo(A,"img"),j=D.length;j?D.forEach(function(U){r(U,"load error",function(){--j||H()})}):H()}function R(A){return A?c.length:d.length}function V(){return d.length>n.perPage}return{mount:$,destroy:f,update:m,register:g,get:C,getIn:y,getAt:x,add:P,remove:L,forEach:_,filter:E,style:v,getLength:R,isEnough:V}}function Qa(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=t.Slides,c=t.Direction.resolve,p=t.Elements,d=p.root,$=p.track,h=p.list,f=s.getAt,m=s.style,g,C,y;function x(){P(),l(window,"resize load",Ra(Ee(r,Xt))),i([De,Ie],P),i(Xt,L)}function P(){g=n.direction===oo,at(d,"maxWidth",Rt(n.width)),at($,c("paddingLeft"),_(!1)),at($,c("paddingRight"),_(!0)),L(!0)}function L(k){var M=Je(d);(k||C.width!==M.width||C.height!==M.height)&&(at($,"height",E()),m(c("marginRight"),Rt(n.gap)),m("width",w()),m("height",R(),!0),C=M,r(Zn),y!==(y=N())&&(gt(d,Cr,y),r(Ia,y)))}function _(k){var M=n.padding,W=c(k?"right":"left");return M&&Rt(M[W]||(un(M)?0:M))||"0px"}function E(){var k="";return g&&(k=v(),cn(k,"height or heightRatio is missing."),k="calc("+k+" - "+_(!1)+" - "+_(!0)+")"),k}function v(){return Rt(n.height||Je(h).width*n.heightRatio)}function w(){return n.autoWidth?null:Rt(n.fixedWidth)||(g?"":V())}function R(){return Rt(n.fixedHeight)||(g?n.autoHeight?null:V():v())}function V(){var k=Rt(n.gap);return"calc((100%"+(k&&" + "+k)+")/"+(n.perPage||1)+(k&&" - "+k)+")"}function A(){return Je(h)[c("width")]}function H(k,M){var W=f(k||0);return W?Je(W.slide)[c("width")]+(M?0:U()):0}function D(k,M){var W=f(k);if(W){var B=Je(W.slide)[c("right")],ee=Je(h)[c("left")];return ze(B-ee)+(M?0:U())}return 0}function j(k){return D(e.length-1)-D(0)+H(0,k)}function U(){var k=f(0);return k&&parseFloat(at(k.slide,c("marginRight")))||0}function S(k){return parseFloat(at($,c("padding"+(k?"Right":"Left"))))||0}function N(){return e.is(_n)||j(!0)>A()}return{mount:x,resize:L,listSize:A,slideSize:H,sliderSize:j,totalSize:D,getPadding:S,isOverflow:N}}var es=2;function ts(e,t,n){var o=_e(e),i=o.on,l=t.Elements,r=t.Slides,s=t.Direction.resolve,c=[],p;function d(){i(Ie,$),i([De,Xt],f),(p=C())&&(m(p),t.Layout.resize(!0))}function $(){h(),d()}function h(){Ot(c),vt(c),o.destroy()}function f(){var y=C();p!==y&&(p<y||!y)&&o.emit(Ie)}function m(y){var x=r.get().slice(),P=x.length;if(P){for(;x.length<y;)Hn(x,x);Hn(x.slice(-y),x.slice(0,y)).forEach(function(L,_){var E=_<y,v=g(L.slide,_);E?ko(v,x[0].slide):$n(l.list,v),Hn(c,v),r.register(v,_-y+(E?0:P),L.index)})}}function g(y,x){var P=y.cloneNode(!0);return ct(P,n.classes.clone),P.id=e.root.id+"-clone"+Oo(x+1),P}function C(){var y=n.clones;if(!e.is(rn))y=0;else if(Sn(y)){var x=n[s("fixedWidth")]&&t.Layout.slideSize(0),P=x&&fn(Je(l.track)[s("width")]/x);y=P||n[s("autoWidth")]&&e.length||n.perPage*es}return y}return{mount:d,destroy:h}}function ns(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=e.state.set,s=t.Layout,c=s.slideSize,p=s.getPadding,d=s.totalSize,$=s.listSize,h=s.sliderSize,f=t.Direction,m=f.resolve,g=f.orient,C=t.Elements,y=C.list,x=C.track,P;function L(){P=t.Transition,i([Pt,Zn,De,Ie],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function E(W,B,ee,de){W!==B&&k(W>ee)&&(A(),w(V(j(),W>ee),!0)),r(nn),l(bt,B,ee,W),P.start(B,function(){r(Yt),l(on,B,ee,W),de&&de()})}function v(W){w(D(W,!0))}function w(W,B){if(!e.is(_n)){var ee=B?W:R(W);at(y,"transform","translate"+m("X")+"("+ee+"px)"),W!==ee&&l(cr)}}function R(W){if(e.is(rn)){var B=H(W),ee=B>t.Controller.getEnd(),de=B<0;(de||ee)&&(W=V(W,ee))}return W}function V(W,B){var ee=W-N(B),de=h();return W-=g(de*(fn(ze(ee)/de)||1))*(B?1:-1),W}function A(){w(j(),!0),P.cancel()}function H(W){for(var B=t.Slides.get(),ee=0,de=1/0,re=0;re<B.length;re++){var me=B[re].index,O=ze(D(me,!0)-W);if(O<=de)de=O,ee=me;else break}return ee}function D(W,B){var ee=g(d(W-1)-S(W));return B?U(ee):ee}function j(){var W=m("left");return Je(y)[W]-Je(x)[W]+g(p(!1))}function U(W){return n.trimSpace&&e.is(Zt)&&(W=jt(W,0,g(h(!0)-$()))),W}function S(W){var B=n.focus;return B==="center"?($()-c(W,!0))/2:+B*c(W)||0}function N(W){return D(W?t.Controller.getEnd():0,!!n.trimSpace)}function k(W){var B=g(V(j(),W));return W?B>=0:B<=y[m("scrollWidth")]-Je(x)[m("width")]}function M(W,B){B=Sn(B)?j():B;var ee=W!==!0&&g(B)<g(N(!1)),de=W!==!1&&g(B)>g(N(!0));return ee||de}return{mount:L,move:E,jump:v,translate:w,shift:V,cancel:A,toIndex:H,toPosition:D,getPosition:j,getLimit:N,exceededLimit:M,reposition:_}}function os(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=t.Move,s=r.getPosition,c=r.getLimit,p=r.toPosition,d=t.Slides,$=d.isEnough,h=d.getLength,f=n.omitEnd,m=e.is(rn),g=e.is(Zt),C=Ee(j,!1),y=Ee(j,!0),x=n.start||0,P,L=x,_,E,v;function w(){R(),i([De,Ie,Gn],R),i(Zn,V)}function R(){_=h(!0),E=n.perMove,v=n.perPage,P=k();var O=jt(x,0,f?P:_-1);O!==x&&(x=O,r.reposition())}function V(){P!==k()&&l(Gn)}function A(O,te,Y){if(!me()){var X=D(O),ne=N(X);ne>-1&&(te||ne!==x)&&(ee(ne),r.move(X,ne,L,Y))}}function H(O,te,Y,X){t.Scroll.scroll(O,te,Y,function(){var ne=N(r.toIndex(s()));ee(f?Lt(ne,P):ne),X&&X()})}function D(O){var te=x;if(Tt(O)){var Y=O.match(/([+\-<>])(\d+)?/)||[],X=Y[1],ne=Y[2];X==="+"||X==="-"?te=U(x+ +(""+X+(+ne||1)),x):X===">"?te=ne?M(+ne):C(!0):X==="<"&&(te=y(!0))}else te=m?O:jt(O,0,P);return te}function j(O,te){var Y=E||(re()?1:v),X=U(x+Y*(O?-1:1),x,!(E||re()));return X===-1&&g&&!Gi(s(),c(!O),1)?O?0:P:te?X:N(X)}function U(O,te,Y){if($()||re()){var X=S(O);X!==O&&(te=O,O=X,Y=!1),O<0||O>P?!E&&(Bn(0,O,te,!0)||Bn(P,te,O,!0))?O=M(W(O)):m?O=Y?O<0?-(_%v||v):_:O:n.rewind?O=O<0?P:0:O=-1:Y&&O!==te&&(O=M(W(te)+(O<te?-1:1)))}else O=-1;return O}function S(O){if(g&&n.trimSpace==="move"&&O!==x)for(var te=s();te===p(O,!0)&&Bn(O,0,e.length-1,!n.rewind);)O<x?--O:++O;return O}function N(O){return m?(O+_)%_||0:O}function k(){for(var O=_-(re()||m&&E?1:v);f&&O-- >0;)if(p(_-1,!0)!==p(O,!0)){O++;break}return jt(O,0,_-1)}function M(O){return jt(re()?O:v*O,0,P)}function W(O){return re()?Lt(O,P):qn((O>=P?_-1:O)/v)}function B(O){var te=r.toIndex(O);return g?jt(te,0,P):te}function ee(O){O!==x&&(L=x,x=O)}function de(O){return O?L:x}function re(){return!Sn(n.focus)||n.isNavigation}function me(){return e.state.is([nn,Cn])&&!!n.waitForTransition}return{mount:w,go:A,scroll:H,getNext:C,getPrev:y,getAdjacent:j,getEnd:k,setIndex:ee,getIndex:de,toIndex:M,toPage:W,toDest:B,hasFocus:re,isBusy:me}}var is="http://www.w3.org/2000/svg",rs="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",Wn=40;function as(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=n.classes,c=n.i18n,p=t.Elements,d=t.Controller,$=p.arrows,h=p.track,f=$,m=p.prev,g=p.next,C,y,x={};function P(){_(),i(De,L)}function L(){E(),P()}function _(){var H=n.arrows;H&&!(m&&g)&&R(),m&&g&&(gn(x,{prev:m,next:g}),hn(f,H?"":"none"),ct(f,y=Go+"--"+n.direction),H&&(v(),A(),fe([m,g],En,h.id),r(or,m,g)))}function E(){o.destroy(),ht(f,y),C?(Ot($?[m,g]:f),m=g=null):dt([m,g],qo)}function v(){i([Pt,on,Ie,Vt,Gn],A),l(g,"click",Ee(w,">")),l(m,"click",Ee(w,"<"))}function w(H){d.go(H,!0)}function R(){f=$||qt("div",s.arrows),m=V(!0),g=V(!1),C=!0,$n(f,[m,g]),!$&&ko(f,h)}function V(H){var D='<button class="'+s.arrow+" "+(H?s.prev:s.next)+'" type="button"><svg xmlns="'+is+'" viewBox="0 0 '+Wn+" "+Wn+'" width="'+Wn+'" height="'+Wn+'" focusable="false"><path d="'+(n.arrowPath||rs)+'" />';return Ui(D)}function A(){if(m&&g){var H=e.index,D=d.getPrev(),j=d.getNext(),U=D>-1&&H<D?c.last:c.prev,S=j>-1&&H>j?c.first:c.next;m.disabled=D<0,g.disabled=j<0,fe(m,Qe,U),fe(g,Qe,S),r(ir,m,g,D,j)}}return{arrows:x,mount:P,destroy:E,update:A}}var ss=No+"-interval";function ls(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=Qn(n.interval,e.go.bind(e,">"),v),c=s.isPaused,p=t.Elements,d=t.Elements,$=d.root,h=d.toggle,f=n.autoplay,m,g,C=f==="pause";function y(){f&&(x(),h&&fe(h,En,p.track.id),C||P(),E())}function x(){n.pauseOnHover&&l($,"mouseenter mouseleave",function(R){m=R.type==="mouseenter",_()}),n.pauseOnFocus&&l($,"focusin focusout",function(R){g=R.type==="focusin",_()}),h&&l(h,"click",function(){C?P():L(!0)}),i([bt,Jn,Ie],s.rewind),i(bt,w)}function P(){c()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),g=m=C=!1,E(),r(Do))}function L(R){R===void 0&&(R=!0),C=!!R,E(),c()||(s.pause(),r(zo))}function _(){C||(m||g?L(!1):P())}function E(){h&&(gt(h,Ht,!C),fe(h,Qe,n.i18n[C?"play":"pause"]))}function v(R){var V=p.bar;V&&at(V,"width",R*100+"%"),r(sr,R)}function w(R){var V=t.Slides.getAt(R);s.set(V&&+st(V.slide,ss)||n.interval)}return{mount:y,destroy:s.cancel,play:P,pause:L,isPaused:c}}function cs(e,t,n){var o=_e(e),i=o.on;function l(){n.cover&&(i(jo,Ee(s,!0)),i([Pt,De,Ie],Ee(r,!0)))}function r(c){t.Slides.forEach(function(p){var d=Tn(p.container||p.slide,"img");d&&d.src&&s(c,d,p)})}function s(c,p,d){d.style("background",c?'center/cover no-repeat url("'+p.src+'")':"",!0),hn(p,c?"none":"")}return{mount:l,destroy:Ee(r,!1)}}var ds=10,us=600,ps=.6,ms=1.5,gs=800;function hs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=e.state.set,s=t.Move,c=s.getPosition,p=s.getLimit,d=s.exceededLimit,$=s.translate,h=e.is(Zt),f,m,g=1;function C(){i(bt,L),i([De,Ie],_)}function y(v,w,R,V,A){var H=c();if(L(),R&&(!h||!d())){var D=t.Layout.sliderSize(),j=$o(v)*D*qn(ze(v)/D)||0;v=s.toPosition(t.Controller.toDest(v%D))+j}var U=Gi(H,v,1);g=1,w=U?0:w||Un(ze(v-H)/ms,gs),m=V,f=Qn(w,x,Ee(P,H,v,A),1),r(Cn),l(Jn),f.start()}function x(){r(Yt),m&&m(),l(Vt)}function P(v,w,R,V){var A=c(),H=v+(w-v)*E(V),D=(H-A)*g;$(A+D),h&&!R&&d()&&(g*=ps,ze(D)<ds&&y(p(d(!0)),us,!1,m,!0))}function L(){f&&f.cancel()}function _(){f&&!f.isPaused()&&(L(),x())}function E(v){var w=n.easingFunc;return w?w(v):1-Math.pow(1-v,4)}return{mount:C,destroy:L,scroll:y,cancel:_}}var Kt={passive:!1,capture:!0};function fs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=o.unbind,c=e.state,p=t.Move,d=t.Scroll,$=t.Controller,h=t.Elements.track,f=t.Media.reduce,m=t.Direction,g=m.resolve,C=m.orient,y=p.getPosition,x=p.exceededLimit,P,L,_,E,v,w=!1,R,V,A;function H(){r(h,go,So,Kt),r(h,ho,So,Kt),r(h,Sr,j,Kt),r(h,"click",N,{capture:!0}),r(h,"dragstart",mt),i([Pt,De],D)}function D(){var I=n.drag;oe(!I),E=I==="free"}function j(I){if(R=!1,!V){var b=ne(I);X(I.target)&&(b||!I.button)&&($.isBusy()?mt(I,!0):(A=b?h:window,v=c.is([nn,Cn]),_=null,r(A,go,U,Kt),r(A,ho,S,Kt),p.cancel(),d.cancel(),k(I)))}}function U(I){if(c.is(On)||(c.set(On),l(er)),I.cancelable)if(v){p.translate(P+Y(re(I)));var b=me(I)>bi,z=w!==(w=x());(b||z)&&k(I),R=!0,l(tr),mt(I)}else B(I)&&(v=W(I),mt(I))}function S(I){c.is(On)&&(c.set(Yt),l(nr)),v&&(M(I),mt(I)),s(A,go,U),s(A,ho,S),v=!1}function N(I){!V&&R&&mt(I,!0)}function k(I){_=L,L=I,P=y()}function M(I){var b=ee(I),z=de(b),q=n.rewind&&n.rewindByDrag;f(!1),E?$.scroll(z,0,n.snap):e.is(_n)?$.go(C($o(b))<0?q?"<":"-":q?">":"+"):e.is(Zt)&&w&&q?$.go(x(!0)?">":"<"):$.go($.toDest(z),!0),f(!0)}function W(I){var b=n.dragMinThreshold,z=un(b),q=z&&b.mouse||0,Z=(z?b.touch:+b)||10;return ze(re(I))>(ne(I)?Z:q)}function B(I){return ze(re(I))>ze(re(I,!0))}function ee(I){if(e.is(rn)||!w){var b=me(I);if(b&&b<bi)return re(I)/b}return 0}function de(I){return y()+$o(I)*Lt(ze(I)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(I,b){return te(I,b)-te(O(I),b)}function me(I){return wo(I)-wo(O(I))}function O(I){return L===I&&_||L}function te(I,b){return(ne(I)?I.changedTouches[0]:I)["page"+g(b?"Y":"X")]}function Y(I){return I/(w&&e.is(Zt)?Ya:1)}function X(I){var b=n.noDrag;return!pn(I,"."+yr+", ."+ro)&&(!b||!pn(I,b))}function ne(I){return typeof TouchEvent<"u"&&I instanceof TouchEvent}function F(){return v}function oe(I){V=I}return{mount:H,disable:oe,isDragging:F}}var ys={Spacebar:" ",Right:no,Left:to,Up:dr,Down:ur};function Yo(e){return e=Tt(e)?e:e.key,ys[e]||e}var xi="keydown";function vs(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.unbind,s=e.root,c=t.Direction.resolve,p,d;function $(){h(),i(De,f),i(De,h),i(bt,g)}function h(){var y=n.keyboard;y&&(p=y==="global"?window:s,l(p,xi,C))}function f(){r(p,xi)}function m(y){d=y}function g(){var y=d;d=!0,Vi(function(){d=y})}function C(y){if(!d){var x=Yo(y);x===c(to)?e.go("<"):x===c(no)&&e.go(">")}}return{mount:$,destroy:f,disable:m}}var dn=No+"-lazy",Vn=dn+"-srcset",bs="["+dn+"], ["+Vn+"]";function xs(e,t,n){var o=_e(e),i=o.on,l=o.off,r=o.bind,s=o.emit,c=n.lazyLoad==="sequential",p=[on,Vt],d=[];function $(){n.lazyLoad&&(h(),i(Ie,h))}function h(){vt(d),f(),c?y():(l(p),i(p,m),m())}function f(){t.Slides.forEach(function(x){Mo(x.slide,bs).forEach(function(P){var L=st(P,dn),_=st(P,Vn);if(L!==P.src||_!==P.srcset){var E=n.classes.spinner,v=P.parentElement,w=Tn(v,"."+E)||qt("span",E,v);d.push([P,x,w]),P.src||hn(P,"none")}})})}function m(){d=d.filter(function(x){var P=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(e.index,P)?g(x):!0}),d.length||l(p)}function g(x){var P=x[0];ct(x[1].slide,_o),r(P,"load error",Ee(C,x)),fe(P,"src",st(P,dn)),fe(P,"srcset",st(P,Vn)),dt(P,dn),dt(P,Vn)}function C(x,P){var L=x[0],_=x[1];ht(_.slide,_o),P.type!=="error"&&(Ot(x[2]),hn(L,""),s(jo,L,_),s(Xt)),c&&y()}function y(){d.length&&g(d.shift())}return{mount:$,destroy:Ee(vt,d),check:m}}function Cs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=t.Slides,c=t.Elements,p=t.Controller,d=p.hasFocus,$=p.getIndex,h=p.go,f=t.Direction.resolve,m=c.pagination,g=[],C,y;function x(){P(),i([De,Ie,Gn],x);var V=n.pagination;m&&hn(m,V?"":"none"),V&&(i([bt,Jn,Vt],R),L(),R(),l(rr,{list:C,items:g},w(e.index)))}function P(){C&&(Ot(m?_t(C.children):C),ht(C,y),vt(g),C=null),o.destroy()}function L(){var V=e.length,A=n.classes,H=n.i18n,D=n.perPage,j=d()?p.getEnd()+1:fn(V/D);C=m||qt("ul",A.pagination,c.track.parentElement),ct(C,y=ao+"--"+v()),fe(C,ft,"tablist"),fe(C,Qe,H.select),fe(C,Uo,v()===oo?"vertical":"");for(var U=0;U<j;U++){var S=qt("li",null,C),N=qt("button",{class:A.page,type:"button"},S),k=s.getIn(U).map(function(W){return W.slide.id}),M=!d()&&D>1?H.pageX:H.slideX;r(N,"click",Ee(_,U)),n.paginationKeyboard&&r(N,"keydown",Ee(E,U)),fe(S,ft,"presentation"),fe(N,ft,"tab"),fe(N,En,k.join(" ")),fe(N,Qe,To(M,U+1)),fe(N,Gt,-1),g.push({li:S,button:N,page:U})}}function _(V){h(">"+V,!0)}function E(V,A){var H=g.length,D=Yo(A),j=v(),U=-1;D===f(no,!1,j)?U=++V%H:D===f(to,!1,j)?U=(--V+H)%H:D==="Home"?U=0:D==="End"&&(U=H-1);var S=g[U];S&&(Ki(S.button),h(">"+U),mt(A,!0))}function v(){return n.paginationDirection||n.direction}function w(V){return g[p.toPage(V)]}function R(){var V=w($(!0)),A=w($());if(V){var H=V.button;ht(H,Ht),dt(H,gi),fe(H,Gt,-1)}if(A){var D=A.button;ct(D,Ht),fe(D,gi,!0),fe(D,Gt,"")}l(ar,{list:C,items:g},V,A)}return{items:g,mount:x,destroy:P,getAt:w,update:R}}var Ss=[" ","Enter"];function ws(e,t,n){var o=n.isNavigation,i=n.slideFocus,l=[];function r(){e.splides.forEach(function(m){m.isParent||(p(e,m.splide),p(m.splide,e))}),o&&d()}function s(){l.forEach(function(m){m.destroy()}),vt(l)}function c(){s(),r()}function p(m,g){var C=_e(m);C.on(bt,function(y,x,P){g.go(g.is(rn)?P:y)}),l.push(C)}function d(){var m=_e(e),g=m.on;g(Ho,h),g(lr,f),g([Pt,De],$),l.push(m),m.emit(Vo,e.splides)}function $(){fe(t.Elements.list,Uo,n.direction===oo?"vertical":"")}function h(m){e.go(m.index)}function f(m,g){Ro(Ss,Yo(g))&&(h(m),mt(g))}return{setup:Ee(t.Media.set,{slideFocus:Sn(i)?o:i},!0),mount:r,destroy:s,remount:c}}function $s(e,t,n){var o=_e(e),i=o.bind,l=0;function r(){n.wheel&&i(t.Elements.track,"wheel",s,Kt)}function s(p){if(p.cancelable){var d=p.deltaY,$=d<0,h=wo(p),f=n.wheelMinThreshold||0,m=n.wheelSleep||0;ze(d)>f&&h-l>m&&(e.go($?"<":">"),l=h),c($)&&mt(p)}}function c(p){return!n.releaseWheel||e.state.is(nn)||t.Controller.getAdjacent(p)!==-1}return{mount:r}}var Ts=90;function Ls(e,t,n){var o=_e(e),i=o.on,l=t.Elements.track,r=n.live&&!n.isNavigation,s=qt("span",ja),c=Qn(Ts,Ee(d,!1));function p(){r&&(h(!t.Autoplay.isPaused()),fe(l,yi,!0),s.textContent="…",i(Do,Ee(h,!0)),i(zo,Ee(h,!1)),i([on,Vt],Ee(d,!0)))}function d(f){fe(l,fi,f),f?($n(l,s),c.start()):(Ot(s),c.cancel())}function $(){dt(l,[hi,yi,fi]),Ot(s)}function h(f){r&&fe(l,hi,f?"off":"polite")}return{mount:p,disable:h,destroy:$}}var Es=Object.freeze({__proto__:null,Media:ka,Direction:Ma,Elements:Xa,Slides:Ja,Layout:Qa,Clones:ts,Move:ns,Controller:os,Arrows:as,Autoplay:ls,Cover:cs,Scroll:hs,Drag:fs,Keyboard:vs,LazyLoad:xs,Pagination:Cs,Sync:ws,Wheel:$s,Live:Ls}),_s={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"},Ps={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:qa,i18n:_s,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function As(e,t,n){var o=t.Slides;function i(){_e(e).on([Pt,Ie],l)}function l(){o.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function r(s,c){o.style("transition","opacity "+n.speed+"ms "+n.easing),Vi(c)}return{mount:i,start:r,cancel:So}}function Ws(e,t,n){var o=t.Move,i=t.Controller,l=t.Scroll,r=t.Elements.list,s=Ee(at,r,"transition"),c;function p(){_e(e).bind(r,"transitionend",function(f){f.target===r&&c&&($(),c())})}function d(f,m){var g=o.toPosition(f,!0),C=o.getPosition(),y=h(f);ze(g-C)>=1&&y>=1?n.useScroll?l.scroll(g,y,!1,m):(s("transform "+y+"ms "+n.easing),o.translate(g,!0),c=m):(o.jump(f),m())}function $(){s(""),l.cancel()}function h(f){var m=n.rewindSpeed;if(e.is(Zt)&&m){var g=i.getIndex(!0),C=i.getEnd();if(g===0&&f>=C||g>=C&&f===0)return m}return n.speed}return{mount:p,start:d,cancel:$}}var Is=(function(){function e(n,o){this.event=_e(),this.Components={},this.state=Fa(Ut),this.splides=[],this._o={},this._E={};var i=Tt(n)?qi(document,n):n;cn(i,i+" is invalid."),this.root=i,o=wt({label:st(i,Qe)||"",labelledby:st(i,Ko)||""},Ps,e.defaults,o||{});try{wt(o,JSON.parse(st(i,No)))}catch{cn(!1,"Invalid JSON")}this._o=Object.create(wt({},o))}var t=e.prototype;return t.mount=function(o,i){var l=this,r=this.state,s=this.Components;cn(r.is([Ut,Kn]),"Already mounted!"),r.set(Ut),this._C=s,this._T=i||this._T||(this.is(_n)?As:Ws),this._E=o||this._E;var c=gn({},Es,this._E,{Transition:this._T});return Nt(c,function(p,d){var $=p(l,s,l._o);s[d]=$,$.setup&&$.setup()}),Nt(s,function(p){p.mount&&p.mount()}),this.emit(Pt),ct(this.root,Ka),r.set(Yt),this.emit(Lo),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(Yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,i){return this.event.on(o,i),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var i;return(i=this.event).emit.apply(i,[o].concat(_t(arguments,1))),this},t.add=function(o,i){return this._C.Slides.add(o,i),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Ie),this},t.destroy=function(o){o===void 0&&(o=!0);var i=this.event,l=this.state;return l.is(Ut)?_e(this).on(Lo,this.destroy.bind(this,o)):(Nt(this._C,function(r){r.destroy&&r.destroy(o)},!0),i.emit(Bo),i.destroy(),o&&vt(this.splides),l.set(Kn)),this},_a(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Xo=Is;Xo.defaults={};Xo.STATES=Aa;var Ci=[[Pt,"onMounted"],[Lo,"onReady"],[bt,"onMove"],[on,"onMoved"],[Ho,"onClick"],[Xi,"onActive"],[Zi,"onInactive"],[Ji,"onVisible"],[Qi,"onHidden"],[Ie,"onRefresh"],[De,"onUpdated"],[Xt,"onResize"],[Zn,"onResized"],[er,"onDrag"],[tr,"onDragging"],[nr,"onDragged"],[Jn,"onScroll"],[Vt,"onScrolled"],[Bo,"onDestroy"],[or,"onArrowsMounted"],[ir,"onArrowsUpdated"],[rr,"onPaginationMounted"],[ar,"onPaginationUpdated"],[Vo,"onNavigationMounted"],[Do,"onAutoplayPlay"],[sr,"onAutoplayPlaying"],[zo,"onAutoplayPause"],[jo,"onLazyLoadLoaded"]];function Zo(...e){return e.filter(Boolean).join(" ")}function Yn(e){return e!==null&&typeof e=="object"}function Po(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Po(n,t[o]));if(Yn(e)&&Yn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(i=>!Object.prototype.hasOwnProperty.call(t,i)||!Po(e[i],t[i]))}return e===t}function Fs(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function Rs(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];if(i!=="__proto__"&&t(e[i],i)===!1)break}}return e}function Ao(e,t){const n=e;return Rs(t,(o,i)=>{Array.isArray(o)?n[i]=o.slice():Yn(o)?n[i]=Ao(Yn(n[i])?n[i]:{},o):n[i]=o}),n}var ks=({children:e,className:t,...n})=>u.createElement("div",{className:Zo("splide__track",t),...n},u.createElement("ul",{className:"splide__list"},e)),Jo=class extends u.Component{constructor(){super(...arguments),this.splideRef=u.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Xo(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ao({},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&&!Po(this.options,e)&&(this.splide.options=e,this.options=Ao({},e));const t=this.getSlides();Fs(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){Ci.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...i)=>{o(e,...i)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:o,...i}=this.props;return u.createElement(t,{className:Zo("splide",e),ref:this.splideRef,...this.omit(i,["options",...Ci.map(l=>l[1])])},n?u.createElement(ks,null,o):o)}},Qo=({children:e,className:t,...n})=>u.createElement("li",{className:Zo("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),ve=require("classnames"),T=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Bi=require("react-dom");function Nr(e){return e.type==="object"&&e.version===1}const Or="ControlSlider-module__wrapper___sHEkd",Hr="ControlSlider-module__hoverArrow___A-dOH",Br="ControlSlider-module__sliderItem___QQSkR",Vr="ControlSlider-module__sliderImage___9hRl-",Dr="ControlSlider-module__arrow___05ghY",zr="ControlSlider-module__arrowVertical___tBfVN",jr="ControlSlider-module__nextArrow___-30Yc",Kr="ControlSlider-module__arrowInner___aEra3",Ur="ControlSlider-module__arrowIcon___S4ztF",qr="ControlSlider-module__arrowImg___2dwJW",Gr="ControlSlider-module__mirror___brd6U",Yr="ControlSlider-module__pagination___bicLF",Xr="ControlSlider-module__paginationInner___bT-P-",Zr="ControlSlider-module__paginationVertical___zYqKw",Jr="ControlSlider-module__paginationItem___nTRbk",Qr="ControlSlider-module__dot___p1Qun",ea="ControlSlider-module__activeDot___LHFaj",ta="ControlSlider-module__paginationInsideBottom___R3FWn",na="ControlSlider-module__paginationInsideTop___V-qb-",oa="ControlSlider-module__paginationOutsideBottom___14w8D",ia="ControlSlider-module__paginationOutsideTop___SCLqB",ra="ControlSlider-module__paginationInsideLeft___yOBRZ",aa="ControlSlider-module__paginationInsideRight___Rtt3o",sa="ControlSlider-module__paginationOutsideLeft___lahaw",la="ControlSlider-module__paginationOutsideRight___EtuQa",ca="ControlSlider-module__imgWrapper___UjEgB",da="ControlSlider-module__captionBlock___dJ6-j",ua="ControlSlider-module__captionTextWrapper___HFlpf",pa="ControlSlider-module__captionText___uGBVc",ma="ControlSlider-module__active___WZK4G",ga="ControlSlider-module__withPointerEvents___t-18M",ha="ControlSlider-module__topLeftAlignment___zjnGM",fa="ControlSlider-module__topCenterAlignment___gD1xW",ya="ControlSlider-module__topRightAlignment___NMapS",va="ControlSlider-module__middleLeftAlignment___OnUrY",ba="ControlSlider-module__middleCenterAlignment___Tdkl0",xa="ControlSlider-module__middleRightAlignment___wEbfX",Ca="ControlSlider-module__bottomLeftAlignment___cTP2-",Sa="ControlSlider-module__bottomCenterAlignment___c54fB",wa="ControlSlider-module__bottomRightAlignment___kEwrz",$a="ControlSlider-module__clickOverlay___DZA28",Ta="ControlSlider-module__contain___pLyq7",La="ControlSlider-module__cover___KdDat",ae={wrapper:Or,hoverArrow:Hr,sliderItem:Br,sliderImage:Vr,arrow:Dr,arrowVertical:zr,nextArrow:jr,arrowInner:Kr,arrowIcon:Ur,arrowImg:qr,mirror:Gr,pagination:Yr,paginationInner:Xr,paginationVertical:Zr,paginationItem:Jr,dot:Qr,activeDot:ea,paginationInsideBottom:ta,paginationInsideTop:na,paginationOutsideBottom:oa,paginationOutsideTop:ia,paginationInsideLeft:ra,paginationInsideRight:aa,paginationOutsideLeft:sa,paginationOutsideRight:la,imgWrapper:ca,captionBlock:da,captionTextWrapper:ua,captionText:pa,active:ma,withPointerEvents:ga,topLeftAlignment:ha,topCenterAlignment:fa,topRightAlignment:ya,middleLeftAlignment:va,middleCenterAlignment:ba,middleRightAlignment:xa,bottomLeftAlignment:Ca,bottomCenterAlignment:Sa,bottomRightAlignment:wa,clickOverlay:$a,contain:Ta,cover:La};function Ea(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _a(e,t,n){return t&&Ea(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var li="(prefers-reduced-motion: reduce)",Ut=1,Pa=2,Yt=3,nn=4,Cn=5,On=6,Kn=7,Aa={CREATED:Ut,MOUNTED:Pa,IDLE:Yt,MOVING:nn,SCROLLING:Cn,DRAGGING:On,DESTROYED:Kn};function vt(e){e.length=0}function _t(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ee(e){return e.bind.apply(e,[null].concat(_t(arguments,1)))}var Vi=setTimeout,So=function(){};function ci(e){return requestAnimationFrame(e)}function Xn(e,t){return typeof t===e}function un(e){return!Io(e)&&Xn("object",e)}var Fo=Array.isArray,Di=Ee(Xn,"function"),Tt=Ee(Xn,"string"),Sn=Ee(Xn,"undefined");function Io(e){return e===null}function zi(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function wn(e){return Fo(e)?e:[e]}function tt(e,t){wn(e).forEach(t)}function Ro(e,t){return e.indexOf(t)>-1}function Hn(e,t){return e.push.apply(e,wn(t)),e}function gt(e,t,n){e&&tt(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function ct(e,t){gt(e,Tt(t)?t.split(" "):t,!0)}function $n(e,t){tt(t,e.appendChild.bind(e))}function ko(e,t){tt(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function pn(e,t){return zi(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ji(e,t){var n=e?_t(e.children):[];return t?n.filter(function(o){return pn(o,t)}):n}function Tn(e,t){return t?ji(e,t)[0]:e.firstElementChild}var mn=Object.keys;function Nt(e,t,n){return e&&(n?mn(e).reverse():mn(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function gn(e){return _t(arguments,1).forEach(function(t){Nt(t,function(n,o){e[o]=t[o]})}),e}function wt(e){return _t(arguments,1).forEach(function(t){Nt(t,function(n,o){Fo(n)?e[o]=n.slice():un(n)?e[o]=wt({},un(e[o])?e[o]:{},n):e[o]=n})}),e}function di(e,t){tt(t||mn(e),function(n){delete e[n]})}function dt(e,t){tt(e,function(n){tt(t,function(o){n&&n.removeAttribute(o)})})}function fe(e,t,n){un(t)?Nt(t,function(o,i){fe(e,i,o)}):tt(e,function(o){Io(n)||n===""?dt(o,t):o.setAttribute(t,String(n))})}function qt(e,t,n){var o=document.createElement(e);return t&&(Tt(t)?ct(o,t):fe(o,t)),n&&$n(n,o),o}function at(e,t,n){if(Sn(n))return getComputedStyle(e)[t];Io(n)||(e.style[t]=""+n)}function hn(e,t){at(e,"display",t)}function Ki(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function st(e,t){return e.getAttribute(t)}function ui(e,t){return e&&e.classList.contains(t)}function Je(e){return e.getBoundingClientRect()}function Ot(e){tt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ui(e){return Tn(new DOMParser().parseFromString(e,"text/html").body)}function mt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function qi(e,t){return e&&e.querySelector(t)}function Mo(e,t){return t?_t(e.querySelectorAll(t)):[]}function ht(e,t){gt(e,t,!1)}function wo(e){return e.timeStamp}function Rt(e){return Tt(e)?e:e?e+"px":""}var Ln="splide",No="data-"+Ln;function cn(e,t){if(!e)throw new Error("["+Ln+"] "+(t||""))}var Lt=Math.min,Un=Math.max,qn=Math.floor,fn=Math.ceil,ze=Math.abs;function Gi(e,t,n){return ze(e-t)<n}function Bn(e,t,n,o){var i=Lt(t,n),l=Un(t,n);return o?i<e&&e<l:i<=e&&e<=l}function jt(e,t,n){var o=Lt(t,n),i=Un(t,n);return Lt(Un(o,e),i)}function $o(e){return+(e>0)-+(e<0)}function To(e,t){return tt(t,function(n){e=e.replace("%s",""+n)}),e}function Oo(e){return e<10?"0"+e:""+e}var pi={};function Wa(e){return""+e+Oo(pi[e]=(pi[e]||0)+1)}function Yi(){var e=[];function t(r,s,c,p){i(r,s,function(d,$,h){var f="addEventListener"in d,m=f?d.removeEventListener.bind(d,$,c,p):d.removeListener.bind(d,c);f?d.addEventListener($,c,p):d.addListener(c),e.push([d,$,h,c,m])})}function n(r,s,c){i(r,s,function(p,d,$){e=e.filter(function(h){return h[0]===p&&h[1]===d&&h[2]===$&&(!c||h[3]===c)?(h[4](),!1):!0})})}function o(r,s,c){var p,d=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:d,detail:c}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,d,!1,c)),r.dispatchEvent(p),p}function i(r,s,c){tt(r,function(p){p&&tt(s,function(d){d.split(" ").forEach(function($){var h=$.split(".");c(p,h[0],h[1])})})})}function l(){e.forEach(function(r){r[4]()}),vt(e)}return{bind:t,unbind:n,dispatch:o,destroy:l}}var Pt="mounted",Lo="ready",bt="move",on="moved",Ho="click",Xi="active",Zi="inactive",Ji="visible",Qi="hidden",Fe="refresh",De="updated",Xt="resize",Zn="resized",er="drag",tr="dragging",nr="dragged",Jn="scroll",Vt="scrolled",Fa="overflow",Bo="destroy",or="arrows:mounted",ir="arrows:updated",rr="pagination:mounted",ar="pagination:updated",Vo="navigation:mounted",Do="autoplay:play",sr="autoplay:playing",zo="autoplay:pause",jo="lazyload:loaded",lr="sk",cr="sh",Gn="ei";function _e(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Yi();function o(l,r){n.bind(t,wn(l).join(" "),function(s){r.apply(r,Fo(s.detail)?s.detail:[])})}function i(l){n.dispatch(t,l,_t(arguments,1))}return e&&e.event.on(Bo,n.destroy),gn(n,{bus:t,on:o,off:Ee(n.unbind,t),emit:i})}function Qn(e,t,n,o){var i=Date.now,l,r=0,s,c=!0,p=0;function d(){if(!c){if(r=e?Lt((i()-l)/e,1):1,n&&n(r),r>=1&&(t(),l=i(),o&&++p>=o))return h();s=ci(d)}}function $(y){y||m(),l=i()-(y?r*e:0),c=!1,s=ci(d)}function h(){c=!0}function f(){l=i(),r=0,n&&n(r)}function m(){s&&cancelAnimationFrame(s),r=0,s=0,c=!0}function g(y){e=y}function C(){return c}return{start:$,rewind:f,pause:h,cancel:m,set:g,isPaused:C}}function Ia(e){var t=e;function n(i){t=i}function o(i){return Ro(wn(i),t)}return{set:n,is:o}}function Ra(e,t){var n=Qn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ka(e,t,n){var o=e.state,i=n.breakpoints||{},l=n.reducedMotion||{},r=Yi(),s=[];function c(){var m=n.mediaQuery==="min";mn(i).sort(function(g,C){return m?+g-+C:+C-+g}).forEach(function(g){d(i[g],"("+(m?"min":"max")+"-width:"+g+"px)")}),d(l,li),$()}function p(m){m&&r.destroy()}function d(m,g){var C=matchMedia(g);r.bind(C,"change",$),s.push([m,C])}function $(){var m=o.is(Kn),g=n.direction,C=s.reduce(function(y,x){return wt(y,x[1].matches?x[0]:{})},{});di(n),f(C),n.destroy?e.destroy(n.destroy==="completely"):m?(p(!0),e.mount()):g!==n.direction&&e.refresh()}function h(m){matchMedia(li).matches&&(m?wt(n,l):di(n,mn(l)))}function f(m,g,C){wt(n,m),g&&wt(Object.getPrototypeOf(n),m),(C||!o.is(Ut))&&e.emit(De,n)}return{setup:c,destroy:p,reduce:h,set:f}}var eo="Arrow",to=eo+"Left",no=eo+"Right",dr=eo+"Up",ur=eo+"Down",mi="rtl",oo="ttb",po={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[dr,no],ArrowRight:[ur,to]};function Ma(e,t,n){function o(l,r,s){s=s||n.direction;var c=s===mi&&!r?1:s===oo?0:-1;return po[l]&&po[l][c]||l.replace(/width|left|right/i,function(p,d){var $=po[p.toLowerCase()][c]||p;return d>0?$.charAt(0).toUpperCase()+$.slice(1):$})}function i(l){return l*(n.direction===mi?1:-1)}return{resolve:o,orient:i}}var ft="role",Gt="tabindex",Na="disabled",lt="aria-",En=lt+"controls",pr=lt+"current",gi=lt+"selected",Qe=lt+"label",Ko=lt+"labelledby",mr=lt+"hidden",Uo=lt+"orientation",yn=lt+"roledescription",hi=lt+"live",fi=lt+"busy",yi=lt+"atomic",qo=[ft,Gt,Na,En,pr,Qe,Ko,mr,Uo,yn],ut=Ln+"__",At="is-",mo=Ln,vi=ut+"track",Oa=ut+"list",io=ut+"slide",gr=io+"--clone",Ha=io+"__container",Go=ut+"arrows",ro=ut+"arrow",hr=ro+"--prev",fr=ro+"--next",ao=ut+"pagination",yr=ao+"__page",Ba=ut+"progress",Va=Ba+"__bar",Da=ut+"toggle",za=ut+"spinner",ja=ut+"sr",Ka=At+"initialized",Ht=At+"active",vr=At+"prev",br=At+"next",Eo=At+"visible",_o=At+"loading",xr=At+"focus-in",Cr=At+"overflow",Ua=[Ht,Eo,vr,br,_o,xr,Cr],qa={slide:io,clone:gr,arrows:Go,arrow:ro,prev:hr,next:fr,pagination:ao,page:yr,spinner:za};function Ga(e,t){if(Di(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!pn(n,t);)n=n.parentElement;return n}var Ya=5,bi=200,Sr="touchstart mousedown",go="touchmove mousemove",ho="touchend touchcancel mouseup click";function Xa(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=e.root,s=n.i18n,c={},p=[],d=[],$=[],h,f,m;function g(){P(),L(),x()}function C(){i(Fe,y),i(Fe,g),i(De,x),l(document,Sr+" keydown",function(v){m=v.type==="keydown"},{capture:!0}),l(r,"focusin",function(){gt(r,xr,!!m)})}function y(v){var w=qo.concat("style");vt(p),ht(r,d),ht(h,$),dt([h,f],w),dt(r,v?w:["style",yn])}function x(){ht(r,d),ht(h,$),d=E(mo),$=E(vi),ct(r,d),ct(h,$),fe(r,Qe,n.label),fe(r,Ko,n.labelledby)}function P(){h=_("."+vi),f=Tn(h,"."+Oa),cn(h&&f,"A track/list element is missing."),Hn(p,ji(f,"."+io+":not(."+gr+")")),Nt({arrows:Go,pagination:ao,prev:hr,next:fr,bar:Va,toggle:Da},function(v,w){c[w]=_("."+v)}),gn(c,{root:r,track:h,list:f,slides:p})}function L(){var v=r.id||Wa(Ln),w=n.role;r.id=v,h.id=h.id||v+"-track",f.id=f.id||v+"-list",!st(r,ft)&&r.tagName!=="SECTION"&&w&&fe(r,ft,w),fe(r,yn,s.carousel),fe(f,ft,"presentation")}function _(v){var w=qi(r,v);return w&&Ga(w,"."+mo)===r?w:void 0}function E(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===mo&&Ht]}return gn(c,{setup:g,mount:C,destroy:y})}var Zt="slide",rn="loop",_n="fade";function Za(e,t,n,o){var i=_e(e),l=i.on,r=i.emit,s=i.bind,c=e.Components,p=e.root,d=e.options,$=d.isNavigation,h=d.updateOnMove,f=d.i18n,m=d.pagination,g=d.slideFocus,C=c.Direction.resolve,y=st(o,"style"),x=st(o,Qe),P=n>-1,L=Tn(o,"."+Ha),_;function E(){P||(o.id=p.id+"-slide"+Oo(t+1),fe(o,ft,m?"tabpanel":"group"),fe(o,yn,f.slide),fe(o,Qe,x||To(f.slideLabel,[t+1,e.length]))),v()}function v(){s(o,"click",Ee(r,Ho,k)),s(o,"keydown",Ee(r,lr,k)),l([on,cr,Vt],A),l(Vo,R),h&&l(bt,V)}function w(){_=!0,i.destroy(),ht(o,Ua),dt(o,qo),fe(o,"style",y),fe(o,Qe,x||"")}function R(){var M=e.splides.map(function(W){var B=W.splide.Components.Slides.getAt(t);return B?B.slide.id:""}).join(" ");fe(o,Qe,To(f.slideX,(P?n:t)+1)),fe(o,En,M),fe(o,ft,g?"button":""),g&&dt(o,yn)}function V(){_||A()}function A(){if(!_){var M=e.index;H(),D(),gt(o,vr,t===M-1),gt(o,br,t===M+1)}}function H(){var M=U();M!==ui(o,Ht)&&(gt(o,Ht,M),fe(o,pr,$&&M||""),r(M?Xi:Zi,k))}function D(){var M=S(),W=!M&&(!U()||P);if(e.state.is([nn,Cn])||fe(o,mr,W||""),fe(Mo(o,d.focusableNodes||""),Gt,W?-1:""),g&&fe(o,Gt,W?-1:0),M!==ui(o,Eo)&&(gt(o,Eo,M),r(M?Ji:Qi,k)),!M&&document.activeElement===o){var B=c.Slides.getAt(e.index);B&&Ki(B.slide)}}function j(M,W,B){at(B&&L||o,M,W)}function U(){var M=e.index;return M===t||d.cloneStatus&&M===n}function S(){if(e.is(_n))return U();var M=Je(c.Elements.track),W=Je(o),B=C("left",!0),ee=C("right",!0);return qn(M[B])<=fn(W[B])&&qn(W[ee])<=fn(M[ee])}function N(M,W){var B=ze(M-t);return!P&&(d.rewind||e.is(rn))&&(B=Lt(B,e.length-B)),B<=W}var k={index:t,slideIndex:n,slide:o,container:L,isClone:P,mount:E,destroy:w,update:A,style:j,isWithin:N};return k}function Ja(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=t.Elements,c=s.slides,p=s.list,d=[];function $(){h(),i(Fe,f),i(Fe,h)}function h(){c.forEach(function(A,H){g(A,H,-1)})}function f(){_(function(A){A.destroy()}),vt(d)}function m(){_(function(A){A.update()})}function g(A,H,D){var j=Za(e,H,D,A);j.mount(),d.push(j),d.sort(function(U,S){return U.index-S.index})}function C(A){return A?E(function(H){return!H.isClone}):d}function y(A){var H=t.Controller,D=H.toIndex(A),j=H.hasFocus()?1:n.perPage;return E(function(U){return Bn(U.index,D,D+j-1)})}function x(A){return E(A)[0]}function P(A,H){tt(A,function(D){if(Tt(D)&&(D=Ui(D)),zi(D)){var j=c[H];j?ko(D,j):$n(p,D),ct(D,n.classes.slide),w(D,Ee(l,Xt))}}),l(Fe)}function L(A){Ot(E(A).map(function(H){return H.slide})),l(Fe)}function _(A,H){C(H).forEach(A)}function E(A){return d.filter(Di(A)?A:function(H){return Tt(A)?pn(H.slide,A):Ro(wn(A),H.index)})}function v(A,H,D){_(function(j){j.style(A,H,D)})}function w(A,H){var D=Mo(A,"img"),j=D.length;j?D.forEach(function(U){r(U,"load error",function(){--j||H()})}):H()}function R(A){return A?c.length:d.length}function V(){return d.length>n.perPage}return{mount:$,destroy:f,update:m,register:g,get:C,getIn:y,getAt:x,add:P,remove:L,forEach:_,filter:E,style:v,getLength:R,isEnough:V}}function Qa(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=t.Slides,c=t.Direction.resolve,p=t.Elements,d=p.root,$=p.track,h=p.list,f=s.getAt,m=s.style,g,C,y;function x(){P(),l(window,"resize load",Ra(Ee(r,Xt))),i([De,Fe],P),i(Xt,L)}function P(){g=n.direction===oo,at(d,"maxWidth",Rt(n.width)),at($,c("paddingLeft"),_(!1)),at($,c("paddingRight"),_(!0)),L(!0)}function L(k){var M=Je(d);(k||C.width!==M.width||C.height!==M.height)&&(at($,"height",E()),m(c("marginRight"),Rt(n.gap)),m("width",w()),m("height",R(),!0),C=M,r(Zn),y!==(y=N())&&(gt(d,Cr,y),r(Fa,y)))}function _(k){var M=n.padding,W=c(k?"right":"left");return M&&Rt(M[W]||(un(M)?0:M))||"0px"}function E(){var k="";return g&&(k=v(),cn(k,"height or heightRatio is missing."),k="calc("+k+" - "+_(!1)+" - "+_(!0)+")"),k}function v(){return Rt(n.height||Je(h).width*n.heightRatio)}function w(){return n.autoWidth?null:Rt(n.fixedWidth)||(g?"":V())}function R(){return Rt(n.fixedHeight)||(g?n.autoHeight?null:V():v())}function V(){var k=Rt(n.gap);return"calc((100%"+(k&&" + "+k)+")/"+(n.perPage||1)+(k&&" - "+k)+")"}function A(){return Je(h)[c("width")]}function H(k,M){var W=f(k||0);return W?Je(W.slide)[c("width")]+(M?0:U()):0}function D(k,M){var W=f(k);if(W){var B=Je(W.slide)[c("right")],ee=Je(h)[c("left")];return ze(B-ee)+(M?0:U())}return 0}function j(k){return D(e.length-1)-D(0)+H(0,k)}function U(){var k=f(0);return k&&parseFloat(at(k.slide,c("marginRight")))||0}function S(k){return parseFloat(at($,c("padding"+(k?"Right":"Left"))))||0}function N(){return e.is(_n)||j(!0)>A()}return{mount:x,resize:L,listSize:A,slideSize:H,sliderSize:j,totalSize:D,getPadding:S,isOverflow:N}}var es=2;function ts(e,t,n){var o=_e(e),i=o.on,l=t.Elements,r=t.Slides,s=t.Direction.resolve,c=[],p;function d(){i(Fe,$),i([De,Xt],f),(p=C())&&(m(p),t.Layout.resize(!0))}function $(){h(),d()}function h(){Ot(c),vt(c),o.destroy()}function f(){var y=C();p!==y&&(p<y||!y)&&o.emit(Fe)}function m(y){var x=r.get().slice(),P=x.length;if(P){for(;x.length<y;)Hn(x,x);Hn(x.slice(-y),x.slice(0,y)).forEach(function(L,_){var E=_<y,v=g(L.slide,_);E?ko(v,x[0].slide):$n(l.list,v),Hn(c,v),r.register(v,_-y+(E?0:P),L.index)})}}function g(y,x){var P=y.cloneNode(!0);return ct(P,n.classes.clone),P.id=e.root.id+"-clone"+Oo(x+1),P}function C(){var y=n.clones;if(!e.is(rn))y=0;else if(Sn(y)){var x=n[s("fixedWidth")]&&t.Layout.slideSize(0),P=x&&fn(Je(l.track)[s("width")]/x);y=P||n[s("autoWidth")]&&e.length||n.perPage*es}return y}return{mount:d,destroy:h}}function ns(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=e.state.set,s=t.Layout,c=s.slideSize,p=s.getPadding,d=s.totalSize,$=s.listSize,h=s.sliderSize,f=t.Direction,m=f.resolve,g=f.orient,C=t.Elements,y=C.list,x=C.track,P;function L(){P=t.Transition,i([Pt,Zn,De,Fe],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function E(W,B,ee,de){W!==B&&k(W>ee)&&(A(),w(V(j(),W>ee),!0)),r(nn),l(bt,B,ee,W),P.start(B,function(){r(Yt),l(on,B,ee,W),de&&de()})}function v(W){w(D(W,!0))}function w(W,B){if(!e.is(_n)){var ee=B?W:R(W);at(y,"transform","translate"+m("X")+"("+ee+"px)"),W!==ee&&l(cr)}}function R(W){if(e.is(rn)){var B=H(W),ee=B>t.Controller.getEnd(),de=B<0;(de||ee)&&(W=V(W,ee))}return W}function V(W,B){var ee=W-N(B),de=h();return W-=g(de*(fn(ze(ee)/de)||1))*(B?1:-1),W}function A(){w(j(),!0),P.cancel()}function H(W){for(var B=t.Slides.get(),ee=0,de=1/0,re=0;re<B.length;re++){var me=B[re].index,O=ze(D(me,!0)-W);if(O<=de)de=O,ee=me;else break}return ee}function D(W,B){var ee=g(d(W-1)-S(W));return B?U(ee):ee}function j(){var W=m("left");return Je(y)[W]-Je(x)[W]+g(p(!1))}function U(W){return n.trimSpace&&e.is(Zt)&&(W=jt(W,0,g(h(!0)-$()))),W}function S(W){var B=n.focus;return B==="center"?($()-c(W,!0))/2:+B*c(W)||0}function N(W){return D(W?t.Controller.getEnd():0,!!n.trimSpace)}function k(W){var B=g(V(j(),W));return W?B>=0:B<=y[m("scrollWidth")]-Je(x)[m("width")]}function M(W,B){B=Sn(B)?j():B;var ee=W!==!0&&g(B)<g(N(!1)),de=W!==!1&&g(B)>g(N(!0));return ee||de}return{mount:L,move:E,jump:v,translate:w,shift:V,cancel:A,toIndex:H,toPosition:D,getPosition:j,getLimit:N,exceededLimit:M,reposition:_}}function os(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=t.Move,s=r.getPosition,c=r.getLimit,p=r.toPosition,d=t.Slides,$=d.isEnough,h=d.getLength,f=n.omitEnd,m=e.is(rn),g=e.is(Zt),C=Ee(j,!1),y=Ee(j,!0),x=n.start||0,P,L=x,_,E,v;function w(){R(),i([De,Fe,Gn],R),i(Zn,V)}function R(){_=h(!0),E=n.perMove,v=n.perPage,P=k();var O=jt(x,0,f?P:_-1);O!==x&&(x=O,r.reposition())}function V(){P!==k()&&l(Gn)}function A(O,te,Y){if(!me()){var X=D(O),ne=N(X);ne>-1&&(te||ne!==x)&&(ee(ne),r.move(X,ne,L,Y))}}function H(O,te,Y,X){t.Scroll.scroll(O,te,Y,function(){var ne=N(r.toIndex(s()));ee(f?Lt(ne,P):ne),X&&X()})}function D(O){var te=x;if(Tt(O)){var Y=O.match(/([+\-<>])(\d+)?/)||[],X=Y[1],ne=Y[2];X==="+"||X==="-"?te=U(x+ +(""+X+(+ne||1)),x):X===">"?te=ne?M(+ne):C(!0):X==="<"&&(te=y(!0))}else te=m?O:jt(O,0,P);return te}function j(O,te){var Y=E||(re()?1:v),X=U(x+Y*(O?-1:1),x,!(E||re()));return X===-1&&g&&!Gi(s(),c(!O),1)?O?0:P:te?X:N(X)}function U(O,te,Y){if($()||re()){var X=S(O);X!==O&&(te=O,O=X,Y=!1),O<0||O>P?!E&&(Bn(0,O,te,!0)||Bn(P,te,O,!0))?O=M(W(O)):m?O=Y?O<0?-(_%v||v):_:O:n.rewind?O=O<0?P:0:O=-1:Y&&O!==te&&(O=M(W(te)+(O<te?-1:1)))}else O=-1;return O}function S(O){if(g&&n.trimSpace==="move"&&O!==x)for(var te=s();te===p(O,!0)&&Bn(O,0,e.length-1,!n.rewind);)O<x?--O:++O;return O}function N(O){return m?(O+_)%_||0:O}function k(){for(var O=_-(re()||m&&E?1:v);f&&O-- >0;)if(p(_-1,!0)!==p(O,!0)){O++;break}return jt(O,0,_-1)}function M(O){return jt(re()?O:v*O,0,P)}function W(O){return re()?Lt(O,P):qn((O>=P?_-1:O)/v)}function B(O){var te=r.toIndex(O);return g?jt(te,0,P):te}function ee(O){O!==x&&(L=x,x=O)}function de(O){return O?L:x}function re(){return!Sn(n.focus)||n.isNavigation}function me(){return e.state.is([nn,Cn])&&!!n.waitForTransition}return{mount:w,go:A,scroll:H,getNext:C,getPrev:y,getAdjacent:j,getEnd:k,setIndex:ee,getIndex:de,toIndex:M,toPage:W,toDest:B,hasFocus:re,isBusy:me}}var is="http://www.w3.org/2000/svg",rs="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",Wn=40;function as(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=n.classes,c=n.i18n,p=t.Elements,d=t.Controller,$=p.arrows,h=p.track,f=$,m=p.prev,g=p.next,C,y,x={};function P(){_(),i(De,L)}function L(){E(),P()}function _(){var H=n.arrows;H&&!(m&&g)&&R(),m&&g&&(gn(x,{prev:m,next:g}),hn(f,H?"":"none"),ct(f,y=Go+"--"+n.direction),H&&(v(),A(),fe([m,g],En,h.id),r(or,m,g)))}function E(){o.destroy(),ht(f,y),C?(Ot($?[m,g]:f),m=g=null):dt([m,g],qo)}function v(){i([Pt,on,Fe,Vt,Gn],A),l(g,"click",Ee(w,">")),l(m,"click",Ee(w,"<"))}function w(H){d.go(H,!0)}function R(){f=$||qt("div",s.arrows),m=V(!0),g=V(!1),C=!0,$n(f,[m,g]),!$&&ko(f,h)}function V(H){var D='<button class="'+s.arrow+" "+(H?s.prev:s.next)+'" type="button"><svg xmlns="'+is+'" viewBox="0 0 '+Wn+" "+Wn+'" width="'+Wn+'" height="'+Wn+'" focusable="false"><path d="'+(n.arrowPath||rs)+'" />';return Ui(D)}function A(){if(m&&g){var H=e.index,D=d.getPrev(),j=d.getNext(),U=D>-1&&H<D?c.last:c.prev,S=j>-1&&H>j?c.first:c.next;m.disabled=D<0,g.disabled=j<0,fe(m,Qe,U),fe(g,Qe,S),r(ir,m,g,D,j)}}return{arrows:x,mount:P,destroy:E,update:A}}var ss=No+"-interval";function ls(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=Qn(n.interval,e.go.bind(e,">"),v),c=s.isPaused,p=t.Elements,d=t.Elements,$=d.root,h=d.toggle,f=n.autoplay,m,g,C=f==="pause";function y(){f&&(x(),h&&fe(h,En,p.track.id),C||P(),E())}function x(){n.pauseOnHover&&l($,"mouseenter mouseleave",function(R){m=R.type==="mouseenter",_()}),n.pauseOnFocus&&l($,"focusin focusout",function(R){g=R.type==="focusin",_()}),h&&l(h,"click",function(){C?P():L(!0)}),i([bt,Jn,Fe],s.rewind),i(bt,w)}function P(){c()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),g=m=C=!1,E(),r(Do))}function L(R){R===void 0&&(R=!0),C=!!R,E(),c()||(s.pause(),r(zo))}function _(){C||(m||g?L(!1):P())}function E(){h&&(gt(h,Ht,!C),fe(h,Qe,n.i18n[C?"play":"pause"]))}function v(R){var V=p.bar;V&&at(V,"width",R*100+"%"),r(sr,R)}function w(R){var V=t.Slides.getAt(R);s.set(V&&+st(V.slide,ss)||n.interval)}return{mount:y,destroy:s.cancel,play:P,pause:L,isPaused:c}}function cs(e,t,n){var o=_e(e),i=o.on;function l(){n.cover&&(i(jo,Ee(s,!0)),i([Pt,De,Fe],Ee(r,!0)))}function r(c){t.Slides.forEach(function(p){var d=Tn(p.container||p.slide,"img");d&&d.src&&s(c,d,p)})}function s(c,p,d){d.style("background",c?'center/cover no-repeat url("'+p.src+'")':"",!0),hn(p,c?"none":"")}return{mount:l,destroy:Ee(r,!1)}}var ds=10,us=600,ps=.6,ms=1.5,gs=800;function hs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=e.state.set,s=t.Move,c=s.getPosition,p=s.getLimit,d=s.exceededLimit,$=s.translate,h=e.is(Zt),f,m,g=1;function C(){i(bt,L),i([De,Fe],_)}function y(v,w,R,V,A){var H=c();if(L(),R&&(!h||!d())){var D=t.Layout.sliderSize(),j=$o(v)*D*qn(ze(v)/D)||0;v=s.toPosition(t.Controller.toDest(v%D))+j}var U=Gi(H,v,1);g=1,w=U?0:w||Un(ze(v-H)/ms,gs),m=V,f=Qn(w,x,Ee(P,H,v,A),1),r(Cn),l(Jn),f.start()}function x(){r(Yt),m&&m(),l(Vt)}function P(v,w,R,V){var A=c(),H=v+(w-v)*E(V),D=(H-A)*g;$(A+D),h&&!R&&d()&&(g*=ps,ze(D)<ds&&y(p(d(!0)),us,!1,m,!0))}function L(){f&&f.cancel()}function _(){f&&!f.isPaused()&&(L(),x())}function E(v){var w=n.easingFunc;return w?w(v):1-Math.pow(1-v,4)}return{mount:C,destroy:L,scroll:y,cancel:_}}var Kt={passive:!1,capture:!0};function fs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=o.unbind,c=e.state,p=t.Move,d=t.Scroll,$=t.Controller,h=t.Elements.track,f=t.Media.reduce,m=t.Direction,g=m.resolve,C=m.orient,y=p.getPosition,x=p.exceededLimit,P,L,_,E,v,w=!1,R,V,A;function H(){r(h,go,So,Kt),r(h,ho,So,Kt),r(h,Sr,j,Kt),r(h,"click",N,{capture:!0}),r(h,"dragstart",mt),i([Pt,De],D)}function D(){var F=n.drag;oe(!F),E=F==="free"}function j(F){if(R=!1,!V){var b=ne(F);X(F.target)&&(b||!F.button)&&($.isBusy()?mt(F,!0):(A=b?h:window,v=c.is([nn,Cn]),_=null,r(A,go,U,Kt),r(A,ho,S,Kt),p.cancel(),d.cancel(),k(F)))}}function U(F){if(c.is(On)||(c.set(On),l(er)),F.cancelable)if(v){p.translate(P+Y(re(F)));var b=me(F)>bi,z=w!==(w=x());(b||z)&&k(F),R=!0,l(tr),mt(F)}else B(F)&&(v=W(F),mt(F))}function S(F){c.is(On)&&(c.set(Yt),l(nr)),v&&(M(F),mt(F)),s(A,go,U),s(A,ho,S),v=!1}function N(F){!V&&R&&mt(F,!0)}function k(F){_=L,L=F,P=y()}function M(F){var b=ee(F),z=de(b),q=n.rewind&&n.rewindByDrag;f(!1),E?$.scroll(z,0,n.snap):e.is(_n)?$.go(C($o(b))<0?q?"<":"-":q?">":"+"):e.is(Zt)&&w&&q?$.go(x(!0)?">":"<"):$.go($.toDest(z),!0),f(!0)}function W(F){var b=n.dragMinThreshold,z=un(b),q=z&&b.mouse||0,Z=(z?b.touch:+b)||10;return ze(re(F))>(ne(F)?Z:q)}function B(F){return ze(re(F))>ze(re(F,!0))}function ee(F){if(e.is(rn)||!w){var b=me(F);if(b&&b<bi)return re(F)/b}return 0}function de(F){return y()+$o(F)*Lt(ze(F)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(F,b){return te(F,b)-te(O(F),b)}function me(F){return wo(F)-wo(O(F))}function O(F){return L===F&&_||L}function te(F,b){return(ne(F)?F.changedTouches[0]:F)["page"+g(b?"Y":"X")]}function Y(F){return F/(w&&e.is(Zt)?Ya:1)}function X(F){var b=n.noDrag;return!pn(F,"."+yr+", ."+ro)&&(!b||!pn(F,b))}function ne(F){return typeof TouchEvent<"u"&&F instanceof TouchEvent}function I(){return v}function oe(F){V=F}return{mount:H,disable:oe,isDragging:I}}var ys={Spacebar:" ",Right:no,Left:to,Up:dr,Down:ur};function Yo(e){return e=Tt(e)?e:e.key,ys[e]||e}var xi="keydown";function vs(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.unbind,s=e.root,c=t.Direction.resolve,p,d;function $(){h(),i(De,f),i(De,h),i(bt,g)}function h(){var y=n.keyboard;y&&(p=y==="global"?window:s,l(p,xi,C))}function f(){r(p,xi)}function m(y){d=y}function g(){var y=d;d=!0,Vi(function(){d=y})}function C(y){if(!d){var x=Yo(y);x===c(to)?e.go("<"):x===c(no)&&e.go(">")}}return{mount:$,destroy:f,disable:m}}var dn=No+"-lazy",Vn=dn+"-srcset",bs="["+dn+"], ["+Vn+"]";function xs(e,t,n){var o=_e(e),i=o.on,l=o.off,r=o.bind,s=o.emit,c=n.lazyLoad==="sequential",p=[on,Vt],d=[];function $(){n.lazyLoad&&(h(),i(Fe,h))}function h(){vt(d),f(),c?y():(l(p),i(p,m),m())}function f(){t.Slides.forEach(function(x){Mo(x.slide,bs).forEach(function(P){var L=st(P,dn),_=st(P,Vn);if(L!==P.src||_!==P.srcset){var E=n.classes.spinner,v=P.parentElement,w=Tn(v,"."+E)||qt("span",E,v);d.push([P,x,w]),P.src||hn(P,"none")}})})}function m(){d=d.filter(function(x){var P=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(e.index,P)?g(x):!0}),d.length||l(p)}function g(x){var P=x[0];ct(x[1].slide,_o),r(P,"load error",Ee(C,x)),fe(P,"src",st(P,dn)),fe(P,"srcset",st(P,Vn)),dt(P,dn),dt(P,Vn)}function C(x,P){var L=x[0],_=x[1];ht(_.slide,_o),P.type!=="error"&&(Ot(x[2]),hn(L,""),s(jo,L,_),s(Xt)),c&&y()}function y(){d.length&&g(d.shift())}return{mount:$,destroy:Ee(vt,d),check:m}}function Cs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=t.Slides,c=t.Elements,p=t.Controller,d=p.hasFocus,$=p.getIndex,h=p.go,f=t.Direction.resolve,m=c.pagination,g=[],C,y;function x(){P(),i([De,Fe,Gn],x);var V=n.pagination;m&&hn(m,V?"":"none"),V&&(i([bt,Jn,Vt],R),L(),R(),l(rr,{list:C,items:g},w(e.index)))}function P(){C&&(Ot(m?_t(C.children):C),ht(C,y),vt(g),C=null),o.destroy()}function L(){var V=e.length,A=n.classes,H=n.i18n,D=n.perPage,j=d()?p.getEnd()+1:fn(V/D);C=m||qt("ul",A.pagination,c.track.parentElement),ct(C,y=ao+"--"+v()),fe(C,ft,"tablist"),fe(C,Qe,H.select),fe(C,Uo,v()===oo?"vertical":"");for(var U=0;U<j;U++){var S=qt("li",null,C),N=qt("button",{class:A.page,type:"button"},S),k=s.getIn(U).map(function(W){return W.slide.id}),M=!d()&&D>1?H.pageX:H.slideX;r(N,"click",Ee(_,U)),n.paginationKeyboard&&r(N,"keydown",Ee(E,U)),fe(S,ft,"presentation"),fe(N,ft,"tab"),fe(N,En,k.join(" ")),fe(N,Qe,To(M,U+1)),fe(N,Gt,-1),g.push({li:S,button:N,page:U})}}function _(V){h(">"+V,!0)}function E(V,A){var H=g.length,D=Yo(A),j=v(),U=-1;D===f(no,!1,j)?U=++V%H:D===f(to,!1,j)?U=(--V+H)%H:D==="Home"?U=0:D==="End"&&(U=H-1);var S=g[U];S&&(Ki(S.button),h(">"+U),mt(A,!0))}function v(){return n.paginationDirection||n.direction}function w(V){return g[p.toPage(V)]}function R(){var V=w($(!0)),A=w($());if(V){var H=V.button;ht(H,Ht),dt(H,gi),fe(H,Gt,-1)}if(A){var D=A.button;ct(D,Ht),fe(D,gi,!0),fe(D,Gt,"")}l(ar,{list:C,items:g},V,A)}return{items:g,mount:x,destroy:P,getAt:w,update:R}}var Ss=[" ","Enter"];function ws(e,t,n){var o=n.isNavigation,i=n.slideFocus,l=[];function r(){e.splides.forEach(function(m){m.isParent||(p(e,m.splide),p(m.splide,e))}),o&&d()}function s(){l.forEach(function(m){m.destroy()}),vt(l)}function c(){s(),r()}function p(m,g){var C=_e(m);C.on(bt,function(y,x,P){g.go(g.is(rn)?P:y)}),l.push(C)}function d(){var m=_e(e),g=m.on;g(Ho,h),g(lr,f),g([Pt,De],$),l.push(m),m.emit(Vo,e.splides)}function $(){fe(t.Elements.list,Uo,n.direction===oo?"vertical":"")}function h(m){e.go(m.index)}function f(m,g){Ro(Ss,Yo(g))&&(h(m),mt(g))}return{setup:Ee(t.Media.set,{slideFocus:Sn(i)?o:i},!0),mount:r,destroy:s,remount:c}}function $s(e,t,n){var o=_e(e),i=o.bind,l=0;function r(){n.wheel&&i(t.Elements.track,"wheel",s,Kt)}function s(p){if(p.cancelable){var d=p.deltaY,$=d<0,h=wo(p),f=n.wheelMinThreshold||0,m=n.wheelSleep||0;ze(d)>f&&h-l>m&&(e.go($?"<":">"),l=h),c($)&&mt(p)}}function c(p){return!n.releaseWheel||e.state.is(nn)||t.Controller.getAdjacent(p)!==-1}return{mount:r}}var Ts=90;function Ls(e,t,n){var o=_e(e),i=o.on,l=t.Elements.track,r=n.live&&!n.isNavigation,s=qt("span",ja),c=Qn(Ts,Ee(d,!1));function p(){r&&(h(!t.Autoplay.isPaused()),fe(l,yi,!0),s.textContent="…",i(Do,Ee(h,!0)),i(zo,Ee(h,!1)),i([on,Vt],Ee(d,!0)))}function d(f){fe(l,fi,f),f?($n(l,s),c.start()):(Ot(s),c.cancel())}function $(){dt(l,[hi,yi,fi]),Ot(s)}function h(f){r&&fe(l,hi,f?"off":"polite")}return{mount:p,disable:h,destroy:$}}var Es=Object.freeze({__proto__:null,Media:ka,Direction:Ma,Elements:Xa,Slides:Ja,Layout:Qa,Clones:ts,Move:ns,Controller:os,Arrows:as,Autoplay:ls,Cover:cs,Scroll:hs,Drag:fs,Keyboard:vs,LazyLoad:xs,Pagination:Cs,Sync:ws,Wheel:$s,Live:Ls}),_s={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"},Ps={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:qa,i18n:_s,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function As(e,t,n){var o=t.Slides;function i(){_e(e).on([Pt,Fe],l)}function l(){o.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function r(s,c){o.style("transition","opacity "+n.speed+"ms "+n.easing),Vi(c)}return{mount:i,start:r,cancel:So}}function Ws(e,t,n){var o=t.Move,i=t.Controller,l=t.Scroll,r=t.Elements.list,s=Ee(at,r,"transition"),c;function p(){_e(e).bind(r,"transitionend",function(f){f.target===r&&c&&($(),c())})}function d(f,m){var g=o.toPosition(f,!0),C=o.getPosition(),y=h(f);ze(g-C)>=1&&y>=1?n.useScroll?l.scroll(g,y,!1,m):(s("transform "+y+"ms "+n.easing),o.translate(g,!0),c=m):(o.jump(f),m())}function $(){s(""),l.cancel()}function h(f){var m=n.rewindSpeed;if(e.is(Zt)&&m){var g=i.getIndex(!0),C=i.getEnd();if(g===0&&f>=C||g>=C&&f===0)return m}return n.speed}return{mount:p,start:d,cancel:$}}var Fs=(function(){function e(n,o){this.event=_e(),this.Components={},this.state=Ia(Ut),this.splides=[],this._o={},this._E={};var i=Tt(n)?qi(document,n):n;cn(i,i+" is invalid."),this.root=i,o=wt({label:st(i,Qe)||"",labelledby:st(i,Ko)||""},Ps,e.defaults,o||{});try{wt(o,JSON.parse(st(i,No)))}catch{cn(!1,"Invalid JSON")}this._o=Object.create(wt({},o))}var t=e.prototype;return t.mount=function(o,i){var l=this,r=this.state,s=this.Components;cn(r.is([Ut,Kn]),"Already mounted!"),r.set(Ut),this._C=s,this._T=i||this._T||(this.is(_n)?As:Ws),this._E=o||this._E;var c=gn({},Es,this._E,{Transition:this._T});return Nt(c,function(p,d){var $=p(l,s,l._o);s[d]=$,$.setup&&$.setup()}),Nt(s,function(p){p.mount&&p.mount()}),this.emit(Pt),ct(this.root,Ka),r.set(Yt),this.emit(Lo),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(Yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,i){return this.event.on(o,i),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var i;return(i=this.event).emit.apply(i,[o].concat(_t(arguments,1))),this},t.add=function(o,i){return this._C.Slides.add(o,i),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Fe),this},t.destroy=function(o){o===void 0&&(o=!0);var i=this.event,l=this.state;return l.is(Ut)?_e(this).on(Lo,this.destroy.bind(this,o)):(Nt(this._C,function(r){r.destroy&&r.destroy(o)},!0),i.emit(Bo),i.destroy(),o&&vt(this.splides),l.set(Kn)),this},_a(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Xo=Fs;Xo.defaults={};Xo.STATES=Aa;var Ci=[[Pt,"onMounted"],[Lo,"onReady"],[bt,"onMove"],[on,"onMoved"],[Ho,"onClick"],[Xi,"onActive"],[Zi,"onInactive"],[Ji,"onVisible"],[Qi,"onHidden"],[Fe,"onRefresh"],[De,"onUpdated"],[Xt,"onResize"],[Zn,"onResized"],[er,"onDrag"],[tr,"onDragging"],[nr,"onDragged"],[Jn,"onScroll"],[Vt,"onScrolled"],[Bo,"onDestroy"],[or,"onArrowsMounted"],[ir,"onArrowsUpdated"],[rr,"onPaginationMounted"],[ar,"onPaginationUpdated"],[Vo,"onNavigationMounted"],[Do,"onAutoplayPlay"],[sr,"onAutoplayPlaying"],[zo,"onAutoplayPause"],[jo,"onLazyLoadLoaded"]];function Zo(...e){return e.filter(Boolean).join(" ")}function Yn(e){return e!==null&&typeof e=="object"}function Po(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Po(n,t[o]));if(Yn(e)&&Yn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(i=>!Object.prototype.hasOwnProperty.call(t,i)||!Po(e[i],t[i]))}return e===t}function Is(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function Rs(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];if(i!=="__proto__"&&t(e[i],i)===!1)break}}return e}function Ao(e,t){const n=e;return Rs(t,(o,i)=>{Array.isArray(o)?n[i]=o.slice():Yn(o)?n[i]=Ao(Yn(n[i])?n[i]:{},o):n[i]=o}),n}var ks=({children:e,className:t,...n})=>u.createElement("div",{className:Zo("splide__track",t),...n},u.createElement("ul",{className:"splide__list"},e)),Jo=class extends u.Component{constructor(){super(...arguments),this.splideRef=u.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Xo(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ao({},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&&!Po(this.options,e)&&(this.splide.options=e,this.options=Ao({},e));const t=this.getSlides();Is(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){Ci.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...i)=>{o(e,...i)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:o,...i}=this.props;return u.createElement(t,{className:Zo("splide",e),ref:this.splideRef,...this.omit(i,["options",...Ci.map(l=>l[1])])},n?u.createElement(ks,null,o):o)}},Qo=({children:e,className:t,...n})=>u.createElement("li",{className:Zo("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 Ms="RichTextRenderer-module__link___BWeZ2",Ns={link:Ms},Os=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},so=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Os(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function yt(e){const{color:t,...n}=e;return n}function qe(e,t){var n,o,i;return{fontFamily:so(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:T.scalingValue(e.letterSpacing,t),wordSpacing:T.scalingValue(e.wordSpacing,t),fontSize:T.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?T.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(i=e.textAppearance)==null?void 0:i.fontVariant,color:e.color}}const vn=({content:e})=>{const t=n=>n.map((o,i)=>o.type==="link"?a.jsx("a",{className:Ns.link,href:o.value,target:o.target,children:t(o.children)},i):a.jsx("span",{style:Hs(o),children:o.text},i));return a.jsx(a.Fragment,{children:e.map((n,o)=>{const i=n.children;return a.jsx("div",{children:t(i)},o)})})};function Hs(e){return{...e.fontFamily&&{fontFamily:so(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 Bs="SvgImage-module__svg___q3xE-",Vs="SvgImage-module__img___VsTm-",Si={svg:Bs,img:Vs},Ds=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},zs=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,$t=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:i})=>{const[l,r]=u.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return u.useEffect(()=>{if(typeof window<"u"&&window.CSS){const s=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');r(s)}},[]),!Ds(e)||!l?a.jsx("img",{src:e,alt:"",className:ve(Si.img,o),style:i}):a.jsx("span",{"data-supports-mask":l,className:ve(Si.svg,o),style:{"--svg":zs(e),"--fill":t,"--hover-fill":n,...i??{}}})},js={"top-left":ae.topLeftAlignment,"top-center":ae.topCenterAlignment,"top-right":ae.topRightAlignment,"middle-left":ae.middleLeftAlignment,"middle-center":ae.middleCenterAlignment,"middle-right":ae.middleRightAlignment,"bottom-left":ae.bottomLeftAlignment,"bottom-center":ae.bottomCenterAlignment,"bottom-right":ae.bottomRightAlignment};function Ks({settings:e,content:t,styles:n,isEditor:o}){const[i,l]=u.useState(null),{widthSettings:r,fontSettings:s,letterSpacing:c,textAlign:p,wordSpacing:d,fontSizeLineHeight:$,textAppearance:h,color:f}=n.imageCaption,[m,g]=u.useState(void 0),[C,y]=u.useState(null),[x,P]=u.useState(0),[L,_]=u.useState(0),{direction:E,transition:v,controls:w,pagination:R,imageCaption:V,triggers:A}=e,H=u.useRef(v.type),{x:D,y:j}=e.controls.offset,U=S=>{i&&i.go(S)};return u.useEffect(()=>{if(!C)return;const S=new ResizeObserver(N=>{if(!i)return;const[k]=N;g({width:Math.round(k.contentRect.width),height:Math.round(k.contentRect.height)})});return S.observe(C),()=>S.unobserve(C)},[C]),u.useEffect(()=>{!i||H.current===v.type||(_(S=>S+1),H.current=v.type)},[v.type]),a.jsx("div",{className:ve(ae.wrapper,{[ae.editor]:o}),ref:y,children:a.jsxs("div",{className:ae.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ve(ae.captionBlock),children:a.jsx("div",{className:ae.captionTextWrapper,children:t.map((S,N)=>a.jsx("div",{className:ve(ae.captionText,js[V.alignment],{[ae.withPointerEvents]:N===x&&o,[ae.active]:N===x}),style:{fontFamily:so(s.fontFamily),fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:r.sizing==="auto"?"max-content":T.scalingValue(r.width,o),letterSpacing:T.scalingValue(c,o),wordSpacing:T.scalingValue(d,o),textAlign:p,fontSize:T.scalingValue($.fontSize,o),lineHeight:T.scalingValue($.lineHeight,o),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ae.captionTextInner,style:{"--link-hover-color":V.linkHoverColor,"--link-color":V.linkColor,position:"relative",top:T.scalingValue(V.offset.y,o),left:T.scalingValue(V.offset.x,o)},children:a.jsx(vn,{content:S.imageCaption})})},N))})}),a.jsx(Jo,{onMove:S=>{P(S.index)},ref:l,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:A.autoPlay!==null,...A.autoPlay!==null&&{interval:parseInt(A.autoPlay)*1e3},direction:E==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:A.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((S,N)=>a.jsx(Qo,{children:a.jsx("div",{className:ae.sliderItem,children:a.jsx("div",{className:ae.imgWrapper,children:a.jsx("img",{className:ve(ae.sliderImage,{[ae.contain]:S.image.objectFit==="contain",[ae.cover]:S.image.objectFit==="cover"}),src:S.image.url,alt:S.image.name??""})})})},N))},L),w.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(ae.arrow,{[ae.arrowVertical]:E==="vert",[ae.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{onClick:()=>{U("-1")},className:ae.arrowInner,style:{transform:`translate(${T.scalingValue(D,o)}, ${T.scalingValue(j*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx($t,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ve(ae.arrowImg,ae.mirror)}),!w.arrowsImgUrl&&a.jsx(wi,{color:w.color,className:ve(ae.arrowIcon,ae.arrowImg,ae.mirror)})]})}),a.jsx("div",{className:ve(ae.arrow,ae.nextArrow,{[ae.arrowVertical]:E==="vert",[ae.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{className:ae.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${T.scalingValue(D*(E==="horiz"?-1:1),o)}, ${T.scalingValue(j,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx($t,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ae.arrowImg}),!w.arrowsImgUrl&&a.jsx(wi,{color:w.color,className:ve(ae.arrowIcon,ae.arrowImg)})]})})]}),A.triggersList.click&&a.jsx("div",{className:ae.clickOverlay,onClick:()=>{i&&i.go("+1")}}),R.isActive&&a.jsx("div",{className:ve(ae.pagination,{[ae.paginationInsideBottom]:R.position==="inside-1"&&E==="horiz",[ae.paginationInsideTop]:R.position==="inside-2"&&E==="horiz",[ae.paginationOutsideBottom]:R.position==="outside-1"&&E==="horiz",[ae.paginationOutsideTop]:R.position==="outside-2"&&E==="horiz",[ae.paginationInsideLeft]:R.position==="inside-1"&&E==="vert",[ae.paginationInsideRight]:R.position==="inside-2"&&E==="vert",[ae.paginationOutsideLeft]:R.position==="outside-1"&&E==="vert",[ae.paginationOutsideRight]:R.position==="outside-2"&&E==="vert",[ae.paginationVertical]:E==="vert"}),children:a.jsx("div",{className:ae.paginationInner,style:{backgroundColor:R.colors[2],transform:`scale(${R.scale/100}) translate(${T.scalingValue(R.offset.x,o)}, ${T.scalingValue(R.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((S,N)=>a.jsx("button",{onClick:()=>{i&&i.go(N)},className:ve(ae.paginationItem),children:a.jsx("div",{className:ve(ae.dot,{[ae.activeDot]:N===x}),style:{backgroundColor:N===x?R.colors[0]:R.colors[1],"--pagination-hover-color":R.hover}})},N))})})]})})}function wi({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 Us={element:Ks,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},qs="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Gs="ImageRevealSlider-module__image___Qjt-e",Ys="ImageRevealSlider-module__link___N-iLG",Xs="ImageRevealSlider-module__cursor___2U03d",zt={imageRevealSlider:qs,image:Gs,link:Ys,cursor:Xs};function $i(e,t,n){for(const o of n){const i=new Image;i.src=o.url;const l=o.width?Number.parseFloat(o.width):i.naturalWidth,r=i.naturalHeight/i.naturalWidth*l,s=l/2,c=r/2;if(e>=o.x-s&&e<=o.x+s&&t>=o.y-c&&t<=o.y+c)return!0}return!1}function fo(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Zs(e,t,n,o){let i,l;if(t==="custom"){i=n;const r=await fo(e);l=r.height/r.width*i}else if(t==="random"){i=Math.random()*(o.max-o.min)+o.min;const r=await fo(e);l=r.height/r.width*i}else{const r=await fo(e);i=r.width,l=r.height}return{width:i,height:l,finalWidth:`${i}px`}}function Js({settings:e,content:t,isEditor:n}){const[o,i]=u.useState(null),[l,r]=u.useState([]),[s,c]=u.useState(0),p=u.useRef(0),[d,$]=u.useState({x:0,y:0}),[h,f]=u.useState(1),[m,g]=u.useState("none"),C=u.useRef({x:0,y:0}),[y,x]=u.useState(!1),{sizeType:P,imageWidth:L,randomRangeImageWidth:_}=e.imageSize,{revealPosition:E,visible:v}=e.position,{cursorType:w,target:R,defaultCursorScale:V,defaultCursor:A,hoverCursorScale:H,hoverCursor:D}=e.cursor;u.useEffect(()=>{if(!o)return;const S=(M,W)=>{const B=o.getBoundingClientRect(),ee=M-B.left,de=W-B.top;if($({x:ee,y:de}),w==="system"){g("none"),f(1);return}const re=ee,me=de,O=document.elementFromPoint(B.left+re,B.top+me);if(O&&O.closest("a")){g("none"),f(1);return}const te=$i(re,me,l)||R==="area"?{img:D??"none",scale:H}:{img:A??"none",scale:V};g(te.img),f(te.scale)},N=M=>{M.stopPropagation(),C.current={x:M.clientX,y:M.clientY},S(M.clientX,M.clientY)},k=()=>{y&&S(C.current.x,C.current.y)};return o.addEventListener("mousemove",N),window.addEventListener("scroll",k,!0),()=>{o.removeEventListener("mousemove",N),window.removeEventListener("scroll",k,!0)}},[o,y,d,w,R,D,A,H,V,l]),u.useEffect(()=>{y||(g("none"),f(0))},[y]);const j=async(S,N,k,M={})=>{const{width:W,height:B,finalWidth:ee}=await Zs(S.image.url,P,L,_);let de=0,re=0;E==="same"?(de=N/2,re=k/2):(de=M.x??Math.random()*N,re=M.y??Math.random()*k);const me=Math.min(Math.max(de,W/2),N-W/2),O=Math.min(Math.max(re,B/2),k-B/2);return{id:p.current++,url:S.image.url,link:S.link,name:S.image.name,x:me,y:O,width:ee}};u.useEffect(()=>{if(!o||t.length===0)return;const S=o.getBoundingClientRect(),N=S.width,k=S.height,M=[];(async()=>{const B=t[0],ee=await j(B,N,k);M.push(ee),r(M),c(1)})()},[P,L,_,E,o]),u.useEffect(()=>{v==="last One"&&r(S=>S.length>0?[S[S.length-1]]:[])},[v]);const U=async S=>{if(!o)return;const N=o.getBoundingClientRect(),k=S.clientX-N.left,M=S.clientY-N.top;if(R==="image"&&!$i(k,M,l))return;let W=0,B=0;E==="on Click"?(W=k,B=M):E==="same"?(W=N.width/2,B=N.height/2):(W=Math.random()*N.width,B=Math.random()*N.height);const ee=t[s],de=await j(ee,N.width,N.height,{x:W,y:B});r(re=>v==="all"?[...re,de]:[de]),c(re=>re>=t.length-1?0:re+1)};return a.jsxs("div",{ref:i,onClick:U,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:zt.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[l.map(S=>a.jsx("div",{className:zt.wrapper,style:{top:`${S.y}px`,left:`${S.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:S.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:R==="area"&&S.link?a.jsx("a",{href:S.link,target:"_blank",className:zt.link,children:a.jsx("img",{src:S.url,alt:S.name,className:zt.image},S.id)}):a.jsx("img",{src:S.url,alt:S.name,className:zt.image},S.id)},S.id)),y&&a.jsx("div",{className:zt.cursor,style:{left:`${d.x}px`,top:`${d.y}px`,transform:`translate(-50%, -50%) scale(${h})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Qs={element:Js,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},el="LightBox-module__hidden___9s-9x",tl="LightBox-module__heroImage___sTxNF",nl="LightBox-module__background___rm9ml",ol="LightBox-module__editor___4ACaY",il="LightBox-module__contentStyle___Bgnsq",rl="LightBox-module__imageStyle___tLIlB",al="LightBox-module__imgWrapper___LuFUp",sl="LightBox-module__contain___8-yaS",ll="LightBox-module__cover___hNvOG",cl="LightBox-module__caption___b6L2I",dl="LightBox-module__captionTextInner___rCGNH",ul="LightBox-module__lightboxSplide___XFuWC",pl="LightBox-module__arrow___iz38X",ml="LightBox-module__arrowVertical___Zfz81",gl="LightBox-module__nextArrow___zkAQN",hl="LightBox-module__arrowInner___p48sW",fl="LightBox-module__arrowIcon___3VaFf",yl="LightBox-module__arrowImg___pNV88",vl="LightBox-module__mirror___pjeXc",bl="LightBox-module__thumbsWrapper___GB-nU",xl="LightBox-module__thumbsContainerVertical___wttk5",Cl="LightBox-module__thumbsContainer___osSma",Sl="LightBox-module__thumbsAlignStart___MO6tY",wl="LightBox-module__thumbsAlignCenter___Q4sUx",$l="LightBox-module__thumbsAlignEnd___p4y9R",Tl="LightBox-module__thumbItem___HvnF3",Ll="LightBox-module__closeButton___g2khP",El="LightBox-module__fadeIn___0m5GW",_l="LightBox-module__slideInLeft___gPYwC",Pl="LightBox-module__slideInRight___S-pPp",Al="LightBox-module__slideInTop___DFdAj",Wl="LightBox-module__slideInBottom___m27kZ",Il="LightBox-module__fadeOut___55qBR",Fl="LightBox-module__slideOutLeft___NvU7P",Rl="LightBox-module__slideOutRight___SK7eC",kl="LightBox-module__slideOutTop___Vgg0z",Ml="LightBox-module__slideOutBottom___nJ0Ef",Nl="LightBox-module__scaleSlide___vZriG",G={hidden:el,heroImage:tl,background:nl,editor:ol,contentStyle:il,imageStyle:rl,imgWrapper:al,contain:sl,cover:ll,caption:cl,captionTextInner:dl,lightboxSplide:ul,arrow:pl,arrowVertical:ml,nextArrow:gl,arrowInner:hl,arrowIcon:fl,arrowImg:yl,mirror:vl,thumbsWrapper:bl,thumbsContainerVertical:xl,thumbsContainer:Cl,thumbsAlignStart:Sl,thumbsAlignCenter:wl,thumbsAlignEnd:$l,thumbItem:Tl,closeButton:Ll,fadeIn:El,slideInLeft:_l,slideInRight:Pl,slideInTop:Al,slideInBottom:Wl,fadeOut:Il,slideOutLeft:Fl,slideOutRight:Rl,slideOutTop:kl,slideOutBottom:Ml,scaleSlide:Nl},In=(e,t,n)=>{const o={},[i,l]=e.split("-");return i==="top"?(o.top="0",o.bottom="auto"):i==="middle"?(o.top="50%",o.bottom="auto"):i==="bottom"&&(o.top="auto",o.bottom="0"),l==="left"?(o.left="0",o.right="auto"):l==="center"?(o.left="50%",o.right="auto"):l==="right"&&(o.left="auto",o.right="0"),i==="middle"&&l==="center"?o.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), calc(-50% + ${T.scalingValue(t.y,n)}))`:i==="middle"?o.transform=`translate(${T.scalingValue(t.x,n)}, calc(-50% + ${T.scalingValue(t.y,n)}))`:l==="center"?o.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), ${T.scalingValue(t.y,n)})`:o.transform=`translate(${T.scalingValue(t.x,n)}, ${T.scalingValue(t.y,n)})`,o};function wr(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 Ti(e){const t=e.getBoundingClientRect(),n=wr(e),o=Math.max(0,t.width-n.left-n.right),i=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,r=e.naturalHeight,s=o/i,c=l/r;let p,d;c>s?(p=o,d=o/c):(d=i,p=i*c);const $=t.left+n.left,h=t.top+n.top,f=(o-p)/2+$,m=(i-d)/2+h;return{x:f,y:m,width:p,height:d}}function Li(e){const t=e.getBoundingClientRect(),n=wr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ei(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(i=>parseFloat(i.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ol(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})(),o=(()=>{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})(),i=(()=>{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})(),l=(()=>{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:o,backdropDisappearClass:i,disappearClass:l}}const Hl=({settings:e,content:t,styles:n,portalId:o,activeEvent:i,isEditor:l})=>{const[r,s]=u.useState(!1),{url:c}=e.thumbnailBlock.cover;return u.useEffect(()=>{i==="close"&&s(!1),i==="open"&&s(!0)},[i]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:c,alt:"Cover",className:G.heroImage,onClick:()=>s(!0)}),a.jsx(Bl,{isOpen:r,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:l})]})},Bl=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:i,portalId:l,isEditor:r,metadata:s})=>{var I;const[c,p]=u.useState(0),[d,$]=u.useState(0),[h,f]=u.useState(!1),[m,g]=u.useState(!1),[C,y]=u.useState({}),x=u.useRef(null),P=u.useRef(null),L=u.useRef(null),_=u.useRef(!1),E=u.useRef(null),v=u.useRef(null),w=u.useRef(null),R=u.useRef(null),V=u.useRef(!1),A=u.useRef(null),[H,D]=u.useState(!1),{appear:j,triggers:U,slider:S,thumbnail:N,controls:k,area:M,caption:W,layout:B}=i.lightboxBlock,{appearClass:ee,backdropAppearClass:de,backdropDisappearClass:re,disappearClass:me}=Ol(j.type,j.direction),O=(s==null?void 0:s.itemId)??null;u.useEffect(()=>{const b=()=>{setTimeout(()=>{var q,Z;(Z=(q=x.current)==null?void 0:q.splide)==null||Z.refresh()},16)},z=()=>{$(q=>q+1)};return window.addEventListener("ArticleEditor.Layout:change",b),window.addEventListener("ArticleEditor.ComponentContent:change",z),()=>{window.removeEventListener("ArticleEditor.Layout:change",b),window.removeEventListener("ArticleEditor.ComponentContent:change",z)}},[]),u.useEffect(()=>{if(!e||!N.isActive){D(!1);return}const b=A.current;if(!b)return;const z=()=>{S.direction==="horiz"?D(b.scrollWidth>b.clientWidth):D(b.scrollHeight>b.clientHeight)};z();const q=new ResizeObserver(z);return q.observe(b),()=>q.disconnect()},[e,N.isActive,n.length,C,S.direction]);const te=u.useCallback(()=>{const b=window.matchMedia("(max-width: 768px)").matches,z=Ei(M.color);b&&!r&&z>.9&&(document.body.style.backgroundColor=""),f(!0),_.current=!0;const q=Z=>{Z.target===E.current&&Z.animationName&&(E.current&&v.current&&E.current.removeEventListener("animationend",v.current),v.current=null,_.current&&(_.current=!1,t()),f(!1))};E.current&&(v.current=q,E.current.addEventListener("animationend",q))},[t,M.color,r]),Y=(b,z,q)=>{var Z,se;if(b){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&c===n.length-1?te():(Z=x.current)==null||Z.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const le=b.getBoundingClientRect(),ce=z-le.left,ge=q-le.top,K=le.width,J=le.height;let Q;S.direction==="horiz"?Q=ce<K/2?"-1":"+1":Q=ge<J/2?"-1":"+1",(se=x.current)==null||se.go(Q)}}},X=b=>{if(V.current){V.current=!1;return}const z=n[c],q=(z==null?void 0:z.image.objectFit)==="cover";let Z,se;if("changedTouches"in b&&b.changedTouches.length>0)Z=b.changedTouches[0].clientX,se=b.changedTouches[0].clientY;else if("clientX"in b)Z=b.clientX,se=b.clientY;else return;let le;if(q&&L.current){const ce=Li(L.current);le=Z>=ce.left&&Z<=ce.right&&se>=ce.top&&se<=ce.bottom}else{const ce=L.current?Ti(L.current):null;if(!ce){b.target===b.currentTarget&&te();return}le=Z>=ce.x&&Z<=ce.x+ce.width&&se>=ce.y&&se<=ce.y+ce.height}le?Y(L.current,Z,se):te()},ne=b=>{const z=b.target;(z.classList.contains(G.thumbsWrapper)||z.classList.contains(G.thumbsContainer))&&X(b)};u.useEffect(()=>{if(!e)return;const b=z=>{var q,Z;if(z.key==="Escape"){te();return}if(z.key==="ArrowRight"){p(se=>(se+1)%Math.max(n.length,1)),(q=x.current)==null||q.go("+1");return}z.key==="ArrowLeft"&&(p(se=>(se-1+Math.max(n.length,1))%Math.max(n.length,1)),(Z=x.current)==null||Z.go("-1"))};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[e,te,n.length]),u.useEffect(()=>{if(e){if(p(0),$(z=>z+1),_.current=!1,f(!1),g(!1),y({}),!O)return;const b=new CustomEvent("page-overlay",{detail:{itemId:O}});window.dispatchEvent(b)}return()=>{E.current&&v.current&&(E.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,O]),u.useEffect(()=>{P.current!==null&&P.current!==S.type&&$(b=>b+1),P.current=S.type},[S.type]),u.useEffect(()=>{if(!e)return;const b=document.body.style.overflow,z=window.matchMedia("(max-width: 768px)").matches,q=Ei(M.color);document.body.style.overflow="hidden",g(!1);const Z=le=>{le.target===E.current&&!_.current&&le.animationName&&(z&&!r&&q>.9&&(document.body.style.backgroundColor=M.color),g(!0),E.current&&w.current&&E.current.removeEventListener("animationend",w.current),w.current=null)};E.current&&(w.current=Z,E.current.addEventListener("animationend",Z));const se=le=>{const ce=le.target;ce&&(ce.closest(`.${G.thumbsWrapper}`)||ce.closest(`.${G.thumbsContainer}`))||S.type!=="slide"&&le.preventDefault()};return document.addEventListener("touchmove",se,{passive:!1}),()=>{document.body.style.overflow=b,document.removeEventListener("touchmove",se),E.current&&w.current&&(E.current.removeEventListener("animationend",w.current),w.current=null),g(!1)}},[e,r,M.color,S.type]),u.useEffect(()=>{if(!e)return;const b=z=>{var Z,se;if(_.current){z.stopPropagation();return}if(V.current){V.current=!1;return}const q=z.target;if(!(q&&(q.closest(`.${G.thumbsContainer}`)||q.closest(`.${G.thumbItem}`)||q.closest(`.${G.arrow}`)||q.closest(`.${G.closeButton}`)||q.closest(`.${G.caption}`)))){if(S.type==="slide"&&U.type==="drag"&&((se=(Z=x.current)==null?void 0:Z.splide)!=null&&se.root)){const le=x.current.splide.root;if(q&&(le.contains(q)||le===q))return}if(z.touches.length===0&&z.changedTouches.length>0){const le=n[c],ce=(le==null?void 0:le.image.objectFit)==="cover",ge=z.changedTouches[0];let K;if(ce&&L.current){const J=Li(L.current);K=ge.clientX>=J.left&&ge.clientX<=J.right&&ge.clientY>=J.top&&ge.clientY<=J.bottom}else{const J=L.current?Ti(L.current):null;if(!J)return;K=ge.clientX>=J.x&&ge.clientX<=J.x+J.width&&ge.clientY>=J.y&&ge.clientY<=J.y+J.height}if(!K){z.stopPropagation(),_.current=!0;const J=Q=>{Q.stopPropagation(),Q.preventDefault(),document.removeEventListener("click",J,!0)};document.addEventListener("click",J,!0),te()}}}};return document.addEventListener("touchend",b,{passive:!0}),()=>{document.removeEventListener("touchend",b)}},[e,te,c,n]);const F=(S.type==="scale"||S.type==="fade")&&S.direction==="vert"&&U.type==="drag";u.useEffect(()=>{var Q,pe;if(!e||!F||!((pe=(Q=x.current)==null?void 0:Q.splide)!=null&&pe.root))return;const b=x.current.splide.root,z=30,q=(ie,ue)=>{if(R.current){const Ce=Math.abs(ie-R.current.x),$e=Math.abs(ue-R.current.y);(Ce>0||$e>0)&&(V.current=!0)}},Z=ie=>{R.current&&(ie.preventDefault(),q(ie.clientX,ie.clientY))},se=ie=>{R.current&&ie.touches.length>0&&(ie.preventDefault(),q(ie.touches[0].clientX,ie.touches[0].clientY))},le=(ie,ue)=>{if(!R.current||!x.current){R.current=null;return}const Ce=Math.abs(ie-R.current.x),$e=Math.abs(ue-R.current.y);$e>z&&$e>Ce&&x.current.go(ue<R.current.y?"+1":"-1"),R.current=null},ce=ie=>{R.current&&le(ie.clientX,ie.clientY),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("pointermove",Z)},ge=ie=>{if(R.current){if(ie.changedTouches.length>0){const ue=ie.changedTouches[0];le(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",se)}},K=ie=>{R.current={x:ie.clientX,y:ie.clientY},V.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",ce),document.addEventListener("pointercancel",ce)},J=ie=>{ie.touches.length>0&&(R.current={x:ie.touches[0].clientX,y:ie.touches[0].clientY},V.current=!1,document.addEventListener("touchmove",se,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return b.addEventListener("pointerdown",K),b.addEventListener("touchstart",J),()=>{b.removeEventListener("pointerdown",K),b.removeEventListener("touchstart",J),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("touchmove",se),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),R.current=null,V.current=!1}},[e,F,d]);const oe={backgroundColor:M.color,backdropFilter:`blur(${M.blur}px)`,animationDuration:`${parseInt(j.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Bi.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:r?null:E,className:ve(G.background,h?re:de,{[G.editor]:r},{[G.hidden]:!e}),style:{...oe,...m&&!r&&!h?{position:"absolute"}:{}}}),a.jsxs("div",{ref:r?E:null,className:ve(G.contentStyle,h?me:ee,{[G.editor]:r},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(j.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Jo,{onMove:b=>p(b.index),ref:x,className:G.lightboxSplide,options:{arrows:!1,speed:S.duration?parseInt(S.duration):500,direction:S.direction==="horiz"||S.type==="fade"||S.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!F,perPage:1,width:"100%",height:"100%",type:S.type==="fade"||S.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":S.duration},children:n.map((b,z)=>{const q=In(B.position,B.offset,r),Z=`${T.scalingValue(B.padding.top,r)} ${T.scalingValue(B.padding.right,r)} ${T.scalingValue(B.padding.bottom,r)} ${T.scalingValue(B.padding.left,r)}`,se=S.type==="scale"?(()=>{const{transform:le,...ce}=q;return{...ce,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":le||"none"}})():{...q,position:"absolute",padding:Z,boxSizing:"border-box"};return a.jsx(Qo,{children:a.jsx("div",{className:G.imgWrapper,onClick:X,children:a.jsx("img",{ref:z===c?L:null,className:ve(G.imageStyle,{[G.contain]:b.image.objectFit==="contain",[G.cover]:b.image.objectFit==="cover",[G.scaleSlide]:S.type==="scale"}),src:b.image.url,alt:b.image.name??"",style:{...se,pointerEvents:b.image.objectFit==="contain"?"none":"auto"}})})},z)})},d),k.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(G.arrow,{[G.arrowVertical]:S.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${T.scalingValue(k.offset.x,r)}, ${T.scalingValue(k.offset.y*(S.direction==="horiz"?1:-1),r)}) scale(${k.scale}) rotate(${S.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=x.current)==null?void 0:b.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&a.jsx($t,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:ve(G.arrowImg,G.mirror)}),!k.arrowsImgUrl&&a.jsx(_i,{color:k.color,className:ve(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:ve(G.arrow,G.nextArrow,{[G.arrowVertical]:S.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${T.scalingValue(k.offset.x*(S.direction==="horiz"?-1:1),r)}, ${T.scalingValue(k.offset.y,r)}) scale(${k.scale}) rotate(${S.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=x.current)==null?void 0:b.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&a.jsx($t,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:G.arrowImg}),!k.arrowsImgUrl&&a.jsx(_i,{color:k.color,className:ve(G.arrowIcon,G.arrowImg)})]})})]}),M.closeIconUrl&&(()=>{const b=In(M.closeIconAlign,M.closeIconOffset,r),z=`scale(${M.closeIconScale})`,q=b.transform?`${b.transform} ${z}`:z;return a.jsx("button",{className:G.closeButton,style:{...b,transform:q},onClick:te,"aria-label":"Close lightbox",children:a.jsx($t,{url:M.closeIconUrl,fill:M.closeIconColor??"#000000",hoverFill:M.closeIconHover??"#cccccc"})})})(),W&&W.isActive&&o.imageCaption&&((I=n[c])==null?void 0:I.imageCaption)&&(()=>{const{widthSettings:b,fontSettings:z,letterSpacing:q,textAlign:Z,wordSpacing:se,fontSizeLineHeight:le,textAppearance:ce,color:ge}=o.imageCaption;return a.jsx("div",{className:G.caption,style:{...In(W.alignment,W.offset,r),fontFamily:so(z.fontFamily),fontWeight:z.fontWeight,fontStyle:z.fontStyle,width:b.sizing==="auto"?"max-content":T.scalingValue(b.width,r),letterSpacing:T.scalingValue(q,r),wordSpacing:T.scalingValue(se,r),textAlign:Z,fontSize:T.scalingValue(le.fontSize,r),lineHeight:T.scalingValue(le.lineHeight,r),textTransform:ce.textTransform??"none",textDecoration:ce.textDecoration??"none",fontVariant:ce.fontVariant??"normal",color:ge},onClick:K=>K.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":W.linkColor,"--link-hover-color":W.linkHoverColor},children:a.jsx(vn,{content:n[c].imageCaption})})})})(),N.isActive&&(()=>{const[b,z]=N.position.split("-"),q=S.direction==="horiz"?`${b}-left`:N.position,Z=In(q,N.offset,r),se=()=>{if(S.direction==="horiz"){if(z==="left")return"flex-start";if(z==="center")return"center";if(z==="right")return"flex-end"}else{if(b==="top")return"flex-start";if(b==="middle")return"center";if(b==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:A,className:G.thumbsWrapper,onClick:le=>ne(le),style:{position:r?"absolute":"fixed",...Z,...S.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ve(G.thumbsContainer,{[G.thumbsContainerVertical]:S.direction==="vert",[G.thumbsAlignStart]:N.align==="start",[G.thumbsAlignCenter]:N.align==="center",[G.thumbsAlignEnd]:N.align==="end"}),style:{gap:T.scalingValue(N.grid.gap,r),justifyContent:H?"flex-start":se()},children:n.map((le,ce)=>{const ge=ce===c,K=C[ce],Q=N.grid.size*(ge?N.activeState.scale:1),pe=()=>{if(N.fit!=="fit")return{};if(!K)return S.direction==="horiz"?{height:T.scalingValue(Q,r)}:{width:T.scalingValue(Q,r)};const ie=K.width/K.height;if(S.direction==="horiz"){const ue=Q,Ce=ue*ie;return{width:T.scalingValue(Ce,r),height:T.scalingValue(ue,r)}}else{const ue=Q,Ce=ue/ie;return{width:T.scalingValue(ue,r),height:T.scalingValue(Ce,r)}}};return a.jsx("button",{className:G.thumbItem,style:{...S.direction==="horiz"&&N.fit!=="fit"?{height:T.scalingValue(Q,r)}:{},...S.direction==="vert"&&N.fit!=="fit"?{width:T.scalingValue(Q,r)}:{},...N.fit==="cover"?{width:T.scalingValue(Q,r),height:T.scalingValue(Q,r)}:{},...pe(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?N.activeState.opacity/100:N.opacity/100,"--thumb-hover":N.activeState.opacity/100},onClick:ie=>{var ue;ie.stopPropagation(),p(ce),(ue=x.current)==null||ue.go(ce)},onMouseEnter:()=>{var ie;N.triggers==="hov"&&((ie=x.current)==null||ie.go(ce))},children:a.jsx("img",{src:le.image.url,alt:le.image.name??"",onLoad:ie=>{const ue=ie.currentTarget;ue.naturalWidth&&ue.naturalHeight&&y(Ce=>({...Ce,[ce]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:N.fit==="cover"?"cover":"contain",...N.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...N.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${le.image.name}-${ce}`)})})})})()]})]}),document.getElementById(l))};function _i({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 Vl={element:Hl,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function Fn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dl(e){return`
|
|
6
|
+
*/const Ms="RichTextRenderer-module__link___BWeZ2",Ns={link:Ms},Os=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},so=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Os(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function yt(e){const{color:t,...n}=e;return n}function qe(e,t){var n,o,i;return{fontFamily:so(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:T.scalingValue(e.letterSpacing,t),wordSpacing:T.scalingValue(e.wordSpacing,t),fontSize:T.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?T.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(i=e.textAppearance)==null?void 0:i.fontVariant,color:e.color}}const vn=({content:e})=>{const t=n=>n.map((o,i)=>o.type==="link"?a.jsx("a",{className:Ns.link,href:o.value,target:o.target,children:t(o.children)},i):a.jsx("span",{style:Hs(o),children:o.text},i));return a.jsx(a.Fragment,{children:e.map((n,o)=>{const i=n.children;return a.jsx("div",{children:t(i)},o)})})};function Hs(e){return{...e.fontFamily&&{fontFamily:so(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 Bs="SvgImage-module__svg___q3xE-",Vs="SvgImage-module__img___VsTm-",Si={svg:Bs,img:Vs},Ds=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},zs=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,$t=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:i})=>{const[l,r]=u.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return u.useEffect(()=>{if(typeof window<"u"&&window.CSS){const s=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');r(s)}},[]),!Ds(e)||!l?a.jsx("img",{src:e,alt:"",className:ve(Si.img,o),style:i}):a.jsx("span",{"data-supports-mask":l,className:ve(Si.svg,o),style:{"--svg":zs(e),"--fill":t,"--hover-fill":n,...i??{}}})},js={"top-left":ae.topLeftAlignment,"top-center":ae.topCenterAlignment,"top-right":ae.topRightAlignment,"middle-left":ae.middleLeftAlignment,"middle-center":ae.middleCenterAlignment,"middle-right":ae.middleRightAlignment,"bottom-left":ae.bottomLeftAlignment,"bottom-center":ae.bottomCenterAlignment,"bottom-right":ae.bottomRightAlignment};function Ks({settings:e,content:t,styles:n,isEditor:o}){const[i,l]=u.useState(null),{widthSettings:r,fontSettings:s,letterSpacing:c,textAlign:p,wordSpacing:d,fontSizeLineHeight:$,textAppearance:h,color:f}=n.imageCaption,[m,g]=u.useState(void 0),[C,y]=u.useState(null),[x,P]=u.useState(0),[L,_]=u.useState(0),{direction:E,transition:v,controls:w,pagination:R,imageCaption:V,triggers:A}=e,H=u.useRef(v.type),{x:D,y:j}=e.controls.offset,U=S=>{i&&i.go(S)};return u.useEffect(()=>{if(!C)return;const S=new ResizeObserver(N=>{if(!i)return;const[k]=N;g({width:Math.round(k.contentRect.width),height:Math.round(k.contentRect.height)})});return S.observe(C),()=>S.unobserve(C)},[C]),u.useEffect(()=>{!i||H.current===v.type||(_(S=>S+1),H.current=v.type)},[v.type]),a.jsx("div",{className:ve(ae.wrapper,{[ae.editor]:o}),ref:y,children:a.jsxs("div",{className:ae.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ve(ae.captionBlock),children:a.jsx("div",{className:ae.captionTextWrapper,children:t.map((S,N)=>a.jsx("div",{className:ve(ae.captionText,js[V.alignment],{[ae.withPointerEvents]:N===x&&o,[ae.active]:N===x}),style:{fontFamily:so(s.fontFamily),fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:r.sizing==="auto"?"max-content":T.scalingValue(r.width,o),letterSpacing:T.scalingValue(c,o),wordSpacing:T.scalingValue(d,o),textAlign:p,fontSize:T.scalingValue($.fontSize,o),lineHeight:T.scalingValue($.lineHeight,o),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ae.captionTextInner,style:{"--link-hover-color":V.linkHoverColor,"--link-color":V.linkColor,position:"relative",top:T.scalingValue(V.offset.y,o),left:T.scalingValue(V.offset.x,o)},children:a.jsx(vn,{content:S.imageCaption})})},N))})}),a.jsx(Jo,{onMove:S=>{P(S.index)},ref:l,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:A.autoPlay!==null,...A.autoPlay!==null&&{interval:parseInt(A.autoPlay)*1e3},direction:E==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:A.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((S,N)=>a.jsx(Qo,{children:a.jsx("div",{className:ae.sliderItem,children:a.jsx("div",{className:ae.imgWrapper,children:a.jsx("img",{className:ve(ae.sliderImage,{[ae.contain]:S.image.objectFit==="contain",[ae.cover]:S.image.objectFit==="cover"}),src:S.image.url,alt:S.image.name??""})})})},N))},L),w.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(ae.arrow,{[ae.arrowVertical]:E==="vert",[ae.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{onClick:()=>{U("-1")},className:ae.arrowInner,style:{transform:`translate(${T.scalingValue(D,o)}, ${T.scalingValue(j*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx($t,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ve(ae.arrowImg,ae.mirror)}),!w.arrowsImgUrl&&a.jsx(wi,{color:w.color,className:ve(ae.arrowIcon,ae.arrowImg,ae.mirror)})]})}),a.jsx("div",{className:ve(ae.arrow,ae.nextArrow,{[ae.arrowVertical]:E==="vert",[ae.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{className:ae.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${T.scalingValue(D*(E==="horiz"?-1:1),o)}, ${T.scalingValue(j,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx($t,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ae.arrowImg}),!w.arrowsImgUrl&&a.jsx(wi,{color:w.color,className:ve(ae.arrowIcon,ae.arrowImg)})]})})]}),A.triggersList.click&&a.jsx("div",{className:ae.clickOverlay,onClick:()=>{i&&i.go("+1")}}),R.isActive&&a.jsx("div",{className:ve(ae.pagination,{[ae.paginationInsideBottom]:R.position==="inside-1"&&E==="horiz",[ae.paginationInsideTop]:R.position==="inside-2"&&E==="horiz",[ae.paginationOutsideBottom]:R.position==="outside-1"&&E==="horiz",[ae.paginationOutsideTop]:R.position==="outside-2"&&E==="horiz",[ae.paginationInsideLeft]:R.position==="inside-1"&&E==="vert",[ae.paginationInsideRight]:R.position==="inside-2"&&E==="vert",[ae.paginationOutsideLeft]:R.position==="outside-1"&&E==="vert",[ae.paginationOutsideRight]:R.position==="outside-2"&&E==="vert",[ae.paginationVertical]:E==="vert"}),children:a.jsx("div",{className:ae.paginationInner,style:{backgroundColor:R.colors[2],transform:`scale(${R.scale/100}) translate(${T.scalingValue(R.offset.x,o)}, ${T.scalingValue(R.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((S,N)=>a.jsx("button",{onClick:()=>{i&&i.go(N)},className:ve(ae.paginationItem),children:a.jsx("div",{className:ve(ae.dot,{[ae.activeDot]:N===x}),style:{backgroundColor:N===x?R.colors[0]:R.colors[1],"--pagination-hover-color":R.hover}})},N))})})]})})}function wi({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 Us={element:Ks,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},qs="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Gs="ImageRevealSlider-module__image___Qjt-e",Ys="ImageRevealSlider-module__link___N-iLG",Xs="ImageRevealSlider-module__cursor___2U03d",zt={imageRevealSlider:qs,image:Gs,link:Ys,cursor:Xs};function $i(e,t,n){for(const o of n){const i=new Image;i.src=o.url;const l=o.width?Number.parseFloat(o.width):i.naturalWidth,r=i.naturalHeight/i.naturalWidth*l,s=l/2,c=r/2;if(e>=o.x-s&&e<=o.x+s&&t>=o.y-c&&t<=o.y+c)return!0}return!1}function fo(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Zs(e,t,n,o){let i,l;if(t==="custom"){i=n;const r=await fo(e);l=r.height/r.width*i}else if(t==="random"){i=Math.random()*(o.max-o.min)+o.min;const r=await fo(e);l=r.height/r.width*i}else{const r=await fo(e);i=r.width,l=r.height}return{width:i,height:l,finalWidth:`${i}px`}}function Js({settings:e,content:t,isEditor:n}){const[o,i]=u.useState(null),[l,r]=u.useState([]),[s,c]=u.useState(0),p=u.useRef(0),[d,$]=u.useState({x:0,y:0}),[h,f]=u.useState(1),[m,g]=u.useState("none"),C=u.useRef({x:0,y:0}),[y,x]=u.useState(!1),{sizeType:P,imageWidth:L,randomRangeImageWidth:_}=e.imageSize,{revealPosition:E,visible:v}=e.position,{cursorType:w,target:R,defaultCursorScale:V,defaultCursor:A,hoverCursorScale:H,hoverCursor:D}=e.cursor;u.useEffect(()=>{if(!o)return;const S=(M,W)=>{const B=o.getBoundingClientRect(),ee=M-B.left,de=W-B.top;if($({x:ee,y:de}),w==="system"){g("none"),f(1);return}const re=ee,me=de,O=document.elementFromPoint(B.left+re,B.top+me);if(O&&O.closest("a")){g("none"),f(1);return}const te=$i(re,me,l)||R==="area"?{img:D??"none",scale:H}:{img:A??"none",scale:V};g(te.img),f(te.scale)},N=M=>{M.stopPropagation(),C.current={x:M.clientX,y:M.clientY},S(M.clientX,M.clientY)},k=()=>{y&&S(C.current.x,C.current.y)};return o.addEventListener("mousemove",N),window.addEventListener("scroll",k,!0),()=>{o.removeEventListener("mousemove",N),window.removeEventListener("scroll",k,!0)}},[o,y,d,w,R,D,A,H,V,l]),u.useEffect(()=>{y||(g("none"),f(0))},[y]);const j=async(S,N,k,M={})=>{const{width:W,height:B,finalWidth:ee}=await Zs(S.image.url,P,L,_);let de=0,re=0;E==="same"?(de=N/2,re=k/2):(de=M.x??Math.random()*N,re=M.y??Math.random()*k);const me=Math.min(Math.max(de,W/2),N-W/2),O=Math.min(Math.max(re,B/2),k-B/2);return{id:p.current++,url:S.image.url,link:S.link,name:S.image.name,x:me,y:O,width:ee}};u.useEffect(()=>{if(!o||t.length===0)return;const S=o.getBoundingClientRect(),N=S.width,k=S.height,M=[];(async()=>{const B=t[0],ee=await j(B,N,k);M.push(ee),r(M),c(1)})()},[P,L,_,E,o]),u.useEffect(()=>{v==="last One"&&r(S=>S.length>0?[S[S.length-1]]:[])},[v]);const U=async S=>{if(!o)return;const N=o.getBoundingClientRect(),k=S.clientX-N.left,M=S.clientY-N.top;if(R==="image"&&!$i(k,M,l))return;let W=0,B=0;E==="on Click"?(W=k,B=M):E==="same"?(W=N.width/2,B=N.height/2):(W=Math.random()*N.width,B=Math.random()*N.height);const ee=t[s],de=await j(ee,N.width,N.height,{x:W,y:B});r(re=>v==="all"?[...re,de]:[de]),c(re=>re>=t.length-1?0:re+1)};return a.jsxs("div",{ref:i,onClick:U,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:zt.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[l.map(S=>a.jsx("div",{className:zt.wrapper,style:{top:`${S.y}px`,left:`${S.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:S.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:R==="area"&&S.link?a.jsx("a",{href:S.link,target:"_blank",className:zt.link,children:a.jsx("img",{src:S.url,alt:S.name,className:zt.image},S.id)}):a.jsx("img",{src:S.url,alt:S.name,className:zt.image},S.id)},S.id)),y&&a.jsx("div",{className:zt.cursor,style:{left:`${d.x}px`,top:`${d.y}px`,transform:`translate(-50%, -50%) scale(${h})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Qs={element:Js,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},el="LightBox-module__hidden___9s-9x",tl="LightBox-module__heroImage___sTxNF",nl="LightBox-module__background___rm9ml",ol="LightBox-module__editor___4ACaY",il="LightBox-module__contentStyle___Bgnsq",rl="LightBox-module__imageStyle___tLIlB",al="LightBox-module__imgWrapper___LuFUp",sl="LightBox-module__contain___8-yaS",ll="LightBox-module__cover___hNvOG",cl="LightBox-module__caption___b6L2I",dl="LightBox-module__captionTextInner___rCGNH",ul="LightBox-module__lightboxSplide___XFuWC",pl="LightBox-module__arrow___iz38X",ml="LightBox-module__arrowVertical___Zfz81",gl="LightBox-module__nextArrow___zkAQN",hl="LightBox-module__arrowInner___p48sW",fl="LightBox-module__arrowIcon___3VaFf",yl="LightBox-module__arrowImg___pNV88",vl="LightBox-module__mirror___pjeXc",bl="LightBox-module__thumbsWrapper___GB-nU",xl="LightBox-module__thumbsContainerVertical___wttk5",Cl="LightBox-module__thumbsContainer___osSma",Sl="LightBox-module__thumbsAlignStart___MO6tY",wl="LightBox-module__thumbsAlignCenter___Q4sUx",$l="LightBox-module__thumbsAlignEnd___p4y9R",Tl="LightBox-module__thumbItem___HvnF3",Ll="LightBox-module__closeButton___g2khP",El="LightBox-module__fadeIn___0m5GW",_l="LightBox-module__slideInLeft___gPYwC",Pl="LightBox-module__slideInRight___S-pPp",Al="LightBox-module__slideInTop___DFdAj",Wl="LightBox-module__slideInBottom___m27kZ",Fl="LightBox-module__fadeOut___55qBR",Il="LightBox-module__slideOutLeft___NvU7P",Rl="LightBox-module__slideOutRight___SK7eC",kl="LightBox-module__slideOutTop___Vgg0z",Ml="LightBox-module__slideOutBottom___nJ0Ef",Nl="LightBox-module__scaleSlide___vZriG",G={hidden:el,heroImage:tl,background:nl,editor:ol,contentStyle:il,imageStyle:rl,imgWrapper:al,contain:sl,cover:ll,caption:cl,captionTextInner:dl,lightboxSplide:ul,arrow:pl,arrowVertical:ml,nextArrow:gl,arrowInner:hl,arrowIcon:fl,arrowImg:yl,mirror:vl,thumbsWrapper:bl,thumbsContainerVertical:xl,thumbsContainer:Cl,thumbsAlignStart:Sl,thumbsAlignCenter:wl,thumbsAlignEnd:$l,thumbItem:Tl,closeButton:Ll,fadeIn:El,slideInLeft:_l,slideInRight:Pl,slideInTop:Al,slideInBottom:Wl,fadeOut:Fl,slideOutLeft:Il,slideOutRight:Rl,slideOutTop:kl,slideOutBottom:Ml,scaleSlide:Nl},Fn=(e,t,n)=>{const o={},[i,l]=e.split("-");return i==="top"?(o.top="0",o.bottom="auto"):i==="middle"?(o.top="50%",o.bottom="auto"):i==="bottom"&&(o.top="auto",o.bottom="0"),l==="left"?(o.left="0",o.right="auto"):l==="center"?(o.left="50%",o.right="auto"):l==="right"&&(o.left="auto",o.right="0"),i==="middle"&&l==="center"?o.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), calc(-50% + ${T.scalingValue(t.y,n)}))`:i==="middle"?o.transform=`translate(${T.scalingValue(t.x,n)}, calc(-50% + ${T.scalingValue(t.y,n)}))`:l==="center"?o.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), ${T.scalingValue(t.y,n)})`:o.transform=`translate(${T.scalingValue(t.x,n)}, ${T.scalingValue(t.y,n)})`,o};function wr(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 Ti(e){const t=e.getBoundingClientRect(),n=wr(e),o=Math.max(0,t.width-n.left-n.right),i=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,r=e.naturalHeight,s=o/i,c=l/r;let p,d;c>s?(p=o,d=o/c):(d=i,p=i*c);const $=t.left+n.left,h=t.top+n.top,f=(o-p)/2+$,m=(i-d)/2+h;return{x:f,y:m,width:p,height:d}}function Li(e){const t=e.getBoundingClientRect(),n=wr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ei(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(i=>parseFloat(i.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ol(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})(),o=(()=>{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})(),i=(()=>{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})(),l=(()=>{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:o,backdropDisappearClass:i,disappearClass:l}}const Hl=({settings:e,content:t,styles:n,portalId:o,activeEvent:i,isEditor:l})=>{const[r,s]=u.useState(!1),{url:c}=e.thumbnailBlock.cover;return u.useEffect(()=>{i==="close"&&s(!1),i==="open"&&s(!0)},[i]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:c,alt:"Cover",className:G.heroImage,onClick:()=>s(!0)}),a.jsx(Bl,{isOpen:r,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:l})]})},Bl=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:i,portalId:l,isEditor:r,metadata:s})=>{var F;const[c,p]=u.useState(0),[d,$]=u.useState(0),[h,f]=u.useState(!1),[m,g]=u.useState(!1),[C,y]=u.useState({}),x=u.useRef(null),P=u.useRef(null),L=u.useRef(null),_=u.useRef(!1),E=u.useRef(null),v=u.useRef(null),w=u.useRef(null),R=u.useRef(null),V=u.useRef(!1),A=u.useRef(null),[H,D]=u.useState(!1),{appear:j,triggers:U,slider:S,thumbnail:N,controls:k,area:M,caption:W,layout:B}=i.lightboxBlock,{appearClass:ee,backdropAppearClass:de,backdropDisappearClass:re,disappearClass:me}=Ol(j.type,j.direction),O=(s==null?void 0:s.itemId)??null;u.useEffect(()=>{const b=()=>{setTimeout(()=>{var q,Z;(Z=(q=x.current)==null?void 0:q.splide)==null||Z.refresh()},16)},z=()=>{$(q=>q+1)};return window.addEventListener("ArticleEditor.Layout:change",b),window.addEventListener("ArticleEditor.ComponentContent:change",z),()=>{window.removeEventListener("ArticleEditor.Layout:change",b),window.removeEventListener("ArticleEditor.ComponentContent:change",z)}},[]),u.useEffect(()=>{if(!e||!N.isActive){D(!1);return}const b=A.current;if(!b)return;const z=()=>{S.direction==="horiz"?D(b.scrollWidth>b.clientWidth):D(b.scrollHeight>b.clientHeight)};z();const q=new ResizeObserver(z);return q.observe(b),()=>q.disconnect()},[e,N.isActive,n.length,C,S.direction]);const te=u.useCallback(()=>{const b=window.matchMedia("(max-width: 768px)").matches,z=Ei(M.color);b&&!r&&z>.9&&(document.body.style.backgroundColor=""),f(!0),_.current=!0;const q=Z=>{Z.target===E.current&&Z.animationName&&(E.current&&v.current&&E.current.removeEventListener("animationend",v.current),v.current=null,_.current&&(_.current=!1,t()),f(!1))};E.current&&(v.current=q,E.current.addEventListener("animationend",q))},[t,M.color,r]),Y=(b,z,q)=>{var Z,se;if(b){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&c===n.length-1?te():(Z=x.current)==null||Z.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const le=b.getBoundingClientRect(),ce=z-le.left,ge=q-le.top,K=le.width,J=le.height;let Q;S.direction==="horiz"?Q=ce<K/2?"-1":"+1":Q=ge<J/2?"-1":"+1",(se=x.current)==null||se.go(Q)}}},X=b=>{if(V.current){V.current=!1;return}const z=n[c],q=(z==null?void 0:z.image.objectFit)==="cover";let Z,se;if("changedTouches"in b&&b.changedTouches.length>0)Z=b.changedTouches[0].clientX,se=b.changedTouches[0].clientY;else if("clientX"in b)Z=b.clientX,se=b.clientY;else return;let le;if(q&&L.current){const ce=Li(L.current);le=Z>=ce.left&&Z<=ce.right&&se>=ce.top&&se<=ce.bottom}else{const ce=L.current?Ti(L.current):null;if(!ce){b.target===b.currentTarget&&te();return}le=Z>=ce.x&&Z<=ce.x+ce.width&&se>=ce.y&&se<=ce.y+ce.height}le?Y(L.current,Z,se):te()},ne=b=>{const z=b.target;(z.classList.contains(G.thumbsWrapper)||z.classList.contains(G.thumbsContainer))&&X(b)};u.useEffect(()=>{if(!e)return;const b=z=>{var q,Z;if(z.key==="Escape"){te();return}if(z.key==="ArrowRight"){p(se=>(se+1)%Math.max(n.length,1)),(q=x.current)==null||q.go("+1");return}z.key==="ArrowLeft"&&(p(se=>(se-1+Math.max(n.length,1))%Math.max(n.length,1)),(Z=x.current)==null||Z.go("-1"))};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[e,te,n.length]),u.useEffect(()=>{if(e){if(p(0),$(z=>z+1),_.current=!1,f(!1),g(!1),y({}),!O)return;const b=new CustomEvent("page-overlay",{detail:{itemId:O}});window.dispatchEvent(b)}return()=>{E.current&&v.current&&(E.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,O]),u.useEffect(()=>{P.current!==null&&P.current!==S.type&&$(b=>b+1),P.current=S.type},[S.type]),u.useEffect(()=>{if(!e)return;const b=document.body.style.overflow,z=window.matchMedia("(max-width: 768px)").matches,q=Ei(M.color);document.body.style.overflow="hidden",g(!1);const Z=le=>{le.target===E.current&&!_.current&&le.animationName&&(z&&!r&&q>.9&&(document.body.style.backgroundColor=M.color),g(!0),E.current&&w.current&&E.current.removeEventListener("animationend",w.current),w.current=null)};E.current&&(w.current=Z,E.current.addEventListener("animationend",Z));const se=le=>{const ce=le.target;ce&&(ce.closest(`.${G.thumbsWrapper}`)||ce.closest(`.${G.thumbsContainer}`))||S.type!=="slide"&&le.preventDefault()};return document.addEventListener("touchmove",se,{passive:!1}),()=>{document.body.style.overflow=b,document.removeEventListener("touchmove",se),E.current&&w.current&&(E.current.removeEventListener("animationend",w.current),w.current=null),g(!1)}},[e,r,M.color,S.type]),u.useEffect(()=>{if(!e)return;const b=z=>{var Z,se;if(_.current){z.stopPropagation();return}if(V.current){V.current=!1;return}const q=z.target;if(!(q&&(q.closest(`.${G.thumbsContainer}`)||q.closest(`.${G.thumbItem}`)||q.closest(`.${G.arrow}`)||q.closest(`.${G.closeButton}`)||q.closest(`.${G.caption}`)))){if(S.type==="slide"&&U.type==="drag"&&((se=(Z=x.current)==null?void 0:Z.splide)!=null&&se.root)){const le=x.current.splide.root;if(q&&(le.contains(q)||le===q))return}if(z.touches.length===0&&z.changedTouches.length>0){const le=n[c],ce=(le==null?void 0:le.image.objectFit)==="cover",ge=z.changedTouches[0];let K;if(ce&&L.current){const J=Li(L.current);K=ge.clientX>=J.left&&ge.clientX<=J.right&&ge.clientY>=J.top&&ge.clientY<=J.bottom}else{const J=L.current?Ti(L.current):null;if(!J)return;K=ge.clientX>=J.x&&ge.clientX<=J.x+J.width&&ge.clientY>=J.y&&ge.clientY<=J.y+J.height}if(!K){z.stopPropagation(),_.current=!0;const J=Q=>{Q.stopPropagation(),Q.preventDefault(),document.removeEventListener("click",J,!0)};document.addEventListener("click",J,!0),te()}}}};return document.addEventListener("touchend",b,{passive:!0}),()=>{document.removeEventListener("touchend",b)}},[e,te,c,n]);const I=(S.type==="scale"||S.type==="fade")&&S.direction==="vert"&&U.type==="drag";u.useEffect(()=>{var Q,pe;if(!e||!I||!((pe=(Q=x.current)==null?void 0:Q.splide)!=null&&pe.root))return;const b=x.current.splide.root,z=30,q=(ie,ue)=>{if(R.current){const Ce=Math.abs(ie-R.current.x),$e=Math.abs(ue-R.current.y);(Ce>0||$e>0)&&(V.current=!0)}},Z=ie=>{R.current&&(ie.preventDefault(),q(ie.clientX,ie.clientY))},se=ie=>{R.current&&ie.touches.length>0&&(ie.preventDefault(),q(ie.touches[0].clientX,ie.touches[0].clientY))},le=(ie,ue)=>{if(!R.current||!x.current){R.current=null;return}const Ce=Math.abs(ie-R.current.x),$e=Math.abs(ue-R.current.y);$e>z&&$e>Ce&&x.current.go(ue<R.current.y?"+1":"-1"),R.current=null},ce=ie=>{R.current&&le(ie.clientX,ie.clientY),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("pointermove",Z)},ge=ie=>{if(R.current){if(ie.changedTouches.length>0){const ue=ie.changedTouches[0];le(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",se)}},K=ie=>{R.current={x:ie.clientX,y:ie.clientY},V.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",ce),document.addEventListener("pointercancel",ce)},J=ie=>{ie.touches.length>0&&(R.current={x:ie.touches[0].clientX,y:ie.touches[0].clientY},V.current=!1,document.addEventListener("touchmove",se,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return b.addEventListener("pointerdown",K),b.addEventListener("touchstart",J),()=>{b.removeEventListener("pointerdown",K),b.removeEventListener("touchstart",J),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("touchmove",se),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),R.current=null,V.current=!1}},[e,I,d]);const oe={backgroundColor:M.color,backdropFilter:`blur(${M.blur}px)`,animationDuration:`${parseInt(j.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Bi.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:r?null:E,className:ve(G.background,h?re:de,{[G.editor]:r},{[G.hidden]:!e}),style:{...oe,...m&&!r&&!h?{position:"absolute"}:{}}}),a.jsxs("div",{ref:r?E:null,className:ve(G.contentStyle,h?me:ee,{[G.editor]:r},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(j.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Jo,{onMove:b=>p(b.index),ref:x,className:G.lightboxSplide,options:{arrows:!1,speed:S.duration?parseInt(S.duration):500,direction:S.direction==="horiz"||S.type==="fade"||S.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!I,perPage:1,width:"100%",height:"100%",type:S.type==="fade"||S.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":S.duration},children:n.map((b,z)=>{const q=Fn(B.position,B.offset,r),Z=`${T.scalingValue(B.padding.top,r)} ${T.scalingValue(B.padding.right,r)} ${T.scalingValue(B.padding.bottom,r)} ${T.scalingValue(B.padding.left,r)}`,se=S.type==="scale"?(()=>{const{transform:le,...ce}=q;return{...ce,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":le||"none"}})():{...q,position:"absolute",padding:Z,boxSizing:"border-box"};return a.jsx(Qo,{children:a.jsx("div",{className:G.imgWrapper,onClick:X,children:a.jsx("img",{ref:z===c?L:null,className:ve(G.imageStyle,{[G.contain]:b.image.objectFit==="contain",[G.cover]:b.image.objectFit==="cover",[G.scaleSlide]:S.type==="scale"}),src:b.image.url,alt:b.image.name??"",style:{...se,pointerEvents:b.image.objectFit==="contain"?"none":"auto"}})})},z)})},d),k.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(G.arrow,{[G.arrowVertical]:S.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${T.scalingValue(k.offset.x,r)}, ${T.scalingValue(k.offset.y*(S.direction==="horiz"?1:-1),r)}) scale(${k.scale}) rotate(${S.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=x.current)==null?void 0:b.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&a.jsx($t,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:ve(G.arrowImg,G.mirror)}),!k.arrowsImgUrl&&a.jsx(_i,{color:k.color,className:ve(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:ve(G.arrow,G.nextArrow,{[G.arrowVertical]:S.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${T.scalingValue(k.offset.x*(S.direction==="horiz"?-1:1),r)}, ${T.scalingValue(k.offset.y,r)}) scale(${k.scale}) rotate(${S.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=x.current)==null?void 0:b.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&a.jsx($t,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:G.arrowImg}),!k.arrowsImgUrl&&a.jsx(_i,{color:k.color,className:ve(G.arrowIcon,G.arrowImg)})]})})]}),M.closeIconUrl&&(()=>{const b=Fn(M.closeIconAlign,M.closeIconOffset,r),z=`scale(${M.closeIconScale})`,q=b.transform?`${b.transform} ${z}`:z;return a.jsx("button",{className:G.closeButton,style:{...b,transform:q},onClick:te,"aria-label":"Close lightbox",children:a.jsx($t,{url:M.closeIconUrl,fill:M.closeIconColor??"#000000",hoverFill:M.closeIconHover??"#cccccc"})})})(),W&&W.isActive&&o.imageCaption&&((F=n[c])==null?void 0:F.imageCaption)&&(()=>{const{widthSettings:b,fontSettings:z,letterSpacing:q,textAlign:Z,wordSpacing:se,fontSizeLineHeight:le,textAppearance:ce,color:ge}=o.imageCaption;return a.jsx("div",{className:G.caption,style:{...Fn(W.alignment,W.offset,r),fontFamily:so(z.fontFamily),fontWeight:z.fontWeight,fontStyle:z.fontStyle,width:b.sizing==="auto"?"max-content":T.scalingValue(b.width,r),letterSpacing:T.scalingValue(q,r),wordSpacing:T.scalingValue(se,r),textAlign:Z,fontSize:T.scalingValue(le.fontSize,r),lineHeight:T.scalingValue(le.lineHeight,r),textTransform:ce.textTransform??"none",textDecoration:ce.textDecoration??"none",fontVariant:ce.fontVariant??"normal",color:ge},onClick:K=>K.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":W.linkColor,"--link-hover-color":W.linkHoverColor},children:a.jsx(vn,{content:n[c].imageCaption})})})})(),N.isActive&&(()=>{const[b,z]=N.position.split("-"),q=S.direction==="horiz"?`${b}-left`:N.position,Z=Fn(q,N.offset,r),se=()=>{if(S.direction==="horiz"){if(z==="left")return"flex-start";if(z==="center")return"center";if(z==="right")return"flex-end"}else{if(b==="top")return"flex-start";if(b==="middle")return"center";if(b==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:A,className:G.thumbsWrapper,onClick:le=>ne(le),style:{position:r?"absolute":"fixed",...Z,...S.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ve(G.thumbsContainer,{[G.thumbsContainerVertical]:S.direction==="vert",[G.thumbsAlignStart]:N.align==="start",[G.thumbsAlignCenter]:N.align==="center",[G.thumbsAlignEnd]:N.align==="end"}),style:{gap:T.scalingValue(N.grid.gap,r),justifyContent:H?"flex-start":se()},children:n.map((le,ce)=>{const ge=ce===c,K=C[ce],Q=N.grid.size*(ge?N.activeState.scale:1),pe=()=>{if(N.fit!=="fit")return{};if(!K)return S.direction==="horiz"?{height:T.scalingValue(Q,r)}:{width:T.scalingValue(Q,r)};const ie=K.width/K.height;if(S.direction==="horiz"){const ue=Q,Ce=ue*ie;return{width:T.scalingValue(Ce,r),height:T.scalingValue(ue,r)}}else{const ue=Q,Ce=ue/ie;return{width:T.scalingValue(ue,r),height:T.scalingValue(Ce,r)}}};return a.jsx("button",{className:G.thumbItem,style:{...S.direction==="horiz"&&N.fit!=="fit"?{height:T.scalingValue(Q,r)}:{},...S.direction==="vert"&&N.fit!=="fit"?{width:T.scalingValue(Q,r)}:{},...N.fit==="cover"?{width:T.scalingValue(Q,r),height:T.scalingValue(Q,r)}:{},...pe(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?N.activeState.opacity/100:N.opacity/100,"--thumb-hover":N.activeState.opacity/100},onClick:ie=>{var ue;ie.stopPropagation(),p(ce),(ue=x.current)==null||ue.go(ce)},onMouseEnter:()=>{var ie;N.triggers==="hov"&&((ie=x.current)==null||ie.go(ce))},children:a.jsx("img",{src:le.image.url,alt:le.image.name??"",onLoad:ie=>{const ue=ie.currentTarget;ue.naturalWidth&&ue.naturalHeight&&y(Ce=>({...Ce,[ce]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:N.fit==="cover"?"cover":"contain",...N.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...N.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${le.image.name}-${ce}`)})})})})()]})]}),document.getElementById(l))};function _i({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 Vl={element:Hl,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function In(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dl(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${In(48)};
|
|
12
12
|
}
|
|
13
13
|
.${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
|
|
14
14
|
.${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
34
|
.${e}-field-group.${e}-labeled {
|
|
35
|
-
gap: ${
|
|
35
|
+
gap: ${In(4)};
|
|
36
36
|
}
|
|
37
37
|
.${e}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
@@ -128,18 +128,18 @@
|
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
130
|
.${e}-success {
|
|
131
|
-
margin-top: ${
|
|
131
|
+
margin-top: ${In(8)};
|
|
132
132
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
133
133
|
}
|
|
134
134
|
.${e}-error {
|
|
135
|
-
margin-top: ${
|
|
135
|
+
margin-top: ${In(8)};
|
|
136
136
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
137
137
|
}
|
|
138
138
|
.${e}-overlay-anchor {
|
|
139
139
|
position: relative;
|
|
140
140
|
height: auto;
|
|
141
141
|
}
|
|
142
|
-
`}function zl({settings:e,isEditor:t,metadata:n,activeEvent:o}){const{prefix:i}=T.useScopedStyles(),{type:l="A",fieldsToShow:r=2,fields:s=[],buttonLabel:c,gap:p,fieldsGap:d,buttonCorners:$,buttonStroke:h,buttonPadding:f,isButtonFullWidth:m,inputCorners:g,inputStroke:C,inputPadding:y,inputColor:x,inputTextColor:P,inputBorderColor:L,placeholderColor:_,buttonColor:E,buttonTextColor:v,buttonBorderColor:w,labelTextColor:R,successColor:V,errorColor:A,fontFamily:H,inputFontSettings:D,inputFontSize:j,inputLineHeight:U,inputLetterSpacing:S,inputWordSpacing:N,inputTextAppearance:k,buttonFontSettings:M,buttonFontSize:W,buttonLineHeight:B,buttonLetterSpacing:ee,buttonWordSpacing:de,buttonTextAppearance:re,labelFontSettings:me,labelFontSize:O,labelLineHeight:te,labelLetterSpacing:Y,labelWordSpacing:X,labelTextAppearance:ne,statusFontSettings:
|
|
142
|
+
`}function zl({settings:e,isEditor:t,metadata:n,activeEvent:o}){const{prefix:i}=T.useScopedStyles(),{type:l="A",fieldsToShow:r=2,fields:s=[],buttonLabel:c,gap:p,fieldsGap:d,buttonCorners:$,buttonStroke:h,buttonPadding:f,isButtonFullWidth:m,inputCorners:g,inputStroke:C,inputPadding:y,inputColor:x,inputTextColor:P,inputBorderColor:L,placeholderColor:_,buttonColor:E,buttonTextColor:v,buttonBorderColor:w,labelTextColor:R,successColor:V,errorColor:A,fontFamily:H,inputFontSettings:D,inputFontSize:j,inputLineHeight:U,inputLetterSpacing:S,inputWordSpacing:N,inputTextAppearance:k,buttonFontSettings:M,buttonFontSize:W,buttonLineHeight:B,buttonLetterSpacing:ee,buttonWordSpacing:de,buttonTextAppearance:re,labelFontSettings:me,labelFontSize:O,labelLineHeight:te,labelLetterSpacing:Y,labelWordSpacing:X,labelTextAppearance:ne,statusFontSettings:I,statusFontSize:oe,statusLineHeight:F,statusLetterSpacing:b,statusWordSpacing:z,statusTextAppearance:q,successMessage:Z,errorMessage:se,stateOverrides:le}=e,ce=l==="B",ge=s.slice(0,Math.min(r,s.length)),K={fontSettings:{fontFamily:H,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:j??.01,lineHeight:U,letterSpacing:S??0,wordSpacing:N??0,textAppearance:k,color:P},J=yt(qe(K,t)),Q=T.scalingValue(C??0,t),pe=T.scalingValue((U??j??.01)+((y==null?void 0:y.top)??0)+((y==null?void 0:y.bottom)??0)+(l==="C"?C??0:(C??0)*2),t),ie={...J,borderStyle:"solid",borderRadius:l==="C"?0:T.scalingValue(g??0,t),...l==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Q,borderLeftWidth:0}:{borderWidth:Q},paddingTop:T.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:T.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:T.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:T.scalingValue((y==null?void 0:y.left)??0,t),height:pe,minHeight:pe},ue={fontSettings:{fontFamily:H,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:W??.01,lineHeight:B,letterSpacing:ee??0,wordSpacing:de??0,textAppearance:re,color:v},Ce=yt(qe(ue,t)),$e=T.scalingValue(h??0,t),Pe={fontSettings:{fontFamily:H,fontWeight:(me==null?void 0:me.fontWeight)??400,fontStyle:(me==null?void 0:me.fontStyle)??"normal"},fontSize:O??.01,lineHeight:te,letterSpacing:Y??0,wordSpacing:X??0,textAppearance:ne,color:R},je=qe(Pe,t),we={fontSettings:{fontFamily:H,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:F,letterSpacing:b??0,wordSpacing:z??0,textAppearance:q,color:V},Me=yt(qe(we,t)),Ge=T.buildColorVars(i,{inputColor:x,inputTextColor:P,inputBorderColor:L,placeholderColor:_!=null&&_.trim()?_:"#cccccc",buttonColor:E,buttonTextColor:v,buttonBorderColor:w,labelTextColor:R,successColor:V,errorColor:A},jl,Kl,le),[ye,Ae]=u.useState(()=>Object.fromEntries(ge.map(be=>[be.name,""]))),[Te,Be]=u.useState("idle"),[Ne,Ie]=u.useState(null),ke=o==="success"?"success":o==="error"?"error":Te,Ye=o==="error"?se:Ne,nt=o==="filled",ot=u.useMemo(()=>{if(!nt)return ye;let be=null;for(const it of ge)(ye[it.name]??"").trim().length>0||(be=be??{...ye},be[it.name]="Filled");return be??ye},[ye,nt,ge]),lo=ke==="error"?T.getFormFieldValidationError(ge,ot):null,uo=`${o&&o!=="default"?`${i}-state-${o}`:""}`.trim(),Se=n==null?void 0:n.submitUrl,an=(be,it)=>{Ae(Ke=>({...Ke,[be]:it}))},Pn=async be=>{be.preventDefault();const it=Object.fromEntries(ge.map(Ve=>{var Xe;return[Ve.name,((Xe=ye[Ve.name])==null?void 0:Xe.trim())??""]}).filter(([,Ve])=>Ve));if(!Se){Be("error"),Ie("No integrations were found for this form.");return}if(Object.keys(it).length===0)return;const Ke=T.getFormFieldValidationError(ge,ye);if(Ke){Be("error"),Ie(Ke);return}Be("submitting"),Ie(null);try{const Ve=await fetch(Se,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(it)});if(!Ve.ok){const Xe=await Ve.text();throw new Error(Xe||`Request failed: ${Ve.status}`)}Be("success"),Ae(Object.fromEntries(ge.map(Xe=>[Xe.name,""])))}catch(Ve){Be("error"),Ie(Ve instanceof Error?Ve.message:"Something went wrong")}};return a.jsxs("div",{className:`${i}-wrapper ${i}-type-${l} ${uo}`.trim(),style:Ge,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dl(i)}}),a.jsxs("form",{onSubmit:Pn,className:`${i}-form`,style:{gap:T.scalingValue(p??0,t)},children:[a.jsx("div",{className:`${i}-fields`,style:{gap:T.scalingValue(d??0,t)},children:ge.map((be,it)=>a.jsxs("div",{className:`${i}-field-group${ce?` ${i}-labeled`:""}`,children:[ce&&a.jsx("span",{className:`${i}-field-label`,style:je?{...je,lineHeight:je.fontSize}:void 0,children:be.label||be.name}),be.type==="textarea"?a.jsx("textarea",{name:be.name,autoComplete:"off",value:ot[be.name]??"",onChange:Ke=>an(be.name,Ke.target.value),placeholder:be.placeholder,className:`${i}-input`,style:ie,rows:1,"data-filled":nt||(ot[be.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:be.type==="phone"?"tel":be.type==="email"?"email":"text",name:be.name,autoComplete:"off",value:ot[be.name]??"",onChange:Ke=>an(be.name,Ke.target.value),placeholder:be.placeholder,required:be.isRequired??be.type==="email",className:`${i}-input`,style:ie,"data-filled":nt||(ot[be.name]??"").trim().length>0})]},it))}),a.jsx("div",{className:`${i}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${i}-button`,style:{borderStyle:"solid",borderRadius:T.scalingValue($??0,t),borderWidth:$e,paddingTop:T.scalingValue((f==null?void 0:f.top)??0,t),paddingRight:T.scalingValue((f==null?void 0:f.right)??0,t),paddingBottom:T.scalingValue((f==null?void 0:f.bottom)??0,t),paddingLeft:T.scalingValue((f==null?void 0:f.left)??0,t),...Ce,...m?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${i}-overlay-anchor`,style:m?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Te==="submitting"?"...":c})})})]}),ke==="success"&&a.jsx("p",{className:`${i}-success`,style:{...Me},children:Z}),ke==="error"&&a.jsx("p",{className:`${i}-error`,style:{...Me},role:"alert",children:lo??Ye??se})]})}const jl={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"},Kl=["hover","focus","filled","success","error"],Ul=`import React, { useMemo, useState } from 'react';
|
|
143
143
|
import { CommonComponentProps } from '../props';
|
|
144
144
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
145
145
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -740,7 +740,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
740
740
|
};
|
|
741
741
|
|
|
742
742
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
743
|
-
`,ql=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],Rn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Gl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Yl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Rn.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...Rn.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...Rn.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...Rn.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:ql,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["isButtonFullWidth"]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Gl],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Xl={element:zl,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:Yl,sourceCode:Ul};function kn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zl(e){return`
|
|
743
|
+
`,ql=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],Rn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Gl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Yl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Rn.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...Rn.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...Rn.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...Rn.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:ql,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["isButtonFullWidth"]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Gl],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Xl={element:zl,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:Yl,sourceCode:Ul};function kn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zl(e){return`
|
|
744
744
|
.${e}-wrapper {
|
|
745
745
|
display: flex;
|
|
746
746
|
flex-direction: column;
|
|
@@ -931,7 +931,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
931
931
|
font-size: ${kn(14)};
|
|
932
932
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
933
933
|
}
|
|
934
|
-
`}const Jl=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:i}=T.useScopedStyles(),{fields:l=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:r,buttonLabel:s,fieldsToShow:c=1,fontFamily:p,inputFontSettings:d,inputFontSize:$,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:m,inputTextAppearance:g,buttonFontSettings:C,buttonFontSize:y,buttonLineHeight:x,buttonLetterSpacing:P,buttonWordSpacing:L,buttonTextAppearance:_,statusFontSettings:E,statusFontSize:v,statusLineHeight:w,statusLetterSpacing:R,statusWordSpacing:V,statusTextAppearance:A,iconMaxWidth:H,minHeight:D,corners:j,stroke:U,stateOverrides:S,inputPadding:N,buttonPadding:k,successMessage:M="Thanks for subscribing!",errorMessage:W="Please, fill all required fields."}=e,B=l.slice(0,Math.min(c,l.length)),[ee,de]=u.useState(()=>Object.fromEntries(B.map(we=>[we.name,""]))),[re,me]=u.useState("idle"),[O,te]=u.useState(null),Y=o==="success"?"success":o==="error"?"error":re,X=o==="error"?W:O,ne=o==="filled",
|
|
934
|
+
`}const Jl=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:i}=T.useScopedStyles(),{fields:l=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:r,buttonLabel:s,fieldsToShow:c=1,fontFamily:p,inputFontSettings:d,inputFontSize:$,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:m,inputTextAppearance:g,buttonFontSettings:C,buttonFontSize:y,buttonLineHeight:x,buttonLetterSpacing:P,buttonWordSpacing:L,buttonTextAppearance:_,statusFontSettings:E,statusFontSize:v,statusLineHeight:w,statusLetterSpacing:R,statusWordSpacing:V,statusTextAppearance:A,iconMaxWidth:H,minHeight:D,corners:j,stroke:U,stateOverrides:S,inputPadding:N,buttonPadding:k,successMessage:M="Thanks for subscribing!",errorMessage:W="Please, fill all required fields."}=e,B=l.slice(0,Math.min(c,l.length)),[ee,de]=u.useState(()=>Object.fromEntries(B.map(we=>[we.name,""]))),[re,me]=u.useState("idle"),[O,te]=u.useState(null),Y=o==="success"?"success":o==="error"?"error":re,X=o==="error"?W:O,ne=o==="filled",I=u.useMemo(()=>{if(!ne)return ee;let we=null;for(const Me of B)(ee[Me.name]??"").trim().length>0||(we=we??{...ee},we[Me.name]="Filled");return we??ee},[ne,ee,B]),oe=Y==="error"?T.getFormFieldValidationError(B,I):null,F=o&&o!=="default"?`${i}-state-${o}`:"",b=B.some(we=>(I[we.name]??"").trim().length>0),z=F!==`${i}-state-filled`&&b?`${i}-state-filled`:"",q=`${F} ${z}`.trim(),Z=n==null?void 0:n.submitUrl,se=s??"",le=(r==null?void 0:r.icon)??"",ce=(r==null?void 0:r.mode)==="On",ge=se||"Submit",K={fontSettings:{fontFamily:p,fontWeight:(d==null?void 0:d.fontWeight)??400,fontStyle:(d==null?void 0:d.fontStyle)??"normal"},fontSize:$??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:m??0,textAppearance:g,color:e.inputTextColor??"#111111"},J={fontSettings:{fontFamily:p,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:y??.01,lineHeight:x,letterSpacing:P??0,wordSpacing:L??0,textAppearance:_,color:e.buttonTextColor??"#ffffff"},Q={fontSettings:{fontFamily:p,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:v??.01,lineHeight:w,letterSpacing:R??0,wordSpacing:V??0,textAppearance:A,color:e.successColor??"#22c55e"},pe=yt(qe(K,t)),ie=yt(qe(J,t)),ue=yt(qe(Q,t)),Ce=T.buildColorVars(i,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(K==null?void 0:K.color)??"#111111",buttonTextColor:e.buttonTextColor??(J==null?void 0:J.color)??"#ffffff"},Ql,ec,S),$e={borderRadius:T.scalingValue(j,t),borderWidth:T.scalingValue(U,t),borderStyle:"solid"},Pe={borderLeftWidth:T.scalingValue(U,t)},je=async we=>{we.preventDefault();const Me=Object.fromEntries(B.map(ye=>{var Ae;return[ye.name,((Ae=ee[ye.name])==null?void 0:Ae.trim())??""]}).filter(([,ye])=>ye));if(!Z){me("error"),te("No integrations were found for this form.");return}if(Object.keys(Me).length===0)return;const Ge=T.getFormFieldValidationError(B,ee);if(Ge){me("error"),te(Ge);return}me("submitting"),te(null);try{const ye=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Me)});if(!ye.ok){const Ae=await ye.text();throw new Error(Ae||`Request failed: ${ye.status}`)}me("success"),de(Object.fromEntries(B.map(Ae=>[Ae.name,""])))}catch(ye){me("error"),te(ye instanceof Error?ye.message:"Something went wrong")}};return a.jsxs("div",{className:`${i}-wrapper ${q}`.trim(),style:Ce,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Zl(i)}}),a.jsxs("form",{onSubmit:je,className:`${i}-form`,style:{...$e,height:T.scalingValue(D,t),minHeight:T.scalingValue(D,t)},children:[a.jsx("div",{className:`${i}-inputWrap ${i}-overlayAnchor`,style:{flex:1,minWidth:0},children:B.map(we=>a.jsx("input",{type:we.type==="email"?"email":we.type==="phone"?"tel":"text",name:we.name,autoComplete:"off",value:I[we.name]??"",onChange:Me=>de(Ge=>({...Ge,[we.name]:Me.target.value})),placeholder:we.placeholder,required:we.isRequired??we.type==="email",className:`${i}-input`,style:{...pe,paddingRight:T.scalingValue(N.right,t),paddingLeft:T.scalingValue(N.left,t),paddingTop:T.scalingValue(N.top,t),paddingBottom:T.scalingValue(N.bottom,t)}},we.name))}),a.jsx("div",{className:`${i}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${i}-submitBtn`,"aria-label":ge,style:{...ie,...Pe,paddingRight:T.scalingValue(k.right,t),paddingLeft:T.scalingValue(k.left,t),paddingTop:T.scalingValue(k.top,t),paddingBottom:T.scalingValue(k.bottom,t)},children:re==="submitting"?"...":ce?le&&a.jsx($t,{url:le,className:`${i}-submitBtnIcon`,style:{maxWidth:T.scalingValue(H??0,t)},fill:`var(--${i}-button-text-color)`,hoverFill:`var(--${i}-button-text-color)`}):se})})]}),Y==="success"&&a.jsx("p",{className:`${i}-success`,style:{...ue},children:M}),Y==="error"&&a.jsx("p",{className:`${i}-error`,style:{...ue},role:"alert",children:oe??X??W})]})},Ql={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"},ec=["hover","focus","filled","success","error"],tc=`import React, { useMemo, useState } from 'react';
|
|
935
935
|
import { CommonComponentProps } from '../props';
|
|
936
936
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
937
937
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1503,7 +1503,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1503
1503
|
};
|
|
1504
1504
|
|
|
1505
1505
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1506
|
-
`,nc="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>'),oc=[{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."}],yo={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ic=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],rc={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...yo.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:{...yo.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:{...yo.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:oc,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:nc},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners: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:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...ic],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"]},ac={element:Jl,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:rc,sourceCode:tc};function Pi(e){return`
|
|
1506
|
+
`,nc="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>'),oc=[{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."}],yo={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ic=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],rc={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...yo.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:{...yo.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:{...yo.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:oc,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:nc},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners: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:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...ic],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"]},ac={element:Jl,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:rc,sourceCode:tc};function Pi(e){return`
|
|
1507
1507
|
.${e}-marquee-wrapper {
|
|
1508
1508
|
overflow: hidden;
|
|
1509
1509
|
width: 100%;
|
|
@@ -1634,7 +1634,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1634
1634
|
.${e}-image-hover-saturate:hover img {
|
|
1635
1635
|
filter: saturate(2);
|
|
1636
1636
|
}
|
|
1637
|
-
`}const sc=30,vo=2,lc=2,cc=(e,t)=>Array.from({length:t},()=>e).flat(),dc=(e,t)=>{const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return o.right>n.left&&o.left<n.right},uc=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(o=>dc(o,e))},pc=({item:e,prefix:t,imageFit:n,imageMaxWidth:o,imageMaxHeight:i,imageHoverClass:l,isFirstSet:r,scaled:s,onFirstSetImageDone:c})=>{var h,f,m;const p=u.useRef(null);u.useLayoutEffect(()=>{if(!r)return;const g=p.current;g!=null&&g.complete&&(c==null||c())},[r,(h=e.image)==null?void 0:h.url,c]);const d=n==="cover",$=((f=e.image)==null?void 0:f.url)&&a.jsx("img",{ref:p,src:e.image.url,alt:((m=e.image)==null?void 0:m.name)??"",style:d?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:s(o),objectFit:"contain"},onLoad:r?c:void 0,onError:r?c:void 0});return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...d?{width:s(o)}:{width:"fit-content",maxWidth:s(o),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...d?{width:"100%",height:s(i),overflow:"hidden"}:{width:"fit-content",maxWidth:s(o),height:s(i)}},children:$&&e.link?a.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:ve(`${t}-marquee-link`,!d&&`${t}-marquee-link-contain`),children:$}):$})})},mc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),{speed:l,direction:r,pauseOnHover:s,gap:c,imageMaxWidth:p,imageMaxHeight:d,imageFit:$,hoverEffect:h}=e,f=h==="off"||h==="randomize"?void 0:`${i}-image-hover-${h}`,m=!o,g=Math.max(0,l)*sc,C=Y=>T.scalingValue(Y,n??!1),y=u.useRef(null),x=u.useRef(null),P=u.useRef(null),[L,_]=u.useState(0),[E,v]=u.useState(0),w=m&&s==="on",[R,V]=u.useState(!1),[A,H]=u.useState({}),D=u.useRef(A);D.current=A;const j=u.useRef(null),U=u.useRef(0),S=u.useRef(null),N=u.useMemo(()=>(t??[]).map(Y=>{var X;return((X=Y.image)==null?void 0:X.url)??""}).join("\0"),[t]),[k,M]=u.useState(vo),W=u.useMemo(()=>{const Y=t??[];return!m||Y.length===0?Y:cc(Y,k)},[t,m,k]),B=u.useMemo(()=>W.filter(Y=>{var X;return!!((X=Y.image)!=null&&X.url)}).length,[W]),ee=u.useMemo(()=>!m||((t==null?void 0:t.length)??0)===0?1:lc,[m,t==null?void 0:t.length]);u.useLayoutEffect(()=>{U.current=0,H({}),j.current=null,M(vo),_(0)},[N]),u.useEffect(()=>{if(h!=="randomize")return;const Y=y.current;if(!Y)return;const X=
|
|
1637
|
+
`}const sc=30,vo=2,lc=2,cc=(e,t)=>Array.from({length:t},()=>e).flat(),dc=(e,t)=>{const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return o.right>n.left&&o.left<n.right},uc=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(o=>dc(o,e))},pc=({item:e,prefix:t,imageFit:n,imageMaxWidth:o,imageMaxHeight:i,imageHoverClass:l,isFirstSet:r,scaled:s,onFirstSetImageDone:c})=>{var h,f,m;const p=u.useRef(null);u.useLayoutEffect(()=>{if(!r)return;const g=p.current;g!=null&&g.complete&&(c==null||c())},[r,(h=e.image)==null?void 0:h.url,c]);const d=n==="cover",$=((f=e.image)==null?void 0:f.url)&&a.jsx("img",{ref:p,src:e.image.url,alt:((m=e.image)==null?void 0:m.name)??"",style:d?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:s(o),objectFit:"contain"},onLoad:r?c:void 0,onError:r?c:void 0});return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...d?{width:s(o)}:{width:"fit-content",maxWidth:s(o),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...d?{width:"100%",height:s(i),overflow:"hidden"}:{width:"fit-content",maxWidth:s(o),height:s(i)}},children:$&&e.link?a.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:ve(`${t}-marquee-link`,!d&&`${t}-marquee-link-contain`),children:$}):$})})},mc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),{speed:l,direction:r,pauseOnHover:s,gap:c,imageMaxWidth:p,imageMaxHeight:d,imageFit:$,hoverEffect:h}=e,f=h==="off"||h==="randomize"?void 0:`${i}-image-hover-${h}`,m=!o,g=Math.max(0,l)*sc,C=Y=>T.scalingValue(Y,n??!1),y=u.useRef(null),x=u.useRef(null),P=u.useRef(null),[L,_]=u.useState(0),[E,v]=u.useState(0),w=m&&s==="on",[R,V]=u.useState(!1),[A,H]=u.useState({}),D=u.useRef(A);D.current=A;const j=u.useRef(null),U=u.useRef(0),S=u.useRef(null),N=u.useMemo(()=>(t??[]).map(Y=>{var X;return((X=Y.image)==null?void 0:X.url)??""}).join("\0"),[t]),[k,M]=u.useState(vo),W=u.useMemo(()=>{const Y=t??[];return!m||Y.length===0?Y:cc(Y,k)},[t,m,k]),B=u.useMemo(()=>W.filter(Y=>{var X;return!!((X=Y.image)!=null&&X.url)}).length,[W]),ee=u.useMemo(()=>!m||((t==null?void 0:t.length)??0)===0?1:lc,[m,t==null?void 0:t.length]);u.useLayoutEffect(()=>{U.current=0,H({}),j.current=null,M(vo),_(0)},[N]),u.useEffect(()=>{if(h!=="randomize")return;const Y=y.current;if(!Y)return;const X=F=>{H(b=>{let z=null;for(const q of F)q in b&&(uc(Y,q)||(z||(z={...b}),delete z[q]));return z??b})},ne=new IntersectionObserver(F=>{const b=new Set;for(const z of F){const q=z.target.dataset.marqueeItemIndex,Z=q!==void 0?Number(q):NaN;Number.isNaN(Z)||b.add(Z)}b.size>0&&X(b)},{root:Y,threshold:0});Object.keys(A).forEach(F=>{const b=Number(F);Y.querySelectorAll(`[data-marquee-item-index="${b}"]`).forEach(z=>ne.observe(z))});let I=0;const oe=()=>{const F=Object.keys(D.current);F.length!==0&&(X(F.map(Number)),I=requestAnimationFrame(oe))};return Object.keys(D.current).length>0&&(I=requestAnimationFrame(oe)),()=>{cancelAnimationFrame(I),ne.disconnect()}},[h,A]),u.useLayoutEffect(()=>{if(!m)return;const Y=y.current,X=P.current;if(!Y||!X)return;let ne=0;const I=()=>{const b=Y.getBoundingClientRect().width,z=X.getBoundingClientRect().width,q=j.current,Z=typeof q=="number"&&Math.abs(q-z)<=.25;if(j.current=z,z>0&&k>0){const se=z/k;if(se>0&&b>0){const le=Math.max(vo,Math.ceil(b/se)+1);if(le!==k){M(le);return}}}if(z>0&&L<=0){_(z);return}Z&&z!==L?_(z):!Z&&L<=0&&(cancelAnimationFrame(ne),ne=requestAnimationFrame(I))},oe=()=>{cancelAnimationFrame(ne),ne=requestAnimationFrame(I)};S.current=oe,oe();const F=new ResizeObserver(oe);return F.observe(Y),F.observe(X),()=>{S.current=null,cancelAnimationFrame(ne),F.disconnect()}},[m,L,N,k]),u.useLayoutEffect(()=>{const Y=x.current;if(!m||!Y)return;const X=L>0?L:0,ne=X>0&&g>0?X/g*1e3:0,I=`${Math.max(0,ne)/1e3}s`;Y.style.setProperty("--marquee-distance",`${X}px`),Y.style.setProperty("--marquee-duration",I)},[m,g,L]),u.useLayoutEffect(()=>{if(!m){v(0);return}if(L<=0){v(0);return}const Y=x.current;if(!Y)return;const X=()=>{const I=Y.getBoundingClientRect().height;v(I>0?I:0)};X();const ne=new ResizeObserver(X);return ne.observe(Y),()=>ne.disconnect()},[m,ee,W,n,c,p,d,L,$,A]);const de=()=>{w&&V(!0)},re=()=>{w&&V(!1)},me=u.useCallback(()=>{var Y;U.current=Math.min(B,U.current+1),(Y=S.current)==null||Y.call(S)},[B]),O=u.useCallback((Y,X)=>{H(ne=>{const I=ne[Y]??X,oe=(t??[]).filter(b=>b!==I);if(oe.length===0)return ne;const F=oe[Math.floor(Math.random()*oe.length)];return{...ne,[Y]:F}})},[t]),te=(Y,X,ne,I)=>{const oe=h==="randomize"&&$==="cover"?A[ne]??Y:Y;return a.jsxs("div",{className:`${i}-marquee-card`,"data-marquee-item-index":ne,onMouseEnter:h==="randomize"&&$==="cover"?()=>O(ne,Y):void 0,children:[a.jsx(pc,{item:oe,prefix:i,imageFit:$,imageMaxWidth:p,imageMaxHeight:d,imageHoverClass:f,isEditor:n,isFirstSet:I,scaled:C,onFirstSetImageDone:me}),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${C(c)})`,width:C(c),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${X}-${ne}`)};return m&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:y,className:ve(`${i}-wrapper`,`${i}-marquee-wrapper`),"aria-label":"Marquee",style:L>0&&E>0?{height:E}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Pi(i)}}),a.jsx("div",{ref:x,className:`${i}-marquee-track`,"data-direction":r,onMouseEnter:de,onMouseLeave:re,style:{...w?{"--marquee-play-state":R?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:ee},(Y,X)=>a.jsx("div",{ref:X===0?P:void 0,className:ve(`${i}-marquee-row`,`${i}-marquee-set`),style:{gap:C(c),paddingRight:C(c)},"aria-hidden":X>0,children:W.map((ne,I)=>te(ne,X,I,X===0))},`set-${X}`))},"marquee-track")]}):a.jsxs("div",{ref:y,className:`${i}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Pi(i)}}),a.jsx("div",{className:ve(`${i}-marquee-row`,`${i}-marquee-static`),style:{gap:C(c),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Y,X)=>te(Y,0,X))},"marquee-static")]})},gc=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1638
1638
|
import cn from 'classnames';
|
|
1639
1639
|
import { CommonComponentProps } from '../props';
|
|
1640
1640
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2234,7 +2234,7 @@ type MarqueeProps = {
|
|
|
2234
2234
|
isEditor?: boolean;
|
|
2235
2235
|
isPreviewMode?: boolean;
|
|
2236
2236
|
} & CommonComponentProps;
|
|
2237
|
-
`,hc={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale","saturate","randomize"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,max:400,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,max:400,display:{type:"numeric-input"}},imageFit:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["cover","contain"]}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:"contain"},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21},d:{speed:1.64,gap:.02,imageMaxWidth:.15,imageMaxHeight:.1}},displayRules:[{if:{name:"imageFit",value:"contain"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","saturate"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["direction"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZNCQFC3T744H0KX6R3FR.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZRTSS60YBFT6Y37ZX00T.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ9M9YJPQ5JWKCHDEW5M1GJD.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S04EHBXQS1T4KVAMZNZQM.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S08Q40WHD39024VNDWF2Q.jpeg",name:""},link:""}]}},fc={element:mc,id:"marquee",name:"Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:140},m:{width:390,height:80}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/
|
|
2237
|
+
`,hc={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale","saturate","randomize"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,max:400,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,max:400,display:{type:"numeric-input"}},imageFit:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["cover","contain"]}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:"contain"},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21},d:{speed:1.64,gap:.02,imageMaxWidth:.15,imageMaxHeight:.1}},displayRules:[{if:{name:"imageFit",value:"contain"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","saturate"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["direction"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZNCQFC3T744H0KX6R3FR.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZRTSS60YBFT6Y37ZX00T.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ9M9YJPQ5JWKCHDEW5M1GJD.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S04EHBXQS1T4KVAMZNZQM.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S08Q40WHD39024VNDWF2Q.jpeg",name:""},link:""}]}},fc={element:mc,id:"marquee",name:"Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:140},m:{width:390,height:80}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple_Marquee.mp4"},schema:hc,sourceCode:gc,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function Ai(e){return`
|
|
2238
2238
|
.${e}-marquee-wrapper {
|
|
2239
2239
|
overflow: hidden;
|
|
2240
2240
|
width: 100%;
|
|
@@ -2321,7 +2321,7 @@ type MarqueeProps = {
|
|
|
2321
2321
|
pointer-events: auto;
|
|
2322
2322
|
z-index: 10;
|
|
2323
2323
|
}
|
|
2324
|
-
`}const yc=30,vc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),{autoplay:l,align:r,speed:s,direction:c,pauseOnHover:p,gap:d,cardWidth:$,corners:h,stroke:f,strokeColor:m,bgColor:g,padding:C,logoMarginTop:y,logoWidth:x,logoHeight:P,captionMarginTop:L}=e,_=l==="on"&&!o,E=_,v=Math.max(0,s)*yc,w=K=>T.scalingValue(K,n??!1),R=u.useRef(null),V=u.useRef(null),A=u.useRef(null),[H,D]=u.useState(0),[j,U]=u.useState(0),[S,N]=u.useState(0),k=E&&p==="on",[M,W]=u.useState(!1),B=u.useRef(null),[ee,de]=u.useState(0),[re,me]=u.useState(0),O=u.useRef(null),te=K=>{var Q,pe,ie,ue,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${K}FontFamily`])??"Arial",fontWeight:((Q=e==null?void 0:e[`${K}FontSettings`])==null?void 0:Q.fontWeight)??400,fontStyle:((pe=e==null?void 0:e[`${K}FontSettings`])==null?void 0:pe.fontStyle)??"normal"},textAppearance:{textTransform:((ie=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:ie.textTransform)??"none",textDecoration:((ue=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:ue.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${K}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${K}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${K}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${K}LineHeight`])??.01,color:(e==null?void 0:e[`${K}Color`])??"#000000"}},Y=te("text"),X=te("caption"),ne=u.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(K=>{var J,Q;return(((J=K.text)==null?void 0:J.length)??0)>0||(((Q=K.caption)==null?void 0:Q.length)??0)>0}),[t]),
|
|
2324
|
+
`}const yc=30,vc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),{autoplay:l,align:r,speed:s,direction:c,pauseOnHover:p,gap:d,cardWidth:$,corners:h,stroke:f,strokeColor:m,bgColor:g,padding:C,logoMarginTop:y,logoWidth:x,logoHeight:P,captionMarginTop:L}=e,_=l==="on"&&!o,E=_,v=Math.max(0,s)*yc,w=K=>T.scalingValue(K,n??!1),R=u.useRef(null),V=u.useRef(null),A=u.useRef(null),[H,D]=u.useState(0),[j,U]=u.useState(0),[S,N]=u.useState(0),k=E&&p==="on",[M,W]=u.useState(!1),B=u.useRef(null),[ee,de]=u.useState(0),[re,me]=u.useState(0),O=u.useRef(null),te=K=>{var Q,pe,ie,ue,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${K}FontFamily`])??"Arial",fontWeight:((Q=e==null?void 0:e[`${K}FontSettings`])==null?void 0:Q.fontWeight)??400,fontStyle:((pe=e==null?void 0:e[`${K}FontSettings`])==null?void 0:pe.fontStyle)??"normal"},textAppearance:{textTransform:((ie=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:ie.textTransform)??"none",textDecoration:((ue=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:ue.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${K}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${K}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${K}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${K}LineHeight`])??.01,color:(e==null?void 0:e[`${K}Color`])??"#000000"}},Y=te("text"),X=te("caption"),ne=u.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(K=>{var J,Q;return(((J=K.text)==null?void 0:J.length)??0)>0||(((Q=K.caption)==null?void 0:Q.length)??0)>0}),[t]),I=u.useMemo(()=>!_||(t==null?void 0:t.length)===0?1:j<=0||H<=0?2:Math.max(2,Math.ceil(H/j)+1),[_,t==null?void 0:t.length,j,H]);u.useLayoutEffect(()=>{if(!_)return;const K=R.current,J=A.current;if(!K||!J)return;let Q=0;const pe=()=>{const Ce=K.getBoundingClientRect().width,$e=J.getBoundingClientRect().width,Pe=O.current,je=typeof Pe=="number"&&Math.abs(Pe-$e)<=.25;if(O.current=$e,D(Ce),typeof $e=="number"&&$e>0&&j<=0){U($e);return}je&&$e!==j?U($e):!je&&j<=0&&(cancelAnimationFrame(Q),Q=requestAnimationFrame(pe))},ie=()=>{cancelAnimationFrame(Q),Q=requestAnimationFrame(pe)};ie();const ue=new ResizeObserver(ie);return ue.observe(K),ue.observe(J),()=>{cancelAnimationFrame(Q),ue.disconnect()}},[_,j]),u.useLayoutEffect(()=>{const K=V.current;if(!_||!K||!E)return;const J=j>0?j:0,Q=J>0&&v>0?J/v*1e3:0,pe=`${Math.max(0,Q)/1e3}s`;K.style.setProperty("--marquee-distance",`${J}px`),K.style.setProperty("--marquee-duration",pe)},[_,E,v,j]),u.useLayoutEffect(()=>{if(!_){N(0);return}const K=A.current,J=V.current;if(!K||!J)return;const Q=()=>{let ie=0;for(let ue=0;ue<K.children.length;ue++){const $e=K.children[ue].firstElementChild;$e&&(ie=Math.max(ie,$e.offsetHeight))}ie<=0&&(ie=J.offsetHeight),N(ie>0?ie:0)};Q();const pe=new ResizeObserver(Q);return pe.observe(K),pe.observe(J),()=>{pe.disconnect()}},[_,I,t,n,d,$,C,f,h,x,P,ee,re]);const oe=()=>{k&&W(!0)},F=()=>{k&&W(!1)},b=u.useMemo(()=>{switch(r){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[r]),z=u.useMemo(()=>{switch(r){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[r]),q=u.useCallback((K,J,Q,pe)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:b,width:"100%"},children:[a.jsx("div",{"data-controls":pe==null?void 0:pe.controlsName,"data-controls-axis":"y",className:`${i}-control`,style:{height:w((pe==null?void 0:pe.marginTop)??0)}}),a.jsx("div",{...pe!=null&&pe.dataMeasureKind?{"data-testimonial-measure":pe.dataMeasureKind}:{},style:{...qe(K,n),textAlign:z,pointerEvents:"auto",...typeof(pe==null?void 0:pe.minHeightPx)=="number"&&pe.minHeightPx>0?{minHeight:pe.minHeightPx}:{}},children:a.jsx(vn,{content:J})})]},Q),[b,z,n]),Z=u.useCallback((K,J,Q)=>{var pe,ie,ue;return a.jsxs("div",{style:{padding:`${w(C.top)} ${w(C.right)} ${w(C.bottom)} ${w(C.left)}`,width:w($+f*2),height:"100%",borderRadius:w(h),border:`${w(f)} solid ${m}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${i}-cover`,style:{background:g}}),a.jsxs("div",{className:`${i}-elements-overlay`,style:{alignItems:b,textAlign:z},children:[K.text&&q(Y,K.text,"text",Q!=null&&Q.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Q==null?void 0:Q.textMinHeightPx)=="number"&&Q.textMinHeightPx>0?{minHeightPx:Q.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:b,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${i}-control`,style:{height:w(y)}}),a.jsx("div",{style:{width:w(x),height:w(P)},children:((pe=K.logo)==null?void 0:pe.url)&&a.jsx("img",{src:K.logo.url,alt:((ie=K.logo)==null?void 0:ie.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ue=K.logo)==null?void 0:ue.objectFit)||"contain"}})})]}),K.caption&&q(X,K.caption,"caption",{controlsName:"captionMarginTop",marginTop:L,...Q!=null&&Q.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Q==null?void 0:Q.captionMinHeightPx)=="number"&&Q.captionMinHeightPx>0?{minHeightPx:Q.captionMinHeightPx}:{}})]})]},J)},[g,L,X,$,h,P,y,x,b,z,C.bottom,C.left,C.right,C.top,q,f,m,Y,n]),se=u.useCallback(K=>{de(K.maxTextPx),me(K.maxCaptionPx)},[]);u.useLayoutEffect(()=>{if(!ne){se({maxTextPx:0,maxCaptionPx:0});return}const K=B.current;if(!K)return;const J=()=>{T.readTestimonialTextMeasure(K,se)};J();const Q=new ResizeObserver(J);return Q.observe(K),()=>{Q.disconnect()}},[ne,se,t,Z]);const le=ne?{textMinHeightPx:ee,captionMinHeightPx:re}:void 0,ce=ne?a.jsx("div",{ref:B,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((K,J)=>Z(K,`measure-${J}`,{dataMeasureAttrs:!0}))}):null,ge=(K,J)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Z(K,`card-${J}`,le),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${w(d)})`,width:w(d),height:"100%",pointerEvents:"auto",zIndex:2}})]},J);return _&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:R,className:ve(`${i}-wrapper`,`${i}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...S>0?{height:S}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ai(i)}}),ce,a.jsx("div",{ref:V,className:`${i}-marquee-track`,"data-direction":c,onMouseEnter:oe,onMouseLeave:F,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...k?{"--marquee-play-state":M?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:I},(K,J)=>a.jsx("div",{ref:J===0?A:void 0,className:`${i}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:w(d),paddingRight:w(d)},"aria-hidden":J>0,children:t==null?void 0:t.map((Q,pe)=>ge(Q,`${J}-${pe}`))},`set-${J}`))})]}):a.jsxs("div",{className:`${i}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ai(i)}}),ce,a.jsx("div",{style:{gap:w(d),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((K,J)=>ge(K,J))})]})},bc=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2325
2325
|
import cn from 'classnames';
|
|
2326
2326
|
import { CommonComponentProps } from '../props';
|
|
2327
2327
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -2927,7 +2927,7 @@ type TestimonialsSettings = {
|
|
|
2927
2927
|
logoHeight: number;
|
|
2928
2928
|
captionMarginTop: number;
|
|
2929
2929
|
};
|
|
2930
|
-
`,Wi={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},xc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Wi.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:{...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{autoplay:"on",direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","autoplay","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Cc={element:vc,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/
|
|
2930
|
+
`,Wi={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},xc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Wi.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:{...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{autoplay:"on",direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","autoplay","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Cc={element:vc,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:xc,sourceCode:bc,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Sc(e){return`
|
|
2931
2931
|
.${e}-container {
|
|
2932
2932
|
position: relative;
|
|
2933
2933
|
overflow-x: clip;
|
|
@@ -3051,7 +3051,7 @@ type TestimonialsSettings = {
|
|
|
3051
3051
|
width: 100%;
|
|
3052
3052
|
height: 100%;
|
|
3053
3053
|
}
|
|
3054
|
-
`}const wc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),l=t||[],{autoplay:r,delay:s,align:c,width:p,imageMarginTop:d,textMarginTop:$,captionMarginTop:h,imageWidth:f,imageHeight:m,controlsWidth:g,controlsColor:C,controlsHoverColor:y}=e,x=r==="on"&&!o,[P,L]=u.useState(0),[_,E]=u.useState(null),[v,w]=u.useState(!1),R=u.useRef(null),V=u.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),A=u.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);u.useEffect(()=>{L(0),E(null),w(!1)},[l.length]);const H=l[P],D=_===null?null:l[_],j=
|
|
3054
|
+
`}const wc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),l=t||[],{autoplay:r,delay:s,align:c,width:p,imageMarginTop:d,textMarginTop:$,captionMarginTop:h,imageWidth:f,imageHeight:m,controlsWidth:g,controlsColor:C,controlsHoverColor:y}=e,x=r==="on"&&!o,[P,L]=u.useState(0),[_,E]=u.useState(null),[v,w]=u.useState(!1),R=u.useRef(null),V=u.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),A=u.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);u.useEffect(()=>{L(0),E(null),w(!1)},[l.length]);const H=l[P],D=_===null?null:l[_],j=I=>{var F,b,z,q,Z;return{fontSettings:{fontFamily:(e==null?void 0:e[`${I}FontFamily`])??"Arial",fontWeight:((F=e==null?void 0:e[`${I}FontSettings`])==null?void 0:F.fontWeight)??400,fontStyle:((b=e==null?void 0:e[`${I}FontSettings`])==null?void 0:b.fontStyle)??"normal"},textAppearance:{textTransform:((z=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:z.textTransform)??"none",textDecoration:((q=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:q.textDecoration)??"none",fontVariant:((Z=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:Z.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${I}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${I}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${I}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${I}WordSpacing`])??0,color:(e==null?void 0:e[`${I}Color`])??"#000000"}},U=j("text"),S=j("caption"),N=l.length>1&&l.some(I=>{var oe,F;return(((oe=I.text)==null?void 0:oe.length)??0)>0||(((F=I.caption)==null?void 0:F.length)??0)>0}),k=u.useRef(null),[M,W]=u.useState(0),[B,ee]=u.useState(0),de=e.controls??{mode:"Off",icon:null},re=l.length>1,me=u.useCallback((I,oe)=>!re||oe===I?I:(R.current&&window.clearTimeout(R.current),E(I),w(!0),R.current=window.setTimeout(()=>{E(null),w(!1),R.current=null},300),oe),[re]),O=u.useCallback(()=>{re&&L(I=>me(I,(I-1+l.length)%l.length))},[re,me,l.length]),te=u.useCallback(()=>{re&&L(I=>me(I,(I+1)%l.length))},[re,me,l.length]);u.useEffect(()=>{if(!x||!re)return;const I=Math.max(300,Number.isFinite(s*1e3)?s*1e3:0),oe=window.setInterval(()=>{L(F=>me(F,(F+1)%l.length))},I);return()=>{window.clearInterval(oe)}},[x,re,me,l.length,s]),u.useEffect(()=>()=>{R.current&&window.clearTimeout(R.current)},[]);const Y=(I,oe)=>{var q,Z,se,le;const F=oe==null?void 0:oe.textMinHeightPx,b=oe==null?void 0:oe.captionMinHeightPx,z=oe==null?void 0:oe.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[I.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${i}-control`,style:{height:T.scalingValue($??0,n??!1)}}),a.jsx("div",{...z&&{"data-testimonial-measure":"text"},style:{...qe(U,n),...F&&F>0?{minHeight:F}:{},textAlign:A,pointerEvents:"auto"},children:a.jsx(vn,{content:I.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${i}-control`,style:{height:T.scalingValue(d??0,n??!1)}}),a.jsx("div",{style:{width:T.scalingValue(f??0,n??!1),height:T.scalingValue(m??0,n??!1)},children:((q=I.image)==null?void 0:q.url)&&a.jsx("img",{src:(Z=I.image)==null?void 0:Z.url,alt:((se=I.image)==null?void 0:se.name)??"",className:`${i}-icon`,style:{objectFit:((le=I.image)==null?void 0:le.objectFit)||"contain"}})})]}),I.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${i}-control`,style:{height:T.scalingValue(h??0,n??!1)}}),a.jsx("div",{...z?{"data-testimonial-measure":"caption"}:{},style:{...qe(S,n),...b&&b>0?{minHeight:b}:{},textAlign:A,pointerEvents:"auto"},children:a.jsx(vn,{content:I.caption})})]})]})},X=u.useCallback(I=>{W(I.maxTextPx),ee(I.maxCaptionPx)},[]);if(u.useLayoutEffect(()=>{if(!N){X({maxTextPx:0,maxCaptionPx:0});return}const I=k.current;if(!I)return;const oe=()=>{T.readTestimonialTextMeasure(I,X)};oe();const F=new ResizeObserver(oe);return F.observe(I),()=>{F.disconnect()}},[N,X,t]),!H)return a.jsx(a.Fragment,{});const ne=N?{textMinHeightPx:M,captionMinHeightPx:B}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${i}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Sc(i)}}),a.jsxs("div",{className:`${i}-wrapper`,style:{width:T.scalingValue(p??0,n??!1),alignItems:V},children:[N&&a.jsx("div",{ref:k,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((I,oe)=>a.jsx("div",{style:{width:"100%"},children:Y(I,{dataMeasureAttrs:!0})},oe))}),a.jsxs("div",{className:`${i}-fade-stack`,children:[D&&v&&a.jsx("div",{className:ve(`${i}-fade-item-prev`,`${i}-fade-out`),children:Y(D,ne)}),a.jsx("div",{className:ve(`${i}-fade-item-current`,v?`${i}-fade-in`:void 0),children:Y(H,ne)})]})]}),de.mode==="On"&&a.jsxs("div",{className:`${i}-controls`,children:[a.jsx("div",{className:`${i}-arrow`,style:{width:T.scalingValue(g??.02,n??!1),height:T.scalingValue(g??.02,n??!1),"--arrow-hover-color":y},children:a.jsx("button",{type:"button",className:`${i}-arrow-inner`,onClick:O,disabled:!re,"aria-label":"Previous testimonial",children:de.icon&&a.jsx($t,{url:de.icon,fill:C,hoverFill:y,className:ve(`${i}-arrow-img`,`${i}-mirror`)})})}),a.jsx("div",{className:ve(`${i}-arrow`,`${i}-next-arrow`),style:{width:T.scalingValue(g??.02,n??!1),height:T.scalingValue(g??.02,n??!1),"--arrow-hover-color":y},children:a.jsx("button",{type:"button",className:`${i}-arrow-inner`,onClick:te,disabled:!re,"aria-label":"Next testimonial",children:de.icon&&a.jsx($t,{url:de.icon,fill:C,hoverFill:y,className:`${i}-arrow-img`})})})]})]})})},$c=`import cn from 'classnames';
|
|
3055
3055
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3056
3056
|
import { CommonComponentProps } from '../props';
|
|
3057
3057
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3543,7 +3543,7 @@ type TestimonialsSettings = {
|
|
|
3543
3543
|
icon?: string | null;
|
|
3544
3544
|
};
|
|
3545
3545
|
};
|
|
3546
|
-
`,Tc="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>'),
|
|
3546
|
+
`,Tc="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>'),Fi={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Lc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},delay:{type:"number",scope:"layout",title:"Delay(s)",display:{type:"percentage-input"},step:1,min:1,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Fi.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:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Fi.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:"Fill Text"}},defaults:{autoplay:"on",controls:{mode:"On",icon:Tc},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{delay:3,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{delay:3,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},displayRules:[{if:{name:"autoplay",value:"off"},then:{name:"properties.delay.display.enabled",value:!1}}],layout:["__componentName__","autoplay","delay","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","delay"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Ec={element:wc,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700,height:300},t:{width:373,height:300},m:{width:334,height:300}},schema:Lc,sourceCode:$c,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function _c(){return window.navigator.platform==="Win32"||window.navigator.platform==="Win64"?'"InputMono-Regular", monospace':'"DepartureMono-Regular", monospace'}function Pc(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ac(e){return`
|
|
3547
3547
|
.${e}-wrapper {
|
|
3548
3548
|
display: grid;
|
|
3549
3549
|
align-items: start;
|
|
@@ -3631,7 +3631,7 @@ type TestimonialsSettings = {
|
|
|
3631
3631
|
pointer-events: auto;
|
|
3632
3632
|
z-index: 10;
|
|
3633
3633
|
}
|
|
3634
|
-
`}const St=500,kt="cubic-bezier(0.22, 1, 0.36, 1)";function Wc({images:e,index:t,imageDisplay:n,originRect:o,reverseClose:i,onClose:l,onPrev:r,onNext:s}){const c=u.useRef(null),p=u.useRef(null),[d,$]=u.useState(null),[h,f]=u.useState(o?"opening":"open"),[m,g]=u.useState(!0),C=u.useRef(t),y=u.useCallback(()=>{const v=c.current,w=p.current;if(!v||!w)return;const R=v.getBoundingClientRect(),V=R.width,A=R.height,H=w.naturalWidth,D=w.naturalHeight;if(!V||!A||!H||!D)return;if(n==="Cover"){$({width:V,height:A,left:R.left,top:R.top});return}const j=H/D,U=V/A;if(j>U){const S=V/j;$({width:V,height:S,left:R.left,top:R.top+(A-S)/2})}else{const S=A*j;$({width:S,height:A,left:R.left+(V-S)/2,top:R.top})}},[n]);u.useEffect(()=>{y();const v=c.current;if(!v)return;const w=new ResizeObserver(()=>y());return w.observe(v),()=>w.disconnect()},[y,t]),u.useEffect(()=>{if(h!=="opening"||!d)return;const v={id:0};return v.id=requestAnimationFrame(()=>{v.id=requestAnimationFrame(()=>f("open"))}),()=>cancelAnimationFrame(v.id)},[h,d]),u.useEffect(()=>{if(h!=="closing")return;const v=setTimeout(()=>l(),St);return()=>clearTimeout(v)},[h,l]),u.useEffect(()=>{C.current!==t&&g(!1),C.current=t},[t]);const x=()=>{h!=="closing"&&f("closing")},P=h==="open",L=h==="closing",_=L&&i&&!!o,E=h==="opening"?o??d:_?o:d;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:x,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:P?1:0,transition:`opacity ${St}ms ${kt}`,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:P?1:0,transition:`opacity ${St}ms ${kt}`,fontFamily:_c()},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})]})})]}),E&&a.jsx("img",{ref:p,src:e[t],onLoad:y,style:{position:"fixed",top:E.top,left:E.left,width:E.width,height:E.height,objectFit:n==="Cover"?"cover":"contain",opacity:L&&!_?0:1,transition:L&&!_?`opacity ${St}ms ${kt}`:_||m?`top ${St}ms ${kt}, left ${St}ms ${kt}, width ${St}ms ${kt}, height ${St}ms ${kt}`:"none",pointerEvents:"none",zIndex:9998}}),P&&d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:d.top,left:d.left,width:d.width/2,height:d.height,cursor:"w-resize",zIndex:9999},onClick:v=>{v.stopPropagation(),r()}}),a.jsx("div",{style:{position:"fixed",top:d.top,left:d.left+d.width/2,width:d.width/2,height:d.height,cursor:"e-resize",zIndex:9999},onClick:v=>{v.stopPropagation(),s()}})]})]})}function
|
|
3634
|
+
`}const St=500,kt="cubic-bezier(0.22, 1, 0.36, 1)";function Wc({images:e,index:t,imageDisplay:n,originRect:o,reverseClose:i,onClose:l,onPrev:r,onNext:s}){const c=u.useRef(null),p=u.useRef(null),[d,$]=u.useState(null),[h,f]=u.useState(o?"opening":"open"),[m,g]=u.useState(!0),C=u.useRef(t),y=u.useCallback(()=>{const v=c.current,w=p.current;if(!v||!w)return;const R=v.getBoundingClientRect(),V=R.width,A=R.height,H=w.naturalWidth,D=w.naturalHeight;if(!V||!A||!H||!D)return;if(n==="Cover"){$({width:V,height:A,left:R.left,top:R.top});return}const j=H/D,U=V/A;if(j>U){const S=V/j;$({width:V,height:S,left:R.left,top:R.top+(A-S)/2})}else{const S=A*j;$({width:S,height:A,left:R.left+(V-S)/2,top:R.top})}},[n]);u.useEffect(()=>{y();const v=c.current;if(!v)return;const w=new ResizeObserver(()=>y());return w.observe(v),()=>w.disconnect()},[y,t]),u.useEffect(()=>{if(h!=="opening"||!d)return;const v={id:0};return v.id=requestAnimationFrame(()=>{v.id=requestAnimationFrame(()=>f("open"))}),()=>cancelAnimationFrame(v.id)},[h,d]),u.useEffect(()=>{if(h!=="closing")return;const v=setTimeout(()=>l(),St);return()=>clearTimeout(v)},[h,l]),u.useEffect(()=>{C.current!==t&&g(!1),C.current=t},[t]);const x=()=>{h!=="closing"&&f("closing")},P=h==="open",L=h==="closing",_=L&&i&&!!o,E=h==="opening"?o??d:_?o:d;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:x,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:P?1:0,transition:`opacity ${St}ms ${kt}`,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:P?1:0,transition:`opacity ${St}ms ${kt}`,fontFamily:_c()},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})]})})]}),E&&a.jsx("img",{ref:p,src:e[t],onLoad:y,style:{position:"fixed",top:E.top,left:E.left,width:E.width,height:E.height,objectFit:n==="Cover"?"cover":"contain",opacity:L&&!_?0:1,transition:L&&!_?`opacity ${St}ms ${kt}`:_||m?`top ${St}ms ${kt}, left ${St}ms ${kt}, width ${St}ms ${kt}, height ${St}ms ${kt}`:"none",pointerEvents:"none",zIndex:9998}}),P&&d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:d.top,left:d.left,width:d.width/2,height:d.height,cursor:"w-resize",zIndex:9999},onClick:v=>{v.stopPropagation(),r()}}),a.jsx("div",{style:{position:"fixed",top:d.top,left:d.left+d.width/2,width:d.width/2,height:d.height,cursor:"e-resize",zIndex:9999},onClick:v=>{v.stopPropagation(),s()}})]})]})}function Fc({settings:e,content:t,isEditor:n,isPreviewMode:o,metadata:i,activeEvent:l,layoutId:r}){const{prefix:s}=T.useScopedStyles(),{type:c="A",gridLayout:p,textBoxWidth:d,verticalGap:$,entriesCount:h,lightbox:f,imageDisplay:m,slider:g,sliderTiming:C,direction:y,transition:x,titleMarginTop:P,subtitleMarginTop:L,titleColor:_,subtitleColor:E,titleFontFamily:v,titleFontSettings:w,titleFontSize:R,titleLineHeight:V,titleLetterSpacing:A,titleWordSpacing:H,titleTextAppearance:D,subtitleFontFamily:j,subtitleFontSettings:U,subtitleFontSize:S,subtitleLineHeight:N,subtitleLetterSpacing:k,subtitleWordSpacing:M,subtitleTextAppearance:W}=e,B={fontSettings:{fontFamily:v,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:R??.01,lineHeight:V,letterSpacing:A??0,wordSpacing:H??0,textAppearance:D,color:_},de={...yt(qe(B,n))},re={fontSettings:{fontFamily:j,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:S??.01,lineHeight:N,letterSpacing:k??0,wordSpacing:M??0,textAppearance:W,color:E},O={...yt(qe(re,n))},te=T.buildColorVars(s,{titleColor:_,subtitleColor:E},Ic,Rc),X=`${l&&l!=="default"?`${s}-state-${l}`:""}`.trim(),ne=h===0?1/0:h,I=(t??[]).slice(0,ne),oe=p.entryWidth??.2,F=(m==null?void 0:m.display)==="Cover",b=(m==null?void 0:m.ratioValue)??"1:1",z=(m==null?void 0:m.reversed)??!1,[q,Z]=b.split(":").map(Number),se=z?Z:q,le=z?q:Z,ce=`${se} / ${le}`,ge=se>=le,K={objectFit:F?"cover":"contain",...F&&{aspectRatio:ce,width:ge?"100%":"auto",height:ge?"auto":"100%"}},[J,Q]=u.useState("ltr"),[pe,ie]=u.useState(0),ue=u.useRef(null);u.useEffect(()=>{const Te=ue.current;if(!Te)return;const Be=new ResizeObserver(Ne=>{ie(Math.round(Ne[0].contentRect.width))});return Be.observe(Te),()=>Be.disconnect()},[]);const[Ce,$e]=u.useState(!1),[Pe,je]=u.useState([]),[we,Me]=u.useState(0),[Ge,ye]=u.useState(null),Ae=(Te,Be,Ne)=>{if(f==="Off")return;const Ie=Te.currentTarget.getBoundingClientRect();ye({top:Ie.top,left:Ie.left,width:Ie.width,height:Ie.height}),je(Be),Me(Ne),$e(!0)};return u.useEffect(()=>{if(!Ce||f!=="On"||typeof document>"u")return;const Te=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Te}},[Ce,f]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ac(s)}}),a.jsx("div",{style:te,children:a.jsx("div",{ref:ue,className:`${s}-wrapper ${s}-type-${c} ${X}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:T.scalingValue($??0,n),columnGap:T.scalingValue(p.horizontalGap??0,n),width:T.scalingValue(p.wrapperWidth??0,n)},children:I.map((Te,Be)=>{var Ne,Ie;return a.jsx("div",{className:`${s}-item`.trim(),children:a.jsx("div",{className:o?`${s}-item-inner`:`${s}-item-inner-hidden`,style:{width:(d??0)>100?`calc(${T.scalingValue(oe??0,n)} * (${d} / 100))`:T.scalingValue(oe??0,n)},children:a.jsxs("a",{href:(((Ne=Te.link)==null?void 0:Ne.length)??0)>0&&f==="Off"?Te.link:void 0,target:"_blank",className:`${s}-item-image-link`,children:[a.jsx("div",{className:`${s}-item-image-wrapper`,style:{width:T.scalingValue(oe??0,n),height:T.scalingValue(oe??0,n)},children:(((Ie=Te.image)==null?void 0:Ie.length)??0)===0?null:g==="Off"?a.jsx("img",{src:Te.image[0].url,alt:Te.image[0].name,className:`${s}-item-image`.trim(),style:K,onClick:ke=>Ae(ke,Te.image.map(Ye=>Ye.url),0)}):a.jsx(Jo,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:500,type:x==="Fade"?"fade":"loop",rewind:x==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:x==="Fade"?"ltr":y!=="Random"?y==="Horizontal"?"ltr":"ttb":J},onMoved:ke=>{if(y!=="Random"||x==="Fade")return;const Ye=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";Q(Ye),setTimeout(()=>{ke.refresh()},0)},children:Te.image.map((ke,Ye)=>a.jsx(Qo,{children:a.jsx("img",{src:ke.url,alt:ke.name,className:`${s}-item-image`.trim(),style:K,onClick:nt=>Ae(nt,Te.image.map(ot=>ot.url),Ye)})},Ye))},`${x}-${oe}-${y}-${C}-${pe}-${r}`)}),a.jsx("div",{"data-controls":"titleMarginTop",className:`${s}-control`,style:{height:T.scalingValue(P??0,n),width:T.scalingValue(oe*d/100,n)}}),a.jsx("p",{className:`${s}-item-title`.trim(),style:{width:`calc(${T.scalingValue(oe??0,n)} * (${d} / 100))`,...de},children:Te.title}),c==="B"&&a.jsx("div",{"data-controls":"subtitleMarginTop",className:`${s}-control`,style:{height:T.scalingValue(L??0,n),width:T.scalingValue(oe*d/100,n)}}),c==="B"&&a.jsx("p",{className:`${s}-item-subtitle`.trim(),style:{width:`calc(${T.scalingValue(oe??0,n)} * (${d} / 100))`,...O},children:Te.subtitle})]})})},Be)})})}),Ce&&typeof document&&document.getElementById("grid-component-lightbox-portal")&&f==="On"&&Bi.createPortal(a.jsx("div",{"data-selection":"none",children:a.jsx(Wc,{images:Pe,index:we,imageDisplay:m.display,originRect:Ge,reverseClose:g==="Off",onClose:()=>$e(!1),onPrev:()=>Me(Te=>(Te-1+Pe.length)%Pe.length),onNext:()=>Me(Te=>(Te+1)%Pe.length)})}),document.body)]})}const Ic={titleColor:"title-color",subtitleColor:"subtitle-color"},Rc=["hover","focus","filled","success","error"],kc=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3635
3635
|
import '@splidejs/react-splide/css/core';
|
|
3636
3636
|
import { CommonComponentProps } from '../props';
|
|
3637
3637
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -4290,7 +4290,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
4290
4290
|
};
|
|
4291
4291
|
|
|
4292
4292
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
4293
|
-
`,
|
|
4293
|
+
`,Ii={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Mc=["titleColor","subtitleColor"],Nc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Title 1",subtitle:"Subtitle 1",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Grid-1.png",objectFit:"cover"}],link:""},{title:"Title 2",subtitle:"Subtitle 2",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Grid-2.png",objectFit:"cover"}],link:""},{title:"Title 3",subtitle:"Subtitle 3",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Grid-3.png",objectFit:"cover"}],link:""}]}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["On","Off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["On","Off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["Horizontal","Vertical","Random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["Fade","Slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Color",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Color",display:{type:"palette-color-picker",visible:!1}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ii.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:{...Ii.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"Off",imageDisplay:{display:"Fit",ratioValue:"16:9",reversed:!1},type:"A",slider:"Off",sliderTiming:5,direction:"Horizontal",transition:"Slide",titleColor:"#767676",subtitleColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Arial",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.043,titleLineHeight:.043,subtitleFontSize:.0373,subtitleLineHeight:.0373},d:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.01,titleLineHeight:.01,subtitleFontSize:.01,subtitleLineHeight:.01}},displayRules:[{if:{name:"transition",value:"Fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"type",value:"B"},then:{name:"properties.subtitleColor.display.visible",value:!0}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","entriesCount","lightbox","imageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","entriesCount"]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"Image",items:["imageDisplay","lightbox"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","sliderTiming"]},{type:"group",title:"",items:["direction","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]}]}],paletteBookmark:{items:[...Mc],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},Oc={element:Fc,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Nc,sourceCode:kc};function Dn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Hc(e){return String(e??"").trim().length>0}function Bc(e,t,n,o,i,l,r){const s=T.scalingValue(l,r),c=T.scalingValue(0,r),p=e===0,d=e===t-1&&!i;return{borderTopWidth:p&&n?s:c,borderBottomWidth:!d||o?s:c}}function Vc(e,t,n){const o=T.scalingValue(t,n),i=T.scalingValue(0,n);return{borderTopWidth:i,borderBottomWidth:e?o:i}}function Dc(e){return`
|
|
4294
4294
|
.${e}-wrapper {
|
|
4295
4295
|
display: grid;
|
|
4296
4296
|
align-items: start;
|
|
@@ -4634,7 +4634,7 @@ a.${e}-list-item {
|
|
|
4634
4634
|
overflow-wrap: anywhere;
|
|
4635
4635
|
word-break: break-word;
|
|
4636
4636
|
}
|
|
4637
|
-
`}const Jt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bt=["AColumn","BColumn","CColumn","DColumn","EColumn"],ei=["A","B","C","D","E"];function $r(e){return`${e}ColumnVerticalAlign`}const zc=["Top","Center","Bottom"];function jc(e){const t=String(e??"Top").trim();return t.toLowerCase().startsWith("baseline")?!1:t==="Top"}function Kc(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ei.includes(n)?n:null}function Tr(e,t,n){const o=Kc(e);return o?o===t?!1:jc(n[$r(o)]):!0}function Wo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ei.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Uc(e,t,n){if(Lr(e,t,n))return Wo(e);const o=Wo(e);return o.kind==="baseline"?{kind:"top"}:o}function Lr(e,t,n){return Tr(e,n,t)?Wo(e).kind==="baseline":!1}function qc(e){if(e.type==="B")return null;const t={};let n=!1;for(const o of ei){const i=$r(o),l=e[i];Tr(l,o,e)||(t[i]="Top",n=!0)}return n?t:null}function Gc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function bo(e,t){if(!e)return 0;const n=document.createElement("i");n.className=t,n.setAttribute("data-baseline-probe",""),n.setAttribute("aria-hidden","true"),e.insertBefore(n,e.firstChild);const o=n.getBoundingClientRect().bottom;return n.remove(),o}function Yc(e,t){return!e||!t?(e&&(e.style.paddingTop="",e.style.marginTop=""),0):(t>0?(e.style.paddingTop=`${t}px`,e.style.marginTop=""):(e.style.paddingTop="",e.style.marginTop=`${t}px`),t)}const Xc={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"},Zc=["textFontFamily","textFontSettings","textFontSize","textLineHeight","textLetterSpacing","textWordSpacing","textTextAppearance"];function ti(e,t){return`${e}${t.replace(/^text/,"Text")}`}function Jc(e){return{textFontFamily:e.textFontFamily??"Arial",textFontSettings:e.textFontSettings??{fontWeight:400,fontStyle:"normal"},textFontSize:e.textFontSize,textLineHeight:e.textLineHeight,textLetterSpacing:e.textLetterSpacing??0,textWordSpacing:e.textWordSpacing??0,textTextAppearance:e.textTextAppearance,textColor:e.textColor}}function Qc(e,t){const n=o=>{const i=ti(t,o),l=e[i];return l!==void 0?l:e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Ri(e,t){var o,i;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((o=e.textFontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((i=e.textFontSettings)==null?void 0:i.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return yt(qe(n,t))}function ed(e,t){const n={};let o=!1;for(const i of Zc)if(e[i]!==t[i]&&e[i]!==void 0){o=!0;for(const l of Bt)Object.assign(n,{[ti(l,i)]:e[i]})}return o?n:null}const et=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Qt=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],en=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],tn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],td={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},nd=["hover","focus","filled","success","error"],ki=.004,ln=.004,ni=50,bn=1440,xn=ni/bn;function Er(e){const t=typeof e=="number"&&e>0?e:bn;return ni/t}function od(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const i=parseFloat(n);if(Number.isFinite(i)&&i>0)return i}const o=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(o){const i=parseFloat(o);if(Number.isFinite(i)&&i>0)return i}t=t.parentElement}return bn}const _r={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function zn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function id(e,t=1){const n=t/e;return Object.fromEntries(et.map(o=>[o,n]))}function rd(){return Object.fromEntries([...Qt.map(e=>[e,0]),...en.map(e=>[e,0])])}function ad(){return Object.fromEntries(tn.map(e=>[e,0]))}function Mn(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:_r[t]]))}function Pr(e,t,n){const o=e-xn,i=t+n;if(i<=0||i<=o)return{paddingLeft:t,paddingRight:n};if(o<=0)return{paddingLeft:0,paddingRight:0};const l=o/i;return{paddingLeft:t*l,paddingRight:n*l}}function jn(e,t,n){const o=oi(e,t,n);if(e<=0)return[];const i=o.slice(0,e-1).reduce((l,r)=>l+r,0);return[...o.slice(0,e-1),Math.max(0,t-i)]}function sd(e,t,n){const o={};for(let i=0;i<e;i+=1){const l=Qt[i],r=en[i],s=typeof n[l]=="number"?n[l]:0,c=typeof n[r]=="number"?n[r]:0,p=Pr(t[i]??0,s,c);p.paddingLeft!==s&&(o[l]=p.paddingLeft),p.paddingRight!==c&&(o[r]=p.paddingRight)}return o}function oi(e,t,n){if(e<=0)return[];const o=et.slice(0,e).map(p=>n[p]);if(e===1)return o;const i=o.slice(0,e-1),r=i.reduce((p,d)=>p+d,0)+xn;if(t>=r)return o;const s=[...i];let c=r-t;for(let p=s.length-1;p>=0&&c>0;p-=1){const d=s[p]-xn;if(d<=0)continue;const $=Math.min(c,d);s[p]-=$,c-=$}return[...s,o[e-1]]}function ld(e,t,n){if(e<=1)return{};const o=oi(e,t,n),i={};for(let l=0;l<e-1;l+=1){const r=et[l];o[l]!==n[r]&&(i[r]=o[l])}return i}function Mi(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Jt]}function cd(e,t){return e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function dd(e,t,n,o){const i=Math.min(o,e.length,et.length),l={};for(let r=0;r<i;r+=1){const s=e[r],c=t.indexOf(s);if(c===-1)continue;const p=et[c],d=Qt[c],$=en[c],h=tn[c],f=et[r],m=Qt[r],g=en[r],C=tn[r],y=n[p],x=n[d],P=n[$],L=n[h];typeof y=="number"&&(l[f]=y),typeof x=="number"&&(l[m]=x),typeof P=="number"&&(l[g]=P),typeof L=="number"&&(l[C]=L)}return l}function ud(e,t,n){const o=ed(e,t);o&&(e={...e,...o});const i=qc(e);i&&(e={...e,...i});const l=Er(n==null?void 0:n.designWidth),r=e.columns,s=t.columns,c=zn(e),p=zn(t),d=e.type==="B"||e.type===void 0&&t.type==="B",$=typeof r=="number"?r:typeof s=="number"?s:Jt.length,h=L=>{if(d)return L;const _=Mn({...t,...L}),E=zn(L),v=jn($,E,_),w=sd($,v,{...t,...L});return Object.keys(w).length===0?L:{...L,...w}};if(typeof r=="number"&&r!==s){const L={...e,...id(r,c),...rd()};if(d)for(const _ of tn)typeof t[_]=="number"&&(L[_]=t[_]);else Object.assign(L,ad());return L}const f=Mi(e),m=Mi(t);if(!cd(f,m))return h({...e,...dd(f,m,t,$)});if(c<p&&typeof $=="number"&&!d){const L=Mn({...t,...e});return h({...e,...ld($,c,L)})}if(d){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,_=Math.max(0,(c-l)/2);return L>_?{...e,textPaddingLR:_}:e}const g=Mn({...t,...e}),C=jn($,p,Mn(t)),x=jn($,c,g).some((L,_)=>L<(C[_]??L)),P=et.some(L=>{const _=e[L],E=t[L];return typeof _=="number"&&typeof E=="number"&&_!==E});return x||P?h(e):e}function pd(e,t,n,o){const i=t.slice(0,e).reduce((r,s)=>r+s,0),l=n.slice(e+1,t.length-1).reduce((r,s)=>r+s,0);return Math.max(xn,o-i-l-xn)}function md(e,t){return Math.random()*(t-e)+e}function gd(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:_r[t]]))}function xo(e,t,n=0){return Object.fromEntries(t.map(o=>[o,typeof e[o]=="number"?e[o]:n]))}function hd(e,t,n,o,i,l){return e.slice(0,t).map((r,s)=>{const c=Qt[s],p=en[s],d=tn[s];return{key:r,textPrefix:Xc[r],widthKey:et[s],width:n[et[s]],paddingLeftKey:c,paddingRightKey:p,paddingBottomKey:d,paddingLeft:o[c],paddingRight:i[p],paddingBottom:l[d]}})}function fd({settings:e,content:t,isEditor:n,isPreviewMode:o,activeEvent:i,layoutId:l,onUpdateSettings:r}){const{prefix:s}=T.useScopedStyles(),c=!!(n&&o),{columns:p,type:d,wrapperWidth:$,entriesCount:h,cellMinHeight:f,dividerWidth:m,showVisibility:g,cut:C,showCut:y,cutCellMinHeight:x,cutLabel:P,imageSize:L,imageOnHover:_,entryHoverEffect:E,rowPaddingTop:v,rowPaddingBottom:w,rowPaddingTopB:R,columnsOrder:V,textPaddingLR:A,textColor:H,textFontFamily:D,textFontSettings:j,textFontSize:U,textLineHeight:S,textLetterSpacing:N,textWordSpacing:k,textTextAppearance:M,backgroundColor:W,dividerColor:B,textHoverColor:ee,backgroundHoverColor:de,dividerHoverColor:re}=e,[me,O]=u.useState(void 0),[te,Y]=u.useState(null),X=_==="On",ne=(C??0)>0,F=d==="B",oe=u.useRef(null),[I,b]=u.useState(bn),z=Er(I),q=Math.max(0,(($??0)-z)/2),Z=Math.min(A??0,q),se=Math.max(Z,ln),le=(($??0)+z)/2;u.useLayoutEffect(()=>{if(!n){b(bn);return}const he=()=>{b(od(oe.current))};he();const xe=oe.current;if(!xe)return;const We=new ResizeObserver(he);We.observe(xe);let Oe=xe;for(;Oe&&!Oe.style.getPropertyValue("--cntrl-article-width");)Oe=Oe.parentElement;return Oe&&We.observe(Oe),()=>We.disconnect()},[n,l]),u.useEffect(()=>{O(void 0)},[C,y,t,h]);const ce=Ri(Jc(e),n),ge=u.useMemo(()=>Object.fromEntries(Bt.map(he=>[he,Ri(Qc(e,he),n)])),[e,D,j,U,S,N,k,M,H,n]),K=T.buildColorVars(s,{textColor:H,backgroundColor:W,dividerColor:B,textHoverColor:ee,backgroundHoverColor:de,dividerHoverColor:re},td,nd),J=i&&i!=="default"?`${s}-state-${i}`:"",pe=`${E==="Default"?`${s}-entry-hover-default`:E==="Blinds"?`${s}-entry-hover-blinds`:""} ${J}`.trim(),ie=(g==null?void 0:g[0])??!1,ue=(g==null?void 0:g[1])??!1,Ce=u.useRef(e),$e=u.useRef(l);u.useEffect(()=>{if(!r||!n){Ce.current=e,$e.current=l;return}if($e.current!==l){Ce.current=e,$e.current=l;return}const he=Ce.current,xe=ud(e,he,{designWidth:I});Ce.current=e,xe!==e&&r(xe)},[e,r,n,l,I]);const Pe=u.useMemo(()=>gd(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),je=u.useMemo(()=>xo(e,Qt),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),we=u.useMemo(()=>xo(e,en),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Me=u.useMemo(()=>xo(e,tn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Ge=u.useMemo(()=>Array.isArray(V)&&V.length>0?V:[...Jt],[V]),ye=u.useMemo(()=>hd(Ge,p,Pe,je,we,Me),[Ge,p,Pe,je,we,Me]),Ae=zn(e),Te=u.useMemo(()=>et.slice(0,p).map(he=>Pe[he]),[p,Pe]),Be=u.useMemo(()=>oi(p,Ae,Pe),[p,Ae,Pe]),Ne=u.useMemo(()=>jn(p,Ae,Pe),[p,Ae,Pe]),Fe=u.useMemo(()=>ye.map((he,xe)=>Pr(Ne[xe]??0,he.paddingLeft,he.paddingRight)),[ye,Ne]),ke=u.useMemo(()=>{const he=h===0?1/0:h;return(t??[]).slice(0,he).map((We,Oe)=>({id:Oe,cells:Object.fromEntries(Jt.map(rt=>[rt,We[rt]??""])),image:We.image,link:We.link}))},[t,h]),Ye=ne?me??C:ke.length,nt=u.useMemo(()=>ne?ke.slice(0,Ye):ke,[ke,ne,Ye]),ot=ne&&Ye<ke.length,lo=nt.length>1||ot,co=[ie?`${s}-divider-top`:"",ue||lo?`${s}-divider-bottom`:""].filter(Boolean).join(" "),uo=()=>{const he=me??C;if(!y){O(ke.length);return}O(Math.min(he+y,ke.length))},Se=he=>T.scalingValue(he,n??!1),an=F?R??0:v??0,Pn=w??0,be=f??0,it=F?"rowPaddingTopB":"rowPaddingTop",Ke=ye[0],Ve=ye[ye.length-1],Xe=Fe[0],sn=Fe[Fe.length-1],Ar=Ke&&Xe?Math.max(Xe.paddingLeft,ln):0,ii=Ve&&sn?Math.max(sn.paddingRight,ln):0,Wr=Ae,Ir=he=>{if(!X)return;const xe=he.image;if(!(xe!=null&&xe.url)){Y(null);return}if((te==null?void 0:te.rowId)===he.id)return;const We=(L==null?void 0:L.min)??80,Oe=(L==null?void 0:L.max)??320;Y({rowId:he.id,url:xe.url,objectFit:xe.objectFit??"cover",widthPx:md(We,Oe)})},Fr=()=>{Y(null)},ri=u.useMemo(()=>!F&&Bt.some(he=>{const xe=he.charAt(0),We=e[`${he}VerticalAlign`];return Lr(We,e,xe)}),[F,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);return u.useLayoutEffect(()=>{var xt;const he=oe.current;if(!he)return;const xe=()=>{he.querySelectorAll("[data-list-col]").forEach(He=>{He.style.transform="";const Ue=He.querySelector(`.${s}-list-col-title`);Ue&&(Ue.style.paddingTop="",Ue.style.marginTop="")})};if(F||!ri){xe();return}const We=()=>{he.querySelectorAll("[data-list-row]").forEach(He=>{const Ue=Array.from(He.querySelectorAll("[data-list-col]"));Ue.forEach(Le=>{Le.style.transform="";const Ze=Le.querySelector(`.${s}-list-col-title`);Ze&&(Ze.style.paddingTop="",Ze.style.marginTop="")});const Ct=`${s}-baseline-probe`,Wt=new Map,Dt=Ue.map(Le=>{const Ze=Le.querySelector(`.${s}-list-col-title`),pt={el:Le,titleEl:Ze,letter:Le.getAttribute("data-col-letter")??"",kind:Le.getAttribute("data-valign")??"top",anchor:Le.getAttribute("data-valign-anchor")};return Wt.set(pt.letter,pt),pt}),It=new Map,An=(Le,Ze)=>{const pt=It.get(Le.letter);if(pt!==void 0)return pt;const Ft=Le.anchor?Wt.get(Le.anchor):void 0;if(Le.kind!=="baseline"||!Ft||Ze.has(Le.letter)){const si=bo(Le.titleEl,Ct);return It.set(Le.letter,si),si}Ze.add(Le.letter);const Rr=An(Ft,Ze);Ze.delete(Le.letter);const kr=bo(Le.titleEl,Ct),Mr=Rr-kr;Yc(Le.titleEl,Mr);const ai=bo(Le.titleEl,Ct);return It.set(Le.letter,ai),ai};Dt.forEach(Le=>An(Le,new Set))})};We();const Oe=new ResizeObserver(()=>We());Oe.observe(he);let rt=!1;return typeof document<"u"&&((xt=document.fonts)!=null&&xt.ready)&&document.fonts.ready.then(()=>{rt||We()}),()=>{rt=!0,Oe.disconnect(),xe()}},[ri,F,e,t,I,nt,Ne,ge]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dc(s)}}),a.jsx("div",{style:K,children:a.jsxs("div",{ref:oe,className:`${s}-wrapper ${pe}${co?` ${co}`:""}${F?` ${s}-type-b`:""}`.trim(),style:{width:T.scalingValue($??0,n)},onMouseLeave:X?Fr:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[nt.map((he,xe)=>{var xt;const We=(((xt=he.link)==null?void 0:xt.length)??0)>0,Oe=We?"a":"div",rt=Bc(xe,nt.length,ie,ue,ot,m??0,n??!1);return a.jsxs(Oe,{className:`${s}-list-item`,...We?{href:he.link,target:"_blank"}:{},style:rt,onMouseEnter:X?()=>Ir(he):void 0,children:[(an>0||c)&&a.jsx("div",{...c?{"data-controls":it,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(an)}}),a.jsx("div",{className:`${s}-list-cols-row${F?"":` ${s}-list-cols-row-h`}`,...F?{}:{"data-list-row":""},style:F?void 0:{minHeight:Se(be)},children:ye.map((He,Ue)=>{const Ct=Ue===ye.length-1,Wt=Fe[Ue],Dt=He.paddingBottom,It=Hc(he.cells[He.key]),An=F&&It&&(Dt>0||c),Le=F?{minHeight:Se(be)}:Ct?{}:{width:Se(Ne[Ue])},Ze=F?{paddingLeft:Se(Z),paddingRight:Se(Z)}:{paddingLeft:Se(Wt.paddingLeft),paddingRight:Se(Wt.paddingRight)},pt=He.textPrefix.charAt(0),Ft=F?{kind:"top"}:Uc(e[`${He.textPrefix}VerticalAlign`],e,pt);return a.jsxs("div",{...F?{}:{"data-list-col":"","data-col-letter":pt,"data-valign":Ft.kind,...Ft.kind==="baseline"?{"data-valign-anchor":Ft.anchorLetter}:{}},children:[a.jsx("div",{className:`${s}-list-col${Ct?` ${s}-list-col-last`:""}`,style:{...Ze,...Le,...F?{}:{justifyContent:Gc(Ft.kind)}},"data-test":He.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:ge[He.textPrefix]??ce,children:he.cells[He.key]??null})}),An&&a.jsx("div",{...c?{"data-controls":He.paddingBottomKey,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(Dt)}})]},He.key)})}),!F&&(Pn>0||c)&&a.jsx("div",{...c?{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(Pn)}})]},he.id)}),ot&&a.jsx("div",{className:`${s}-cut-item`,style:{minHeight:Se(x??0),...Vc(ue,m??0,n??!1)},children:a.jsx("div",{className:`${s}-list-cols-row`,style:F?{paddingLeft:Se(Z),paddingRight:Se(Z)}:{justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${s}-cut-label`,style:ce,onClick:uo,children:P})})})]}),c&&!F&&Ke&&Ve&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ke.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((Xe==null?void 0:Xe.paddingRight)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:0,width:Se(Ar),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Ve.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[ye.length-1]-((sn==null?void 0:sn.paddingLeft)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(Wr-ii),width:Se(ii),height:"100%",pointerEvents:"auto",zIndex:2}})]},"column-edge-padding-handles"),c&&!F&&ye.slice(0,-1).map((he,xe)=>{const We=ye[xe+1],Oe=pd(xe,Be,Te,Ae),rt=Be.slice(0,xe+1).reduce((Dt,It)=>Dt+It,0),xt=Fe[xe],He=Fe[xe+1],Ue=Math.max(xt.paddingRight,ln),Ct=Math.max(He.paddingLeft,ln),Wt=rt-ki/2;return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":he.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe]-xt.paddingLeft),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(rt-Ue),width:Se(Ue),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":he.widthKey,"data-controls-axis":"x","data-controls-min":String(ni),"data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Se(Wt),width:Se(ki),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":We.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe+1]-He.paddingRight),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(rt),width:Se(Ct),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${he.widthKey}-junction`)}),c&&F&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:0,width:Se(se),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:Se(Math.max(se,Ae-se)),width:Se(se),height:"100%",pointerEvents:"auto",zIndex:2}})]},"text-padding-lr-handles"),X&&te&&a.jsx("img",{className:`${s}-hover-image`,src:te.url,alt:"",style:{width:Dn(te.widthPx),objectFit:te.objectFit}})]})})]})}const yd=`import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4637
|
+
`}const Jt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bt=["AColumn","BColumn","CColumn","DColumn","EColumn"],ei=["A","B","C","D","E"];function $r(e){return`${e}ColumnVerticalAlign`}const zc=["Top","Center","Bottom"];function jc(e){const t=String(e??"Top").trim();return t.toLowerCase().startsWith("baseline")?!1:t==="Top"}function Kc(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ei.includes(n)?n:null}function Tr(e,t,n){const o=Kc(e);return o?o===t?!1:jc(n[$r(o)]):!0}function Wo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ei.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Uc(e,t,n){if(Lr(e,t,n))return Wo(e);const o=Wo(e);return o.kind==="baseline"?{kind:"top"}:o}function Lr(e,t,n){return Tr(e,n,t)?Wo(e).kind==="baseline":!1}function qc(e){if(e.type==="B")return null;const t={};let n=!1;for(const o of ei){const i=$r(o),l=e[i];Tr(l,o,e)||(t[i]="Top",n=!0)}return n?t:null}function Gc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function bo(e,t){if(!e)return 0;const n=document.createElement("i");n.className=t,n.setAttribute("data-baseline-probe",""),n.setAttribute("aria-hidden","true"),e.insertBefore(n,e.firstChild);const o=n.getBoundingClientRect().bottom;return n.remove(),o}function Yc(e,t){return!e||!t?(e&&(e.style.paddingTop="",e.style.marginTop=""),0):(t>0?(e.style.paddingTop=`${t}px`,e.style.marginTop=""):(e.style.paddingTop="",e.style.marginTop=`${t}px`),t)}const Xc={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"},Zc=["textFontFamily","textFontSettings","textFontSize","textLineHeight","textLetterSpacing","textWordSpacing","textTextAppearance"];function ti(e,t){return`${e}${t.replace(/^text/,"Text")}`}function Jc(e){return{textFontFamily:e.textFontFamily??"Arial",textFontSettings:e.textFontSettings??{fontWeight:400,fontStyle:"normal"},textFontSize:e.textFontSize,textLineHeight:e.textLineHeight,textLetterSpacing:e.textLetterSpacing??0,textWordSpacing:e.textWordSpacing??0,textTextAppearance:e.textTextAppearance,textColor:e.textColor}}function Qc(e,t){const n=o=>{const i=ti(t,o),l=e[i];return l!==void 0?l:e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Ri(e,t){var o,i;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((o=e.textFontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((i=e.textFontSettings)==null?void 0:i.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return yt(qe(n,t))}function ed(e,t){const n={};let o=!1;for(const i of Zc)if(e[i]!==t[i]&&e[i]!==void 0){o=!0;for(const l of Bt)Object.assign(n,{[ti(l,i)]:e[i]})}return o?n:null}const et=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Qt=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],en=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],tn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],td={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},nd=["hover","focus","filled","success","error"],ki=.004,ln=.004,ni=50,bn=1440,xn=ni/bn;function Er(e){const t=typeof e=="number"&&e>0?e:bn;return ni/t}function od(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const i=parseFloat(n);if(Number.isFinite(i)&&i>0)return i}const o=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(o){const i=parseFloat(o);if(Number.isFinite(i)&&i>0)return i}t=t.parentElement}return bn}const _r={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function zn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function id(e,t=1){const n=t/e;return Object.fromEntries(et.map(o=>[o,n]))}function rd(){return Object.fromEntries([...Qt.map(e=>[e,0]),...en.map(e=>[e,0])])}function ad(){return Object.fromEntries(tn.map(e=>[e,0]))}function Mn(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:_r[t]]))}function Pr(e,t,n){const o=e-xn,i=t+n;if(i<=0||i<=o)return{paddingLeft:t,paddingRight:n};if(o<=0)return{paddingLeft:0,paddingRight:0};const l=o/i;return{paddingLeft:t*l,paddingRight:n*l}}function jn(e,t,n){const o=oi(e,t,n);if(e<=0)return[];const i=o.slice(0,e-1).reduce((l,r)=>l+r,0);return[...o.slice(0,e-1),Math.max(0,t-i)]}function sd(e,t,n){const o={};for(let i=0;i<e;i+=1){const l=Qt[i],r=en[i],s=typeof n[l]=="number"?n[l]:0,c=typeof n[r]=="number"?n[r]:0,p=Pr(t[i]??0,s,c);p.paddingLeft!==s&&(o[l]=p.paddingLeft),p.paddingRight!==c&&(o[r]=p.paddingRight)}return o}function oi(e,t,n){if(e<=0)return[];const o=et.slice(0,e).map(p=>n[p]);if(e===1)return o;const i=o.slice(0,e-1),r=i.reduce((p,d)=>p+d,0)+xn;if(t>=r)return o;const s=[...i];let c=r-t;for(let p=s.length-1;p>=0&&c>0;p-=1){const d=s[p]-xn;if(d<=0)continue;const $=Math.min(c,d);s[p]-=$,c-=$}return[...s,o[e-1]]}function ld(e,t,n){if(e<=1)return{};const o=oi(e,t,n),i={};for(let l=0;l<e-1;l+=1){const r=et[l];o[l]!==n[r]&&(i[r]=o[l])}return i}function Mi(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Jt]}function cd(e,t){return e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function dd(e,t,n,o){const i=Math.min(o,e.length,et.length),l={};for(let r=0;r<i;r+=1){const s=e[r],c=t.indexOf(s);if(c===-1)continue;const p=et[c],d=Qt[c],$=en[c],h=tn[c],f=et[r],m=Qt[r],g=en[r],C=tn[r],y=n[p],x=n[d],P=n[$],L=n[h];typeof y=="number"&&(l[f]=y),typeof x=="number"&&(l[m]=x),typeof P=="number"&&(l[g]=P),typeof L=="number"&&(l[C]=L)}return l}function ud(e,t,n){const o=ed(e,t);o&&(e={...e,...o});const i=qc(e);i&&(e={...e,...i});const l=Er(n==null?void 0:n.designWidth),r=e.columns,s=t.columns,c=zn(e),p=zn(t),d=e.type==="B"||e.type===void 0&&t.type==="B",$=typeof r=="number"?r:typeof s=="number"?s:Jt.length,h=L=>{if(d)return L;const _=Mn({...t,...L}),E=zn(L),v=jn($,E,_),w=sd($,v,{...t,...L});return Object.keys(w).length===0?L:{...L,...w}};if(typeof r=="number"&&r!==s){const L={...e,...id(r,c),...rd()};if(d)for(const _ of tn)typeof t[_]=="number"&&(L[_]=t[_]);else Object.assign(L,ad());return L}const f=Mi(e),m=Mi(t);if(!cd(f,m))return h({...e,...dd(f,m,t,$)});if(c<p&&typeof $=="number"&&!d){const L=Mn({...t,...e});return h({...e,...ld($,c,L)})}if(d){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,_=Math.max(0,(c-l)/2);return L>_?{...e,textPaddingLR:_}:e}const g=Mn({...t,...e}),C=jn($,p,Mn(t)),x=jn($,c,g).some((L,_)=>L<(C[_]??L)),P=et.some(L=>{const _=e[L],E=t[L];return typeof _=="number"&&typeof E=="number"&&_!==E});return x||P?h(e):e}function pd(e,t,n,o){const i=t.slice(0,e).reduce((r,s)=>r+s,0),l=n.slice(e+1,t.length-1).reduce((r,s)=>r+s,0);return Math.max(xn,o-i-l-xn)}function md(e,t){return Math.random()*(t-e)+e}function gd(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:_r[t]]))}function xo(e,t,n=0){return Object.fromEntries(t.map(o=>[o,typeof e[o]=="number"?e[o]:n]))}function hd(e,t,n,o,i,l){return e.slice(0,t).map((r,s)=>{const c=Qt[s],p=en[s],d=tn[s];return{key:r,textPrefix:Xc[r],widthKey:et[s],width:n[et[s]],paddingLeftKey:c,paddingRightKey:p,paddingBottomKey:d,paddingLeft:o[c],paddingRight:i[p],paddingBottom:l[d]}})}function fd({settings:e,content:t,isEditor:n,isPreviewMode:o,activeEvent:i,layoutId:l,onUpdateSettings:r}){const{prefix:s}=T.useScopedStyles(),c=!!(n&&o),{columns:p,type:d,wrapperWidth:$,entriesCount:h,cellMinHeight:f,dividerWidth:m,showVisibility:g,cut:C,showCut:y,cutCellMinHeight:x,cutLabel:P,imageSize:L,imageOnHover:_,entryHoverEffect:E,rowPaddingTop:v,rowPaddingBottom:w,rowPaddingTopB:R,columnsOrder:V,textPaddingLR:A,textColor:H,textFontFamily:D,textFontSettings:j,textFontSize:U,textLineHeight:S,textLetterSpacing:N,textWordSpacing:k,textTextAppearance:M,backgroundColor:W,dividerColor:B,textHoverColor:ee,backgroundHoverColor:de,dividerHoverColor:re}=e,[me,O]=u.useState(void 0),[te,Y]=u.useState(null),X=_==="On",ne=(C??0)>0,I=d==="B",oe=u.useRef(null),[F,b]=u.useState(bn),z=Er(F),q=Math.max(0,(($??0)-z)/2),Z=Math.min(A??0,q),se=Math.max(Z,ln),le=(($??0)+z)/2;u.useLayoutEffect(()=>{if(!n){b(bn);return}const he=()=>{b(od(oe.current))};he();const xe=oe.current;if(!xe)return;const We=new ResizeObserver(he);We.observe(xe);let Oe=xe;for(;Oe&&!Oe.style.getPropertyValue("--cntrl-article-width");)Oe=Oe.parentElement;return Oe&&We.observe(Oe),()=>We.disconnect()},[n,l]),u.useEffect(()=>{O(void 0)},[C,y,t,h]);const ce=Ri(Jc(e),n),ge=u.useMemo(()=>Object.fromEntries(Bt.map(he=>[he,Ri(Qc(e,he),n)])),[e,D,j,U,S,N,k,M,H,n]),K=T.buildColorVars(s,{textColor:H,backgroundColor:W,dividerColor:B,textHoverColor:ee,backgroundHoverColor:de,dividerHoverColor:re},td,nd),J=i&&i!=="default"?`${s}-state-${i}`:"",pe=`${E==="Default"?`${s}-entry-hover-default`:E==="Blinds"?`${s}-entry-hover-blinds`:""} ${J}`.trim(),ie=(g==null?void 0:g[0])??!1,ue=(g==null?void 0:g[1])??!1,Ce=u.useRef(e),$e=u.useRef(l);u.useEffect(()=>{if(!r||!n){Ce.current=e,$e.current=l;return}if($e.current!==l){Ce.current=e,$e.current=l;return}const he=Ce.current,xe=ud(e,he,{designWidth:F});Ce.current=e,xe!==e&&r(xe)},[e,r,n,l,F]);const Pe=u.useMemo(()=>gd(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),je=u.useMemo(()=>xo(e,Qt),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),we=u.useMemo(()=>xo(e,en),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Me=u.useMemo(()=>xo(e,tn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Ge=u.useMemo(()=>Array.isArray(V)&&V.length>0?V:[...Jt],[V]),ye=u.useMemo(()=>hd(Ge,p,Pe,je,we,Me),[Ge,p,Pe,je,we,Me]),Ae=zn(e),Te=u.useMemo(()=>et.slice(0,p).map(he=>Pe[he]),[p,Pe]),Be=u.useMemo(()=>oi(p,Ae,Pe),[p,Ae,Pe]),Ne=u.useMemo(()=>jn(p,Ae,Pe),[p,Ae,Pe]),Ie=u.useMemo(()=>ye.map((he,xe)=>Pr(Ne[xe]??0,he.paddingLeft,he.paddingRight)),[ye,Ne]),ke=u.useMemo(()=>{const he=h===0?1/0:h;return(t??[]).slice(0,he).map((We,Oe)=>({id:Oe,cells:Object.fromEntries(Jt.map(rt=>[rt,We[rt]??""])),image:We.image,link:We.link}))},[t,h]),Ye=ne?me??C:ke.length,nt=u.useMemo(()=>ne?ke.slice(0,Ye):ke,[ke,ne,Ye]),ot=ne&&Ye<ke.length,lo=nt.length>1||ot,co=[ie?`${s}-divider-top`:"",ue||lo?`${s}-divider-bottom`:""].filter(Boolean).join(" "),uo=()=>{const he=me??C;if(!y){O(ke.length);return}O(Math.min(he+y,ke.length))},Se=he=>T.scalingValue(he,n??!1),an=I?R??0:v??0,Pn=w??0,be=f??0,it=I?"rowPaddingTopB":"rowPaddingTop",Ke=ye[0],Ve=ye[ye.length-1],Xe=Ie[0],sn=Ie[Ie.length-1],Ar=Ke&&Xe?Math.max(Xe.paddingLeft,ln):0,ii=Ve&&sn?Math.max(sn.paddingRight,ln):0,Wr=Ae,Fr=he=>{if(!X)return;const xe=he.image;if(!(xe!=null&&xe.url)){Y(null);return}if((te==null?void 0:te.rowId)===he.id)return;const We=(L==null?void 0:L.min)??80,Oe=(L==null?void 0:L.max)??320;Y({rowId:he.id,url:xe.url,objectFit:xe.objectFit??"cover",widthPx:md(We,Oe)})},Ir=()=>{Y(null)},ri=u.useMemo(()=>!I&&Bt.some(he=>{const xe=he.charAt(0),We=e[`${he}VerticalAlign`];return Lr(We,e,xe)}),[I,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);return u.useLayoutEffect(()=>{var xt;const he=oe.current;if(!he)return;const xe=()=>{he.querySelectorAll("[data-list-col]").forEach(He=>{He.style.transform="";const Ue=He.querySelector(`.${s}-list-col-title`);Ue&&(Ue.style.paddingTop="",Ue.style.marginTop="")})};if(I||!ri){xe();return}const We=()=>{he.querySelectorAll("[data-list-row]").forEach(He=>{const Ue=Array.from(He.querySelectorAll("[data-list-col]"));Ue.forEach(Le=>{Le.style.transform="";const Ze=Le.querySelector(`.${s}-list-col-title`);Ze&&(Ze.style.paddingTop="",Ze.style.marginTop="")});const Ct=`${s}-baseline-probe`,Wt=new Map,Dt=Ue.map(Le=>{const Ze=Le.querySelector(`.${s}-list-col-title`),pt={el:Le,titleEl:Ze,letter:Le.getAttribute("data-col-letter")??"",kind:Le.getAttribute("data-valign")??"top",anchor:Le.getAttribute("data-valign-anchor")};return Wt.set(pt.letter,pt),pt}),Ft=new Map,An=(Le,Ze)=>{const pt=Ft.get(Le.letter);if(pt!==void 0)return pt;const It=Le.anchor?Wt.get(Le.anchor):void 0;if(Le.kind!=="baseline"||!It||Ze.has(Le.letter)){const si=bo(Le.titleEl,Ct);return Ft.set(Le.letter,si),si}Ze.add(Le.letter);const Rr=An(It,Ze);Ze.delete(Le.letter);const kr=bo(Le.titleEl,Ct),Mr=Rr-kr;Yc(Le.titleEl,Mr);const ai=bo(Le.titleEl,Ct);return Ft.set(Le.letter,ai),ai};Dt.forEach(Le=>An(Le,new Set))})};We();const Oe=new ResizeObserver(()=>We());Oe.observe(he);let rt=!1;return typeof document<"u"&&((xt=document.fonts)!=null&&xt.ready)&&document.fonts.ready.then(()=>{rt||We()}),()=>{rt=!0,Oe.disconnect(),xe()}},[ri,I,e,t,F,nt,Ne,ge]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dc(s)}}),a.jsx("div",{style:K,children:a.jsxs("div",{ref:oe,className:`${s}-wrapper ${pe}${co?` ${co}`:""}${I?` ${s}-type-b`:""}`.trim(),style:{width:T.scalingValue($??0,n)},onMouseLeave:X?Ir:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[nt.map((he,xe)=>{var xt;const We=(((xt=he.link)==null?void 0:xt.length)??0)>0,Oe=We?"a":"div",rt=Bc(xe,nt.length,ie,ue,ot,m??0,n??!1);return a.jsxs(Oe,{className:`${s}-list-item`,...We?{href:he.link,target:"_blank"}:{},style:rt,onMouseEnter:X?()=>Fr(he):void 0,children:[(an>0||c)&&a.jsx("div",{...c?{"data-controls":it,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(an)}}),a.jsx("div",{className:`${s}-list-cols-row${I?"":` ${s}-list-cols-row-h`}`,...I?{}:{"data-list-row":""},style:I?void 0:{minHeight:Se(be)},children:ye.map((He,Ue)=>{const Ct=Ue===ye.length-1,Wt=Ie[Ue],Dt=He.paddingBottom,Ft=Hc(he.cells[He.key]),An=I&&Ft&&(Dt>0||c),Le=I?{minHeight:Se(be)}:Ct?{}:{width:Se(Ne[Ue])},Ze=I?{paddingLeft:Se(Z),paddingRight:Se(Z)}:{paddingLeft:Se(Wt.paddingLeft),paddingRight:Se(Wt.paddingRight)},pt=He.textPrefix.charAt(0),It=I?{kind:"top"}:Uc(e[`${He.textPrefix}VerticalAlign`],e,pt);return a.jsxs("div",{...I?{}:{"data-list-col":"","data-col-letter":pt,"data-valign":It.kind,...It.kind==="baseline"?{"data-valign-anchor":It.anchorLetter}:{}},children:[a.jsx("div",{className:`${s}-list-col${Ct?` ${s}-list-col-last`:""}`,style:{...Ze,...Le,...I?{}:{justifyContent:Gc(It.kind)}},"data-test":He.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:ge[He.textPrefix]??ce,children:he.cells[He.key]??null})}),An&&a.jsx("div",{...c?{"data-controls":He.paddingBottomKey,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(Dt)}})]},He.key)})}),!I&&(Pn>0||c)&&a.jsx("div",{...c?{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(Pn)}})]},he.id)}),ot&&a.jsx("div",{className:`${s}-cut-item`,style:{minHeight:Se(x??0),...Vc(ue,m??0,n??!1)},children:a.jsx("div",{className:`${s}-list-cols-row`,style:I?{paddingLeft:Se(Z),paddingRight:Se(Z)}:{justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${s}-cut-label`,style:ce,onClick:uo,children:P})})})]}),c&&!I&&Ke&&Ve&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ke.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((Xe==null?void 0:Xe.paddingRight)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:0,width:Se(Ar),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Ve.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[ye.length-1]-((sn==null?void 0:sn.paddingLeft)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(Wr-ii),width:Se(ii),height:"100%",pointerEvents:"auto",zIndex:2}})]},"column-edge-padding-handles"),c&&!I&&ye.slice(0,-1).map((he,xe)=>{const We=ye[xe+1],Oe=pd(xe,Be,Te,Ae),rt=Be.slice(0,xe+1).reduce((Dt,Ft)=>Dt+Ft,0),xt=Ie[xe],He=Ie[xe+1],Ue=Math.max(xt.paddingRight,ln),Ct=Math.max(He.paddingLeft,ln),Wt=rt-ki/2;return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":he.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe]-xt.paddingLeft),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(rt-Ue),width:Se(Ue),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":he.widthKey,"data-controls-axis":"x","data-controls-min":String(ni),"data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Se(Wt),width:Se(ki),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":We.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe+1]-He.paddingRight),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(rt),width:Se(Ct),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${he.widthKey}-junction`)}),c&&I&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:0,width:Se(se),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:Se(Math.max(se,Ae-se)),width:Se(se),height:"100%",pointerEvents:"auto",zIndex:2}})]},"text-padding-lr-handles"),X&&te&&a.jsx("img",{className:`${s}-hover-image`,src:te.url,alt:"",style:{width:Dn(te.widthPx),objectFit:te.objectFit}})]})})]})}const yd=`import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4638
4638
|
import { CommonComponentProps } from '../props';
|
|
4639
4639
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
4640
4640
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -6984,4 +6984,4 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6984
6984
|
</>
|
|
6985
6985
|
);
|
|
6986
6986
|
}
|
|
6987
|
-
`,Et=["A","B","C","D","E"],Ni=[...zc,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],vd={FontFamily:"textFontFamily",FontSettings:"textFontSettings",FontSize:"textFontSize",LineHeight:"textLineHeight",LetterSpacing:"textLetterSpacing",WordSpacing:"textWordSpacing",TextAppearance:"textTextAppearance"};function Re(e,t){return ti(e,vd[t])}const Mt={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function bd(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Nn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function xd(){return Object.fromEntries(Et.map((e,t)=>{const n=Jt[t],o=`${e} column`;return[n,bd(o)]}))}function Cd(){const e={};for(const t of Et)e[`${t}ColumnWidth`]=Nn(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Nn(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Nn(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Nn(`${t} column padding bottom`);return e}function Oi(e={}){const t={columns:5,wrapperWidth:1,columnsOrder:[...Jt]};for(const n of Et)t[`${n}ColumnWidth`]=.2,t[`${n}ColumnPaddingLeft`]=0,t[`${n}ColumnPaddingRight`]=0,t[`${n}ColumnPaddingBottom`]=0;return{...t,...e}}function Sd(e){const t=e.charAt(0);return{[`${e}VerticalAlign`]:{type:"string",scope:"layout",title:"Vertical align",display:{type:"drop-down",enum:[...Ni],filterBaselineByTopAnchor:!0,columnLetter:t},enum:[...Ni]},[Re(e,"FontFamily")]:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},[Re(e,"FontSettings")]:{...Mt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},[Re(e,"FontSize")]:{...Mt.fontSize,scope:"layout",title:"Font Size",display:{type:"font-size"}},[Re(e,"LineHeight")]:{...Mt.lineHeight,scope:"layout",title:"Line Height",display:{type:"line-height-input"}},[Re(e,"LetterSpacing")]:{...Mt.letterSpacing,scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},[Re(e,"WordSpacing")]:{...Mt.wordSpacing,scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},[Re(e,"TextAppearance")]:{...Mt.textAppearance,scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}}}}const wd=Bt.reduce((e,t)=>({...e,...Sd(t)}),{}),$d=Bt.reduce((e,t)=>({...e,[`${t}VerticalAlign`]:"Top",[Re(t,"FontFamily")]:"Arial",[Re(t,"FontSettings")]:{fontWeight:400,fontStyle:"normal"},[Re(t,"LetterSpacing")]:0,[Re(t,"WordSpacing")]:0,[Re(t,"TextAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Hi(e){const{textFontSize:t,textLineHeight:n}=e;return Bt.reduce((o,i)=>(t!==void 0&&(o[`${i}TextFontSize`]=t),n!==void 0&&(o[`${i}TextLineHeight`]=n),o),{})}const Td=Et.map(e=>`${e} column`),Ld=Bt.map((e,t)=>({type:"group",title:Td[t],items:[Re(e,"FontFamily"),Re(e,"FontSettings"),{type:"row",items:[Re(e,"FontSize"),Re(e,"LineHeight"),Re(e,"LetterSpacing"),Re(e,"WordSpacing")]},Re(e,"TextAppearance"),`${e}VerticalAlign`]})),Ed=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],_d=["cutLabel","cutCellMinHeight","showCut"],Pd=[...Et.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"];function Co(e,t){const n=e?` ${e}`:"";return{AColumn:`AColumn${n}`,BColumnWidth:`BColumnWidth${n}`,CColumnWidth:`CColumnWidth${n}`,DColumnWidth:`DColumnWidth${n}`,EColumnWidth:`EColumnWidth${n}`,image:t,link:""}}const Ad=[Co("",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"}),Co("2",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"}),Co("3",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"})],Wd=[...Et.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Id={type:"object",version:1,properties:{content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{...xd(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Ad}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["On","Off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["Top","Bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Cut",display:{type:"toggle-numeric-input",enum:["Off","On"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["All","Custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Cd(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},textFontSettings:{...Mt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},...wd,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...$d,backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:Oi({type:"B",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.043,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043,...Hi({textFontSize:.043,textLineHeight:.043})}),d:Oi({type:"A",textPaddingLR:.01,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01,...Hi({textFontSize:.01,textLineHeight:.01})})},displayRules:[..._d.map(e=>({if:{name:"cut",value:0},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"A"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Pd.map(e=>({if:{name:"type",value:"B"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"A"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Et.map(e=>({if:{name:"type",value:"A"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),...Et.map(e=>({if:{name:"type",value:"B"},then:{name:`properties.${e}ColumnVerticalAlign.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Wd]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["entryHoverEffect"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]},{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"All text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]},...Ld]}],paletteBookmark:{items:[...Ed],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Fd={element:fd,id:"list",name:"Default List",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Id,sourceCode:yd},Rd=[Us,Qs,Vl,Xl,ac,fc,Cc,Ec,Oc,Fd];exports.components=Rd;exports.isSchemaV1=Nr;
|
|
6987
|
+
`,Et=["A","B","C","D","E"],Ni=[...zc,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],vd={FontFamily:"textFontFamily",FontSettings:"textFontSettings",FontSize:"textFontSize",LineHeight:"textLineHeight",LetterSpacing:"textLetterSpacing",WordSpacing:"textWordSpacing",TextAppearance:"textTextAppearance"};function Re(e,t){return ti(e,vd[t])}const Mt={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function bd(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Nn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function xd(){return Object.fromEntries(Et.map((e,t)=>{const n=Jt[t],o=`${e} column`;return[n,bd(o)]}))}function Cd(){const e={};for(const t of Et)e[`${t}ColumnWidth`]=Nn(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Nn(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Nn(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Nn(`${t} column padding bottom`);return e}function Oi(e={}){const t={columns:5,wrapperWidth:1,columnsOrder:[...Jt]};for(const n of Et)t[`${n}ColumnWidth`]=.2,t[`${n}ColumnPaddingLeft`]=0,t[`${n}ColumnPaddingRight`]=0,t[`${n}ColumnPaddingBottom`]=0;return{...t,...e}}function Sd(e){const t=e.charAt(0);return{[`${e}VerticalAlign`]:{type:"string",scope:"layout",title:"Vertical align",display:{type:"drop-down",enum:[...Ni],filterBaselineByTopAnchor:!0,columnLetter:t},enum:[...Ni]},[Re(e,"FontFamily")]:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},[Re(e,"FontSettings")]:{...Mt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},[Re(e,"FontSize")]:{...Mt.fontSize,scope:"layout",title:"Font Size",display:{type:"font-size"}},[Re(e,"LineHeight")]:{...Mt.lineHeight,scope:"layout",title:"Line Height",display:{type:"line-height-input"}},[Re(e,"LetterSpacing")]:{...Mt.letterSpacing,scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},[Re(e,"WordSpacing")]:{...Mt.wordSpacing,scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},[Re(e,"TextAppearance")]:{...Mt.textAppearance,scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}}}}const wd=Bt.reduce((e,t)=>({...e,...Sd(t)}),{}),$d=Bt.reduce((e,t)=>({...e,[`${t}VerticalAlign`]:"Top",[Re(t,"FontFamily")]:"Arial",[Re(t,"FontSettings")]:{fontWeight:400,fontStyle:"normal"},[Re(t,"LetterSpacing")]:0,[Re(t,"WordSpacing")]:0,[Re(t,"TextAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Hi(e){const{textFontSize:t,textLineHeight:n}=e;return Bt.reduce((o,i)=>(t!==void 0&&(o[`${i}TextFontSize`]=t),n!==void 0&&(o[`${i}TextLineHeight`]=n),o),{})}const Td=Et.map(e=>`${e} column`),Ld=Bt.map((e,t)=>({type:"group",title:Td[t],items:[Re(e,"FontFamily"),Re(e,"FontSettings"),{type:"row",items:[Re(e,"FontSize"),Re(e,"LineHeight"),Re(e,"LetterSpacing"),Re(e,"WordSpacing")]},Re(e,"TextAppearance"),`${e}VerticalAlign`]})),Ed=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],_d=["cutLabel","cutCellMinHeight","showCut"],Pd=[...Et.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"];function Co(e,t){const n=e?` ${e}`:"";return{AColumn:`AColumn${n}`,BColumnWidth:`BColumnWidth${n}`,CColumnWidth:`CColumnWidth${n}`,DColumnWidth:`DColumnWidth${n}`,EColumnWidth:`EColumnWidth${n}`,image:t,link:""}}const Ad=[Co("",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"}),Co("2",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"}),Co("3",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"})],Wd=[...Et.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Fd={type:"object",version:1,properties:{content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{...xd(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Ad}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["On","Off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["Top","Bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Cut",display:{type:"toggle-numeric-input",enum:["Off","On"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["All","Custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Cd(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},textFontSettings:{...Mt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},...wd,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...$d,backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:Oi({type:"B",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.043,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043,...Hi({textFontSize:.043,textLineHeight:.043})}),d:Oi({type:"A",textPaddingLR:.01,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01,...Hi({textFontSize:.01,textLineHeight:.01})})},displayRules:[..._d.map(e=>({if:{name:"cut",value:0},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"A"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Pd.map(e=>({if:{name:"type",value:"B"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"A"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Et.map(e=>({if:{name:"type",value:"A"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),...Et.map(e=>({if:{name:"type",value:"B"},then:{name:`properties.${e}ColumnVerticalAlign.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Wd]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["entryHoverEffect"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]},{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"All text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]},...Ld]}],paletteBookmark:{items:[...Ed],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Id={element:fd,id:"list",name:"Default List",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png "},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Fd,sourceCode:yd},Rd=[Us,Qs,Vl,Xl,ac,fc,Cc,Ec,Oc,Id];exports.components=Rd;exports.isSchemaV1=Nr;
|