@cntrl-site/components 1.0.9-alpha.5 → 1.0.9-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Marquee/Marquee.d.ts +19 -2
- package/dist/Components/Marquee/MarqueeCard.d.ts +18 -0
- package/dist/Components/Marquee/MarqueeComponent.d.ts +7 -1
- package/dist/index.js +152 -115
- package/dist/index.mjs +2518 -2226
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),g=require("react"),he=require("classnames"),_=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),xr=require("react-dom");function Sr(e){return e.type==="object"&&e.version===1}const Cr="ControlSlider-module__wrapper___sHEkd",wr="ControlSlider-module__hoverArrow___A-dOH",$r="ControlSlider-module__sliderItem___QQSkR",Tr="ControlSlider-module__sliderImage___9hRl-",_r="ControlSlider-module__arrow___05ghY",Er="ControlSlider-module__arrowVertical___tBfVN",kr="ControlSlider-module__nextArrow___-30Yc",Ar="ControlSlider-module__arrowInner___aEra3",Ir="ControlSlider-module__arrowIcon___S4ztF",Lr="ControlSlider-module__arrowImg___2dwJW",Fr="ControlSlider-module__mirror___brd6U",Rr="ControlSlider-module__pagination___bicLF",Mr="ControlSlider-module__paginationInner___bT-P-",Pr="ControlSlider-module__paginationVertical___zYqKw",Wr="ControlSlider-module__paginationItem___nTRbk",Hr="ControlSlider-module__dot___p1Qun",Nr="ControlSlider-module__activeDot___LHFaj",jr="ControlSlider-module__paginationInsideBottom___R3FWn",Vr="ControlSlider-module__paginationInsideTop___V-qb-",Br="ControlSlider-module__paginationOutsideBottom___14w8D",Or="ControlSlider-module__paginationOutsideTop___SCLqB",zr="ControlSlider-module__paginationInsideLeft___yOBRZ",Dr="ControlSlider-module__paginationInsideRight___Rtt3o",qr="ControlSlider-module__paginationOutsideLeft___lahaw",Ur="ControlSlider-module__paginationOutsideRight___EtuQa",Gr="ControlSlider-module__imgWrapper___UjEgB",Kr="ControlSlider-module__captionBlock___dJ6-j",Yr="ControlSlider-module__captionTextWrapper___HFlpf",Xr="ControlSlider-module__captionText___uGBVc",Zr="ControlSlider-module__active___WZK4G",Jr="ControlSlider-module__withPointerEvents___t-18M",Qr="ControlSlider-module__topLeftAlignment___zjnGM",ei="ControlSlider-module__topCenterAlignment___gD1xW",ti="ControlSlider-module__topRightAlignment___NMapS",ni="ControlSlider-module__middleLeftAlignment___OnUrY",oi="ControlSlider-module__middleCenterAlignment___Tdkl0",ri="ControlSlider-module__middleRightAlignment___wEbfX",ii="ControlSlider-module__bottomLeftAlignment___cTP2-",ai="ControlSlider-module__bottomCenterAlignment___c54fB",si="ControlSlider-module__bottomRightAlignment___kEwrz",li="ControlSlider-module__clickOverlay___DZA28",ci="ControlSlider-module__contain___pLyq7",ui="ControlSlider-module__cover___KdDat",te={wrapper:Cr,hoverArrow:wr,sliderItem:$r,sliderImage:Tr,arrow:_r,arrowVertical:Er,nextArrow:kr,arrowInner:Ar,arrowIcon:Ir,arrowImg:Lr,mirror:Fr,pagination:Rr,paginationInner:Mr,paginationVertical:Pr,paginationItem:Wr,dot:Hr,activeDot:Nr,paginationInsideBottom:jr,paginationInsideTop:Vr,paginationOutsideBottom:Br,paginationOutsideTop:Or,paginationInsideLeft:zr,paginationInsideRight:Dr,paginationOutsideLeft:qr,paginationOutsideRight:Ur,imgWrapper:Gr,captionBlock:Kr,captionTextWrapper:Yr,captionText:Xr,active:Zr,withPointerEvents:Jr,topLeftAlignment:Qr,topCenterAlignment:ei,topRightAlignment:ti,middleLeftAlignment:ni,middleCenterAlignment:oi,middleRightAlignment:ri,bottomLeftAlignment:ii,bottomCenterAlignment:ai,bottomRightAlignment:si,clickOverlay:li,contain:ci,cover:ui};function pi(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 di(e,t,n){return t&&pi(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var oo="(prefers-reduced-motion: reduce)",mt=1,mi=2,yt=3,xt=4,Pt=5,Xt=6,en=7,gi={CREATED:mt,MOUNTED:mi,IDLE:yt,MOVING:xt,SCROLLING:Pt,DRAGGING:Xt,DESTROYED:en};function Ue(e){e.length=0}function Qe(e,t,n){return Array.prototype.slice.call(e,t,n)}function ve(e){return e.bind.apply(e,[null].concat(Qe(arguments,1)))}var Io=setTimeout,Tn=function(){};function ro(e){return requestAnimationFrame(e)}function an(e,t){return typeof t===e}function Et(e){return!Pn(e)&&an("object",e)}var Mn=Array.isArray,Lo=ve(an,"function"),Ze=ve(an,"string"),Wt=ve(an,"undefined");function Pn(e){return e===null}function Fo(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ht(e){return Mn(e)?e:[e]}function Ae(e,t){Ht(e).forEach(t)}function Wn(e,t){return e.indexOf(t)>-1}function Zt(e,t){return e.push.apply(e,Ht(t)),e}function ze(e,t,n){e&&Ae(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function We(e,t){ze(e,Ze(t)?t.split(" "):t,!0)}function Nt(e,t){Ae(t,e.appendChild.bind(e))}function Hn(e,t){Ae(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function kt(e,t){return Fo(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ro(e,t){var n=e?Qe(e.children):[];return t?n.filter(function(o){return kt(o,t)}):n}function jt(e,t){return t?Ro(e,t)[0]:e.firstElementChild}var At=Object.keys;function rt(e,t,n){return e&&(n?At(e).reverse():At(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function It(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){e[o]=t[o]})}),e}function Ye(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){Mn(n)?e[o]=n.slice():Et(n)?e[o]=Ye({},Et(e[o])?e[o]:{},n):e[o]=n})}),e}function io(e,t){Ae(t||At(e),function(n){delete e[n]})}function He(e,t){Ae(e,function(n){Ae(t,function(o){n&&n.removeAttribute(o)})})}function de(e,t,n){Et(t)?rt(t,function(o,r){de(e,r,o)}):Ae(e,function(o){Pn(n)||n===""?He(o,t):o.setAttribute(t,String(n))})}function gt(e,t,n){var o=document.createElement(e);return t&&(Ze(t)?We(o,t):de(o,t)),n&&Nt(n,o),o}function Le(e,t,n){if(Wt(n))return getComputedStyle(e)[t];Pn(n)||(e.style[t]=""+n)}function Lt(e,t){Le(e,"display",t)}function Mo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Fe(e,t){return e.getAttribute(t)}function ao(e,t){return e&&e.classList.contains(t)}function Ee(e){return e.getBoundingClientRect()}function it(e){Ae(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Po(e){return jt(new DOMParser().parseFromString(e,"text/html").body)}function Oe(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Wo(e,t){return e&&e.querySelector(t)}function Nn(e,t){return t?Qe(e.querySelectorAll(t)):[]}function De(e,t){ze(e,t,!1)}function _n(e){return e.timeStamp}function ot(e){return Ze(e)?e:e?e+"px":""}var Vt="splide",jn="data-"+Vt;function Tt(e,t){if(!e)throw new Error("["+Vt+"] "+(t||""))}var Je=Math.min,tn=Math.max,nn=Math.floor,Ft=Math.ceil,_e=Math.abs;function Ho(e,t,n){return _e(e-t)<n}function Jt(e,t,n,o){var r=Je(t,n),s=tn(t,n);return o?r<e&&e<s:r<=e&&e<=s}function pt(e,t,n){var o=Je(t,n),r=tn(t,n);return Je(tn(o,e),r)}function En(e){return+(e>0)-+(e<0)}function kn(e,t){return Ae(t,function(n){e=e.replace("%s",""+n)}),e}function Vn(e){return e<10?"0"+e:""+e}var so={};function fi(e){return""+e+Vn(so[e]=(so[e]||0)+1)}function No(){var e=[];function t(i,u,l,m){r(i,u,function(c,T,v){var h="addEventListener"in c,p=h?c.removeEventListener.bind(c,T,l,m):c.removeListener.bind(c,l);h?c.addEventListener(T,l,m):c.addListener(l),e.push([c,T,v,l,p])})}function n(i,u,l){r(i,u,function(m,c,T){e=e.filter(function(v){return v[0]===m&&v[1]===c&&v[2]===T&&(!l||v[3]===l)?(v[4](),!1):!0})})}function o(i,u,l){var m,c=!0;return typeof CustomEvent=="function"?m=new CustomEvent(u,{bubbles:c,detail:l}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(u,c,!1,l)),i.dispatchEvent(m),m}function r(i,u,l){Ae(i,function(m){m&&Ae(u,function(c){c.split(" ").forEach(function(T){var v=T.split(".");l(m,v[0],v[1])})})})}function s(){e.forEach(function(i){i[4]()}),Ue(e)}return{bind:t,unbind:n,dispatch:o,destroy:s}}var et="mounted",An="ready",Ge="move",St="moved",Bn="click",jo="active",Vo="inactive",Bo="visible",Oo="hidden",Se="refresh",Te="updated",vt="resize",sn="resized",zo="drag",Do="dragging",qo="dragged",ln="scroll",st="scrolled",hi="overflow",On="destroy",Uo="arrows:mounted",Go="arrows:updated",Ko="pagination:mounted",Yo="pagination:updated",zn="navigation:mounted",Dn="autoplay:play",Xo="autoplay:playing",qn="autoplay:pause",Un="lazyload:loaded",Zo="sk",Jo="sh",on="ei";function be(e){var t=e?e.event.bus:document.createDocumentFragment(),n=No();function o(s,i){n.bind(t,Ht(s).join(" "),function(u){i.apply(i,Mn(u.detail)?u.detail:[])})}function r(s){n.dispatch(t,s,Qe(arguments,1))}return e&&e.event.on(On,n.destroy),It(n,{bus:t,on:o,off:ve(n.unbind,t),emit:r})}function cn(e,t,n,o){var r=Date.now,s,i=0,u,l=!0,m=0;function c(){if(!l){if(i=e?Je((r()-s)/e,1):1,n&&n(i),i>=1&&(t(),s=r(),o&&++m>=o))return v();u=ro(c)}}function T(b){b||p(),s=r()-(b?i*e:0),l=!1,u=ro(c)}function v(){l=!0}function h(){s=r(),i=0,n&&n(i)}function p(){u&&cancelAnimationFrame(u),i=0,u=0,l=!0}function d(b){e=b}function C(){return l}return{start:T,rewind:h,pause:v,cancel:p,set:d,isPaused:C}}function yi(e){var t=e;function n(r){t=r}function o(r){return Wn(Ht(r),t)}return{set:n,is:o}}function vi(e,t){var n=cn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function bi(e,t,n){var o=e.state,r=n.breakpoints||{},s=n.reducedMotion||{},i=No(),u=[];function l(){var p=n.mediaQuery==="min";At(r).sort(function(d,C){return p?+d-+C:+C-+d}).forEach(function(d){c(r[d],"("+(p?"min":"max")+"-width:"+d+"px)")}),c(s,oo),T()}function m(p){p&&i.destroy()}function c(p,d){var C=matchMedia(d);i.bind(C,"change",T),u.push([p,C])}function T(){var p=o.is(en),d=n.direction,C=u.reduce(function(b,x){return Ye(b,x[1].matches?x[0]:{})},{});io(n),h(C),n.destroy?e.destroy(n.destroy==="completely"):p?(m(!0),e.mount()):d!==n.direction&&e.refresh()}function v(p){matchMedia(oo).matches&&(p?Ye(n,s):io(n,At(s)))}function h(p,d,C){Ye(n,p),d&&Ye(Object.getPrototypeOf(n),p),(C||!o.is(mt))&&e.emit(Te,n)}return{setup:l,destroy:m,reduce:v,set:h}}var un="Arrow",pn=un+"Left",dn=un+"Right",Qo=un+"Up",er=un+"Down",lo="rtl",mn="ttb",bn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Qo,dn],ArrowRight:[er,pn]};function xi(e,t,n){function o(s,i,u){u=u||n.direction;var l=u===lo&&!i?1:u===mn?0:-1;return bn[s]&&bn[s][l]||s.replace(/width|left|right/i,function(m,c){var T=bn[m.toLowerCase()][l]||m;return c>0?T.charAt(0).toUpperCase()+T.slice(1):T})}function r(s){return s*(n.direction===lo?1:-1)}return{resolve:o,orient:r}}var qe="role",ft="tabindex",Si="disabled",Re="aria-",Bt=Re+"controls",tr=Re+"current",co=Re+"selected",ke=Re+"label",Gn=Re+"labelledby",nr=Re+"hidden",Kn=Re+"orientation",Rt=Re+"roledescription",uo=Re+"live",po=Re+"busy",mo=Re+"atomic",Yn=[qe,ft,Si,Bt,tr,ke,Gn,nr,Kn,Rt],Ne=Vt+"__",tt="is-",xn=Vt,go=Ne+"track",Ci=Ne+"list",gn=Ne+"slide",or=gn+"--clone",wi=gn+"__container",Xn=Ne+"arrows",fn=Ne+"arrow",rr=fn+"--prev",ir=fn+"--next",hn=Ne+"pagination",ar=hn+"__page",$i=Ne+"progress",Ti=$i+"__bar",_i=Ne+"toggle",Ei=Ne+"spinner",ki=Ne+"sr",Ai=tt+"initialized",at=tt+"active",sr=tt+"prev",lr=tt+"next",In=tt+"visible",Ln=tt+"loading",cr=tt+"focus-in",ur=tt+"overflow",Ii=[at,In,sr,lr,Ln,cr,ur],Li={slide:gn,clone:or,arrows:Xn,arrow:fn,prev:rr,next:ir,pagination:hn,page:ar,spinner:Ei};function Fi(e,t){if(Lo(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!kt(n,t);)n=n.parentElement;return n}var Ri=5,fo=200,pr="touchstart mousedown",Sn="touchmove mousemove",Cn="touchend touchcancel mouseup click";function Mi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=e.root,u=n.i18n,l={},m=[],c=[],T=[],v,h,p;function d(){E(),U(),x()}function C(){r(Se,b),r(Se,d),r(Te,x),s(document,pr+" keydown",function(S){p=S.type==="keydown"},{capture:!0}),s(i,"focusin",function(){ze(i,cr,!!p)})}function b(S){var w=Yn.concat("style");Ue(m),De(i,c),De(v,T),He([v,h],w),He(i,S?w:["style",Rt])}function x(){De(i,c),De(v,T),c=A(xn),T=A(go),We(i,c),We(v,T),de(i,ke,n.label),de(i,Gn,n.labelledby)}function E(){v=k("."+go),h=jt(v,"."+Ci),Tt(v&&h,"A track/list element is missing."),Zt(m,Ro(h,"."+gn+":not(."+or+")")),rt({arrows:Xn,pagination:hn,prev:rr,next:ir,bar:Ti,toggle:_i},function(S,w){l[w]=k("."+S)}),It(l,{root:i,track:v,list:h,slides:m})}function U(){var S=i.id||fi(Vt),w=n.role;i.id=S,v.id=v.id||S+"-track",h.id=h.id||S+"-list",!Fe(i,qe)&&i.tagName!=="SECTION"&&w&&de(i,qe,w),de(i,Rt,u.carousel),de(h,qe,"presentation")}function k(S){var w=Wo(i,S);return w&&Fi(w,"."+xn)===i?w:void 0}function A(S){return[S+"--"+n.type,S+"--"+n.direction,n.drag&&S+"--draggable",n.isNavigation&&S+"--nav",S===xn&&at]}return It(l,{setup:d,mount:C,destroy:b})}var bt="slide",Ct="loop",Ot="fade";function Pi(e,t,n,o){var r=be(e),s=r.on,i=r.emit,u=r.bind,l=e.Components,m=e.root,c=e.options,T=c.isNavigation,v=c.updateOnMove,h=c.i18n,p=c.pagination,d=c.slideFocus,C=l.Direction.resolve,b=Fe(o,"style"),x=Fe(o,ke),E=n>-1,U=jt(o,"."+wi),k;function A(){E||(o.id=m.id+"-slide"+Vn(t+1),de(o,qe,p?"tabpanel":"group"),de(o,Rt,h.slide),de(o,ke,x||kn(h.slideLabel,[t+1,e.length]))),S()}function S(){u(o,"click",ve(i,Bn,I)),u(o,"keydown",ve(i,Zo,I)),s([St,Jo,st],H),s(zn,R),v&&s(Ge,V)}function w(){k=!0,r.destroy(),De(o,Ii),He(o,Yn),de(o,"style",b),de(o,ke,x||"")}function R(){var P=e.splides.map(function($){var N=$.splide.Components.Slides.getAt(t);return N?N.slide.id:""}).join(" ");de(o,ke,kn(h.slideX,(E?n:t)+1)),de(o,Bt,P),de(o,qe,d?"button":""),d&&He(o,Rt)}function V(){k||H()}function H(){if(!k){var P=e.index;j(),M(),ze(o,sr,t===P-1),ze(o,lr,t===P+1)}}function j(){var P=K();P!==ao(o,at)&&(ze(o,at,P),de(o,tr,T&&P||""),i(P?jo:Vo,I))}function M(){var P=f(),$=!P&&(!K()||E);if(e.state.is([xt,Pt])||de(o,nr,$||""),de(Nn(o,c.focusableNodes||""),ft,$?-1:""),d&&de(o,ft,$?-1:0),P!==ao(o,In)&&(ze(o,In,P),i(P?Bo:Oo,I)),!P&&document.activeElement===o){var N=l.Slides.getAt(e.index);N&&Mo(N.slide)}}function z(P,$,N){Le(N&&U||o,P,$)}function K(){var P=e.index;return P===t||c.cloneStatus&&P===n}function f(){if(e.is(Ot))return K();var P=Ee(l.Elements.track),$=Ee(o),N=C("left",!0),ee=C("right",!0);return nn(P[N])<=Ft($[N])&&nn($[ee])<=Ft(P[ee])}function L(P,$){var N=_e(P-t);return!E&&(c.rewind||e.is(Ct))&&(N=Je(N,e.length-N)),N<=$}var I={index:t,slideIndex:n,slide:o,container:U,isClone:E,mount:A,destroy:w,update:H,style:z,isWithin:L};return I}function Wi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=t.Elements,l=u.slides,m=u.list,c=[];function T(){v(),r(Se,h),r(Se,v)}function v(){l.forEach(function(H,j){d(H,j,-1)})}function h(){k(function(H){H.destroy()}),Ue(c)}function p(){k(function(H){H.update()})}function d(H,j,M){var z=Pi(e,j,M,H);z.mount(),c.push(z),c.sort(function(K,f){return K.index-f.index})}function C(H){return H?A(function(j){return!j.isClone}):c}function b(H){var j=t.Controller,M=j.toIndex(H),z=j.hasFocus()?1:n.perPage;return A(function(K){return Jt(K.index,M,M+z-1)})}function x(H){return A(H)[0]}function E(H,j){Ae(H,function(M){if(Ze(M)&&(M=Po(M)),Fo(M)){var z=l[j];z?Hn(M,z):Nt(m,M),We(M,n.classes.slide),w(M,ve(s,vt))}}),s(Se)}function U(H){it(A(H).map(function(j){return j.slide})),s(Se)}function k(H,j){C(j).forEach(H)}function A(H){return c.filter(Lo(H)?H:function(j){return Ze(H)?kt(j.slide,H):Wn(Ht(H),j.index)})}function S(H,j,M){k(function(z){z.style(H,j,M)})}function w(H,j){var M=Nn(H,"img"),z=M.length;z?M.forEach(function(K){i(K,"load error",function(){--z||j()})}):j()}function R(H){return H?l.length:c.length}function V(){return c.length>n.perPage}return{mount:T,destroy:h,update:p,register:d,get:C,getIn:b,getAt:x,add:E,remove:U,forEach:k,filter:A,style:S,getLength:R,isEnough:V}}function Hi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=t.Slides,l=t.Direction.resolve,m=t.Elements,c=m.root,T=m.track,v=m.list,h=u.getAt,p=u.style,d,C,b;function x(){E(),s(window,"resize load",vi(ve(i,vt))),r([Te,Se],E),r(vt,U)}function E(){d=n.direction===mn,Le(c,"maxWidth",ot(n.width)),Le(T,l("paddingLeft"),k(!1)),Le(T,l("paddingRight"),k(!0)),U(!0)}function U(I){var P=Ee(c);(I||C.width!==P.width||C.height!==P.height)&&(Le(T,"height",A()),p(l("marginRight"),ot(n.gap)),p("width",w()),p("height",R(),!0),C=P,i(sn),b!==(b=L())&&(ze(c,ur,b),i(hi,b)))}function k(I){var P=n.padding,$=l(I?"right":"left");return P&&ot(P[$]||(Et(P)?0:P))||"0px"}function A(){var I="";return d&&(I=S(),Tt(I,"height or heightRatio is missing."),I="calc("+I+" - "+k(!1)+" - "+k(!0)+")"),I}function S(){return ot(n.height||Ee(v).width*n.heightRatio)}function w(){return n.autoWidth?null:ot(n.fixedWidth)||(d?"":V())}function R(){return ot(n.fixedHeight)||(d?n.autoHeight?null:V():S())}function V(){var I=ot(n.gap);return"calc((100%"+(I&&" + "+I)+")/"+(n.perPage||1)+(I&&" - "+I)+")"}function H(){return Ee(v)[l("width")]}function j(I,P){var $=h(I||0);return $?Ee($.slide)[l("width")]+(P?0:K()):0}function M(I,P){var $=h(I);if($){var N=Ee($.slide)[l("right")],ee=Ee(v)[l("left")];return _e(N-ee)+(P?0:K())}return 0}function z(I){return M(e.length-1)-M(0)+j(0,I)}function K(){var I=h(0);return I&&parseFloat(Le(I.slide,l("marginRight")))||0}function f(I){return parseFloat(Le(T,l("padding"+(I?"Right":"Left"))))||0}function L(){return e.is(Ot)||z(!0)>H()}return{mount:x,resize:U,listSize:H,slideSize:j,sliderSize:z,totalSize:M,getPadding:f,isOverflow:L}}var Ni=2;function ji(e,t,n){var o=be(e),r=o.on,s=t.Elements,i=t.Slides,u=t.Direction.resolve,l=[],m;function c(){r(Se,T),r([Te,vt],h),(m=C())&&(p(m),t.Layout.resize(!0))}function T(){v(),c()}function v(){it(l),Ue(l),o.destroy()}function h(){var b=C();m!==b&&(m<b||!b)&&o.emit(Se)}function p(b){var x=i.get().slice(),E=x.length;if(E){for(;x.length<b;)Zt(x,x);Zt(x.slice(-b),x.slice(0,b)).forEach(function(U,k){var A=k<b,S=d(U.slide,k);A?Hn(S,x[0].slide):Nt(s.list,S),Zt(l,S),i.register(S,k-b+(A?0:E),U.index)})}}function d(b,x){var E=b.cloneNode(!0);return We(E,n.classes.clone),E.id=e.root.id+"-clone"+Vn(x+1),E}function C(){var b=n.clones;if(!e.is(Ct))b=0;else if(Wt(b)){var x=n[u("fixedWidth")]&&t.Layout.slideSize(0),E=x&&Ft(Ee(s.track)[u("width")]/x);b=E||n[u("autoWidth")]&&e.length||n.perPage*Ni}return b}return{mount:c,destroy:v}}function Vi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=e.state.set,u=t.Layout,l=u.slideSize,m=u.getPadding,c=u.totalSize,T=u.listSize,v=u.sliderSize,h=t.Direction,p=h.resolve,d=h.orient,C=t.Elements,b=C.list,x=C.track,E;function U(){E=t.Transition,r([et,sn,Te,Se],k)}function k(){t.Controller.isBusy()||(t.Scroll.cancel(),S(e.index),t.Slides.update())}function A($,N,ee,ue){$!==N&&I($>ee)&&(H(),w(V(z(),$>ee),!0)),i(xt),s(Ge,N,ee,$),E.start(N,function(){i(yt),s(St,N,ee,$),ue&&ue()})}function S($){w(M($,!0))}function w($,N){if(!e.is(Ot)){var ee=N?$:R($);Le(b,"transform","translate"+p("X")+"("+ee+"px)"),$!==ee&&s(Jo)}}function R($){if(e.is(Ct)){var N=j($),ee=N>t.Controller.getEnd(),ue=N<0;(ue||ee)&&($=V($,ee))}return $}function V($,N){var ee=$-L(N),ue=v();return $-=d(ue*(Ft(_e(ee)/ue)||1))*(N?1:-1),$}function H(){w(z(),!0),E.cancel()}function j($){for(var N=t.Slides.get(),ee=0,ue=1/0,oe=0;oe<N.length;oe++){var me=N[oe].index,W=_e(M(me,!0)-$);if(W<=ue)ue=W,ee=me;else break}return ee}function M($,N){var ee=d(c($-1)-f($));return N?K(ee):ee}function z(){var $=p("left");return Ee(b)[$]-Ee(x)[$]+d(m(!1))}function K($){return n.trimSpace&&e.is(bt)&&($=pt($,0,d(v(!0)-T()))),$}function f($){var N=n.focus;return N==="center"?(T()-l($,!0))/2:+N*l($)||0}function L($){return M($?t.Controller.getEnd():0,!!n.trimSpace)}function I($){var N=d(V(z(),$));return $?N>=0:N<=b[p("scrollWidth")]-Ee(x)[p("width")]}function P($,N){N=Wt(N)?z():N;var ee=$!==!0&&d(N)<d(L(!1)),ue=$!==!1&&d(N)>d(L(!0));return ee||ue}return{mount:U,move:A,jump:S,translate:w,shift:V,cancel:H,toIndex:j,toPosition:M,getPosition:z,getLimit:L,exceededLimit:P,reposition:k}}function Bi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=t.Move,u=i.getPosition,l=i.getLimit,m=i.toPosition,c=t.Slides,T=c.isEnough,v=c.getLength,h=n.omitEnd,p=e.is(Ct),d=e.is(bt),C=ve(z,!1),b=ve(z,!0),x=n.start||0,E,U=x,k,A,S;function w(){R(),r([Te,Se,on],R),r(sn,V)}function R(){k=v(!0),A=n.perMove,S=n.perPage,E=I();var W=pt(x,0,h?E:k-1);W!==x&&(x=W,i.reposition())}function V(){E!==I()&&s(on)}function H(W,B,Q){if(!me()){var ne=M(W),se=L(ne);se>-1&&(B||se!==x)&&(ee(se),i.move(ne,se,U,Q))}}function j(W,B,Q,ne){t.Scroll.scroll(W,B,Q,function(){var se=L(i.toIndex(u()));ee(h?Je(se,E):se),ne&&ne()})}function M(W){var B=x;if(Ze(W)){var Q=W.match(/([+\-<>])(\d+)?/)||[],ne=Q[1],se=Q[2];ne==="+"||ne==="-"?B=K(x+ +(""+ne+(+se||1)),x):ne===">"?B=se?P(+se):C(!0):ne==="<"&&(B=b(!0))}else B=p?W:pt(W,0,E);return B}function z(W,B){var Q=A||(oe()?1:S),ne=K(x+Q*(W?-1:1),x,!(A||oe()));return ne===-1&&d&&!Ho(u(),l(!W),1)?W?0:E:B?ne:L(ne)}function K(W,B,Q){if(T()||oe()){var ne=f(W);ne!==W&&(B=W,W=ne,Q=!1),W<0||W>E?!A&&(Jt(0,W,B,!0)||Jt(E,B,W,!0))?W=P($(W)):p?W=Q?W<0?-(k%S||S):k:W:n.rewind?W=W<0?E:0:W=-1:Q&&W!==B&&(W=P($(B)+(W<B?-1:1)))}else W=-1;return W}function f(W){if(d&&n.trimSpace==="move"&&W!==x)for(var B=u();B===m(W,!0)&&Jt(W,0,e.length-1,!n.rewind);)W<x?--W:++W;return W}function L(W){return p?(W+k)%k||0:W}function I(){for(var W=k-(oe()||p&&A?1:S);h&&W-- >0;)if(m(k-1,!0)!==m(W,!0)){W++;break}return pt(W,0,k-1)}function P(W){return pt(oe()?W:S*W,0,E)}function $(W){return oe()?Je(W,E):nn((W>=E?k-1:W)/S)}function N(W){var B=i.toIndex(W);return d?pt(B,0,E):B}function ee(W){W!==x&&(U=x,x=W)}function ue(W){return W?U:x}function oe(){return!Wt(n.focus)||n.isNavigation}function me(){return e.state.is([xt,Pt])&&!!n.waitForTransition}return{mount:w,go:H,scroll:j,getNext:C,getPrev:b,getAdjacent:z,getEnd:I,setIndex:ee,getIndex:ue,toIndex:P,toPage:$,toDest:N,hasFocus:oe,isBusy:me}}var Oi="http://www.w3.org/2000/svg",zi="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",qt=40;function Di(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=n.classes,l=n.i18n,m=t.Elements,c=t.Controller,T=m.arrows,v=m.track,h=T,p=m.prev,d=m.next,C,b,x={};function E(){k(),r(Te,U)}function U(){A(),E()}function k(){var j=n.arrows;j&&!(p&&d)&&R(),p&&d&&(It(x,{prev:p,next:d}),Lt(h,j?"":"none"),We(h,b=Xn+"--"+n.direction),j&&(S(),H(),de([p,d],Bt,v.id),i(Uo,p,d)))}function A(){o.destroy(),De(h,b),C?(it(T?[p,d]:h),p=d=null):He([p,d],Yn)}function S(){r([et,St,Se,st,on],H),s(d,"click",ve(w,">")),s(p,"click",ve(w,"<"))}function w(j){c.go(j,!0)}function R(){h=T||gt("div",u.arrows),p=V(!0),d=V(!1),C=!0,Nt(h,[p,d]),!T&&Hn(h,v)}function V(j){var M='<button class="'+u.arrow+" "+(j?u.prev:u.next)+'" type="button"><svg xmlns="'+Oi+'" viewBox="0 0 '+qt+" "+qt+'" width="'+qt+'" height="'+qt+'" focusable="false"><path d="'+(n.arrowPath||zi)+'" />';return Po(M)}function H(){if(p&&d){var j=e.index,M=c.getPrev(),z=c.getNext(),K=M>-1&&j<M?l.last:l.prev,f=z>-1&&j>z?l.first:l.next;p.disabled=M<0,d.disabled=z<0,de(p,ke,K),de(d,ke,f),i(Go,p,d,M,z)}}return{arrows:x,mount:E,destroy:A,update:H}}var qi=jn+"-interval";function Ui(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=cn(n.interval,e.go.bind(e,">"),S),l=u.isPaused,m=t.Elements,c=t.Elements,T=c.root,v=c.toggle,h=n.autoplay,p,d,C=h==="pause";function b(){h&&(x(),v&&de(v,Bt,m.track.id),C||E(),A())}function x(){n.pauseOnHover&&s(T,"mouseenter mouseleave",function(R){p=R.type==="mouseenter",k()}),n.pauseOnFocus&&s(T,"focusin focusout",function(R){d=R.type==="focusin",k()}),v&&s(v,"click",function(){C?E():U(!0)}),r([Ge,ln,Se],u.rewind),r(Ge,w)}function E(){l()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),d=p=C=!1,A(),i(Dn))}function U(R){R===void 0&&(R=!0),C=!!R,A(),l()||(u.pause(),i(qn))}function k(){C||(p||d?U(!1):E())}function A(){v&&(ze(v,at,!C),de(v,ke,n.i18n[C?"play":"pause"]))}function S(R){var V=m.bar;V&&Le(V,"width",R*100+"%"),i(Xo,R)}function w(R){var V=t.Slides.getAt(R);u.set(V&&+Fe(V.slide,qi)||n.interval)}return{mount:b,destroy:u.cancel,play:E,pause:U,isPaused:l}}function Gi(e,t,n){var o=be(e),r=o.on;function s(){n.cover&&(r(Un,ve(u,!0)),r([et,Te,Se],ve(i,!0)))}function i(l){t.Slides.forEach(function(m){var c=jt(m.container||m.slide,"img");c&&c.src&&u(l,c,m)})}function u(l,m,c){c.style("background",l?'center/cover no-repeat url("'+m.src+'")':"",!0),Lt(m,l?"none":"")}return{mount:s,destroy:ve(i,!1)}}var Ki=10,Yi=600,Xi=.6,Zi=1.5,Ji=800;function Qi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=e.state.set,u=t.Move,l=u.getPosition,m=u.getLimit,c=u.exceededLimit,T=u.translate,v=e.is(bt),h,p,d=1;function C(){r(Ge,U),r([Te,Se],k)}function b(S,w,R,V,H){var j=l();if(U(),R&&(!v||!c())){var M=t.Layout.sliderSize(),z=En(S)*M*nn(_e(S)/M)||0;S=u.toPosition(t.Controller.toDest(S%M))+z}var K=Ho(j,S,1);d=1,w=K?0:w||tn(_e(S-j)/Zi,Ji),p=V,h=cn(w,x,ve(E,j,S,H),1),i(Pt),s(ln),h.start()}function x(){i(yt),p&&p(),s(st)}function E(S,w,R,V){var H=l(),j=S+(w-S)*A(V),M=(j-H)*d;T(H+M),v&&!R&&c()&&(d*=Xi,_e(M)<Ki&&b(m(c(!0)),Yi,!1,p,!0))}function U(){h&&h.cancel()}function k(){h&&!h.isPaused()&&(U(),x())}function A(S){var w=n.easingFunc;return w?w(S):1-Math.pow(1-S,4)}return{mount:C,destroy:U,scroll:b,cancel:k}}var dt={passive:!1,capture:!0};function ea(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=o.unbind,l=e.state,m=t.Move,c=t.Scroll,T=t.Controller,v=t.Elements.track,h=t.Media.reduce,p=t.Direction,d=p.resolve,C=p.orient,b=m.getPosition,x=m.exceededLimit,E,U,k,A,S,w=!1,R,V,H;function j(){i(v,Sn,Tn,dt),i(v,Cn,Tn,dt),i(v,pr,z,dt),i(v,"click",L,{capture:!0}),i(v,"dragstart",Oe),r([et,Te],M)}function M(){var F=n.drag;ce(!F),A=F==="free"}function z(F){if(R=!1,!V){var y=se(F);ne(F.target)&&(y||!F.button)&&(T.isBusy()?Oe(F,!0):(H=y?v:window,S=l.is([xt,Pt]),k=null,i(H,Sn,K,dt),i(H,Cn,f,dt),m.cancel(),c.cancel(),I(F)))}}function K(F){if(l.is(Xt)||(l.set(Xt),s(zo)),F.cancelable)if(S){m.translate(E+Q(oe(F)));var y=me(F)>fo,O=w!==(w=x());(y||O)&&I(F),R=!0,s(Do),Oe(F)}else N(F)&&(S=$(F),Oe(F))}function f(F){l.is(Xt)&&(l.set(yt),s(qo)),S&&(P(F),Oe(F)),u(H,Sn,K),u(H,Cn,f),S=!1}function L(F){!V&&R&&Oe(F,!0)}function I(F){k=U,U=F,E=b()}function P(F){var y=ee(F),O=ue(y),Y=n.rewind&&n.rewindByDrag;h(!1),A?T.scroll(O,0,n.snap):e.is(Ot)?T.go(C(En(y))<0?Y?"<":"-":Y?">":"+"):e.is(bt)&&w&&Y?T.go(x(!0)?">":"<"):T.go(T.toDest(O),!0),h(!0)}function $(F){var y=n.dragMinThreshold,O=Et(y),Y=O&&y.mouse||0,J=(O?y.touch:+y)||10;return _e(oe(F))>(se(F)?J:Y)}function N(F){return _e(oe(F))>_e(oe(F,!0))}function ee(F){if(e.is(Ct)||!w){var y=me(F);if(y&&y<fo)return oe(F)/y}return 0}function ue(F){return b()+En(F)*Je(_e(F)*(n.flickPower||600),A?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function oe(F,y){return B(F,y)-B(W(F),y)}function me(F){return _n(F)-_n(W(F))}function W(F){return U===F&&k||U}function B(F,y){return(se(F)?F.changedTouches[0]:F)["page"+d(y?"Y":"X")]}function Q(F){return F/(w&&e.is(bt)?Ri:1)}function ne(F){var y=n.noDrag;return!kt(F,"."+ar+", ."+fn)&&(!y||!kt(F,y))}function se(F){return typeof TouchEvent<"u"&&F instanceof TouchEvent}function D(){return S}function ce(F){V=F}return{mount:j,disable:ce,isDragging:D}}var ta={Spacebar:" ",Right:dn,Left:pn,Up:Qo,Down:er};function Zn(e){return e=Ze(e)?e:e.key,ta[e]||e}var ho="keydown";function na(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.unbind,u=e.root,l=t.Direction.resolve,m,c;function T(){v(),r(Te,h),r(Te,v),r(Ge,d)}function v(){var b=n.keyboard;b&&(m=b==="global"?window:u,s(m,ho,C))}function h(){i(m,ho)}function p(b){c=b}function d(){var b=c;c=!0,Io(function(){c=b})}function C(b){if(!c){var x=Zn(b);x===l(pn)?e.go("<"):x===l(dn)&&e.go(">")}}return{mount:T,destroy:h,disable:p}}var _t=jn+"-lazy",Qt=_t+"-srcset",oa="["+_t+"], ["+Qt+"]";function ra(e,t,n){var o=be(e),r=o.on,s=o.off,i=o.bind,u=o.emit,l=n.lazyLoad==="sequential",m=[St,st],c=[];function T(){n.lazyLoad&&(v(),r(Se,v))}function v(){Ue(c),h(),l?b():(s(m),r(m,p),p())}function h(){t.Slides.forEach(function(x){Nn(x.slide,oa).forEach(function(E){var U=Fe(E,_t),k=Fe(E,Qt);if(U!==E.src||k!==E.srcset){var A=n.classes.spinner,S=E.parentElement,w=jt(S,"."+A)||gt("span",A,S);c.push([E,x,w]),E.src||Lt(E,"none")}})})}function p(){c=c.filter(function(x){var E=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(e.index,E)?d(x):!0}),c.length||s(m)}function d(x){var E=x[0];We(x[1].slide,Ln),i(E,"load error",ve(C,x)),de(E,"src",Fe(E,_t)),de(E,"srcset",Fe(E,Qt)),He(E,_t),He(E,Qt)}function C(x,E){var U=x[0],k=x[1];De(k.slide,Ln),E.type!=="error"&&(it(x[2]),Lt(U,""),u(Un,U,k),u(vt)),l&&b()}function b(){c.length&&d(c.shift())}return{mount:T,destroy:ve(Ue,c),check:p}}function ia(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=t.Slides,l=t.Elements,m=t.Controller,c=m.hasFocus,T=m.getIndex,v=m.go,h=t.Direction.resolve,p=l.pagination,d=[],C,b;function x(){E(),r([Te,Se,on],x);var V=n.pagination;p&&Lt(p,V?"":"none"),V&&(r([Ge,ln,st],R),U(),R(),s(Ko,{list:C,items:d},w(e.index)))}function E(){C&&(it(p?Qe(C.children):C),De(C,b),Ue(d),C=null),o.destroy()}function U(){var V=e.length,H=n.classes,j=n.i18n,M=n.perPage,z=c()?m.getEnd()+1:Ft(V/M);C=p||gt("ul",H.pagination,l.track.parentElement),We(C,b=hn+"--"+S()),de(C,qe,"tablist"),de(C,ke,j.select),de(C,Kn,S()===mn?"vertical":"");for(var K=0;K<z;K++){var f=gt("li",null,C),L=gt("button",{class:H.page,type:"button"},f),I=u.getIn(K).map(function($){return $.slide.id}),P=!c()&&M>1?j.pageX:j.slideX;i(L,"click",ve(k,K)),n.paginationKeyboard&&i(L,"keydown",ve(A,K)),de(f,qe,"presentation"),de(L,qe,"tab"),de(L,Bt,I.join(" ")),de(L,ke,kn(P,K+1)),de(L,ft,-1),d.push({li:f,button:L,page:K})}}function k(V){v(">"+V,!0)}function A(V,H){var j=d.length,M=Zn(H),z=S(),K=-1;M===h(dn,!1,z)?K=++V%j:M===h(pn,!1,z)?K=(--V+j)%j:M==="Home"?K=0:M==="End"&&(K=j-1);var f=d[K];f&&(Mo(f.button),v(">"+K),Oe(H,!0))}function S(){return n.paginationDirection||n.direction}function w(V){return d[m.toPage(V)]}function R(){var V=w(T(!0)),H=w(T());if(V){var j=V.button;De(j,at),He(j,co),de(j,ft,-1)}if(H){var M=H.button;We(M,at),de(M,co,!0),de(M,ft,"")}s(Yo,{list:C,items:d},V,H)}return{items:d,mount:x,destroy:E,getAt:w,update:R}}var aa=[" ","Enter"];function sa(e,t,n){var o=n.isNavigation,r=n.slideFocus,s=[];function i(){e.splides.forEach(function(p){p.isParent||(m(e,p.splide),m(p.splide,e))}),o&&c()}function u(){s.forEach(function(p){p.destroy()}),Ue(s)}function l(){u(),i()}function m(p,d){var C=be(p);C.on(Ge,function(b,x,E){d.go(d.is(Ct)?E:b)}),s.push(C)}function c(){var p=be(e),d=p.on;d(Bn,v),d(Zo,h),d([et,Te],T),s.push(p),p.emit(zn,e.splides)}function T(){de(t.Elements.list,Kn,n.direction===mn?"vertical":"")}function v(p){e.go(p.index)}function h(p,d){Wn(aa,Zn(d))&&(v(p),Oe(d))}return{setup:ve(t.Media.set,{slideFocus:Wt(r)?o:r},!0),mount:i,destroy:u,remount:l}}function la(e,t,n){var o=be(e),r=o.bind,s=0;function i(){n.wheel&&r(t.Elements.track,"wheel",u,dt)}function u(m){if(m.cancelable){var c=m.deltaY,T=c<0,v=_n(m),h=n.wheelMinThreshold||0,p=n.wheelSleep||0;_e(c)>h&&v-s>p&&(e.go(T?"<":">"),s=v),l(T)&&Oe(m)}}function l(m){return!n.releaseWheel||e.state.is(xt)||t.Controller.getAdjacent(m)!==-1}return{mount:i}}var ca=90;function ua(e,t,n){var o=be(e),r=o.on,s=t.Elements.track,i=n.live&&!n.isNavigation,u=gt("span",ki),l=cn(ca,ve(c,!1));function m(){i&&(v(!t.Autoplay.isPaused()),de(s,mo,!0),u.textContent="…",r(Dn,ve(v,!0)),r(qn,ve(v,!1)),r([St,st],ve(c,!0)))}function c(h){de(s,po,h),h?(Nt(s,u),l.start()):(it(u),l.cancel())}function T(){He(s,[uo,mo,po]),it(u)}function v(h){i&&de(s,uo,h?"off":"polite")}return{mount:m,disable:v,destroy:T}}var pa=Object.freeze({__proto__:null,Media:bi,Direction:xi,Elements:Mi,Slides:Wi,Layout:Hi,Clones:ji,Move:Vi,Controller:Bi,Arrows:Di,Autoplay:Ui,Cover:Gi,Scroll:Qi,Drag:ea,Keyboard:na,LazyLoad:ra,Pagination:ia,Sync:sa,Wheel:la,Live:ua}),da={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"},ma={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:Li,i18n:da,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ga(e,t,n){var o=t.Slides;function r(){be(e).on([et,Se],s)}function s(){o.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function i(u,l){o.style("transition","opacity "+n.speed+"ms "+n.easing),Io(l)}return{mount:r,start:i,cancel:Tn}}function fa(e,t,n){var o=t.Move,r=t.Controller,s=t.Scroll,i=t.Elements.list,u=ve(Le,i,"transition"),l;function m(){be(e).bind(i,"transitionend",function(h){h.target===i&&l&&(T(),l())})}function c(h,p){var d=o.toPosition(h,!0),C=o.getPosition(),b=v(h);_e(d-C)>=1&&b>=1?n.useScroll?s.scroll(d,b,!1,p):(u("transform "+b+"ms "+n.easing),o.translate(d,!0),l=p):(o.jump(h),p())}function T(){u(""),s.cancel()}function v(h){var p=n.rewindSpeed;if(e.is(bt)&&p){var d=r.getIndex(!0),C=r.getEnd();if(d===0&&h>=C||d>=C&&h===0)return p}return n.speed}return{mount:m,start:c,cancel:T}}var ha=(function(){function e(n,o){this.event=be(),this.Components={},this.state=yi(mt),this.splides=[],this._o={},this._E={};var r=Ze(n)?Wo(document,n):n;Tt(r,r+" is invalid."),this.root=r,o=Ye({label:Fe(r,ke)||"",labelledby:Fe(r,Gn)||""},ma,e.defaults,o||{});try{Ye(o,JSON.parse(Fe(r,jn)))}catch{Tt(!1,"Invalid JSON")}this._o=Object.create(Ye({},o))}var t=e.prototype;return t.mount=function(o,r){var s=this,i=this.state,u=this.Components;Tt(i.is([mt,en]),"Already mounted!"),i.set(mt),this._C=u,this._T=r||this._T||(this.is(Ot)?ga:fa),this._E=o||this._E;var l=It({},pa,this._E,{Transition:this._T});return rt(l,function(m,c){var T=m(s,u,s._o);u[c]=T,T.setup&&T.setup()}),rt(u,function(m){m.mount&&m.mount()}),this.emit(et),We(this.root,Ai),i.set(yt),this.emit(An),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,r){return this.event.on(o,r),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var r;return(r=this.event).emit.apply(r,[o].concat(Qe(arguments,1))),this},t.add=function(o,r){return this._C.Slides.add(o,r),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Se),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,s=this.state;return s.is(mt)?be(this).on(An,this.destroy.bind(this,o)):(rt(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(On),r.destroy(),o&&Ue(this.splides),s.set(en)),this},di(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Jn=ha;Jn.defaults={};Jn.STATES=gi;var yo=[[et,"onMounted"],[An,"onReady"],[Ge,"onMove"],[St,"onMoved"],[Bn,"onClick"],[jo,"onActive"],[Vo,"onInactive"],[Bo,"onVisible"],[Oo,"onHidden"],[Se,"onRefresh"],[Te,"onUpdated"],[vt,"onResize"],[sn,"onResized"],[zo,"onDrag"],[Do,"onDragging"],[qo,"onDragged"],[ln,"onScroll"],[st,"onScrolled"],[On,"onDestroy"],[Uo,"onArrowsMounted"],[Go,"onArrowsUpdated"],[Ko,"onPaginationMounted"],[Yo,"onPaginationUpdated"],[zn,"onNavigationMounted"],[Dn,"onAutoplayPlay"],[Xo,"onAutoplayPlaying"],[qn,"onAutoplayPause"],[Un,"onLazyLoadLoaded"]];function Qn(...e){return e.filter(Boolean).join(" ")}function rn(e){return e!==null&&typeof e=="object"}function Fn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Fn(n,t[o]));if(rn(e)&&rn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!Fn(e[r],t[r]))}return e===t}function ya(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function va(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const r=n[o];if(r!=="__proto__"&&t(e[r],r)===!1)break}}return e}function Rn(e,t){const n=e;return va(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():rn(o)?n[r]=Rn(rn(n[r])?n[r]:{},o):n[r]=o}),n}var ba=({children:e,className:t,...n})=>g.createElement("div",{className:Qn("splide__track",t),...n},g.createElement("ul",{className:"splide__list"},e)),dr=class extends g.Component{constructor(){super(...arguments),this.splideRef=g.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Jn(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Rn({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!Fn(this.options,e)&&(this.splide.options=e,this.options=Rn({},e));const t=this.getSlides();ya(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){yo.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...r)=>{o(e,...r)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:o,...r}=this.props;return g.createElement(t,{className:Qn("splide",e),ref:this.splideRef,...this.omit(r,["options",...yo.map(s=>s[1])])},n?g.createElement(ba,null,o):o)}},mr=({children:e,className:t,...n})=>g.createElement("li",{className:Qn("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),he=require("classnames"),k=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),br=require("react-dom");function xr(e){return e.type==="object"&&e.version===1}const Sr="ControlSlider-module__wrapper___sHEkd",Cr="ControlSlider-module__hoverArrow___A-dOH",wr="ControlSlider-module__sliderItem___QQSkR",$r="ControlSlider-module__sliderImage___9hRl-",Tr="ControlSlider-module__arrow___05ghY",_r="ControlSlider-module__arrowVertical___tBfVN",Er="ControlSlider-module__nextArrow___-30Yc",kr="ControlSlider-module__arrowInner___aEra3",Ar="ControlSlider-module__arrowIcon___S4ztF",Lr="ControlSlider-module__arrowImg___2dwJW",Ir="ControlSlider-module__mirror___brd6U",Fr="ControlSlider-module__pagination___bicLF",Rr="ControlSlider-module__paginationInner___bT-P-",Mr="ControlSlider-module__paginationVertical___zYqKw",Pr="ControlSlider-module__paginationItem___nTRbk",Wr="ControlSlider-module__dot___p1Qun",Hr="ControlSlider-module__activeDot___LHFaj",Nr="ControlSlider-module__paginationInsideBottom___R3FWn",jr="ControlSlider-module__paginationInsideTop___V-qb-",Vr="ControlSlider-module__paginationOutsideBottom___14w8D",zr="ControlSlider-module__paginationOutsideTop___SCLqB",Br="ControlSlider-module__paginationInsideLeft___yOBRZ",Or="ControlSlider-module__paginationInsideRight___Rtt3o",Dr="ControlSlider-module__paginationOutsideLeft___lahaw",qr="ControlSlider-module__paginationOutsideRight___EtuQa",Ur="ControlSlider-module__imgWrapper___UjEgB",Gr="ControlSlider-module__captionBlock___dJ6-j",Kr="ControlSlider-module__captionTextWrapper___HFlpf",Yr="ControlSlider-module__captionText___uGBVc",Xr="ControlSlider-module__active___WZK4G",Zr="ControlSlider-module__withPointerEvents___t-18M",Jr="ControlSlider-module__topLeftAlignment___zjnGM",Qr="ControlSlider-module__topCenterAlignment___gD1xW",ei="ControlSlider-module__topRightAlignment___NMapS",ti="ControlSlider-module__middleLeftAlignment___OnUrY",ni="ControlSlider-module__middleCenterAlignment___Tdkl0",oi="ControlSlider-module__middleRightAlignment___wEbfX",ri="ControlSlider-module__bottomLeftAlignment___cTP2-",ii="ControlSlider-module__bottomCenterAlignment___c54fB",ai="ControlSlider-module__bottomRightAlignment___kEwrz",si="ControlSlider-module__clickOverlay___DZA28",li="ControlSlider-module__contain___pLyq7",ci="ControlSlider-module__cover___KdDat",ne={wrapper:Sr,hoverArrow:Cr,sliderItem:wr,sliderImage:$r,arrow:Tr,arrowVertical:_r,nextArrow:Er,arrowInner:kr,arrowIcon:Ar,arrowImg:Lr,mirror:Ir,pagination:Fr,paginationInner:Rr,paginationVertical:Mr,paginationItem:Pr,dot:Wr,activeDot:Hr,paginationInsideBottom:Nr,paginationInsideTop:jr,paginationOutsideBottom:Vr,paginationOutsideTop:zr,paginationInsideLeft:Br,paginationInsideRight:Or,paginationOutsideLeft:Dr,paginationOutsideRight:qr,imgWrapper:Ur,captionBlock:Gr,captionTextWrapper:Kr,captionText:Yr,active:Xr,withPointerEvents:Zr,topLeftAlignment:Jr,topCenterAlignment:Qr,topRightAlignment:ei,middleLeftAlignment:ti,middleCenterAlignment:ni,middleRightAlignment:oi,bottomLeftAlignment:ri,bottomCenterAlignment:ii,bottomRightAlignment:ai,clickOverlay:si,contain:li,cover:ci};function ui(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 pi(e,t,n){return t&&ui(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var oo="(prefers-reduced-motion: reduce)",mt=1,di=2,yt=3,St=4,Pt=5,Xt=6,en=7,mi={CREATED:mt,MOUNTED:di,IDLE:yt,MOVING:St,SCROLLING:Pt,DRAGGING:Xt,DESTROYED:en};function Ue(e){e.length=0}function Qe(e,t,n){return Array.prototype.slice.call(e,t,n)}function ve(e){return e.bind.apply(e,[null].concat(Qe(arguments,1)))}var Ao=setTimeout,Tn=function(){};function ro(e){return requestAnimationFrame(e)}function an(e,t){return typeof t===e}function kt(e){return!Pn(e)&&an("object",e)}var Mn=Array.isArray,Lo=ve(an,"function"),Ze=ve(an,"string"),Wt=ve(an,"undefined");function Pn(e){return e===null}function Io(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ht(e){return Mn(e)?e:[e]}function Ae(e,t){Ht(e).forEach(t)}function Wn(e,t){return e.indexOf(t)>-1}function Zt(e,t){return e.push.apply(e,Ht(t)),e}function Oe(e,t,n){e&&Ae(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function We(e,t){Oe(e,Ze(t)?t.split(" "):t,!0)}function Nt(e,t){Ae(t,e.appendChild.bind(e))}function Hn(e,t){Ae(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function At(e,t){return Io(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Fo(e,t){var n=e?Qe(e.children):[];return t?n.filter(function(o){return At(o,t)}):n}function jt(e,t){return t?Fo(e,t)[0]:e.firstElementChild}var Lt=Object.keys;function rt(e,t,n){return e&&(n?Lt(e).reverse():Lt(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function It(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){e[o]=t[o]})}),e}function Ye(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){Mn(n)?e[o]=n.slice():kt(n)?e[o]=Ye({},kt(e[o])?e[o]:{},n):e[o]=n})}),e}function io(e,t){Ae(t||Lt(e),function(n){delete e[n]})}function He(e,t){Ae(e,function(n){Ae(t,function(o){n&&n.removeAttribute(o)})})}function de(e,t,n){kt(t)?rt(t,function(o,r){de(e,r,o)}):Ae(e,function(o){Pn(n)||n===""?He(o,t):o.setAttribute(t,String(n))})}function gt(e,t,n){var o=document.createElement(e);return t&&(Ze(t)?We(o,t):de(o,t)),n&&Nt(n,o),o}function Ie(e,t,n){if(Wt(n))return getComputedStyle(e)[t];Pn(n)||(e.style[t]=""+n)}function Ft(e,t){Ie(e,"display",t)}function Ro(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Fe(e,t){return e.getAttribute(t)}function ao(e,t){return e&&e.classList.contains(t)}function Ee(e){return e.getBoundingClientRect()}function it(e){Ae(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Mo(e){return jt(new DOMParser().parseFromString(e,"text/html").body)}function Be(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Po(e,t){return e&&e.querySelector(t)}function Nn(e,t){return t?Qe(e.querySelectorAll(t)):[]}function De(e,t){Oe(e,t,!1)}function _n(e){return e.timeStamp}function ot(e){return Ze(e)?e:e?e+"px":""}var Vt="splide",jn="data-"+Vt;function _t(e,t){if(!e)throw new Error("["+Vt+"] "+(t||""))}var Je=Math.min,tn=Math.max,nn=Math.floor,Rt=Math.ceil,_e=Math.abs;function Wo(e,t,n){return _e(e-t)<n}function Jt(e,t,n,o){var r=Je(t,n),s=tn(t,n);return o?r<e&&e<s:r<=e&&e<=s}function pt(e,t,n){var o=Je(t,n),r=tn(t,n);return Je(tn(o,e),r)}function En(e){return+(e>0)-+(e<0)}function kn(e,t){return Ae(t,function(n){e=e.replace("%s",""+n)}),e}function Vn(e){return e<10?"0"+e:""+e}var so={};function gi(e){return""+e+Vn(so[e]=(so[e]||0)+1)}function Ho(){var e=[];function t(i,u,l,g){r(i,u,function(c,_,C){var y="addEventListener"in c,p=y?c.removeEventListener.bind(c,_,l,g):c.removeListener.bind(c,l);y?c.addEventListener(_,l,g):c.addListener(l),e.push([c,_,C,l,p])})}function n(i,u,l){r(i,u,function(g,c,_){e=e.filter(function(C){return C[0]===g&&C[1]===c&&C[2]===_&&(!l||C[3]===l)?(C[4](),!1):!0})})}function o(i,u,l){var g,c=!0;return typeof CustomEvent=="function"?g=new CustomEvent(u,{bubbles:c,detail:l}):(g=document.createEvent("CustomEvent"),g.initCustomEvent(u,c,!1,l)),i.dispatchEvent(g),g}function r(i,u,l){Ae(i,function(g){g&&Ae(u,function(c){c.split(" ").forEach(function(_){var C=_.split(".");l(g,C[0],C[1])})})})}function s(){e.forEach(function(i){i[4]()}),Ue(e)}return{bind:t,unbind:n,dispatch:o,destroy:s}}var et="mounted",An="ready",Ge="move",Ct="moved",zn="click",No="active",jo="inactive",Vo="visible",zo="hidden",Se="refresh",Te="updated",vt="resize",sn="resized",Bo="drag",Oo="dragging",Do="dragged",ln="scroll",st="scrolled",fi="overflow",Bn="destroy",qo="arrows:mounted",Uo="arrows:updated",Go="pagination:mounted",Ko="pagination:updated",On="navigation:mounted",Dn="autoplay:play",Yo="autoplay:playing",qn="autoplay:pause",Un="lazyload:loaded",Xo="sk",Zo="sh",on="ei";function be(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Ho();function o(s,i){n.bind(t,Ht(s).join(" "),function(u){i.apply(i,Mn(u.detail)?u.detail:[])})}function r(s){n.dispatch(t,s,Qe(arguments,1))}return e&&e.event.on(Bn,n.destroy),It(n,{bus:t,on:o,off:ve(n.unbind,t),emit:r})}function cn(e,t,n,o){var r=Date.now,s,i=0,u,l=!0,g=0;function c(){if(!l){if(i=e?Je((r()-s)/e,1):1,n&&n(i),i>=1&&(t(),s=r(),o&&++g>=o))return C();u=ro(c)}}function _(h){h||p(),s=r()-(h?i*e:0),l=!1,u=ro(c)}function C(){l=!0}function y(){s=r(),i=0,n&&n(i)}function p(){u&&cancelAnimationFrame(u),i=0,u=0,l=!0}function d(h){e=h}function S(){return l}return{start:_,rewind:y,pause:C,cancel:p,set:d,isPaused:S}}function hi(e){var t=e;function n(r){t=r}function o(r){return Wn(Ht(r),t)}return{set:n,is:o}}function yi(e,t){var n=cn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function vi(e,t,n){var o=e.state,r=n.breakpoints||{},s=n.reducedMotion||{},i=Ho(),u=[];function l(){var p=n.mediaQuery==="min";Lt(r).sort(function(d,S){return p?+d-+S:+S-+d}).forEach(function(d){c(r[d],"("+(p?"min":"max")+"-width:"+d+"px)")}),c(s,oo),_()}function g(p){p&&i.destroy()}function c(p,d){var S=matchMedia(d);i.bind(S,"change",_),u.push([p,S])}function _(){var p=o.is(en),d=n.direction,S=u.reduce(function(h,v){return Ye(h,v[1].matches?v[0]:{})},{});io(n),y(S),n.destroy?e.destroy(n.destroy==="completely"):p?(g(!0),e.mount()):d!==n.direction&&e.refresh()}function C(p){matchMedia(oo).matches&&(p?Ye(n,s):io(n,Lt(s)))}function y(p,d,S){Ye(n,p),d&&Ye(Object.getPrototypeOf(n),p),(S||!o.is(mt))&&e.emit(Te,n)}return{setup:l,destroy:g,reduce:C,set:y}}var un="Arrow",pn=un+"Left",dn=un+"Right",Jo=un+"Up",Qo=un+"Down",lo="rtl",mn="ttb",bn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Jo,dn],ArrowRight:[Qo,pn]};function bi(e,t,n){function o(s,i,u){u=u||n.direction;var l=u===lo&&!i?1:u===mn?0:-1;return bn[s]&&bn[s][l]||s.replace(/width|left|right/i,function(g,c){var _=bn[g.toLowerCase()][l]||g;return c>0?_.charAt(0).toUpperCase()+_.slice(1):_})}function r(s){return s*(n.direction===lo?1:-1)}return{resolve:o,orient:r}}var qe="role",ft="tabindex",xi="disabled",Me="aria-",zt=Me+"controls",er=Me+"current",co=Me+"selected",ke=Me+"label",Gn=Me+"labelledby",tr=Me+"hidden",Kn=Me+"orientation",Mt=Me+"roledescription",uo=Me+"live",po=Me+"busy",mo=Me+"atomic",Yn=[qe,ft,xi,zt,er,ke,Gn,tr,Kn,Mt],Ne=Vt+"__",tt="is-",xn=Vt,go=Ne+"track",Si=Ne+"list",gn=Ne+"slide",nr=gn+"--clone",Ci=gn+"__container",Xn=Ne+"arrows",fn=Ne+"arrow",or=fn+"--prev",rr=fn+"--next",hn=Ne+"pagination",ir=hn+"__page",wi=Ne+"progress",$i=wi+"__bar",Ti=Ne+"toggle",_i=Ne+"spinner",Ei=Ne+"sr",ki=tt+"initialized",at=tt+"active",ar=tt+"prev",sr=tt+"next",Ln=tt+"visible",In=tt+"loading",lr=tt+"focus-in",cr=tt+"overflow",Ai=[at,Ln,ar,sr,In,lr,cr],Li={slide:gn,clone:nr,arrows:Xn,arrow:fn,prev:or,next:rr,pagination:hn,page:ir,spinner:_i};function Ii(e,t){if(Lo(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!At(n,t);)n=n.parentElement;return n}var Fi=5,fo=200,ur="touchstart mousedown",Sn="touchmove mousemove",Cn="touchend touchcancel mouseup click";function Ri(e,t,n){var o=be(e),r=o.on,s=o.bind,i=e.root,u=n.i18n,l={},g=[],c=[],_=[],C,y,p;function d(){T(),O(),v()}function S(){r(Se,h),r(Se,d),r(Te,v),s(document,ur+" keydown",function(f){p=f.type==="keydown"},{capture:!0}),s(i,"focusin",function(){Oe(i,lr,!!p)})}function h(f){var w=Yn.concat("style");Ue(g),De(i,c),De(C,_),He([C,y],w),He(i,f?w:["style",Mt])}function v(){De(i,c),De(C,_),c=E(xn),_=E(go),We(i,c),We(C,_),de(i,ke,n.label),de(i,Gn,n.labelledby)}function T(){C=P("."+go),y=jt(C,"."+Si),_t(C&&y,"A track/list element is missing."),Zt(g,Fo(y,"."+gn+":not(."+nr+")")),rt({arrows:Xn,pagination:hn,prev:or,next:rr,bar:$i,toggle:Ti},function(f,w){l[w]=P("."+f)}),It(l,{root:i,track:C,list:y,slides:g})}function O(){var f=i.id||gi(Vt),w=n.role;i.id=f,C.id=C.id||f+"-track",y.id=y.id||f+"-list",!Fe(i,qe)&&i.tagName!=="SECTION"&&w&&de(i,qe,w),de(i,Mt,u.carousel),de(y,qe,"presentation")}function P(f){var w=Po(i,f);return w&&Ii(w,"."+xn)===i?w:void 0}function E(f){return[f+"--"+n.type,f+"--"+n.direction,n.drag&&f+"--draggable",n.isNavigation&&f+"--nav",f===xn&&at]}return It(l,{setup:d,mount:S,destroy:h})}var bt="slide",wt="loop",Bt="fade";function Mi(e,t,n,o){var r=be(e),s=r.on,i=r.emit,u=r.bind,l=e.Components,g=e.root,c=e.options,_=c.isNavigation,C=c.updateOnMove,y=c.i18n,p=c.pagination,d=c.slideFocus,S=l.Direction.resolve,h=Fe(o,"style"),v=Fe(o,ke),T=n>-1,O=jt(o,"."+Ci),P;function E(){T||(o.id=g.id+"-slide"+Vn(t+1),de(o,qe,p?"tabpanel":"group"),de(o,Mt,y.slide),de(o,ke,v||kn(y.slideLabel,[t+1,e.length]))),f()}function f(){u(o,"click",ve(i,zn,A)),u(o,"keydown",ve(i,Xo,A)),s([Ct,Zo,st],L),s(On,R),C&&s(Ge,V)}function w(){P=!0,r.destroy(),De(o,Ai),He(o,Yn),de(o,"style",h),de(o,ke,v||"")}function R(){var I=e.splides.map(function($){var j=$.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");de(o,ke,kn(y.slideX,(T?n:t)+1)),de(o,zt,I),de(o,qe,d?"button":""),d&&He(o,Mt)}function V(){P||L()}function L(){if(!P){var I=e.index;N(),W(),Oe(o,ar,t===I-1),Oe(o,sr,t===I+1)}}function N(){var I=D();I!==ao(o,at)&&(Oe(o,at,I),de(o,er,_&&I||""),i(I?No:jo,A))}function W(){var I=b(),$=!I&&(!D()||T);if(e.state.is([St,Pt])||de(o,tr,$||""),de(Nn(o,c.focusableNodes||""),ft,$?-1:""),d&&de(o,ft,$?-1:0),I!==ao(o,Ln)&&(Oe(o,Ln,I),i(I?Vo:zo,A)),!I&&document.activeElement===o){var j=l.Slides.getAt(e.index);j&&Ro(j.slide)}}function B(I,$,j){Ie(j&&O||o,I,$)}function D(){var I=e.index;return I===t||c.cloneStatus&&I===n}function b(){if(e.is(Bt))return D();var I=Ee(l.Elements.track),$=Ee(o),j=S("left",!0),Z=S("right",!0);return nn(I[j])<=Rt($[j])&&nn($[Z])<=Rt(I[Z])}function F(I,$){var j=_e(I-t);return!T&&(c.rewind||e.is(wt))&&(j=Je(j,e.length-j)),j<=$}var A={index:t,slideIndex:n,slide:o,container:O,isClone:T,mount:E,destroy:w,update:L,style:B,isWithin:F};return A}function Pi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=t.Elements,l=u.slides,g=u.list,c=[];function _(){C(),r(Se,y),r(Se,C)}function C(){l.forEach(function(L,N){d(L,N,-1)})}function y(){P(function(L){L.destroy()}),Ue(c)}function p(){P(function(L){L.update()})}function d(L,N,W){var B=Mi(e,N,W,L);B.mount(),c.push(B),c.sort(function(D,b){return D.index-b.index})}function S(L){return L?E(function(N){return!N.isClone}):c}function h(L){var N=t.Controller,W=N.toIndex(L),B=N.hasFocus()?1:n.perPage;return E(function(D){return Jt(D.index,W,W+B-1)})}function v(L){return E(L)[0]}function T(L,N){Ae(L,function(W){if(Ze(W)&&(W=Mo(W)),Io(W)){var B=l[N];B?Hn(W,B):Nt(g,W),We(W,n.classes.slide),w(W,ve(s,vt))}}),s(Se)}function O(L){it(E(L).map(function(N){return N.slide})),s(Se)}function P(L,N){S(N).forEach(L)}function E(L){return c.filter(Lo(L)?L:function(N){return Ze(L)?At(N.slide,L):Wn(Ht(L),N.index)})}function f(L,N,W){P(function(B){B.style(L,N,W)})}function w(L,N){var W=Nn(L,"img"),B=W.length;B?W.forEach(function(D){i(D,"load error",function(){--B||N()})}):N()}function R(L){return L?l.length:c.length}function V(){return c.length>n.perPage}return{mount:_,destroy:y,update:p,register:d,get:S,getIn:h,getAt:v,add:T,remove:O,forEach:P,filter:E,style:f,getLength:R,isEnough:V}}function Wi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=t.Slides,l=t.Direction.resolve,g=t.Elements,c=g.root,_=g.track,C=g.list,y=u.getAt,p=u.style,d,S,h;function v(){T(),s(window,"resize load",yi(ve(i,vt))),r([Te,Se],T),r(vt,O)}function T(){d=n.direction===mn,Ie(c,"maxWidth",ot(n.width)),Ie(_,l("paddingLeft"),P(!1)),Ie(_,l("paddingRight"),P(!0)),O(!0)}function O(A){var I=Ee(c);(A||S.width!==I.width||S.height!==I.height)&&(Ie(_,"height",E()),p(l("marginRight"),ot(n.gap)),p("width",w()),p("height",R(),!0),S=I,i(sn),h!==(h=F())&&(Oe(c,cr,h),i(fi,h)))}function P(A){var I=n.padding,$=l(A?"right":"left");return I&&ot(I[$]||(kt(I)?0:I))||"0px"}function E(){var A="";return d&&(A=f(),_t(A,"height or heightRatio is missing."),A="calc("+A+" - "+P(!1)+" - "+P(!0)+")"),A}function f(){return ot(n.height||Ee(C).width*n.heightRatio)}function w(){return n.autoWidth?null:ot(n.fixedWidth)||(d?"":V())}function R(){return ot(n.fixedHeight)||(d?n.autoHeight?null:V():f())}function V(){var A=ot(n.gap);return"calc((100%"+(A&&" + "+A)+")/"+(n.perPage||1)+(A&&" - "+A)+")"}function L(){return Ee(C)[l("width")]}function N(A,I){var $=y(A||0);return $?Ee($.slide)[l("width")]+(I?0:D()):0}function W(A,I){var $=y(A);if($){var j=Ee($.slide)[l("right")],Z=Ee(C)[l("left")];return _e(j-Z)+(I?0:D())}return 0}function B(A){return W(e.length-1)-W(0)+N(0,A)}function D(){var A=y(0);return A&&parseFloat(Ie(A.slide,l("marginRight")))||0}function b(A){return parseFloat(Ie(_,l("padding"+(A?"Right":"Left"))))||0}function F(){return e.is(Bt)||B(!0)>L()}return{mount:v,resize:O,listSize:L,slideSize:N,sliderSize:B,totalSize:W,getPadding:b,isOverflow:F}}var Hi=2;function Ni(e,t,n){var o=be(e),r=o.on,s=t.Elements,i=t.Slides,u=t.Direction.resolve,l=[],g;function c(){r(Se,_),r([Te,vt],y),(g=S())&&(p(g),t.Layout.resize(!0))}function _(){C(),c()}function C(){it(l),Ue(l),o.destroy()}function y(){var h=S();g!==h&&(g<h||!h)&&o.emit(Se)}function p(h){var v=i.get().slice(),T=v.length;if(T){for(;v.length<h;)Zt(v,v);Zt(v.slice(-h),v.slice(0,h)).forEach(function(O,P){var E=P<h,f=d(O.slide,P);E?Hn(f,v[0].slide):Nt(s.list,f),Zt(l,f),i.register(f,P-h+(E?0:T),O.index)})}}function d(h,v){var T=h.cloneNode(!0);return We(T,n.classes.clone),T.id=e.root.id+"-clone"+Vn(v+1),T}function S(){var h=n.clones;if(!e.is(wt))h=0;else if(Wt(h)){var v=n[u("fixedWidth")]&&t.Layout.slideSize(0),T=v&&Rt(Ee(s.track)[u("width")]/v);h=T||n[u("autoWidth")]&&e.length||n.perPage*Hi}return h}return{mount:c,destroy:C}}function ji(e,t,n){var o=be(e),r=o.on,s=o.emit,i=e.state.set,u=t.Layout,l=u.slideSize,g=u.getPadding,c=u.totalSize,_=u.listSize,C=u.sliderSize,y=t.Direction,p=y.resolve,d=y.orient,S=t.Elements,h=S.list,v=S.track,T;function O(){T=t.Transition,r([et,sn,Te,Se],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),f(e.index),t.Slides.update())}function E($,j,Z,ce){$!==j&&A($>Z)&&(L(),w(V(B(),$>Z),!0)),i(St),s(Ge,j,Z,$),T.start(j,function(){i(yt),s(Ct,j,Z,$),ce&&ce()})}function f($){w(W($,!0))}function w($,j){if(!e.is(Bt)){var Z=j?$:R($);Ie(h,"transform","translate"+p("X")+"("+Z+"px)"),$!==Z&&s(Zo)}}function R($){if(e.is(wt)){var j=N($),Z=j>t.Controller.getEnd(),ce=j<0;(ce||Z)&&($=V($,Z))}return $}function V($,j){var Z=$-F(j),ce=C();return $-=d(ce*(Rt(_e(Z)/ce)||1))*(j?1:-1),$}function L(){w(B(),!0),T.cancel()}function N($){for(var j=t.Slides.get(),Z=0,ce=1/0,re=0;re<j.length;re++){var ge=j[re].index,H=_e(W(ge,!0)-$);if(H<=ce)ce=H,Z=ge;else break}return Z}function W($,j){var Z=d(c($-1)-b($));return j?D(Z):Z}function B(){var $=p("left");return Ee(h)[$]-Ee(v)[$]+d(g(!1))}function D($){return n.trimSpace&&e.is(bt)&&($=pt($,0,d(C(!0)-_()))),$}function b($){var j=n.focus;return j==="center"?(_()-l($,!0))/2:+j*l($)||0}function F($){return W($?t.Controller.getEnd():0,!!n.trimSpace)}function A($){var j=d(V(B(),$));return $?j>=0:j<=h[p("scrollWidth")]-Ee(v)[p("width")]}function I($,j){j=Wt(j)?B():j;var Z=$!==!0&&d(j)<d(F(!1)),ce=$!==!1&&d(j)>d(F(!0));return Z||ce}return{mount:O,move:E,jump:f,translate:w,shift:V,cancel:L,toIndex:N,toPosition:W,getPosition:B,getLimit:F,exceededLimit:I,reposition:P}}function Vi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=t.Move,u=i.getPosition,l=i.getLimit,g=i.toPosition,c=t.Slides,_=c.isEnough,C=c.getLength,y=n.omitEnd,p=e.is(wt),d=e.is(bt),S=ve(B,!1),h=ve(B,!0),v=n.start||0,T,O=v,P,E,f;function w(){R(),r([Te,Se,on],R),r(sn,V)}function R(){P=C(!0),E=n.perMove,f=n.perPage,T=A();var H=pt(v,0,y?T:P-1);H!==v&&(v=H,i.reposition())}function V(){T!==A()&&s(on)}function L(H,oe,te){if(!ge()){var J=W(H),se=F(J);se>-1&&(oe||se!==v)&&(Z(se),i.move(J,se,O,te))}}function N(H,oe,te,J){t.Scroll.scroll(H,oe,te,function(){var se=F(i.toIndex(u()));Z(y?Je(se,T):se),J&&J()})}function W(H){var oe=v;if(Ze(H)){var te=H.match(/([+\-<>])(\d+)?/)||[],J=te[1],se=te[2];J==="+"||J==="-"?oe=D(v+ +(""+J+(+se||1)),v):J===">"?oe=se?I(+se):S(!0):J==="<"&&(oe=h(!0))}else oe=p?H:pt(H,0,T);return oe}function B(H,oe){var te=E||(re()?1:f),J=D(v+te*(H?-1:1),v,!(E||re()));return J===-1&&d&&!Wo(u(),l(!H),1)?H?0:T:oe?J:F(J)}function D(H,oe,te){if(_()||re()){var J=b(H);J!==H&&(oe=H,H=J,te=!1),H<0||H>T?!E&&(Jt(0,H,oe,!0)||Jt(T,oe,H,!0))?H=I($(H)):p?H=te?H<0?-(P%f||f):P:H:n.rewind?H=H<0?T:0:H=-1:te&&H!==oe&&(H=I($(oe)+(H<oe?-1:1)))}else H=-1;return H}function b(H){if(d&&n.trimSpace==="move"&&H!==v)for(var oe=u();oe===g(H,!0)&&Jt(H,0,e.length-1,!n.rewind);)H<v?--H:++H;return H}function F(H){return p?(H+P)%P||0:H}function A(){for(var H=P-(re()||p&&E?1:f);y&&H-- >0;)if(g(P-1,!0)!==g(H,!0)){H++;break}return pt(H,0,P-1)}function I(H){return pt(re()?H:f*H,0,T)}function $(H){return re()?Je(H,T):nn((H>=T?P-1:H)/f)}function j(H){var oe=i.toIndex(H);return d?pt(oe,0,T):oe}function Z(H){H!==v&&(O=v,v=H)}function ce(H){return H?O:v}function re(){return!Wt(n.focus)||n.isNavigation}function ge(){return e.state.is([St,Pt])&&!!n.waitForTransition}return{mount:w,go:L,scroll:N,getNext:S,getPrev:h,getAdjacent:B,getEnd:A,setIndex:Z,getIndex:ce,toIndex:I,toPage:$,toDest:j,hasFocus:re,isBusy:ge}}var zi="http://www.w3.org/2000/svg",Bi="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",qt=40;function Oi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=n.classes,l=n.i18n,g=t.Elements,c=t.Controller,_=g.arrows,C=g.track,y=_,p=g.prev,d=g.next,S,h,v={};function T(){P(),r(Te,O)}function O(){E(),T()}function P(){var N=n.arrows;N&&!(p&&d)&&R(),p&&d&&(It(v,{prev:p,next:d}),Ft(y,N?"":"none"),We(y,h=Xn+"--"+n.direction),N&&(f(),L(),de([p,d],zt,C.id),i(qo,p,d)))}function E(){o.destroy(),De(y,h),S?(it(_?[p,d]:y),p=d=null):He([p,d],Yn)}function f(){r([et,Ct,Se,st,on],L),s(d,"click",ve(w,">")),s(p,"click",ve(w,"<"))}function w(N){c.go(N,!0)}function R(){y=_||gt("div",u.arrows),p=V(!0),d=V(!1),S=!0,Nt(y,[p,d]),!_&&Hn(y,C)}function V(N){var W='<button class="'+u.arrow+" "+(N?u.prev:u.next)+'" type="button"><svg xmlns="'+zi+'" viewBox="0 0 '+qt+" "+qt+'" width="'+qt+'" height="'+qt+'" focusable="false"><path d="'+(n.arrowPath||Bi)+'" />';return Mo(W)}function L(){if(p&&d){var N=e.index,W=c.getPrev(),B=c.getNext(),D=W>-1&&N<W?l.last:l.prev,b=B>-1&&N>B?l.first:l.next;p.disabled=W<0,d.disabled=B<0,de(p,ke,D),de(d,ke,b),i(Uo,p,d,W,B)}}return{arrows:v,mount:T,destroy:E,update:L}}var Di=jn+"-interval";function qi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=cn(n.interval,e.go.bind(e,">"),f),l=u.isPaused,g=t.Elements,c=t.Elements,_=c.root,C=c.toggle,y=n.autoplay,p,d,S=y==="pause";function h(){y&&(v(),C&&de(C,zt,g.track.id),S||T(),E())}function v(){n.pauseOnHover&&s(_,"mouseenter mouseleave",function(R){p=R.type==="mouseenter",P()}),n.pauseOnFocus&&s(_,"focusin focusout",function(R){d=R.type==="focusin",P()}),C&&s(C,"click",function(){S?T():O(!0)}),r([Ge,ln,Se],u.rewind),r(Ge,w)}function T(){l()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),d=p=S=!1,E(),i(Dn))}function O(R){R===void 0&&(R=!0),S=!!R,E(),l()||(u.pause(),i(qn))}function P(){S||(p||d?O(!1):T())}function E(){C&&(Oe(C,at,!S),de(C,ke,n.i18n[S?"play":"pause"]))}function f(R){var V=g.bar;V&&Ie(V,"width",R*100+"%"),i(Yo,R)}function w(R){var V=t.Slides.getAt(R);u.set(V&&+Fe(V.slide,Di)||n.interval)}return{mount:h,destroy:u.cancel,play:T,pause:O,isPaused:l}}function Ui(e,t,n){var o=be(e),r=o.on;function s(){n.cover&&(r(Un,ve(u,!0)),r([et,Te,Se],ve(i,!0)))}function i(l){t.Slides.forEach(function(g){var c=jt(g.container||g.slide,"img");c&&c.src&&u(l,c,g)})}function u(l,g,c){c.style("background",l?'center/cover no-repeat url("'+g.src+'")':"",!0),Ft(g,l?"none":"")}return{mount:s,destroy:ve(i,!1)}}var Gi=10,Ki=600,Yi=.6,Xi=1.5,Zi=800;function Ji(e,t,n){var o=be(e),r=o.on,s=o.emit,i=e.state.set,u=t.Move,l=u.getPosition,g=u.getLimit,c=u.exceededLimit,_=u.translate,C=e.is(bt),y,p,d=1;function S(){r(Ge,O),r([Te,Se],P)}function h(f,w,R,V,L){var N=l();if(O(),R&&(!C||!c())){var W=t.Layout.sliderSize(),B=En(f)*W*nn(_e(f)/W)||0;f=u.toPosition(t.Controller.toDest(f%W))+B}var D=Wo(N,f,1);d=1,w=D?0:w||tn(_e(f-N)/Xi,Zi),p=V,y=cn(w,v,ve(T,N,f,L),1),i(Pt),s(ln),y.start()}function v(){i(yt),p&&p(),s(st)}function T(f,w,R,V){var L=l(),N=f+(w-f)*E(V),W=(N-L)*d;_(L+W),C&&!R&&c()&&(d*=Yi,_e(W)<Gi&&h(g(c(!0)),Ki,!1,p,!0))}function O(){y&&y.cancel()}function P(){y&&!y.isPaused()&&(O(),v())}function E(f){var w=n.easingFunc;return w?w(f):1-Math.pow(1-f,4)}return{mount:S,destroy:O,scroll:h,cancel:P}}var dt={passive:!1,capture:!0};function Qi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=o.unbind,l=e.state,g=t.Move,c=t.Scroll,_=t.Controller,C=t.Elements.track,y=t.Media.reduce,p=t.Direction,d=p.resolve,S=p.orient,h=g.getPosition,v=g.exceededLimit,T,O,P,E,f,w=!1,R,V,L;function N(){i(C,Sn,Tn,dt),i(C,Cn,Tn,dt),i(C,ur,B,dt),i(C,"click",F,{capture:!0}),i(C,"dragstart",Be),r([et,Te],W)}function W(){var M=n.drag;pe(!M),E=M==="free"}function B(M){if(R=!1,!V){var x=se(M);J(M.target)&&(x||!M.button)&&(_.isBusy()?Be(M,!0):(L=x?C:window,f=l.is([St,Pt]),P=null,i(L,Sn,D,dt),i(L,Cn,b,dt),g.cancel(),c.cancel(),A(M)))}}function D(M){if(l.is(Xt)||(l.set(Xt),s(Bo)),M.cancelable)if(f){g.translate(T+te(re(M)));var x=ge(M)>fo,U=w!==(w=v());(x||U)&&A(M),R=!0,s(Oo),Be(M)}else j(M)&&(f=$(M),Be(M))}function b(M){l.is(Xt)&&(l.set(yt),s(Do)),f&&(I(M),Be(M)),u(L,Sn,D),u(L,Cn,b),f=!1}function F(M){!V&&R&&Be(M,!0)}function A(M){P=O,O=M,T=h()}function I(M){var x=Z(M),U=ce(x),K=n.rewind&&n.rewindByDrag;y(!1),E?_.scroll(U,0,n.snap):e.is(Bt)?_.go(S(En(x))<0?K?"<":"-":K?">":"+"):e.is(bt)&&w&&K?_.go(v(!0)?">":"<"):_.go(_.toDest(U),!0),y(!0)}function $(M){var x=n.dragMinThreshold,U=kt(x),K=U&&x.mouse||0,Q=(U?x.touch:+x)||10;return _e(re(M))>(se(M)?Q:K)}function j(M){return _e(re(M))>_e(re(M,!0))}function Z(M){if(e.is(wt)||!w){var x=ge(M);if(x&&x<fo)return re(M)/x}return 0}function ce(M){return h()+En(M)*Je(_e(M)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(M,x){return oe(M,x)-oe(H(M),x)}function ge(M){return _n(M)-_n(H(M))}function H(M){return O===M&&P||O}function oe(M,x){return(se(M)?M.changedTouches[0]:M)["page"+d(x?"Y":"X")]}function te(M){return M/(w&&e.is(bt)?Fi:1)}function J(M){var x=n.noDrag;return!At(M,"."+ir+", ."+fn)&&(!x||!At(M,x))}function se(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function z(){return f}function pe(M){V=M}return{mount:N,disable:pe,isDragging:z}}var ea={Spacebar:" ",Right:dn,Left:pn,Up:Jo,Down:Qo};function Zn(e){return e=Ze(e)?e:e.key,ea[e]||e}var ho="keydown";function ta(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.unbind,u=e.root,l=t.Direction.resolve,g,c;function _(){C(),r(Te,y),r(Te,C),r(Ge,d)}function C(){var h=n.keyboard;h&&(g=h==="global"?window:u,s(g,ho,S))}function y(){i(g,ho)}function p(h){c=h}function d(){var h=c;c=!0,Ao(function(){c=h})}function S(h){if(!c){var v=Zn(h);v===l(pn)?e.go("<"):v===l(dn)&&e.go(">")}}return{mount:_,destroy:y,disable:p}}var Et=jn+"-lazy",Qt=Et+"-srcset",na="["+Et+"], ["+Qt+"]";function oa(e,t,n){var o=be(e),r=o.on,s=o.off,i=o.bind,u=o.emit,l=n.lazyLoad==="sequential",g=[Ct,st],c=[];function _(){n.lazyLoad&&(C(),r(Se,C))}function C(){Ue(c),y(),l?h():(s(g),r(g,p),p())}function y(){t.Slides.forEach(function(v){Nn(v.slide,na).forEach(function(T){var O=Fe(T,Et),P=Fe(T,Qt);if(O!==T.src||P!==T.srcset){var E=n.classes.spinner,f=T.parentElement,w=jt(f,"."+E)||gt("span",E,f);c.push([T,v,w]),T.src||Ft(T,"none")}})})}function p(){c=c.filter(function(v){var T=n.perPage*((n.preloadPages||1)+1)-1;return v[1].isWithin(e.index,T)?d(v):!0}),c.length||s(g)}function d(v){var T=v[0];We(v[1].slide,In),i(T,"load error",ve(S,v)),de(T,"src",Fe(T,Et)),de(T,"srcset",Fe(T,Qt)),He(T,Et),He(T,Qt)}function S(v,T){var O=v[0],P=v[1];De(P.slide,In),T.type!=="error"&&(it(v[2]),Ft(O,""),u(Un,O,P),u(vt)),l&&h()}function h(){c.length&&d(c.shift())}return{mount:_,destroy:ve(Ue,c),check:p}}function ra(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=t.Slides,l=t.Elements,g=t.Controller,c=g.hasFocus,_=g.getIndex,C=g.go,y=t.Direction.resolve,p=l.pagination,d=[],S,h;function v(){T(),r([Te,Se,on],v);var V=n.pagination;p&&Ft(p,V?"":"none"),V&&(r([Ge,ln,st],R),O(),R(),s(Go,{list:S,items:d},w(e.index)))}function T(){S&&(it(p?Qe(S.children):S),De(S,h),Ue(d),S=null),o.destroy()}function O(){var V=e.length,L=n.classes,N=n.i18n,W=n.perPage,B=c()?g.getEnd()+1:Rt(V/W);S=p||gt("ul",L.pagination,l.track.parentElement),We(S,h=hn+"--"+f()),de(S,qe,"tablist"),de(S,ke,N.select),de(S,Kn,f()===mn?"vertical":"");for(var D=0;D<B;D++){var b=gt("li",null,S),F=gt("button",{class:L.page,type:"button"},b),A=u.getIn(D).map(function($){return $.slide.id}),I=!c()&&W>1?N.pageX:N.slideX;i(F,"click",ve(P,D)),n.paginationKeyboard&&i(F,"keydown",ve(E,D)),de(b,qe,"presentation"),de(F,qe,"tab"),de(F,zt,A.join(" ")),de(F,ke,kn(I,D+1)),de(F,ft,-1),d.push({li:b,button:F,page:D})}}function P(V){C(">"+V,!0)}function E(V,L){var N=d.length,W=Zn(L),B=f(),D=-1;W===y(dn,!1,B)?D=++V%N:W===y(pn,!1,B)?D=(--V+N)%N:W==="Home"?D=0:W==="End"&&(D=N-1);var b=d[D];b&&(Ro(b.button),C(">"+D),Be(L,!0))}function f(){return n.paginationDirection||n.direction}function w(V){return d[g.toPage(V)]}function R(){var V=w(_(!0)),L=w(_());if(V){var N=V.button;De(N,at),He(N,co),de(N,ft,-1)}if(L){var W=L.button;We(W,at),de(W,co,!0),de(W,ft,"")}s(Ko,{list:S,items:d},V,L)}return{items:d,mount:v,destroy:T,getAt:w,update:R}}var ia=[" ","Enter"];function aa(e,t,n){var o=n.isNavigation,r=n.slideFocus,s=[];function i(){e.splides.forEach(function(p){p.isParent||(g(e,p.splide),g(p.splide,e))}),o&&c()}function u(){s.forEach(function(p){p.destroy()}),Ue(s)}function l(){u(),i()}function g(p,d){var S=be(p);S.on(Ge,function(h,v,T){d.go(d.is(wt)?T:h)}),s.push(S)}function c(){var p=be(e),d=p.on;d(zn,C),d(Xo,y),d([et,Te],_),s.push(p),p.emit(On,e.splides)}function _(){de(t.Elements.list,Kn,n.direction===mn?"vertical":"")}function C(p){e.go(p.index)}function y(p,d){Wn(ia,Zn(d))&&(C(p),Be(d))}return{setup:ve(t.Media.set,{slideFocus:Wt(r)?o:r},!0),mount:i,destroy:u,remount:l}}function sa(e,t,n){var o=be(e),r=o.bind,s=0;function i(){n.wheel&&r(t.Elements.track,"wheel",u,dt)}function u(g){if(g.cancelable){var c=g.deltaY,_=c<0,C=_n(g),y=n.wheelMinThreshold||0,p=n.wheelSleep||0;_e(c)>y&&C-s>p&&(e.go(_?"<":">"),s=C),l(_)&&Be(g)}}function l(g){return!n.releaseWheel||e.state.is(St)||t.Controller.getAdjacent(g)!==-1}return{mount:i}}var la=90;function ca(e,t,n){var o=be(e),r=o.on,s=t.Elements.track,i=n.live&&!n.isNavigation,u=gt("span",Ei),l=cn(la,ve(c,!1));function g(){i&&(C(!t.Autoplay.isPaused()),de(s,mo,!0),u.textContent="…",r(Dn,ve(C,!0)),r(qn,ve(C,!1)),r([Ct,st],ve(c,!0)))}function c(y){de(s,po,y),y?(Nt(s,u),l.start()):(it(u),l.cancel())}function _(){He(s,[uo,mo,po]),it(u)}function C(y){i&&de(s,uo,y?"off":"polite")}return{mount:g,disable:C,destroy:_}}var ua=Object.freeze({__proto__:null,Media:vi,Direction:bi,Elements:Ri,Slides:Pi,Layout:Wi,Clones:Ni,Move:ji,Controller:Vi,Arrows:Oi,Autoplay:qi,Cover:Ui,Scroll:Ji,Drag:Qi,Keyboard:ta,LazyLoad:oa,Pagination:ra,Sync:aa,Wheel:sa,Live:ca}),pa={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"},da={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:Li,i18n:pa,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ma(e,t,n){var o=t.Slides;function r(){be(e).on([et,Se],s)}function s(){o.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function i(u,l){o.style("transition","opacity "+n.speed+"ms "+n.easing),Ao(l)}return{mount:r,start:i,cancel:Tn}}function ga(e,t,n){var o=t.Move,r=t.Controller,s=t.Scroll,i=t.Elements.list,u=ve(Ie,i,"transition"),l;function g(){be(e).bind(i,"transitionend",function(y){y.target===i&&l&&(_(),l())})}function c(y,p){var d=o.toPosition(y,!0),S=o.getPosition(),h=C(y);_e(d-S)>=1&&h>=1?n.useScroll?s.scroll(d,h,!1,p):(u("transform "+h+"ms "+n.easing),o.translate(d,!0),l=p):(o.jump(y),p())}function _(){u(""),s.cancel()}function C(y){var p=n.rewindSpeed;if(e.is(bt)&&p){var d=r.getIndex(!0),S=r.getEnd();if(d===0&&y>=S||d>=S&&y===0)return p}return n.speed}return{mount:g,start:c,cancel:_}}var fa=(function(){function e(n,o){this.event=be(),this.Components={},this.state=hi(mt),this.splides=[],this._o={},this._E={};var r=Ze(n)?Po(document,n):n;_t(r,r+" is invalid."),this.root=r,o=Ye({label:Fe(r,ke)||"",labelledby:Fe(r,Gn)||""},da,e.defaults,o||{});try{Ye(o,JSON.parse(Fe(r,jn)))}catch{_t(!1,"Invalid JSON")}this._o=Object.create(Ye({},o))}var t=e.prototype;return t.mount=function(o,r){var s=this,i=this.state,u=this.Components;_t(i.is([mt,en]),"Already mounted!"),i.set(mt),this._C=u,this._T=r||this._T||(this.is(Bt)?ma:ga),this._E=o||this._E;var l=It({},ua,this._E,{Transition:this._T});return rt(l,function(g,c){var _=g(s,u,s._o);u[c]=_,_.setup&&_.setup()}),rt(u,function(g){g.mount&&g.mount()}),this.emit(et),We(this.root,ki),i.set(yt),this.emit(An),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,r){return this.event.on(o,r),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var r;return(r=this.event).emit.apply(r,[o].concat(Qe(arguments,1))),this},t.add=function(o,r){return this._C.Slides.add(o,r),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Se),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,s=this.state;return s.is(mt)?be(this).on(An,this.destroy.bind(this,o)):(rt(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(Bn),r.destroy(),o&&Ue(this.splides),s.set(en)),this},pi(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Jn=fa;Jn.defaults={};Jn.STATES=mi;var yo=[[et,"onMounted"],[An,"onReady"],[Ge,"onMove"],[Ct,"onMoved"],[zn,"onClick"],[No,"onActive"],[jo,"onInactive"],[Vo,"onVisible"],[zo,"onHidden"],[Se,"onRefresh"],[Te,"onUpdated"],[vt,"onResize"],[sn,"onResized"],[Bo,"onDrag"],[Oo,"onDragging"],[Do,"onDragged"],[ln,"onScroll"],[st,"onScrolled"],[Bn,"onDestroy"],[qo,"onArrowsMounted"],[Uo,"onArrowsUpdated"],[Go,"onPaginationMounted"],[Ko,"onPaginationUpdated"],[On,"onNavigationMounted"],[Dn,"onAutoplayPlay"],[Yo,"onAutoplayPlaying"],[qn,"onAutoplayPause"],[Un,"onLazyLoadLoaded"]];function Qn(...e){return e.filter(Boolean).join(" ")}function rn(e){return e!==null&&typeof e=="object"}function Fn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Fn(n,t[o]));if(rn(e)&&rn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!Fn(e[r],t[r]))}return e===t}function ha(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function ya(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const r=n[o];if(r!=="__proto__"&&t(e[r],r)===!1)break}}return e}function Rn(e,t){const n=e;return ya(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():rn(o)?n[r]=Rn(rn(n[r])?n[r]:{},o):n[r]=o}),n}var va=({children:e,className:t,...n})=>m.createElement("div",{className:Qn("splide__track",t),...n},m.createElement("ul",{className:"splide__list"},e)),pr=class extends m.Component{constructor(){super(...arguments),this.splideRef=m.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Jn(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Rn({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!Fn(this.options,e)&&(this.splide.options=e,this.options=Rn({},e));const t=this.getSlides();ha(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){yo.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...r)=>{o(e,...r)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:o,...r}=this.props;return m.createElement(t,{className:Qn("splide",e),ref:this.splideRef,...this.omit(r,["options",...yo.map(s=>s[1])])},n?m.createElement(va,null,o):o)}},dr=({children:e,className:t,...n})=>m.createElement("li",{className:Qn("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 xa="RichTextRenderer-module__link___BWeZ2",Sa={link:xa},Ca=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},yn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Ca(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function ht(e){const{color:t,...n}=e;return n}function Pe(e,t){var n,o,r;return{fontFamily:yn(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:_.scalingValue(e.letterSpacing,t),wordSpacing:_.scalingValue(e.wordSpacing,t),fontSize:_.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?_.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(r=e.textAppearance)==null?void 0:r.fontVariant,color:e.color}}const Mt=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?a.jsx("a",{className:Sa.link,href:o.value,target:o.target,children:t(o.children)},r):a.jsx("span",{style:wa(o),children:o.text},r));return a.jsx(a.Fragment,{children:e.map((n,o)=>{const r=n.children;return a.jsx("div",{children:t(r)},o)})})};function wa(e){return{...e.fontFamily&&{fontFamily:yn(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const $a="SvgImage-module__svg___q3xE-",Ta="SvgImage-module__img___VsTm-",vo={svg:$a,img:Ta},_a=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Ea=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Xe=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:r})=>{const[s,i]=g.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return g.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(u)}},[]),!_a(e)||!s?a.jsx("img",{src:e,alt:"",className:he(vo.img,o),style:r}):a.jsx("span",{"data-supports-mask":s,className:he(vo.svg,o),style:{"--svg":Ea(e),"--fill":t,"--hover-fill":n,...r??{}}})},ka={"top-left":te.topLeftAlignment,"top-center":te.topCenterAlignment,"top-right":te.topRightAlignment,"middle-left":te.middleLeftAlignment,"middle-center":te.middleCenterAlignment,"middle-right":te.middleRightAlignment,"bottom-left":te.bottomLeftAlignment,"bottom-center":te.bottomCenterAlignment,"bottom-right":te.bottomRightAlignment};function Aa({settings:e,content:t,styles:n,isEditor:o}){const[r,s]=g.useState(null),{widthSettings:i,fontSettings:u,letterSpacing:l,textAlign:m,wordSpacing:c,fontSizeLineHeight:T,textAppearance:v,color:h}=n.imageCaption,[p,d]=g.useState(void 0),[C,b]=g.useState(null),[x,E]=g.useState(0),[U,k]=g.useState(0),{direction:A,transition:S,controls:w,pagination:R,imageCaption:V,triggers:H}=e,j=g.useRef(S.type),{x:M,y:z}=e.controls.offset,K=f=>{r&&r.go(f)};return g.useEffect(()=>{if(!C)return;const f=new ResizeObserver(L=>{if(!r)return;const[I]=L;d({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return f.observe(C),()=>f.unobserve(C)},[C]),g.useEffect(()=>{!r||j.current===S.type||(k(f=>f+1),j.current=S.type)},[S.type]),a.jsx("div",{className:he(te.wrapper,{[te.editor]:o}),ref:b,children:a.jsxs("div",{className:te.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:S.backgroundColor&&S.type==="fade in"?S.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:he(te.captionBlock),children:a.jsx("div",{className:te.captionTextWrapper,children:t.map((f,L)=>a.jsx("div",{className:he(te.captionText,ka[V.alignment],{[te.withPointerEvents]:L===x&&o,[te.active]:L===x}),style:{fontFamily:yn(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:i.sizing==="auto"?"max-content":_.scalingValue(i.width,o),letterSpacing:_.scalingValue(l,o),wordSpacing:_.scalingValue(c,o),textAlign:m,fontSize:_.scalingValue(T.fontSize,o),lineHeight:_.scalingValue(T.lineHeight,o),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:h,transitionDuration:S.duration?`${Math.round(parseInt(S.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:te.captionTextInner,style:{"--link-hover-color":V.linkHoverColor,"--link-color":V.linkColor,position:"relative",top:_.scalingValue(V.offset.y,o),left:_.scalingValue(V.offset.x,o)},children:a.jsx(Mt,{content:f.imageCaption})})},L))})}),a.jsx(dr,{onMove:f=>{E(f.index)},ref:s,options:{arrows:!1,speed:S.duration?parseInt(S.duration):500,autoplay:H.autoPlay!==null,...H.autoPlay!==null&&{interval:parseInt(H.autoPlay)*1e3},direction:A==="horiz"||S.type==="fade in"?"ltr":"ttb",pagination:!1,drag:H.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:S.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,L)=>a.jsx(mr,{children:a.jsx("div",{className:te.sliderItem,children:a.jsx("div",{className:te.imgWrapper,children:a.jsx("img",{className:he(te.sliderImage,{[te.contain]:f.image.objectFit==="contain",[te.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},L))},U),w.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:he(te.arrow,{[te.arrowVertical]:A==="vert",[te.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{onClick:()=>{K("-1")},className:te.arrowInner,style:{transform:`translate(${_.scalingValue(M,o)}, ${_.scalingValue(z*(A==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx(Xe,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:he(te.arrowImg,te.mirror)}),!w.arrowsImgUrl&&a.jsx(bo,{color:w.color,className:he(te.arrowIcon,te.arrowImg,te.mirror)})]})}),a.jsx("div",{className:he(te.arrow,te.nextArrow,{[te.arrowVertical]:A==="vert",[te.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{className:te.arrowInner,onClick:()=>K("+1"),style:{transform:`translate(${_.scalingValue(M*(A==="horiz"?-1:1),o)}, ${_.scalingValue(z,o)}) scale(${e.controls.scale/100}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx(Xe,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:te.arrowImg}),!w.arrowsImgUrl&&a.jsx(bo,{color:w.color,className:he(te.arrowIcon,te.arrowImg)})]})})]}),H.triggersList.click&&a.jsx("div",{className:te.clickOverlay,onClick:()=>{r&&r.go("+1")}}),R.isActive&&a.jsx("div",{className:he(te.pagination,{[te.paginationInsideBottom]:R.position==="inside-1"&&A==="horiz",[te.paginationInsideTop]:R.position==="inside-2"&&A==="horiz",[te.paginationOutsideBottom]:R.position==="outside-1"&&A==="horiz",[te.paginationOutsideTop]:R.position==="outside-2"&&A==="horiz",[te.paginationInsideLeft]:R.position==="inside-1"&&A==="vert",[te.paginationInsideRight]:R.position==="inside-2"&&A==="vert",[te.paginationOutsideLeft]:R.position==="outside-1"&&A==="vert",[te.paginationOutsideRight]:R.position==="outside-2"&&A==="vert",[te.paginationVertical]:A==="vert"}),children:a.jsx("div",{className:te.paginationInner,style:{backgroundColor:R.colors[2],transform:`scale(${R.scale/100}) translate(${_.scalingValue(R.offset.x,o)}, ${_.scalingValue(R.offset.y,o)}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:t.map((f,L)=>a.jsx("button",{onClick:()=>{r&&r.go(L)},className:he(te.paginationItem),children:a.jsx("div",{className:he(te.dot,{[te.activeDot]:L===x}),style:{backgroundColor:L===x?R.colors[0]:R.colors[1],"--pagination-hover-color":R.hover}})},L))})})]})})}function bo({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 Ia={element:Aa,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"outside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},La="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Fa="ImageRevealSlider-module__image___Qjt-e",Ra="ImageRevealSlider-module__link___N-iLG",Ma="ImageRevealSlider-module__cursor___2U03d",ut={imageRevealSlider:La,image:Fa,link:Ra,cursor:Ma};function xo(e,t,n){for(const o of n){const r=new Image;r.src=o.url;const s=o.width?Number.parseFloat(o.width):r.naturalWidth,i=r.naturalHeight/r.naturalWidth*s,u=s/2,l=i/2;if(e>=o.x-u&&e<=o.x+u&&t>=o.y-l&&t<=o.y+l)return!0}return!1}function wn(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Pa(e,t,n,o){let r,s;if(t==="custom"){r=n;const i=await wn(e);s=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await wn(e);s=i.height/i.width*r}else{const i=await wn(e);r=i.width,s=i.height}return{width:r,height:s,finalWidth:`${r}px`}}function Wa({settings:e,content:t,isEditor:n}){const[o,r]=g.useState(null),[s,i]=g.useState([]),[u,l]=g.useState(0),m=g.useRef(0),[c,T]=g.useState({x:0,y:0}),[v,h]=g.useState(1),[p,d]=g.useState("none"),C=g.useRef({x:0,y:0}),[b,x]=g.useState(!1),{sizeType:E,imageWidth:U,randomRangeImageWidth:k}=e.imageSize,{revealPosition:A,visible:S}=e.position,{cursorType:w,target:R,defaultCursorScale:V,defaultCursor:H,hoverCursorScale:j,hoverCursor:M}=e.cursor;g.useEffect(()=>{if(!o)return;const f=(P,$)=>{const N=o.getBoundingClientRect(),ee=P-N.left,ue=$-N.top;if(T({x:ee,y:ue}),w==="system"){d("none"),h(1);return}const oe=ee,me=ue,W=document.elementFromPoint(N.left+oe,N.top+me);if(W&&W.closest("a")){d("none"),h(1);return}const B=xo(oe,me,s)||R==="area"?{img:M??"none",scale:j}:{img:H??"none",scale:V};d(B.img),h(B.scale)},L=P=>{P.stopPropagation(),C.current={x:P.clientX,y:P.clientY},f(P.clientX,P.clientY)},I=()=>{b&&f(C.current.x,C.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",I,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",I,!0)}},[o,b,c,w,R,M,H,j,V,s]),g.useEffect(()=>{b||(d("none"),h(0))},[b]);const z=async(f,L,I,P={})=>{const{width:$,height:N,finalWidth:ee}=await Pa(f.image.url,E,U,k);let ue=0,oe=0;A==="same"?(ue=L/2,oe=I/2):(ue=P.x??Math.random()*L,oe=P.y??Math.random()*I);const me=Math.min(Math.max(ue,$/2),L-$/2),W=Math.min(Math.max(oe,N/2),I-N/2);return{id:m.current++,url:f.image.url,link:f.link,name:f.image.name,x:me,y:W,width:ee}};g.useEffect(()=>{if(!o||t.length===0)return;const f=o.getBoundingClientRect(),L=f.width,I=f.height,P=[];(async()=>{const N=t[0],ee=await z(N,L,I);P.push(ee),i(P),l(1)})()},[E,U,k,A,o]),g.useEffect(()=>{S==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[S]);const K=async f=>{if(!o)return;const L=o.getBoundingClientRect(),I=f.clientX-L.left,P=f.clientY-L.top;if(R==="image"&&!xo(I,P,s))return;let $=0,N=0;A==="on Click"?($=I,N=P):A==="same"?($=L.width/2,N=L.height/2):($=Math.random()*L.width,N=Math.random()*L.height);const ee=t[u],ue=await z(ee,L.width,L.height,{x:$,y:N});i(oe=>S==="all"?[...oe,ue]:[ue]),l(oe=>oe>=t.length-1?0:oe+1)};return a.jsxs("div",{ref:r,onClick:K,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:ut.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[s.map(f=>a.jsx("div",{className:ut.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:R==="area"&&f.link?a.jsx("a",{href:f.link,target:"_blank",className:ut.link,children:a.jsx("img",{src:f.url,alt:f.name,className:ut.image},f.id)}):a.jsx("img",{src:f.url,alt:f.name,className:ut.image},f.id)},f.id)),b&&a.jsx("div",{className:ut.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Ha={element:Wa,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{width:"100%",height:"100%"},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Na="LightBox-module__hidden___9s-9x",ja="LightBox-module__heroImage___sTxNF",Va="LightBox-module__background___rm9ml",Ba="LightBox-module__editor___4ACaY",Oa="LightBox-module__contentStyle___Bgnsq",za="LightBox-module__imageStyle___tLIlB",Da="LightBox-module__imgWrapper___LuFUp",qa="LightBox-module__contain___8-yaS",Ua="LightBox-module__cover___hNvOG",Ga="LightBox-module__caption___b6L2I",Ka="LightBox-module__captionTextInner___rCGNH",Ya="LightBox-module__lightboxSplide___XFuWC",Xa="LightBox-module__arrow___iz38X",Za="LightBox-module__arrowVertical___Zfz81",Ja="LightBox-module__nextArrow___zkAQN",Qa="LightBox-module__arrowInner___p48sW",es="LightBox-module__arrowIcon___3VaFf",ts="LightBox-module__arrowImg___pNV88",ns="LightBox-module__mirror___pjeXc",os="LightBox-module__thumbsWrapper___GB-nU",rs="LightBox-module__thumbsContainerVertical___wttk5",is="LightBox-module__thumbsContainer___osSma",as="LightBox-module__thumbsAlignStart___MO6tY",ss="LightBox-module__thumbsAlignCenter___Q4sUx",ls="LightBox-module__thumbsAlignEnd___p4y9R",cs="LightBox-module__thumbItem___HvnF3",us="LightBox-module__closeButton___g2khP",ps="LightBox-module__fadeIn___0m5GW",ds="LightBox-module__slideInLeft___gPYwC",ms="LightBox-module__slideInRight___S-pPp",gs="LightBox-module__slideInTop___DFdAj",fs="LightBox-module__slideInBottom___m27kZ",hs="LightBox-module__fadeOut___55qBR",ys="LightBox-module__slideOutLeft___NvU7P",vs="LightBox-module__slideOutRight___SK7eC",bs="LightBox-module__slideOutTop___Vgg0z",xs="LightBox-module__slideOutBottom___nJ0Ef",Ss="LightBox-module__scaleSlide___vZriG",G={hidden:Na,heroImage:ja,background:Va,editor:Ba,contentStyle:Oa,imageStyle:za,imgWrapper:Da,contain:qa,cover:Ua,caption:Ga,captionTextInner:Ka,lightboxSplide:Ya,arrow:Xa,arrowVertical:Za,nextArrow:Ja,arrowInner:Qa,arrowIcon:es,arrowImg:ts,mirror:ns,thumbsWrapper:os,thumbsContainerVertical:rs,thumbsContainer:is,thumbsAlignStart:as,thumbsAlignCenter:ss,thumbsAlignEnd:ls,thumbItem:cs,closeButton:us,fadeIn:ps,slideInLeft:ds,slideInRight:ms,slideInTop:gs,slideInBottom:fs,fadeOut:hs,slideOutLeft:ys,slideOutRight:vs,slideOutTop:bs,slideOutBottom:xs,scaleSlide:Ss},Ut=(e,t,n)=>{const o={},[r,s]=e.split("-");return r==="top"?(o.top="0",o.bottom="auto"):r==="middle"?(o.top="50%",o.bottom="auto"):r==="bottom"&&(o.top="auto",o.bottom="0"),s==="left"?(o.left="0",o.right="auto"):s==="center"?(o.left="50%",o.right="auto"):s==="right"&&(o.left="auto",o.right="0"),r==="middle"&&s==="center"?o.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), calc(-50% + ${_.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${_.scalingValue(t.x,n)}, calc(-50% + ${_.scalingValue(t.y,n)}))`:s==="center"?o.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), ${_.scalingValue(t.y,n)})`:o.transform=`translate(${_.scalingValue(t.x,n)}, ${_.scalingValue(t.y,n)})`,o};function gr(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function So(e){const t=e.getBoundingClientRect(),n=gr(e),o=Math.max(0,t.width-n.left-n.right),r=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,i=e.naturalHeight,u=o/r,l=s/i;let m,c;l>u?(m=o,c=o/l):(c=r,m=r*l);const T=t.left+n.left,v=t.top+n.top,h=(o-m)/2+T,p=(r-c)/2+v;return{x:h,y:p,width:m,height:c}}function Co(e){const t=e.getBoundingClientRect(),n=gr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function wo(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(r=>parseFloat(r.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Cs(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})(),r=(()=>{if(e==="fade in"||e==="mix")return G.fadeOut;if(e==="slide in")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})(),s=(()=>{if(e==="fade in")return G.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:r,disappearClass:s}}const ws=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:s})=>{const[i,u]=g.useState(!1),{url:l}=e.thumbnailBlock.cover;return g.useEffect(()=>{r==="close"&&u(!1),r==="open"&&u(!0)},[r]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:l,alt:"Cover",className:G.heroImage,onClick:()=>u(!0)}),a.jsx($s,{isOpen:i,onClose:()=>u(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:s})]})},$s=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:s,isEditor:i,metadata:u})=>{var F;const[l,m]=g.useState(0),[c,T]=g.useState(0),[v,h]=g.useState(!1),[p,d]=g.useState(!1),[C,b]=g.useState({}),x=g.useRef(null),E=g.useRef(null),U=g.useRef(null),k=g.useRef(!1),A=g.useRef(null),S=g.useRef(null),w=g.useRef(null),R=g.useRef(null),V=g.useRef(!1),H=g.useRef(null),[j,M]=g.useState(!1),{appear:z,triggers:K,slider:f,thumbnail:L,controls:I,area:P,caption:$,layout:N}=r.lightboxBlock,{appearClass:ee,backdropAppearClass:ue,backdropDisappearClass:oe,disappearClass:me}=Cs(z.type,z.direction),W=(u==null?void 0:u.itemId)??null;g.useEffect(()=>{const y=()=>{setTimeout(()=>{var Y,J;(J=(Y=x.current)==null?void 0:Y.splide)==null||J.refresh()},16)},O=()=>{T(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",y),window.addEventListener("ArticleEditor.ComponentContent:change",O),()=>{window.removeEventListener("ArticleEditor.Layout:change",y),window.removeEventListener("ArticleEditor.ComponentContent:change",O)}},[]),g.useEffect(()=>{if(!e||!L.isActive){M(!1);return}const y=H.current;if(!y)return;const O=()=>{f.direction==="horiz"?M(y.scrollWidth>y.clientWidth):M(y.scrollHeight>y.clientHeight)};O();const Y=new ResizeObserver(O);return Y.observe(y),()=>Y.disconnect()},[e,L.isActive,n.length,C,f.direction]);const B=g.useCallback(()=>{const y=window.matchMedia("(max-width: 768px)").matches,O=wo(P.color);y&&!i&&O>.9&&(document.body.style.backgroundColor=""),h(!0),k.current=!0;const Y=J=>{J.target===A.current&&J.animationName&&(A.current&&S.current&&A.current.removeEventListener("animationend",S.current),S.current=null,k.current&&(k.current=!1,t()),h(!1))};A.current&&(S.current=Y,A.current.addEventListener("animationend",Y))},[t,P.color,i]),Q=(y,O,Y)=>{var J,le;if(y){if(K.type==="click"&&K.switch==="image")K.repeat==="close"&&l===n.length-1?B():(J=x.current)==null||J.go("+1");else if(K.type==="click"&&K.switch==="50/50"){const ae=y.getBoundingClientRect(),re=O-ae.left,ge=Y-ae.top,q=ae.width,Z=ae.height;let X;f.direction==="horiz"?X=re<q/2?"-1":"+1":X=ge<Z/2?"-1":"+1",(le=x.current)==null||le.go(X)}}},ne=y=>{if(V.current){V.current=!1;return}const O=n[l],Y=(O==null?void 0:O.image.objectFit)==="cover";let J,le;if("changedTouches"in y&&y.changedTouches.length>0)J=y.changedTouches[0].clientX,le=y.changedTouches[0].clientY;else if("clientX"in y)J=y.clientX,le=y.clientY;else return;let ae;if(Y&&U.current){const re=Co(U.current);ae=J>=re.left&&J<=re.right&&le>=re.top&&le<=re.bottom}else{const re=U.current?So(U.current):null;if(!re){y.target===y.currentTarget&&B();return}ae=J>=re.x&&J<=re.x+re.width&&le>=re.y&&le<=re.y+re.height}ae?Q(U.current,J,le):B()},se=y=>{const O=y.target;(O.classList.contains(G.thumbsWrapper)||O.classList.contains(G.thumbsContainer))&&ne(y)};g.useEffect(()=>{if(!e)return;const y=O=>{var Y,J;if(O.key==="Escape"){B();return}if(O.key==="ArrowRight"){m(le=>(le+1)%Math.max(n.length,1)),(Y=x.current)==null||Y.go("+1");return}O.key==="ArrowLeft"&&(m(le=>(le-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=x.current)==null||J.go("-1"))};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y)}},[e,B,n.length]),g.useEffect(()=>{if(e){if(m(0),T(O=>O+1),k.current=!1,h(!1),d(!1),b({}),!W)return;const y=new CustomEvent("page-overlay",{detail:{itemId:W}});window.dispatchEvent(y)}return()=>{A.current&&S.current&&(A.current.removeEventListener("animationend",S.current),S.current=null),d(!1)}},[e,W]),g.useEffect(()=>{E.current!==null&&E.current!==f.type&&T(y=>y+1),E.current=f.type},[f.type]),g.useEffect(()=>{if(!e)return;const y=document.body.style.overflow,O=window.matchMedia("(max-width: 768px)").matches,Y=wo(P.color);document.body.style.overflow="hidden",d(!1);const J=ae=>{ae.target===A.current&&!k.current&&ae.animationName&&(O&&!i&&Y>.9&&(document.body.style.backgroundColor=P.color),d(!0),A.current&&w.current&&A.current.removeEventListener("animationend",w.current),w.current=null)};A.current&&(w.current=J,A.current.addEventListener("animationend",J));const le=ae=>{const re=ae.target;re&&(re.closest(`.${G.thumbsWrapper}`)||re.closest(`.${G.thumbsContainer}`))||f.type!=="slide"&&ae.preventDefault()};return document.addEventListener("touchmove",le,{passive:!1}),()=>{document.body.style.overflow=y,document.removeEventListener("touchmove",le),A.current&&w.current&&(A.current.removeEventListener("animationend",w.current),w.current=null),d(!1)}},[e,i,P.color,f.type]),g.useEffect(()=>{if(!e)return;const y=O=>{var J,le;if(k.current){O.stopPropagation();return}if(V.current){V.current=!1;return}const Y=O.target;if(!(Y&&(Y.closest(`.${G.thumbsContainer}`)||Y.closest(`.${G.thumbItem}`)))){if(f.type==="slide"&&K.type==="drag"&&((le=(J=x.current)==null?void 0:J.splide)!=null&&le.root)){const ae=x.current.splide.root;if(Y&&(ae.contains(Y)||ae===Y))return}if(O.touches.length===0&&O.changedTouches.length>0){const ae=n[l],re=(ae==null?void 0:ae.image.objectFit)==="cover",ge=O.changedTouches[0];let q;if(re&&U.current){const Z=Co(U.current);q=ge.clientX>=Z.left&&ge.clientX<=Z.right&&ge.clientY>=Z.top&&ge.clientY<=Z.bottom}else{const Z=U.current?So(U.current):null;if(!Z)return;q=ge.clientX>=Z.x&&ge.clientX<=Z.x+Z.width&&ge.clientY>=Z.y&&ge.clientY<=Z.y+Z.height}if(!q){O.stopPropagation(),k.current=!0;const Z=X=>{X.stopPropagation(),X.preventDefault(),document.removeEventListener("click",Z,!0)};document.addEventListener("click",Z,!0),B()}}}};return document.addEventListener("touchend",y,{passive:!0}),()=>{document.removeEventListener("touchend",y)}},[e,B,l,n]);const D=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&K.type==="drag";g.useEffect(()=>{var X,pe;if(!e||!D||!((pe=(X=x.current)==null?void 0:X.splide)!=null&&pe.root))return;const y=x.current.splide.root,O=30,Y=(ie,fe)=>{if(R.current){const we=Math.abs(ie-R.current.x),$e=Math.abs(fe-R.current.y);(we>0||$e>0)&&(V.current=!0)}},J=ie=>{R.current&&(ie.preventDefault(),Y(ie.clientX,ie.clientY))},le=ie=>{R.current&&ie.touches.length>0&&(ie.preventDefault(),Y(ie.touches[0].clientX,ie.touches[0].clientY))},ae=(ie,fe)=>{if(!R.current||!x.current){R.current=null;return}const we=Math.abs(ie-R.current.x),$e=Math.abs(fe-R.current.y);$e>O&&$e>we&&x.current.go(fe<R.current.y?"+1":"-1"),R.current=null},re=ie=>{R.current&&ae(ie.clientX,ie.clientY),document.removeEventListener("pointerup",re),document.removeEventListener("pointercancel",re),document.removeEventListener("pointermove",J)},ge=ie=>{if(R.current){if(ie.changedTouches.length>0){const fe=ie.changedTouches[0];ae(fe.clientX,fe.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",le)}},q=ie=>{R.current={x:ie.clientX,y:ie.clientY},V.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",re),document.addEventListener("pointercancel",re)},Z=ie=>{ie.touches.length>0&&(R.current={x:ie.touches[0].clientX,y:ie.touches[0].clientY},V.current=!1,document.addEventListener("touchmove",le,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return y.addEventListener("pointerdown",q),y.addEventListener("touchstart",Z),()=>{y.removeEventListener("pointerdown",q),y.removeEventListener("touchstart",Z),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",re),document.removeEventListener("pointercancel",re),document.removeEventListener("touchmove",le),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),R.current=null,V.current=!1}},[e,D,c]);const ce={backgroundColor:P.color,backdropFilter:`blur(${P.blur}px)`,animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:xr.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:A,className:he(G.background,v?oe:ue,{[G.editor]:i},{[G.hidden]:!e}),style:{...ce,...p&&!i&&!v?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?A:null,className:he(G.contentStyle,v?me:ee,{[G.editor]:i},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(dr,{onMove:y=>m(y.index),ref:x,className:G.lightboxSplide,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,direction:f.direction==="horiz"||f.type==="fade"||f.type==="scale"?"ltr":"ttb",pagination:!1,drag:K.type==="drag"&&!D,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:K.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((y,O)=>{const Y=Ut(N.position,N.offset,i),J=`${_.scalingValue(N.padding.top,i)} ${_.scalingValue(N.padding.right,i)} ${_.scalingValue(N.padding.bottom,i)} ${_.scalingValue(N.padding.left,i)}`,le=f.type==="scale"?(()=>{const{transform:ae,...re}=Y;return{...re,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":ae||"none"}})():{...Y,position:"absolute",padding:J,boxSizing:"border-box"};return a.jsx(mr,{children:a.jsx("div",{className:G.imgWrapper,onClick:ne,children:a.jsx("img",{ref:O===l?U:null,className:he(G.imageStyle,{[G.contain]:y.image.objectFit==="contain",[G.cover]:y.image.objectFit==="cover",[G.scaleSlide]:f.type==="scale"}),src:y.image.url,alt:y.image.name??"",style:{...le,pointerEvents:y.image.objectFit==="contain"?"none":"auto"}})})},O)})},c),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:he(G.arrow,{[G.arrowVertical]:f.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${_.scalingValue(I.offset.x,i)}, ${_.scalingValue(I.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${I.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var y;return(y=x.current)==null?void 0:y.go("-1")},"aria-label":"Previous",children:[I.arrowsImgUrl&&a.jsx(Xe,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:he(G.arrowImg,G.mirror)}),!I.arrowsImgUrl&&a.jsx($o,{color:I.color,className:he(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:he(G.arrow,G.nextArrow,{[G.arrowVertical]:f.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${_.scalingValue(I.offset.x*(f.direction==="horiz"?-1:1),i)}, ${_.scalingValue(I.offset.y,i)}) scale(${I.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var y;return(y=x.current)==null?void 0:y.go("+1")},"aria-label":"Next",children:[I.arrowsImgUrl&&a.jsx(Xe,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:G.arrowImg}),!I.arrowsImgUrl&&a.jsx($o,{color:I.color,className:he(G.arrowIcon,G.arrowImg)})]})})]}),P.closeIconUrl&&(()=>{const y=Ut(P.closeIconAlign,P.closeIconOffset,i),O=`scale(${P.closeIconScale})`,Y=y.transform?`${y.transform} ${O}`:O;return a.jsx("button",{className:G.closeButton,style:{...y,transform:Y},onClick:B,"aria-label":"Close lightbox",children:a.jsx(Xe,{url:P.closeIconUrl,fill:P.closeIconColor??"#000000",hoverFill:P.closeIconHover??"#cccccc"})})})(),$&&$.isActive&&o.imageCaption&&((F=n[l])==null?void 0:F.imageCaption)&&(()=>{const{widthSettings:y,fontSettings:O,letterSpacing:Y,textAlign:J,wordSpacing:le,fontSizeLineHeight:ae,textAppearance:re,color:ge}=o.imageCaption;return a.jsx("div",{className:G.caption,style:{...Ut($.alignment,$.offset,i),fontFamily:yn(O.fontFamily),fontWeight:O.fontWeight,fontStyle:O.fontStyle,width:y.sizing==="auto"?"max-content":_.scalingValue(y.width,i),letterSpacing:_.scalingValue(Y,i),wordSpacing:_.scalingValue(le,i),textAlign:J,fontSize:_.scalingValue(ae.fontSize,i),lineHeight:_.scalingValue(ae.lineHeight,i),textTransform:re.textTransform??"none",textDecoration:re.textDecoration??"none",fontVariant:re.fontVariant??"normal",color:ge},onClick:q=>q.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":$.linkColor,"--link-hover-color":$.linkHoverColor},children:a.jsx(Mt,{content:n[l].imageCaption})})})})(),L.isActive&&(()=>{const[y,O]=L.position.split("-"),Y=f.direction==="horiz"?`${y}-left`:L.position,J=Ut(Y,L.offset,i),le=()=>{if(f.direction==="horiz"){if(O==="left")return"flex-start";if(O==="center")return"center";if(O==="right")return"flex-end"}else{if(y==="top")return"flex-start";if(y==="middle")return"center";if(y==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:H,className:G.thumbsWrapper,onClick:ae=>se(ae),style:{position:i?"absolute":"fixed",...J,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:he(G.thumbsContainer,{[G.thumbsContainerVertical]:f.direction==="vert",[G.thumbsAlignStart]:L.align==="start",[G.thumbsAlignCenter]:L.align==="center",[G.thumbsAlignEnd]:L.align==="end"}),style:{gap:_.scalingValue(L.grid.gap,i),justifyContent:j?"flex-start":le()},children:n.map((ae,re)=>{const ge=re===l,q=C[re],X=L.grid.size*(ge?L.activeState.scale:1),pe=()=>{if(L.fit!=="fit")return{};if(!q)return f.direction==="horiz"?{height:_.scalingValue(X,i)}:{width:_.scalingValue(X,i)};const ie=q.width/q.height;if(f.direction==="horiz"){const fe=X,we=fe*ie;return{width:_.scalingValue(we,i),height:_.scalingValue(fe,i)}}else{const fe=X,we=fe/ie;return{width:_.scalingValue(fe,i),height:_.scalingValue(we,i)}}};return a.jsx("button",{className:G.thumbItem,style:{...f.direction==="horiz"&&L.fit!=="fit"?{height:_.scalingValue(X,i)}:{},...f.direction==="vert"&&L.fit!=="fit"?{width:_.scalingValue(X,i)}:{},...L.fit==="cover"?{width:_.scalingValue(X,i),height:_.scalingValue(X,i)}:{},...pe(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?L.activeState.opacity/100:L.opacity/100,"--thumb-hover":L.activeState.opacity/100},onClick:ie=>{var fe;ie.stopPropagation(),m(re),(fe=x.current)==null||fe.go(re)},onMouseEnter:()=>{var ie;L.triggers==="hov"&&((ie=x.current)==null||ie.go(re))},children:a.jsx("img",{src:ae.image.url,alt:ae.image.name??"",onLoad:ie=>{const fe=ie.currentTarget;fe.naturalWidth&&fe.naturalHeight&&b(we=>({...we,[re]:{width:fe.naturalWidth,height:fe.naturalHeight}}))},style:{objectFit:L.fit==="cover"?"cover":"contain",...L.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...L.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ae.image.name}-${re}`)})})})})()]})]}),document.getElementById(s))};function $o({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 Ts={element:ws,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function Gt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _s(e){return`
|
|
6
|
+
*/const ba="RichTextRenderer-module__link___BWeZ2",xa={link:ba},Sa=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},yn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Sa(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function ht(e){const{color:t,...n}=e;return n}function Re(e,t){var n,o,r;return{fontFamily:yn(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:k.scalingValue(e.letterSpacing,t),wordSpacing:k.scalingValue(e.wordSpacing,t),fontSize:k.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?k.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(r=e.textAppearance)==null?void 0:r.fontVariant,color:e.color}}const xt=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?a.jsx("a",{className:xa.link,href:o.value,target:o.target,children:t(o.children)},r):a.jsx("span",{style:Ca(o),children:o.text},r));return a.jsx(a.Fragment,{children:e.map((n,o)=>{const r=n.children;return a.jsx("div",{children:t(r)},o)})})};function Ca(e){return{...e.fontFamily&&{fontFamily:yn(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const wa="SvgImage-module__svg___q3xE-",$a="SvgImage-module__img___VsTm-",vo={svg:wa,img:$a},Ta=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},_a=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Xe=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:r})=>{const[s,i]=m.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return m.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(u)}},[]),!Ta(e)||!s?a.jsx("img",{src:e,alt:"",className:he(vo.img,o),style:r}):a.jsx("span",{"data-supports-mask":s,className:he(vo.svg,o),style:{"--svg":_a(e),"--fill":t,"--hover-fill":n,...r??{}}})},Ea={"top-left":ne.topLeftAlignment,"top-center":ne.topCenterAlignment,"top-right":ne.topRightAlignment,"middle-left":ne.middleLeftAlignment,"middle-center":ne.middleCenterAlignment,"middle-right":ne.middleRightAlignment,"bottom-left":ne.bottomLeftAlignment,"bottom-center":ne.bottomCenterAlignment,"bottom-right":ne.bottomRightAlignment};function ka({settings:e,content:t,styles:n,isEditor:o}){const[r,s]=m.useState(null),{widthSettings:i,fontSettings:u,letterSpacing:l,textAlign:g,wordSpacing:c,fontSizeLineHeight:_,textAppearance:C,color:y}=n.imageCaption,[p,d]=m.useState(void 0),[S,h]=m.useState(null),[v,T]=m.useState(0),[O,P]=m.useState(0),{direction:E,transition:f,controls:w,pagination:R,imageCaption:V,triggers:L}=e,N=m.useRef(f.type),{x:W,y:B}=e.controls.offset,D=b=>{r&&r.go(b)};return m.useEffect(()=>{if(!S)return;const b=new ResizeObserver(F=>{if(!r)return;const[A]=F;d({width:Math.round(A.contentRect.width),height:Math.round(A.contentRect.height)})});return b.observe(S),()=>b.unobserve(S)},[S]),m.useEffect(()=>{!r||N.current===f.type||(P(b=>b+1),N.current=f.type)},[f.type]),a.jsx("div",{className:he(ne.wrapper,{[ne.editor]:o}),ref:h,children:a.jsxs("div",{className:ne.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:f.backgroundColor&&f.type==="fade in"?f.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:he(ne.captionBlock),children:a.jsx("div",{className:ne.captionTextWrapper,children:t.map((b,F)=>a.jsx("div",{className:he(ne.captionText,Ea[V.alignment],{[ne.withPointerEvents]:F===v&&o,[ne.active]:F===v}),style:{fontFamily:yn(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:i.sizing==="auto"?"max-content":k.scalingValue(i.width,o),letterSpacing:k.scalingValue(l,o),wordSpacing:k.scalingValue(c,o),textAlign:g,fontSize:k.scalingValue(_.fontSize,o),lineHeight:k.scalingValue(_.lineHeight,o),textTransform:C.textTransform??"none",textDecoration:C.textDecoration??"none",fontVariant:C.fontVariant??"normal",color:y,transitionDuration:f.duration?`${Math.round(parseInt(f.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ne.captionTextInner,style:{"--link-hover-color":V.linkHoverColor,"--link-color":V.linkColor,position:"relative",top:k.scalingValue(V.offset.y,o),left:k.scalingValue(V.offset.x,o)},children:a.jsx(xt,{content:b.imageCaption})})},F))})}),a.jsx(pr,{onMove:b=>{T(b.index)},ref:s,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:E==="horiz"||f.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:f.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((b,F)=>a.jsx(dr,{children:a.jsx("div",{className:ne.sliderItem,children:a.jsx("div",{className:ne.imgWrapper,children:a.jsx("img",{className:he(ne.sliderImage,{[ne.contain]:b.image.objectFit==="contain",[ne.cover]:b.image.objectFit==="cover"}),src:b.image.url,alt:b.image.name??""})})})},F))},O),w.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:he(ne.arrow,{[ne.arrowVertical]:E==="vert",[ne.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{onClick:()=>{D("-1")},className:ne.arrowInner,style:{transform:`translate(${k.scalingValue(W,o)}, ${k.scalingValue(B*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx(Xe,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:he(ne.arrowImg,ne.mirror)}),!w.arrowsImgUrl&&a.jsx(bo,{color:w.color,className:he(ne.arrowIcon,ne.arrowImg,ne.mirror)})]})}),a.jsx("div",{className:he(ne.arrow,ne.nextArrow,{[ne.arrowVertical]:E==="vert",[ne.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{className:ne.arrowInner,onClick:()=>D("+1"),style:{transform:`translate(${k.scalingValue(W*(E==="horiz"?-1:1),o)}, ${k.scalingValue(B,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx(Xe,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ne.arrowImg}),!w.arrowsImgUrl&&a.jsx(bo,{color:w.color,className:he(ne.arrowIcon,ne.arrowImg)})]})})]}),L.triggersList.click&&a.jsx("div",{className:ne.clickOverlay,onClick:()=>{r&&r.go("+1")}}),R.isActive&&a.jsx("div",{className:he(ne.pagination,{[ne.paginationInsideBottom]:R.position==="inside-1"&&E==="horiz",[ne.paginationInsideTop]:R.position==="inside-2"&&E==="horiz",[ne.paginationOutsideBottom]:R.position==="outside-1"&&E==="horiz",[ne.paginationOutsideTop]:R.position==="outside-2"&&E==="horiz",[ne.paginationInsideLeft]:R.position==="inside-1"&&E==="vert",[ne.paginationInsideRight]:R.position==="inside-2"&&E==="vert",[ne.paginationOutsideLeft]:R.position==="outside-1"&&E==="vert",[ne.paginationOutsideRight]:R.position==="outside-2"&&E==="vert",[ne.paginationVertical]:E==="vert"}),children:a.jsx("div",{className:ne.paginationInner,style:{backgroundColor:R.colors[2],transform:`scale(${R.scale/100}) translate(${k.scalingValue(R.offset.x,o)}, ${k.scalingValue(R.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((b,F)=>a.jsx("button",{onClick:()=>{r&&r.go(F)},className:he(ne.paginationItem),children:a.jsx("div",{className:he(ne.dot,{[ne.activeDot]:F===v}),style:{backgroundColor:F===v?R.colors[0]:R.colors[1],"--pagination-hover-color":R.hover}})},F))})})]})})}function bo({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 Aa={element:ka,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"outside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},La="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Ia="ImageRevealSlider-module__image___Qjt-e",Fa="ImageRevealSlider-module__link___N-iLG",Ra="ImageRevealSlider-module__cursor___2U03d",ut={imageRevealSlider:La,image:Ia,link:Fa,cursor:Ra};function xo(e,t,n){for(const o of n){const r=new Image;r.src=o.url;const s=o.width?Number.parseFloat(o.width):r.naturalWidth,i=r.naturalHeight/r.naturalWidth*s,u=s/2,l=i/2;if(e>=o.x-u&&e<=o.x+u&&t>=o.y-l&&t<=o.y+l)return!0}return!1}function wn(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Ma(e,t,n,o){let r,s;if(t==="custom"){r=n;const i=await wn(e);s=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await wn(e);s=i.height/i.width*r}else{const i=await wn(e);r=i.width,s=i.height}return{width:r,height:s,finalWidth:`${r}px`}}function Pa({settings:e,content:t,isEditor:n}){const[o,r]=m.useState(null),[s,i]=m.useState([]),[u,l]=m.useState(0),g=m.useRef(0),[c,_]=m.useState({x:0,y:0}),[C,y]=m.useState(1),[p,d]=m.useState("none"),S=m.useRef({x:0,y:0}),[h,v]=m.useState(!1),{sizeType:T,imageWidth:O,randomRangeImageWidth:P}=e.imageSize,{revealPosition:E,visible:f}=e.position,{cursorType:w,target:R,defaultCursorScale:V,defaultCursor:L,hoverCursorScale:N,hoverCursor:W}=e.cursor;m.useEffect(()=>{if(!o)return;const b=(I,$)=>{const j=o.getBoundingClientRect(),Z=I-j.left,ce=$-j.top;if(_({x:Z,y:ce}),w==="system"){d("none"),y(1);return}const re=Z,ge=ce,H=document.elementFromPoint(j.left+re,j.top+ge);if(H&&H.closest("a")){d("none"),y(1);return}const oe=xo(re,ge,s)||R==="area"?{img:W??"none",scale:N}:{img:L??"none",scale:V};d(oe.img),y(oe.scale)},F=I=>{I.stopPropagation(),S.current={x:I.clientX,y:I.clientY},b(I.clientX,I.clientY)},A=()=>{h&&b(S.current.x,S.current.y)};return o.addEventListener("mousemove",F),window.addEventListener("scroll",A,!0),()=>{o.removeEventListener("mousemove",F),window.removeEventListener("scroll",A,!0)}},[o,h,c,w,R,W,L,N,V,s]),m.useEffect(()=>{h||(d("none"),y(0))},[h]);const B=async(b,F,A,I={})=>{const{width:$,height:j,finalWidth:Z}=await Ma(b.image.url,T,O,P);let ce=0,re=0;E==="same"?(ce=F/2,re=A/2):(ce=I.x??Math.random()*F,re=I.y??Math.random()*A);const ge=Math.min(Math.max(ce,$/2),F-$/2),H=Math.min(Math.max(re,j/2),A-j/2);return{id:g.current++,url:b.image.url,link:b.link,name:b.image.name,x:ge,y:H,width:Z}};m.useEffect(()=>{if(!o||t.length===0)return;const b=o.getBoundingClientRect(),F=b.width,A=b.height,I=[];(async()=>{const j=t[0],Z=await B(j,F,A);I.push(Z),i(I),l(1)})()},[T,O,P,E,o]),m.useEffect(()=>{f==="last One"&&i(b=>b.length>0?[b[b.length-1]]:[])},[f]);const D=async b=>{if(!o)return;const F=o.getBoundingClientRect(),A=b.clientX-F.left,I=b.clientY-F.top;if(R==="image"&&!xo(A,I,s))return;let $=0,j=0;E==="on Click"?($=A,j=I):E==="same"?($=F.width/2,j=F.height/2):($=Math.random()*F.width,j=Math.random()*F.height);const Z=t[u],ce=await B(Z,F.width,F.height,{x:$,y:j});i(re=>f==="all"?[...re,ce]:[ce]),l(re=>re>=t.length-1?0:re+1)};return a.jsxs("div",{ref:r,onClick:D,onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),className:ut.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[s.map(b=>a.jsx("div",{className:ut.wrapper,style:{top:`${b.y}px`,left:`${b.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:b.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:R==="area"&&b.link?a.jsx("a",{href:b.link,target:"_blank",className:ut.link,children:a.jsx("img",{src:b.url,alt:b.name,className:ut.image},b.id)}):a.jsx("img",{src:b.url,alt:b.name,className:ut.image},b.id)},b.id)),h&&a.jsx("div",{className:ut.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${C})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Wa={element:Pa,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{width:"100%",height:"100%"},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Ha="LightBox-module__hidden___9s-9x",Na="LightBox-module__heroImage___sTxNF",ja="LightBox-module__background___rm9ml",Va="LightBox-module__editor___4ACaY",za="LightBox-module__contentStyle___Bgnsq",Ba="LightBox-module__imageStyle___tLIlB",Oa="LightBox-module__imgWrapper___LuFUp",Da="LightBox-module__contain___8-yaS",qa="LightBox-module__cover___hNvOG",Ua="LightBox-module__caption___b6L2I",Ga="LightBox-module__captionTextInner___rCGNH",Ka="LightBox-module__lightboxSplide___XFuWC",Ya="LightBox-module__arrow___iz38X",Xa="LightBox-module__arrowVertical___Zfz81",Za="LightBox-module__nextArrow___zkAQN",Ja="LightBox-module__arrowInner___p48sW",Qa="LightBox-module__arrowIcon___3VaFf",es="LightBox-module__arrowImg___pNV88",ts="LightBox-module__mirror___pjeXc",ns="LightBox-module__thumbsWrapper___GB-nU",os="LightBox-module__thumbsContainerVertical___wttk5",rs="LightBox-module__thumbsContainer___osSma",is="LightBox-module__thumbsAlignStart___MO6tY",as="LightBox-module__thumbsAlignCenter___Q4sUx",ss="LightBox-module__thumbsAlignEnd___p4y9R",ls="LightBox-module__thumbItem___HvnF3",cs="LightBox-module__closeButton___g2khP",us="LightBox-module__fadeIn___0m5GW",ps="LightBox-module__slideInLeft___gPYwC",ds="LightBox-module__slideInRight___S-pPp",ms="LightBox-module__slideInTop___DFdAj",gs="LightBox-module__slideInBottom___m27kZ",fs="LightBox-module__fadeOut___55qBR",hs="LightBox-module__slideOutLeft___NvU7P",ys="LightBox-module__slideOutRight___SK7eC",vs="LightBox-module__slideOutTop___Vgg0z",bs="LightBox-module__slideOutBottom___nJ0Ef",xs="LightBox-module__scaleSlide___vZriG",G={hidden:Ha,heroImage:Na,background:ja,editor:Va,contentStyle:za,imageStyle:Ba,imgWrapper:Oa,contain:Da,cover:qa,caption:Ua,captionTextInner:Ga,lightboxSplide:Ka,arrow:Ya,arrowVertical:Xa,nextArrow:Za,arrowInner:Ja,arrowIcon:Qa,arrowImg:es,mirror:ts,thumbsWrapper:ns,thumbsContainerVertical:os,thumbsContainer:rs,thumbsAlignStart:is,thumbsAlignCenter:as,thumbsAlignEnd:ss,thumbItem:ls,closeButton:cs,fadeIn:us,slideInLeft:ps,slideInRight:ds,slideInTop:ms,slideInBottom:gs,fadeOut:fs,slideOutLeft:hs,slideOutRight:ys,slideOutTop:vs,slideOutBottom:bs,scaleSlide:xs},Ut=(e,t,n)=>{const o={},[r,s]=e.split("-");return r==="top"?(o.top="0",o.bottom="auto"):r==="middle"?(o.top="50%",o.bottom="auto"):r==="bottom"&&(o.top="auto",o.bottom="0"),s==="left"?(o.left="0",o.right="auto"):s==="center"?(o.left="50%",o.right="auto"):s==="right"&&(o.left="auto",o.right="0"),r==="middle"&&s==="center"?o.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), calc(-50% + ${k.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${k.scalingValue(t.x,n)}, calc(-50% + ${k.scalingValue(t.y,n)}))`:s==="center"?o.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), ${k.scalingValue(t.y,n)})`:o.transform=`translate(${k.scalingValue(t.x,n)}, ${k.scalingValue(t.y,n)})`,o};function mr(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function So(e){const t=e.getBoundingClientRect(),n=mr(e),o=Math.max(0,t.width-n.left-n.right),r=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,i=e.naturalHeight,u=o/r,l=s/i;let g,c;l>u?(g=o,c=o/l):(c=r,g=r*l);const _=t.left+n.left,C=t.top+n.top,y=(o-g)/2+_,p=(r-c)/2+C;return{x:y,y:p,width:g,height:c}}function Co(e){const t=e.getBoundingClientRect(),n=mr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function wo(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(r=>parseFloat(r.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ss(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})(),r=(()=>{if(e==="fade in"||e==="mix")return G.fadeOut;if(e==="slide in")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})(),s=(()=>{if(e==="fade in")return G.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:r,disappearClass:s}}const Cs=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:s})=>{const[i,u]=m.useState(!1),{url:l}=e.thumbnailBlock.cover;return m.useEffect(()=>{r==="close"&&u(!1),r==="open"&&u(!0)},[r]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:l,alt:"Cover",className:G.heroImage,onClick:()=>u(!0)}),a.jsx(ws,{isOpen:i,onClose:()=>u(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:s})]})},ws=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:s,isEditor:i,metadata:u})=>{var M;const[l,g]=m.useState(0),[c,_]=m.useState(0),[C,y]=m.useState(!1),[p,d]=m.useState(!1),[S,h]=m.useState({}),v=m.useRef(null),T=m.useRef(null),O=m.useRef(null),P=m.useRef(!1),E=m.useRef(null),f=m.useRef(null),w=m.useRef(null),R=m.useRef(null),V=m.useRef(!1),L=m.useRef(null),[N,W]=m.useState(!1),{appear:B,triggers:D,slider:b,thumbnail:F,controls:A,area:I,caption:$,layout:j}=r.lightboxBlock,{appearClass:Z,backdropAppearClass:ce,backdropDisappearClass:re,disappearClass:ge}=Ss(B.type,B.direction),H=(u==null?void 0:u.itemId)??null;m.useEffect(()=>{const x=()=>{setTimeout(()=>{var K,Q;(Q=(K=v.current)==null?void 0:K.splide)==null||Q.refresh()},16)},U=()=>{_(K=>K+1)};return window.addEventListener("ArticleEditor.Layout:change",x),window.addEventListener("ArticleEditor.ComponentContent:change",U),()=>{window.removeEventListener("ArticleEditor.Layout:change",x),window.removeEventListener("ArticleEditor.ComponentContent:change",U)}},[]),m.useEffect(()=>{if(!e||!F.isActive){W(!1);return}const x=L.current;if(!x)return;const U=()=>{b.direction==="horiz"?W(x.scrollWidth>x.clientWidth):W(x.scrollHeight>x.clientHeight)};U();const K=new ResizeObserver(U);return K.observe(x),()=>K.disconnect()},[e,F.isActive,n.length,S,b.direction]);const oe=m.useCallback(()=>{const x=window.matchMedia("(max-width: 768px)").matches,U=wo(I.color);x&&!i&&U>.9&&(document.body.style.backgroundColor=""),y(!0),P.current=!0;const K=Q=>{Q.target===E.current&&Q.animationName&&(E.current&&f.current&&E.current.removeEventListener("animationend",f.current),f.current=null,P.current&&(P.current=!1,t()),y(!1))};E.current&&(f.current=K,E.current.addEventListener("animationend",K))},[t,I.color,i]),te=(x,U,K)=>{var Q,le;if(x){if(D.type==="click"&&D.switch==="image")D.repeat==="close"&&l===n.length-1?oe():(Q=v.current)==null||Q.go("+1");else if(D.type==="click"&&D.switch==="50/50"){const ae=x.getBoundingClientRect(),ie=U-ae.left,fe=K-ae.top,q=ae.width,X=ae.height;let Y;b.direction==="horiz"?Y=ie<q/2?"-1":"+1":Y=fe<X/2?"-1":"+1",(le=v.current)==null||le.go(Y)}}},J=x=>{if(V.current){V.current=!1;return}const U=n[l],K=(U==null?void 0:U.image.objectFit)==="cover";let Q,le;if("changedTouches"in x&&x.changedTouches.length>0)Q=x.changedTouches[0].clientX,le=x.changedTouches[0].clientY;else if("clientX"in x)Q=x.clientX,le=x.clientY;else return;let ae;if(K&&O.current){const ie=Co(O.current);ae=Q>=ie.left&&Q<=ie.right&&le>=ie.top&&le<=ie.bottom}else{const ie=O.current?So(O.current):null;if(!ie){x.target===x.currentTarget&&oe();return}ae=Q>=ie.x&&Q<=ie.x+ie.width&&le>=ie.y&&le<=ie.y+ie.height}ae?te(O.current,Q,le):oe()},se=x=>{const U=x.target;(U.classList.contains(G.thumbsWrapper)||U.classList.contains(G.thumbsContainer))&&J(x)};m.useEffect(()=>{if(!e)return;const x=U=>{var K,Q;if(U.key==="Escape"){oe();return}if(U.key==="ArrowRight"){g(le=>(le+1)%Math.max(n.length,1)),(K=v.current)==null||K.go("+1");return}U.key==="ArrowLeft"&&(g(le=>(le-1+Math.max(n.length,1))%Math.max(n.length,1)),(Q=v.current)==null||Q.go("-1"))};return window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x)}},[e,oe,n.length]),m.useEffect(()=>{if(e){if(g(0),_(U=>U+1),P.current=!1,y(!1),d(!1),h({}),!H)return;const x=new CustomEvent("page-overlay",{detail:{itemId:H}});window.dispatchEvent(x)}return()=>{E.current&&f.current&&(E.current.removeEventListener("animationend",f.current),f.current=null),d(!1)}},[e,H]),m.useEffect(()=>{T.current!==null&&T.current!==b.type&&_(x=>x+1),T.current=b.type},[b.type]),m.useEffect(()=>{if(!e)return;const x=document.body.style.overflow,U=window.matchMedia("(max-width: 768px)").matches,K=wo(I.color);document.body.style.overflow="hidden",d(!1);const Q=ae=>{ae.target===E.current&&!P.current&&ae.animationName&&(U&&!i&&K>.9&&(document.body.style.backgroundColor=I.color),d(!0),E.current&&w.current&&E.current.removeEventListener("animationend",w.current),w.current=null)};E.current&&(w.current=Q,E.current.addEventListener("animationend",Q));const le=ae=>{const ie=ae.target;ie&&(ie.closest(`.${G.thumbsWrapper}`)||ie.closest(`.${G.thumbsContainer}`))||b.type!=="slide"&&ae.preventDefault()};return document.addEventListener("touchmove",le,{passive:!1}),()=>{document.body.style.overflow=x,document.removeEventListener("touchmove",le),E.current&&w.current&&(E.current.removeEventListener("animationend",w.current),w.current=null),d(!1)}},[e,i,I.color,b.type]),m.useEffect(()=>{if(!e)return;const x=U=>{var Q,le;if(P.current){U.stopPropagation();return}if(V.current){V.current=!1;return}const K=U.target;if(!(K&&(K.closest(`.${G.thumbsContainer}`)||K.closest(`.${G.thumbItem}`)))){if(b.type==="slide"&&D.type==="drag"&&((le=(Q=v.current)==null?void 0:Q.splide)!=null&&le.root)){const ae=v.current.splide.root;if(K&&(ae.contains(K)||ae===K))return}if(U.touches.length===0&&U.changedTouches.length>0){const ae=n[l],ie=(ae==null?void 0:ae.image.objectFit)==="cover",fe=U.changedTouches[0];let q;if(ie&&O.current){const X=Co(O.current);q=fe.clientX>=X.left&&fe.clientX<=X.right&&fe.clientY>=X.top&&fe.clientY<=X.bottom}else{const X=O.current?So(O.current):null;if(!X)return;q=fe.clientX>=X.x&&fe.clientX<=X.x+X.width&&fe.clientY>=X.y&&fe.clientY<=X.y+X.height}if(!q){U.stopPropagation(),P.current=!0;const X=Y=>{Y.stopPropagation(),Y.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),oe()}}}};return document.addEventListener("touchend",x,{passive:!0}),()=>{document.removeEventListener("touchend",x)}},[e,oe,l,n]);const z=(b.type==="scale"||b.type==="fade")&&b.direction==="vert"&&D.type==="drag";m.useEffect(()=>{var Y,ue;if(!e||!z||!((ue=(Y=v.current)==null?void 0:Y.splide)!=null&&ue.root))return;const x=v.current.splide.root,U=30,K=(ee,me)=>{if(R.current){const Ce=Math.abs(ee-R.current.x),we=Math.abs(me-R.current.y);(Ce>0||we>0)&&(V.current=!0)}},Q=ee=>{R.current&&(ee.preventDefault(),K(ee.clientX,ee.clientY))},le=ee=>{R.current&&ee.touches.length>0&&(ee.preventDefault(),K(ee.touches[0].clientX,ee.touches[0].clientY))},ae=(ee,me)=>{if(!R.current||!v.current){R.current=null;return}const Ce=Math.abs(ee-R.current.x),we=Math.abs(me-R.current.y);we>U&&we>Ce&&v.current.go(me<R.current.y?"+1":"-1"),R.current=null},ie=ee=>{R.current&&ae(ee.clientX,ee.clientY),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("pointermove",Q)},fe=ee=>{if(R.current){if(ee.changedTouches.length>0){const me=ee.changedTouches[0];ae(me.clientX,me.clientY)}document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),document.removeEventListener("touchmove",le)}},q=ee=>{R.current={x:ee.clientX,y:ee.clientY},V.current=!1,document.addEventListener("pointermove",Q,{passive:!1}),document.addEventListener("pointerup",ie),document.addEventListener("pointercancel",ie)},X=ee=>{ee.touches.length>0&&(R.current={x:ee.touches[0].clientX,y:ee.touches[0].clientY},V.current=!1,document.addEventListener("touchmove",le,{passive:!1}),document.addEventListener("touchend",fe),document.addEventListener("touchcancel",fe))};return x.addEventListener("pointerdown",q),x.addEventListener("touchstart",X),()=>{x.removeEventListener("pointerdown",q),x.removeEventListener("touchstart",X),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("touchmove",le),document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),R.current=null,V.current=!1}},[e,z,c]);const pe={backgroundColor:I.color,backdropFilter:`blur(${I.blur}px)`,animationDuration:`${parseInt(B.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:br.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:E,className:he(G.background,C?re:ce,{[G.editor]:i},{[G.hidden]:!e}),style:{...pe,...p&&!i&&!C?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?E:null,className:he(G.contentStyle,C?ge:Z,{[G.editor]:i},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(B.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(pr,{onMove:x=>g(x.index),ref:v,className:G.lightboxSplide,options:{arrows:!1,speed:b.duration?parseInt(b.duration):500,direction:b.direction==="horiz"||b.type==="fade"||b.type==="scale"?"ltr":"ttb",pagination:!1,drag:D.type==="drag"&&!z,perPage:1,width:"100%",height:"100%",type:b.type==="fade"||b.type==="scale"?"fade":"loop",padding:0,rewind:D.repeat!=="close",start:0},style:{"--splide-speed":b.duration},children:n.map((x,U)=>{const K=Ut(j.position,j.offset,i),Q=`${k.scalingValue(j.padding.top,i)} ${k.scalingValue(j.padding.right,i)} ${k.scalingValue(j.padding.bottom,i)} ${k.scalingValue(j.padding.left,i)}`,le=b.type==="scale"?(()=>{const{transform:ae,...ie}=K;return{...ie,position:"absolute",padding:Q,boxSizing:"border-box","--position-transform":ae||"none"}})():{...K,position:"absolute",padding:Q,boxSizing:"border-box"};return a.jsx(dr,{children:a.jsx("div",{className:G.imgWrapper,onClick:J,children:a.jsx("img",{ref:U===l?O:null,className:he(G.imageStyle,{[G.contain]:x.image.objectFit==="contain",[G.cover]:x.image.objectFit==="cover",[G.scaleSlide]:b.type==="scale"}),src:x.image.url,alt:x.image.name??"",style:{...le,pointerEvents:x.image.objectFit==="contain"?"none":"auto"}})})},U)})},c),A.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:he(G.arrow,{[G.arrowVertical]:b.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${k.scalingValue(A.offset.x,i)}, ${k.scalingValue(A.offset.y*(b.direction==="horiz"?1:-1),i)}) scale(${A.scale}) rotate(${b.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=v.current)==null?void 0:x.go("-1")},"aria-label":"Previous",children:[A.arrowsImgUrl&&a.jsx(Xe,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:he(G.arrowImg,G.mirror)}),!A.arrowsImgUrl&&a.jsx($o,{color:A.color,className:he(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:he(G.arrow,G.nextArrow,{[G.arrowVertical]:b.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${k.scalingValue(A.offset.x*(b.direction==="horiz"?-1:1),i)}, ${k.scalingValue(A.offset.y,i)}) scale(${A.scale}) rotate(${b.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=v.current)==null?void 0:x.go("+1")},"aria-label":"Next",children:[A.arrowsImgUrl&&a.jsx(Xe,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:G.arrowImg}),!A.arrowsImgUrl&&a.jsx($o,{color:A.color,className:he(G.arrowIcon,G.arrowImg)})]})})]}),I.closeIconUrl&&(()=>{const x=Ut(I.closeIconAlign,I.closeIconOffset,i),U=`scale(${I.closeIconScale})`,K=x.transform?`${x.transform} ${U}`:U;return a.jsx("button",{className:G.closeButton,style:{...x,transform:K},onClick:oe,"aria-label":"Close lightbox",children:a.jsx(Xe,{url:I.closeIconUrl,fill:I.closeIconColor??"#000000",hoverFill:I.closeIconHover??"#cccccc"})})})(),$&&$.isActive&&o.imageCaption&&((M=n[l])==null?void 0:M.imageCaption)&&(()=>{const{widthSettings:x,fontSettings:U,letterSpacing:K,textAlign:Q,wordSpacing:le,fontSizeLineHeight:ae,textAppearance:ie,color:fe}=o.imageCaption;return a.jsx("div",{className:G.caption,style:{...Ut($.alignment,$.offset,i),fontFamily:yn(U.fontFamily),fontWeight:U.fontWeight,fontStyle:U.fontStyle,width:x.sizing==="auto"?"max-content":k.scalingValue(x.width,i),letterSpacing:k.scalingValue(K,i),wordSpacing:k.scalingValue(le,i),textAlign:Q,fontSize:k.scalingValue(ae.fontSize,i),lineHeight:k.scalingValue(ae.lineHeight,i),textTransform:ie.textTransform??"none",textDecoration:ie.textDecoration??"none",fontVariant:ie.fontVariant??"normal",color:fe},onClick:q=>q.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":$.linkColor,"--link-hover-color":$.linkHoverColor},children:a.jsx(xt,{content:n[l].imageCaption})})})})(),F.isActive&&(()=>{const[x,U]=F.position.split("-"),K=b.direction==="horiz"?`${x}-left`:F.position,Q=Ut(K,F.offset,i),le=()=>{if(b.direction==="horiz"){if(U==="left")return"flex-start";if(U==="center")return"center";if(U==="right")return"flex-end"}else{if(x==="top")return"flex-start";if(x==="middle")return"center";if(x==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:G.thumbsWrapper,onClick:ae=>se(ae),style:{position:i?"absolute":"fixed",...Q,...b.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:he(G.thumbsContainer,{[G.thumbsContainerVertical]:b.direction==="vert",[G.thumbsAlignStart]:F.align==="start",[G.thumbsAlignCenter]:F.align==="center",[G.thumbsAlignEnd]:F.align==="end"}),style:{gap:k.scalingValue(F.grid.gap,i),justifyContent:N?"flex-start":le()},children:n.map((ae,ie)=>{const fe=ie===l,q=S[ie],Y=F.grid.size*(fe?F.activeState.scale:1),ue=()=>{if(F.fit!=="fit")return{};if(!q)return b.direction==="horiz"?{height:k.scalingValue(Y,i)}:{width:k.scalingValue(Y,i)};const ee=q.width/q.height;if(b.direction==="horiz"){const me=Y,Ce=me*ee;return{width:k.scalingValue(Ce,i),height:k.scalingValue(me,i)}}else{const me=Y,Ce=me/ee;return{width:k.scalingValue(me,i),height:k.scalingValue(Ce,i)}}};return a.jsx("button",{className:G.thumbItem,style:{...b.direction==="horiz"&&F.fit!=="fit"?{height:k.scalingValue(Y,i)}:{},...b.direction==="vert"&&F.fit!=="fit"?{width:k.scalingValue(Y,i)}:{},...F.fit==="cover"?{width:k.scalingValue(Y,i),height:k.scalingValue(Y,i)}:{},...ue(),transition:fe?"all 0.25s ease-out":"none",opacity:fe?F.activeState.opacity/100:F.opacity/100,"--thumb-hover":F.activeState.opacity/100},onClick:ee=>{var me;ee.stopPropagation(),g(ie),(me=v.current)==null||me.go(ie)},onMouseEnter:()=>{var ee;F.triggers==="hov"&&((ee=v.current)==null||ee.go(ie))},children:a.jsx("img",{src:ae.image.url,alt:ae.image.name??"",onLoad:ee=>{const me=ee.currentTarget;me.naturalWidth&&me.naturalHeight&&h(Ce=>({...Ce,[ie]:{width:me.naturalWidth,height:me.naturalHeight}}))},style:{objectFit:F.fit==="cover"?"cover":"contain",...F.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...F.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ae.image.name}-${ie}`)})})})})()]})]}),document.getElementById(s))};function $o({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const $s={element:Cs,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function Gt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ts(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
position: relative;
|
|
140
140
|
height: auto;
|
|
141
141
|
}
|
|
142
|
-
`}function
|
|
142
|
+
`}function _s({settings:e,isEditor:t,metadata:n,activeEvent:o}){const{prefix:r}=k.useScopedStyles(),{type:s="A",fieldsToShow:i=2,fields:u=[],buttonLabel:l,gap:g,fieldsGap:c,buttonCorners:_,buttonStroke:C,buttonPadding:y,isButtonFullWidth:p,inputCorners:d,inputStroke:S,inputPadding:h,inputColor:v,inputTextColor:T,inputBorderColor:O,placeholderColor:P,buttonColor:E,buttonTextColor:f,buttonBorderColor:w,labelTextColor:R,successColor:V,errorColor:L,fontFamily:N,inputFontSettings:W,inputFontSize:B,inputLineHeight:D,inputLetterSpacing:b,inputWordSpacing:F,inputTextAppearance:A,buttonFontSettings:I,buttonFontSize:$,buttonLineHeight:j,buttonLetterSpacing:Z,buttonWordSpacing:ce,buttonTextAppearance:re,labelFontSettings:ge,labelFontSize:H,labelLineHeight:oe,labelLetterSpacing:te,labelWordSpacing:J,labelTextAppearance:se,statusFontSettings:z,statusFontSize:pe,statusLineHeight:M,statusLetterSpacing:x,statusWordSpacing:U,statusTextAppearance:K,successMessage:Q,errorMessage:le,stateOverrides:ae}=e,ie=s==="B",fe=u.slice(0,Math.min(i,u.length)),q={fontSettings:{fontFamily:N,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:B??.01,lineHeight:D,letterSpacing:b??0,wordSpacing:F??0,textAppearance:A,color:T},X=ht(Re(q,t)),Y=k.scalingValue(S??0,t),ue=k.scalingValue((D??B??.01)+((h==null?void 0:h.top)??0)+((h==null?void 0:h.bottom)??0)+(s==="C"?S??0:(S??0)*2),t),ee={...X,borderStyle:"solid",borderRadius:s==="C"?0:k.scalingValue(d??0,t),...s==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Y,borderLeftWidth:0}:{borderWidth:Y},paddingTop:k.scalingValue((h==null?void 0:h.top)??0,t),paddingRight:k.scalingValue((h==null?void 0:h.right)??0,t),paddingBottom:k.scalingValue((h==null?void 0:h.bottom)??0,t),paddingLeft:k.scalingValue((h==null?void 0:h.left)??0,t),height:ue,minHeight:ue},me={fontSettings:{fontFamily:N,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:$??.01,lineHeight:j,letterSpacing:Z??0,wordSpacing:ce??0,textAppearance:re,color:f},Ce=ht(Re(me,t)),we=k.scalingValue(C??0,t),lt={fontSettings:{fontFamily:N,fontWeight:(ge==null?void 0:ge.fontWeight)??400,fontStyle:(ge==null?void 0:ge.fontStyle)??"normal"},fontSize:H??.01,lineHeight:oe,letterSpacing:te??0,wordSpacing:J??0,textAppearance:se,color:R},Ke=Re(lt,t),xe={fontSettings:{fontFamily:N,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:pe??.01,lineHeight:M,letterSpacing:x??0,wordSpacing:U??0,textAppearance:K,color:V},Pe=ht(Re(xe,t)),nt=k.buildColorVars(r,{inputColor:v,inputTextColor:T,inputBorderColor:O,placeholderColor:P!=null&&P.trim()?P:"#cccccc",buttonColor:E,buttonTextColor:f,buttonBorderColor:w,labelTextColor:R,successColor:V,errorColor:L},Es,ks,ae),[$e,je]=m.useState(()=>Object.fromEntries(fe.map(ye=>[ye.name,""]))),[eo,$t]=m.useState("idle"),[gr,Ot]=m.useState(null),vn=o==="success"?"success":o==="error"?"error":eo,fr=o==="error"?le:gr,Dt=o==="filled",Tt=m.useMemo(()=>{if(!Dt)return $e;let ye=null;for(const Ve of fe)($e[Ve.name]??"").trim().length>0||(ye=ye??{...$e},ye[Ve.name]="Filled");return ye??$e},[$e,Dt,fe]),hr=vn==="error"?k.getFormFieldValidationError(fe,Tt):null,yr=`${o&&o!=="default"?`${r}-state-${o}`:""}`.trim(),to=n==null?void 0:n.submitUrl,no=(ye,Ve)=>{je(ze=>({...ze,[ye]:Ve}))},vr=async ye=>{ye.preventDefault();const Ve=Object.fromEntries(fe.map(Le=>{var ct;return[Le.name,((ct=$e[Le.name])==null?void 0:ct.trim())??""]}).filter(([,Le])=>Le));if(!to){$t("error"),Ot("No integrations were found for this form.");return}if(Object.keys(Ve).length===0)return;const ze=k.getFormFieldValidationError(fe,$e);if(ze){$t("error"),Ot(ze);return}$t("submitting"),Ot(null);try{const Le=await fetch(to,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ve)});if(!Le.ok){const ct=await Le.text();throw new Error(ct||`Request failed: ${Le.status}`)}$t("success"),je(Object.fromEntries(fe.map(ct=>[ct.name,""])))}catch(Le){$t("error"),Ot(Le instanceof Error?Le.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${r}-type-${s} ${yr}`.trim(),style:nt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ts(r)}}),a.jsxs("form",{onSubmit:vr,className:`${r}-form`,style:{gap:k.scalingValue(g??0,t)},children:[a.jsx("div",{className:`${r}-fields`,style:{gap:k.scalingValue(c??0,t)},children:fe.map((ye,Ve)=>a.jsxs("div",{className:`${r}-field-group${ie?` ${r}-labeled`:""}`,children:[ie&&a.jsx("span",{className:`${r}-field-label`,style:Ke?{...Ke,lineHeight:Ke.fontSize}:void 0,children:ye.label||ye.name}),ye.type==="textarea"?a.jsx("textarea",{name:ye.name,autoComplete:"off",value:Tt[ye.name]??"",onChange:ze=>no(ye.name,ze.target.value),placeholder:ye.placeholder,className:`${r}-input`,style:ee,rows:1,"data-filled":Dt||(Tt[ye.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:ye.type==="phone"?"tel":ye.type==="email"?"email":"text",name:ye.name,autoComplete:"off",value:Tt[ye.name]??"",onChange:ze=>no(ye.name,ze.target.value),placeholder:ye.placeholder,required:ye.isRequired??ye.type==="email",className:`${r}-input`,style:ee,"data-filled":Dt||(Tt[ye.name]??"").trim().length>0})]},Ve))}),a.jsx("div",{className:`${r}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${r}-button`,style:{borderStyle:"solid",borderRadius:k.scalingValue(_??0,t),borderWidth:we,paddingTop:k.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:k.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:k.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:k.scalingValue((y==null?void 0:y.left)??0,t),...Ce,...p?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${r}-overlay-anchor`,style:p?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:eo==="submitting"?"...":l})})})]}),vn==="success"&&a.jsx("p",{className:`${r}-success`,style:{...Pe},children:Q}),vn==="error"&&a.jsx("p",{className:`${r}-error`,style:{...Pe},role:"alert",children:hr??fr??le})]})}const Es={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"},ks=["hover","focus","filled","success","error"],As=`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
|
-
`,Ls=[{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"}],Kt={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Fs=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Rs={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Input Stroke",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Button Stroke",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Color",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Kt.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:{...Kt.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:{...Kt.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:{...Kt.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:Ls,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"",items:["inputPadding"]}]},{type:"group",title:"Button",items:[{type:"row",items:["isButtonFullWidth"]},{type:"row",items:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"",items:["buttonPadding"]}]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Fs],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"]},Ms={element:Es,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{width:300,height:42},schema:Rs,sourceCode:Is};function Yt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ps(e){return`
|
|
743
|
+
`,Ls=[{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"}],Kt={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Is=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Fs={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Input Stroke",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Button Stroke",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Color",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Kt.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:{...Kt.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:{...Kt.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:{...Kt.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:Ls,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"",items:["inputPadding"]}]},{type:"group",title:"Button",items:[{type:"row",items:["isButtonFullWidth"]},{type:"row",items:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"",items:["buttonPadding"]}]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Is],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"]},Rs={element:_s,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{width:300,height:42},schema:Fs,sourceCode:As};function Yt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ms(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: ${Yt(14)};
|
|
932
932
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
933
933
|
}
|
|
934
|
-
`}const
|
|
934
|
+
`}const Ps=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:r}=k.useScopedStyles(),{fields:s=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:i,buttonLabel:u,fieldsToShow:l=1,fontFamily:g,inputFontSettings:c,inputFontSize:_,inputLineHeight:C,inputLetterSpacing:y,inputWordSpacing:p,inputTextAppearance:d,buttonFontSettings:S,buttonFontSize:h,buttonLineHeight:v,buttonLetterSpacing:T,buttonWordSpacing:O,buttonTextAppearance:P,statusFontSettings:E,statusFontSize:f,statusLineHeight:w,statusLetterSpacing:R,statusWordSpacing:V,statusTextAppearance:L,iconMaxWidth:N,minHeight:W,corners:B,stroke:D,stateOverrides:b,inputPadding:F,buttonPadding:A,successMessage:I="Thanks for subscribing!",errorMessage:$="Please, fill all required fields."}=e,j=s.slice(0,Math.min(l,s.length)),[Z,ce]=m.useState(()=>Object.fromEntries(j.map(xe=>[xe.name,""]))),[re,ge]=m.useState("idle"),[H,oe]=m.useState(null),te=o==="success"?"success":o==="error"?"error":re,J=o==="error"?$:H,se=o==="filled",z=m.useMemo(()=>{if(!se)return Z;let xe=null;for(const Pe of j)(Z[Pe.name]??"").trim().length>0||(xe=xe??{...Z},xe[Pe.name]="Filled");return xe??Z},[se,Z,j]),pe=te==="error"?k.getFormFieldValidationError(j,z):null,M=o&&o!=="default"?`${r}-state-${o}`:"",x=j.some(xe=>(z[xe.name]??"").trim().length>0),U=M!==`${r}-state-filled`&&x?`${r}-state-filled`:"",K=`${M} ${U}`.trim(),Q=n==null?void 0:n.submitUrl,le=u??"",ae=(i==null?void 0:i.icon)??"",ie=(i==null?void 0:i.mode)==="On",fe=le||"Submit",q={fontSettings:{fontFamily:g,fontWeight:(c==null?void 0:c.fontWeight)??400,fontStyle:(c==null?void 0:c.fontStyle)??"normal"},fontSize:_??.01,lineHeight:C,letterSpacing:y??0,wordSpacing:p??0,textAppearance:d,color:e.inputTextColor??"#111111"},X={fontSettings:{fontFamily:g,fontWeight:(S==null?void 0:S.fontWeight)??400,fontStyle:(S==null?void 0:S.fontStyle)??"normal"},fontSize:h??.01,lineHeight:v,letterSpacing:T??0,wordSpacing:O??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},Y={fontSettings:{fontFamily:g,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:f??.01,lineHeight:w,letterSpacing:R??0,wordSpacing:V??0,textAppearance:L,color:e.successColor??"#22c55e"},ue=ht(Re(q,t)),ee=ht(Re(X,t)),me=ht(Re(Y,t)),Ce=k.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(q==null?void 0:q.color)??"#111111",buttonTextColor:e.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},Ws,Hs,b),we={borderRadius:k.scalingValue(B,t),borderWidth:k.scalingValue(D,t),borderStyle:"solid"},lt={borderLeftWidth:k.scalingValue(D,t)},Ke=async xe=>{xe.preventDefault();const Pe=Object.fromEntries(j.map($e=>{var je;return[$e.name,((je=Z[$e.name])==null?void 0:je.trim())??""]}).filter(([,$e])=>$e));if(!Q){ge("error"),oe("No integrations were found for this form.");return}if(Object.keys(Pe).length===0)return;const nt=k.getFormFieldValidationError(j,Z);if(nt){ge("error"),oe(nt);return}ge("submitting"),oe(null);try{const $e=await fetch(Q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Pe)});if(!$e.ok){const je=await $e.text();throw new Error(je||`Request failed: ${$e.status}`)}ge("success"),ce(Object.fromEntries(j.map(je=>[je.name,""])))}catch($e){ge("error"),oe($e instanceof Error?$e.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${K}`.trim(),style:Ce,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ms(r)}}),a.jsxs("form",{onSubmit:Ke,className:`${r}-form`,style:{...we,height:k.scalingValue(W,t),minHeight:k.scalingValue(W,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:j.map(xe=>a.jsx("input",{type:xe.type==="email"?"email":xe.type==="phone"?"tel":"text",name:xe.name,autoComplete:"off",value:z[xe.name]??"",onChange:Pe=>ce(nt=>({...nt,[xe.name]:Pe.target.value})),placeholder:xe.placeholder,required:xe.isRequired??xe.type==="email",className:`${r}-input`,style:{...ue,paddingRight:k.scalingValue(F.right,t),paddingLeft:k.scalingValue(F.left,t),paddingTop:k.scalingValue(F.top,t),paddingBottom:k.scalingValue(F.bottom,t)}},xe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${r}-submitBtn`,"aria-label":fe,style:{...ee,...lt,paddingRight:k.scalingValue(A.right,t),paddingLeft:k.scalingValue(A.left,t),paddingTop:k.scalingValue(A.top,t),paddingBottom:k.scalingValue(A.bottom,t)},children:re==="submitting"?"...":ie?ae&&a.jsx(Xe,{url:ae,className:`${r}-submitBtnIcon`,style:{maxWidth:k.scalingValue(N??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):le})})]}),te==="success"&&a.jsx("p",{className:`${r}-success`,style:{...me},children:I}),te==="error"&&a.jsx("p",{className:`${r}-error`,style:{...me},role:"alert",children:pe??J??$})]})},Ws={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"},Hs=["hover","focus","filled","success","error"],Ns=`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
|
-
`,Vs="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Bs=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],$n={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Os=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],zs={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...$n.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...$n.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...$n.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Bs,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Vs},fontFamily:"Arial",strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#0088D7",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:0,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:0,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonIcon"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Os],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"]},Ds={element:Ws,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{width:400,height:60},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:zs,sourceCode:js};function To(e){return`
|
|
1506
|
+
`,js="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Vs=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],$n={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},zs=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Bs={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...$n.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...$n.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...$n.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Vs,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:js},fontFamily:"Arial",strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#0088D7",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:0,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:0,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonIcon"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...zs],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Os={element:Ps,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{width:400,height:60},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:Bs,sourceCode:Ns},Ds=({item:e,prefix:t,imageFit:n,imageMaxWidth:o,imageMaxHeight:r,textMarginTop:s,textStyle:i,imageHoverClass:u,isEditor:l,isFirstSet:g,scaled:c,onFirstSetImageDone:_})=>{var E,f,w,R,V,L,N;const C=m.useRef(null),[y,p]=m.useState(null),d=(E=e.link)==null?void 0:E.trim(),S=(((f=e.text)==null?void 0:f.length)??0)>0,h=n==="contain"&&!!((w=e.image)!=null&&w.url)&&S,v=m.useCallback(()=>{if(!h){p(null);return}const W=C.current;if(!W)return;const B=W.getBoundingClientRect().width;B>0&&p(B)},[h]);m.useLayoutEffect(()=>{v()},[v,(R=e.image)==null?void 0:R.url,n,o,r,l]),m.useLayoutEffect(()=>{if(!h)return;const W=C.current;if(!W)return;const B=new ResizeObserver(v);return B.observe(W),()=>B.disconnect()},[h,v,(V=e.image)==null?void 0:V.url]);const T=()=>{v(),g&&(_==null||_())},O=((L=e.image)==null?void 0:L.url)&&a.jsx("img",{ref:C,src:e.image.url,alt:((N=e.image)==null?void 0:N.name)??"",style:{pointerEvents:"auto",objectFit:n,objectPosition:"top",...n==="contain"?{width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}:{width:"100%",height:"100%"}},onLoad:g?T:v,onError:g?T:v}),P=S&&a.jsxs(a.Fragment,{children:[a.jsx("div",{...l?{"data-controls":"textMarginTop","data-controls-axis":"y"}:{},className:l?`${t}-control`:void 0,style:{width:"100%",height:c(s??0),flexShrink:0}}),a.jsx("div",{style:{...Re(i,l),width:y!=null?`${y}px`:"100%",flexShrink:0,pointerEvents:"auto"},children:a.jsx(xt,{content:e.text})})]});return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...n==="contain"?{maxWidth:c(o)}:{width:c(o)}},children:[a.jsx("div",{className:u,style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",width:"100%",height:c(r),overflow:"hidden",flexShrink:0},children:O&&(d?a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",alignSelf:"flex-start",...n==="cover"?{width:"100%",height:"100%"}:{height:"auto",width:"auto",maxWidth:"100%",maxHeight:"100%"},textDecoration:"none",color:"inherit"},children:O}):O)}),P]})};function To(e){return`
|
|
1507
1507
|
.${e}-marquee-wrapper {
|
|
1508
1508
|
overflow: hidden;
|
|
1509
1509
|
width: 100%;
|
|
@@ -1569,11 +1569,37 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1569
1569
|
pointer-events: auto;
|
|
1570
1570
|
z-index: 10;
|
|
1571
1571
|
}
|
|
1572
|
-
|
|
1572
|
+
|
|
1573
|
+
.${e}-image-hover-brightness img {
|
|
1574
|
+
transition: filter 0.3s ease;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
.${e}-image-hover-brightness:hover img {
|
|
1578
|
+
filter: brightness(1.25);
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
.${e}-image-hover-grayscale img {
|
|
1582
|
+
transition: filter 0.3s ease;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
.${e}-image-hover-grayscale:hover img {
|
|
1586
|
+
filter: grayscale(100%);
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
.${e}-image-hover-saturate img {
|
|
1590
|
+
transition: filter 0.3s ease;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
.${e}-image-hover-saturate:hover img {
|
|
1594
|
+
filter: saturate(2);
|
|
1595
|
+
}
|
|
1596
|
+
`}const qs=30,Us=12,Gs=180,Ks=e=>{var t,n,o,r,s;return{fontSettings:{fontFamily:e.textFontFamily??"Arial",fontWeight:((t=e.textFontSettings)==null?void 0:t.fontWeight)??400,fontStyle:((n=e.textFontSettings)==null?void 0:n.fontStyle)??"normal"},textAppearance:{textTransform:((o=e.textTextAppearance)==null?void 0:o.textTransform)??"none",textDecoration:((r=e.textTextAppearance)==null?void 0:r.textDecoration)??"none",fontVariant:((s=e.textTextAppearance)==null?void 0:s.fontVariant)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight??.01,letterSpacing:e.textLetterSpacing??0,wordSpacing:e.textWordSpacing??0,color:e.textColor??"#000000"}},Ys=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:r}=k.useScopedStyles(),{speed:s,direction:i,pauseOnHover:u,gap:l,imageMaxWidth:g,imageMaxHeight:c,textMarginTop:_}=e,C=e.hoverEffect==="off"?void 0:`${r}-image-hover-${e.hoverEffect}`,y=m.useMemo(()=>Ks(e),[e]),p=e.imageFit==="cover"?"cover":"contain",d=!o,S=Math.max(0,s)*qs,h=te=>k.scalingValue(te,n??!1),v=m.useRef(null),T=m.useRef(null),O=m.useRef(null),[P,E]=m.useState(0),[f,w]=m.useState(0),[R,V]=m.useState(0),L=d&&u==="on",[N,W]=m.useState(!1),B=m.useRef(!1),D=m.useRef(0),b=m.useRef(0),F=m.useRef({w:-1,n:0}),A=m.useRef(0),I=m.useRef(0),$=m.useRef(null),j=m.useMemo(()=>(t??[]).map(te=>{var J;return((J=te.image)==null?void 0:J.url)??""}).join("\0"),[t]),Z=m.useMemo(()=>(t??[]).filter(te=>{var J;return!!((J=te.image)!=null&&J.url)}).length,[t]),ce=m.useMemo(()=>!d||(t==null?void 0:t.length)===0?1:f<=0||P<=0?2:Math.max(2,Math.ceil(P/f)+1),[d,t==null?void 0:t.length,f,P,p]);m.useLayoutEffect(()=>{I.current=0},[j]),m.useLayoutEffect(()=>{if(!d)return;const te=v.current,J=O.current;if(!te||!J)return;const se={id:0},z=()=>{const x=te.getBoundingClientRect().width,U=J.getBoundingClientRect().width;U>0&&(b.current=U);const K=J.offsetWidth>0?J.offsetWidth:Math.max(0,Math.round(U));F.current.w!==K?F.current={w:K,n:1}:F.current.n+=1;const Q=F.current.n>=Us,le=Z===0||I.current>=Z;if(E(x),K>0&&(f<=0||K!==f)){if(A.current+=1,le&&(Q||A.current>Gs)){A.current=0,w(K);return}cancelAnimationFrame(se.id),se.id=requestAnimationFrame(z);return}A.current=0},pe=()=>{cancelAnimationFrame(se.id),se.id=requestAnimationFrame(z)};$.current=pe,pe();const M=new ResizeObserver(pe);return M.observe(te),M.observe(J),()=>{$.current=null,cancelAnimationFrame(se.id),M.disconnect()}},[d,Z,f,p]),m.useEffect(()=>{B.current=N},[N]),m.useLayoutEffect(()=>{if(!d)return;const te=T.current,J=O.current;if(!te||!J||f<=0||S<=0)return;if(b.current<=0){const M=J.getBoundingClientRect().width;M>0&&(b.current=M)}const se=b.current>0?b.current:f;i==="right"&&D.current>=0?D.current=-se:i==="left"&&D.current>0&&(D.current=0);const z={raf:0,lastTime:0},pe=M=>{z.lastTime===0&&(z.lastTime=M);const x=Math.min(100,M-z.lastTime)/1e3;if(z.lastTime=M,!(L&&B.current)){const K=S*x;D.current+=i==="left"?-K:K;const Q=b.current>0?b.current:f;Q>0&&(i==="left"&&D.current<=-Q?D.current+=Q:i==="right"&&D.current>=0&&(D.current-=Q)),te.style.transform=`translate3d(${D.current}px, 0, 0)`}z.raf=requestAnimationFrame(pe)};return te.style.transform=`translate3d(${D.current}px, 0, 0)`,z.raf=requestAnimationFrame(pe),()=>{cancelAnimationFrame(z.raf)}},[d,S,i,f,L]),m.useLayoutEffect(()=>{if(!d){V(0);return}if(f<=0){V(0);return}const te=T.current;if(!te)return;const J=()=>{const z=te.getBoundingClientRect().height;V(z>0?z:0)};J();const se=new ResizeObserver(J);return se.observe(te),()=>{se.disconnect()}},[d,ce,t,n,l,g,c,f,p,y,_]);const re=()=>{L&&W(!0)},ge=()=>{L&&W(!1)},H=()=>{var te;I.current=Math.min(Z,I.current+1),(te=$.current)==null||te.call($)},oe=(te,J,se)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",alignSelf:"flex-start",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[a.jsx(Ds,{item:te,prefix:r,imageFit:p,imageMaxWidth:g,imageMaxHeight:c,textMarginTop:_,textStyle:y,imageHoverClass:C,isEditor:n,isFirstSet:se,scaled:h,onFirstSetImageDone:H}),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${h(l)})`,width:h(l),height:"100%",pointerEvents:"auto",zIndex:2}})]},J);return d&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:v,className:he(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:{overflow:"hidden",width:"100%",...f>0&&R>0?{height:R}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:To(r)}}),a.jsx("div",{ref:T,className:`${r}-marquee-track`,"data-direction":i,onMouseEnter:re,onMouseLeave:ge,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px"},children:Array.from({length:ce},(te,J)=>a.jsx("div",{ref:J===0?O:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",alignItems:"flex-start",gap:h(l),paddingRight:h(l)},"aria-hidden":J>0,children:t==null?void 0:t.map((se,z)=>oe(se,`${J}-${z}`,J===0))},`set-${J}`))})]}):a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:To(r)}}),a.jsx("div",{style:{gap:h(l),justifyContent:"center",alignItems:"flex-start",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Marquee",children:t==null?void 0:t.map((te,J)=>oe(te,J))})]})},Xs=`import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1573
1597
|
import cn from 'classnames';
|
|
1574
1598
|
import { CommonComponentProps } from '../props';
|
|
1575
1599
|
import { scalingValue } from '../utils/scalingValue';
|
|
1576
1600
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
1601
|
+
import { type TextStyles } from '../utils/textStylesToCss';
|
|
1602
|
+
import { MarqueeCard } from './MarqueeCard';
|
|
1577
1603
|
|
|
1578
1604
|
function getCSS(P: string): string {
|
|
1579
1605
|
return \`
|
|
@@ -1642,6 +1668,30 @@ function getCSS(P: string): string {
|
|
|
1642
1668
|
pointer-events: auto;
|
|
1643
1669
|
z-index: 10;
|
|
1644
1670
|
}
|
|
1671
|
+
|
|
1672
|
+
.\${P}-image-hover-brightness img {
|
|
1673
|
+
transition: filter 0.3s ease;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
.\${P}-image-hover-brightness:hover img {
|
|
1677
|
+
filter: brightness(1.25);
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
.\${P}-image-hover-grayscale img {
|
|
1681
|
+
transition: filter 0.3s ease;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
.\${P}-image-hover-grayscale:hover img {
|
|
1685
|
+
filter: grayscale(100%);
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
.\${P}-image-hover-saturate img {
|
|
1689
|
+
transition: filter 0.3s ease;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
.\${P}-image-hover-saturate:hover img {
|
|
1693
|
+
filter: saturate(2);
|
|
1694
|
+
}
|
|
1645
1695
|
\`;
|
|
1646
1696
|
}
|
|
1647
1697
|
|
|
@@ -1656,13 +1706,34 @@ const PX_PER_SEC_PER_SPEED_UNIT = 30;
|
|
|
1656
1706
|
const SET_WIDTH_STREAK_MIN = 12;
|
|
1657
1707
|
const SET_WIDTH_RAF_FALLBACK = 180;
|
|
1658
1708
|
|
|
1709
|
+
const resolveTextStyle = (settings: MarqueeSettings): TextStyles => ({
|
|
1710
|
+
fontSettings: {
|
|
1711
|
+
fontFamily: settings.textFontFamily ?? 'Arial',
|
|
1712
|
+
fontWeight: settings.textFontSettings?.fontWeight ?? 400,
|
|
1713
|
+
fontStyle: settings.textFontSettings?.fontStyle ?? 'normal',
|
|
1714
|
+
},
|
|
1715
|
+
textAppearance: {
|
|
1716
|
+
textTransform: settings.textTextAppearance?.textTransform ?? 'none',
|
|
1717
|
+
textDecoration: settings.textTextAppearance?.textDecoration ?? 'none',
|
|
1718
|
+
fontVariant: settings.textTextAppearance?.fontVariant ?? 'normal',
|
|
1719
|
+
},
|
|
1720
|
+
fontSize: settings.textFontSize ?? 0.01,
|
|
1721
|
+
lineHeight: settings.textLineHeight ?? 0.01,
|
|
1722
|
+
letterSpacing: settings.textLetterSpacing ?? 0,
|
|
1723
|
+
wordSpacing: settings.textWordSpacing ?? 0,
|
|
1724
|
+
color: settings.textColor ?? '#000000',
|
|
1725
|
+
});
|
|
1726
|
+
|
|
1659
1727
|
export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeProps) => {
|
|
1660
1728
|
const { prefix: P } = useScopedStyles();
|
|
1661
|
-
const { speed, direction, pauseOnHover, gap, imageMaxWidth, imageMaxHeight } =
|
|
1729
|
+
const { speed, direction, pauseOnHover, gap, imageMaxWidth, imageMaxHeight, textMarginTop } =
|
|
1730
|
+
settings;
|
|
1731
|
+
const imageHoverClass =
|
|
1732
|
+
settings.hoverEffect === 'off' ? undefined : \`\${P}-image-hover-\${settings.hoverEffect}\`;
|
|
1733
|
+
const textStyle = useMemo(() => resolveTextStyle(settings), [settings]);
|
|
1662
1734
|
const imageFit: 'cover' | 'contain' =
|
|
1663
1735
|
settings.imageFit === 'cover' ? 'cover' : 'contain';
|
|
1664
1736
|
const autoplayEnabled = !isPreviewMode;
|
|
1665
|
-
const isAnimating = autoplayEnabled;
|
|
1666
1737
|
const pxPerSec = Math.max(0, speed) * PX_PER_SEC_PER_SPEED_UNIT;
|
|
1667
1738
|
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
1668
1739
|
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
@@ -1671,7 +1742,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1671
1742
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
1672
1743
|
const [setWidth, setSetWidth] = useState(0);
|
|
1673
1744
|
const [trackHeight, setTrackHeight] = useState(0);
|
|
1674
|
-
const hoverPauseEnabled =
|
|
1745
|
+
const hoverPauseEnabled = autoplayEnabled && pauseOnHover === 'on';
|
|
1675
1746
|
const [isHovering, setIsHovering] = useState(false);
|
|
1676
1747
|
const isHoveringRef = useRef(false);
|
|
1677
1748
|
const offsetRef = useRef(0);
|
|
@@ -1703,7 +1774,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1703
1774
|
const wrapper = wrapperRef.current;
|
|
1704
1775
|
const set = setRef.current;
|
|
1705
1776
|
if (!wrapper || !set) return;
|
|
1706
|
-
|
|
1777
|
+
const rafState = { id: 0 };
|
|
1707
1778
|
const measure = () => {
|
|
1708
1779
|
const nextContainerWidth = wrapper.getBoundingClientRect().width;
|
|
1709
1780
|
const rectW = set.getBoundingClientRect().width;
|
|
@@ -1720,14 +1791,9 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1720
1791
|
firstSetImageUrlCount === 0 ||
|
|
1721
1792
|
loadedFirstSetImagesRef.current >= firstSetImageUrlCount;
|
|
1722
1793
|
setContainerWidth(nextContainerWidth);
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
typeof nextRawSetWidth === 'number' &&
|
|
1727
|
-
nextRawSetWidth > 0 &&
|
|
1728
|
-
setWidth > 0 &&
|
|
1729
|
-
nextRawSetWidth !== setWidth;
|
|
1730
|
-
if (initialPending) {
|
|
1794
|
+
const needsWidthCommit =
|
|
1795
|
+
nextRawSetWidth > 0 && (setWidth <= 0 || nextRawSetWidth !== setWidth);
|
|
1796
|
+
if (needsWidthCommit) {
|
|
1731
1797
|
settleFramesRef.current += 1;
|
|
1732
1798
|
const canCommit =
|
|
1733
1799
|
imagesOk &&
|
|
@@ -1737,29 +1803,15 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1737
1803
|
setSetWidth(nextRawSetWidth);
|
|
1738
1804
|
return;
|
|
1739
1805
|
}
|
|
1740
|
-
cancelAnimationFrame(
|
|
1741
|
-
|
|
1742
|
-
return;
|
|
1743
|
-
}
|
|
1744
|
-
if (updatePending) {
|
|
1745
|
-
settleFramesRef.current += 1;
|
|
1746
|
-
const canUpdate =
|
|
1747
|
-
imagesOk &&
|
|
1748
|
-
(streakOk || settleFramesRef.current > SET_WIDTH_RAF_FALLBACK);
|
|
1749
|
-
if (canUpdate) {
|
|
1750
|
-
settleFramesRef.current = 0;
|
|
1751
|
-
setSetWidth(nextRawSetWidth);
|
|
1752
|
-
return;
|
|
1753
|
-
}
|
|
1754
|
-
cancelAnimationFrame(raf);
|
|
1755
|
-
raf = requestAnimationFrame(measure);
|
|
1806
|
+
cancelAnimationFrame(rafState.id);
|
|
1807
|
+
rafState.id = requestAnimationFrame(measure);
|
|
1756
1808
|
return;
|
|
1757
1809
|
}
|
|
1758
1810
|
settleFramesRef.current = 0;
|
|
1759
1811
|
};
|
|
1760
1812
|
const schedule = () => {
|
|
1761
|
-
cancelAnimationFrame(
|
|
1762
|
-
|
|
1813
|
+
cancelAnimationFrame(rafState.id);
|
|
1814
|
+
rafState.id = requestAnimationFrame(measure);
|
|
1763
1815
|
};
|
|
1764
1816
|
scheduleRemeasureRef.current = schedule;
|
|
1765
1817
|
schedule();
|
|
@@ -1768,7 +1820,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1768
1820
|
ro.observe(set);
|
|
1769
1821
|
return () => {
|
|
1770
1822
|
scheduleRemeasureRef.current = null;
|
|
1771
|
-
cancelAnimationFrame(
|
|
1823
|
+
cancelAnimationFrame(rafState.id);
|
|
1772
1824
|
ro.disconnect();
|
|
1773
1825
|
};
|
|
1774
1826
|
}, [autoplayEnabled, firstSetImageUrlCount, setWidth, imageFit]);
|
|
@@ -1778,7 +1830,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1778
1830
|
}, [isHovering]);
|
|
1779
1831
|
|
|
1780
1832
|
useLayoutEffect(() => {
|
|
1781
|
-
if (!autoplayEnabled
|
|
1833
|
+
if (!autoplayEnabled) return;
|
|
1782
1834
|
const track = trackRef.current;
|
|
1783
1835
|
const set = setRef.current;
|
|
1784
1836
|
if (!track || !set) return;
|
|
@@ -1796,12 +1848,11 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1796
1848
|
offsetRef.current = 0;
|
|
1797
1849
|
}
|
|
1798
1850
|
|
|
1799
|
-
|
|
1800
|
-
let lastTime = 0;
|
|
1851
|
+
const animState = { raf: 0, lastTime: 0 };
|
|
1801
1852
|
const tick = (now: number) => {
|
|
1802
|
-
if (lastTime === 0) lastTime = now;
|
|
1803
|
-
const dt = Math.min(100, now - lastTime) / 1000;
|
|
1804
|
-
lastTime = now;
|
|
1853
|
+
if (animState.lastTime === 0) animState.lastTime = now;
|
|
1854
|
+
const dt = Math.min(100, now - animState.lastTime) / 1000;
|
|
1855
|
+
animState.lastTime = now;
|
|
1805
1856
|
const paused = hoverPauseEnabled && isHoveringRef.current;
|
|
1806
1857
|
if (!paused) {
|
|
1807
1858
|
const delta = pxPerSec * dt;
|
|
@@ -1816,16 +1867,16 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1816
1867
|
}
|
|
1817
1868
|
track.style.transform = \`translate3d(\${offsetRef.current}px, 0, 0)\`;
|
|
1818
1869
|
}
|
|
1819
|
-
raf = requestAnimationFrame(tick);
|
|
1870
|
+
animState.raf = requestAnimationFrame(tick);
|
|
1820
1871
|
};
|
|
1821
1872
|
|
|
1822
1873
|
track.style.transform = \`translate3d(\${offsetRef.current}px, 0, 0)\`;
|
|
1823
|
-
raf = requestAnimationFrame(tick);
|
|
1874
|
+
animState.raf = requestAnimationFrame(tick);
|
|
1824
1875
|
|
|
1825
1876
|
return () => {
|
|
1826
|
-
cancelAnimationFrame(raf);
|
|
1877
|
+
cancelAnimationFrame(animState.raf);
|
|
1827
1878
|
};
|
|
1828
|
-
}, [autoplayEnabled,
|
|
1879
|
+
}, [autoplayEnabled, pxPerSec, direction, setWidth, hoverPauseEnabled]);
|
|
1829
1880
|
|
|
1830
1881
|
useLayoutEffect(() => {
|
|
1831
1882
|
if (!autoplayEnabled) {
|
|
@@ -1841,7 +1892,6 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1841
1892
|
const measure = () => {
|
|
1842
1893
|
const next = track.getBoundingClientRect().height;
|
|
1843
1894
|
setTrackHeight(next > 0 ? next : 0);
|
|
1844
|
-
|
|
1845
1895
|
};
|
|
1846
1896
|
measure();
|
|
1847
1897
|
const ro = new ResizeObserver(measure);
|
|
@@ -1849,7 +1899,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1849
1899
|
return () => {
|
|
1850
1900
|
ro.disconnect();
|
|
1851
1901
|
};
|
|
1852
|
-
}, [autoplayEnabled, copies, content, isEditor, gap, imageMaxWidth, imageMaxHeight, setWidth, imageFit]);
|
|
1902
|
+
}, [autoplayEnabled, copies, content, isEditor, gap, imageMaxWidth, imageMaxHeight, setWidth, imageFit, textStyle, textMarginTop]);
|
|
1853
1903
|
|
|
1854
1904
|
const onTrackEnter = () => {
|
|
1855
1905
|
if (!hoverPauseEnabled) return;
|
|
@@ -1868,72 +1918,33 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1868
1918
|
scheduleRemeasureRef.current?.();
|
|
1869
1919
|
};
|
|
1870
1920
|
|
|
1871
|
-
const renderCard = (item: MarqueeItem, key: string | number, isFirstSet?: boolean) => {
|
|
1872
|
-
const linkHref = item.link?.trim();
|
|
1873
|
-
const imageNode =
|
|
1874
|
-
item.image?.url &&
|
|
1875
|
-
(
|
|
1876
|
-
<img
|
|
1877
|
-
src={item.image.url}
|
|
1878
|
-
alt={item.image?.name ?? ''}
|
|
1879
|
-
style={{
|
|
1880
|
-
pointerEvents: 'auto',
|
|
1881
|
-
height: '100%',
|
|
1882
|
-
...(imageFit === 'contain'
|
|
1883
|
-
? { width: 'auto', maxWidth: '100%' }
|
|
1884
|
-
: { width: '100%' }),
|
|
1885
|
-
objectFit: imageFit,
|
|
1886
|
-
}}
|
|
1887
|
-
onLoad={isFirstSet ? onFirstSetImageDone : undefined}
|
|
1888
|
-
onError={isFirstSet ? onFirstSetImageDone : undefined}
|
|
1889
|
-
/>
|
|
1890
|
-
);
|
|
1891
|
-
return (
|
|
1892
|
-
<div
|
|
1893
|
-
key={key}
|
|
1894
|
-
style={{
|
|
1895
|
-
...(imageFit === 'contain' ? { maxWidth: scaled(imageMaxWidth) } : { width: scaled(imageMaxWidth) }),
|
|
1896
|
-
height: scaled(imageMaxHeight),
|
|
1897
|
-
overflow: 'hidden',
|
|
1898
|
-
}}
|
|
1899
|
-
>
|
|
1900
|
-
{imageNode &&
|
|
1901
|
-
(linkHref ? (
|
|
1902
|
-
<a
|
|
1903
|
-
href={linkHref}
|
|
1904
|
-
target='_blank'
|
|
1905
|
-
rel='noopener noreferrer'
|
|
1906
|
-
style={{
|
|
1907
|
-
display: 'block',
|
|
1908
|
-
height: '100%',
|
|
1909
|
-
...(imageFit === 'cover' ? { width: '100%' } : {}),
|
|
1910
|
-
textDecoration: 'none',
|
|
1911
|
-
color: 'inherit',
|
|
1912
|
-
}}
|
|
1913
|
-
>
|
|
1914
|
-
{imageNode}
|
|
1915
|
-
</a>
|
|
1916
|
-
) : (
|
|
1917
|
-
imageNode
|
|
1918
|
-
))}
|
|
1919
|
-
</div>
|
|
1920
|
-
);
|
|
1921
|
-
};
|
|
1922
|
-
|
|
1923
1921
|
const renderCardWrapper = (item: MarqueeItem, key: string | number, isFirstSet?: boolean) => (
|
|
1924
1922
|
<div
|
|
1925
1923
|
key={key}
|
|
1926
1924
|
style={{
|
|
1927
1925
|
position: 'relative',
|
|
1928
1926
|
flex: '0 0 auto',
|
|
1929
|
-
|
|
1927
|
+
alignSelf: 'flex-start',
|
|
1930
1928
|
transform: 'translateZ(0)',
|
|
1931
1929
|
backfaceVisibility: 'hidden',
|
|
1932
1930
|
WebkitBackfaceVisibility: 'hidden',
|
|
1933
1931
|
willChange: 'transform',
|
|
1934
1932
|
}}
|
|
1935
1933
|
>
|
|
1936
|
-
|
|
1934
|
+
<MarqueeCard
|
|
1935
|
+
item={item}
|
|
1936
|
+
prefix={P}
|
|
1937
|
+
imageFit={imageFit}
|
|
1938
|
+
imageMaxWidth={imageMaxWidth}
|
|
1939
|
+
imageMaxHeight={imageMaxHeight}
|
|
1940
|
+
textMarginTop={textMarginTop}
|
|
1941
|
+
textStyle={textStyle}
|
|
1942
|
+
imageHoverClass={imageHoverClass}
|
|
1943
|
+
isEditor={isEditor}
|
|
1944
|
+
isFirstSet={isFirstSet}
|
|
1945
|
+
scaled={scaled}
|
|
1946
|
+
onFirstSetImageDone={onFirstSetImageDone}
|
|
1947
|
+
/>
|
|
1937
1948
|
{isEditor && (
|
|
1938
1949
|
<div
|
|
1939
1950
|
data-controls="gap"
|
|
@@ -1993,6 +2004,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1993
2004
|
display: 'flex',
|
|
1994
2005
|
flexDirection: 'row',
|
|
1995
2006
|
flex: '0 0 auto',
|
|
2007
|
+
alignItems: 'flex-start',
|
|
1996
2008
|
gap: scaled(gap),
|
|
1997
2009
|
paddingRight: scaled(gap),
|
|
1998
2010
|
}}
|
|
@@ -2015,6 +2027,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
2015
2027
|
style={{
|
|
2016
2028
|
gap: scaled(gap),
|
|
2017
2029
|
justifyContent: 'center',
|
|
2030
|
+
alignItems: 'flex-start',
|
|
2018
2031
|
overflowX: 'auto',
|
|
2019
2032
|
display: 'flex',
|
|
2020
2033
|
flexDirection: 'row',
|
|
@@ -2034,6 +2047,7 @@ export type MarqueeItem = {
|
|
|
2034
2047
|
url?: string;
|
|
2035
2048
|
name?: string;
|
|
2036
2049
|
};
|
|
2050
|
+
text?: any[];
|
|
2037
2051
|
link?: string;
|
|
2038
2052
|
};
|
|
2039
2053
|
|
|
@@ -2041,13 +2055,26 @@ export type MarqueeSettings = {
|
|
|
2041
2055
|
speed: number;
|
|
2042
2056
|
direction: 'left' | 'right';
|
|
2043
2057
|
pauseOnHover: 'on' | 'off';
|
|
2058
|
+
hoverEffect: 'off' | 'brightness' | 'grayscale' | 'saturate';
|
|
2044
2059
|
gap: number;
|
|
2045
2060
|
imageMaxWidth: number;
|
|
2046
2061
|
imageMaxHeight: number;
|
|
2047
|
-
|
|
2048
|
-
|
|
2062
|
+
imageFit?: 'cover' | 'contain';
|
|
2063
|
+
textFontFamily?: string;
|
|
2064
|
+
textFontSettings?: { fontWeight?: number; fontStyle?: string };
|
|
2065
|
+
textFontSize?: number;
|
|
2066
|
+
textLineHeight?: number;
|
|
2067
|
+
textLetterSpacing?: number;
|
|
2068
|
+
textWordSpacing?: number;
|
|
2069
|
+
textTextAppearance?: {
|
|
2070
|
+
textTransform?: string;
|
|
2071
|
+
textDecoration?: string;
|
|
2072
|
+
fontVariant?: string;
|
|
2073
|
+
};
|
|
2074
|
+
textColor?: string;
|
|
2075
|
+
textMarginTop?: number;
|
|
2049
2076
|
};
|
|
2050
|
-
`,
|
|
2077
|
+
`,Zs={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:"switch-toggle-2",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Hover Effect",display:{type:"switch-toggle",enum:["off","brightness","grayscale","saturate"]},enum:["off","brightness","grayscale","saturate"]},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,max:400,display:{type:"range-control"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,max:400,display:{type:"range-control"}},imageFit:{type:"string",scope:"common",title:"Image cover",enum:["cover","contain"],display:{type:"switch-toggle-2",enum:["cover","contain"]}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}},title:""},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:"contain",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000"},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21,textFontSize:.04,textLineHeight:.05,textMarginTop:.02},d:{speed:1.64,gap:.02,imageMaxWidth:.15,imageMaxHeight:.1,textFontSize:.014,textLineHeight:.018,textMarginTop:.008}},displayRules:[],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:["pauseOnHover","hoverEffect"]}]},{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"]}]}]}],paletteBookmark:{items:["textColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{type:"object",label:"Text",display:{type:"rich-text"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZNCQFC3T744H0KX6R3FR.jpeg",name:""},text:[],link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZRTSS60YBFT6Y37ZX00T.jpeg",name:""},text:[],link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ9M9YJPQ5JWKCHDEW5M1GJD.jpeg",name:""},text:[],link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S04EHBXQS1T4KVAMZNZQM.jpeg",name:""},text:[],link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S08Q40WHD39024VNDWF2Q.jpeg",name:""},text:[],link:""}]}},Js={element:Ys,id:"marquee",name:"Marquee",category:"galleries",version:1,defaultSize:{width:"100%",height:200},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/marquee.png"},schema:Zs,sourceCode:Xs,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily",placeholderEnabled:!0},{path:"textFontSettings.fontWeight"},{path:"textFontSettings.fontStyle"}]}};function _o(e){return`
|
|
2051
2078
|
.${e}-marquee-wrapper {
|
|
2052
2079
|
overflow: hidden;
|
|
2053
2080
|
width: 100%;
|
|
@@ -2134,7 +2161,7 @@ export type MarqueeSettings = {
|
|
|
2134
2161
|
pointer-events: auto;
|
|
2135
2162
|
z-index: 10;
|
|
2136
2163
|
}
|
|
2137
|
-
`}const
|
|
2164
|
+
`}const Qs=30,el=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:r}=k.useScopedStyles(),{autoplay:s,align:i,speed:u,direction:l,pauseOnHover:g,gap:c,cardWidth:_,corners:C,stroke:y,strokeColor:p,bgColor:d,padding:S,logoMarginTop:h,logoWidth:v,logoHeight:T,captionMarginTop:O}=e,P=s==="on"&&!o,E=P,f=Math.max(0,u)*Qs,w=q=>k.scalingValue(q,n??!1),R=m.useRef(null),V=m.useRef(null),L=m.useRef(null),[N,W]=m.useState(0),[B,D]=m.useState(0),[b,F]=m.useState(0),A=E&&g==="on",[I,$]=m.useState(!1),j=m.useRef(null),[Z,ce]=m.useState(0),[re,ge]=m.useState(0),H=m.useRef(null),oe=q=>{var Y,ue,ee,me,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${q}FontFamily`])??"Arial",fontWeight:((Y=e==null?void 0:e[`${q}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((ue=e==null?void 0:e[`${q}FontSettings`])==null?void 0:ue.fontStyle)??"normal"},textAppearance:{textTransform:((ee=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:ee.textTransform)??"none",textDecoration:((me=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:me.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${q}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${q}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${q}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${q}LineHeight`])??.01,color:(e==null?void 0:e[`${q}Color`])??"#000000"}},te=oe("text"),J=oe("caption"),se=m.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(q=>{var X,Y;return(((X=q.text)==null?void 0:X.length)??0)>0||(((Y=q.caption)==null?void 0:Y.length)??0)>0}),[t]),z=m.useMemo(()=>!P||(t==null?void 0:t.length)===0?1:B<=0||N<=0?2:Math.max(2,Math.ceil(N/B)+1),[P,t==null?void 0:t.length,B,N]);m.useLayoutEffect(()=>{if(!P)return;const q=R.current,X=L.current;if(!q||!X)return;let Y=0;const ue=()=>{const Ce=q.getBoundingClientRect().width,we=X.getBoundingClientRect().width,lt=H.current,Ke=typeof lt=="number"&&Math.abs(lt-we)<=.25;if(H.current=we,W(Ce),typeof we=="number"&&we>0&&B<=0){D(we);return}Ke&&we!==B?D(we):!Ke&&B<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(ue))},ee=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(ue)};ee();const me=new ResizeObserver(ee);return me.observe(q),me.observe(X),()=>{cancelAnimationFrame(Y),me.disconnect()}},[P,B]),m.useLayoutEffect(()=>{const q=V.current;if(!P||!q||!E)return;const X=B>0?B:0,Y=X>0&&f>0?X/f*1e3:0,ue=`${Math.max(0,Y)/1e3}s`;q.style.setProperty("--marquee-distance",`${X}px`),q.style.setProperty("--marquee-duration",ue)},[P,E,f,B]),m.useLayoutEffect(()=>{if(!P){F(0);return}const q=L.current,X=V.current;if(!q||!X)return;const Y=()=>{let ee=0;for(let me=0;me<q.children.length;me++){const we=q.children[me].firstElementChild;we&&(ee=Math.max(ee,we.offsetHeight))}ee<=0&&(ee=X.offsetHeight),F(ee>0?ee:0)};Y();const ue=new ResizeObserver(Y);return ue.observe(q),ue.observe(X),()=>{ue.disconnect()}},[P,z,t,n,c,_,S,y,C,v,T,Z,re]);const pe=()=>{A&&$(!0)},M=()=>{A&&$(!1)},x=m.useMemo(()=>{switch(i){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[i]),U=m.useMemo(()=>{switch(i){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[i]),K=m.useCallback((q,X,Y,ue)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[a.jsx("div",{"data-controls":ue==null?void 0:ue.controlsName,"data-controls-axis":"y",className:`${r}-control`,style:{height:w((ue==null?void 0:ue.marginTop)??0)}}),a.jsx("div",{...ue!=null&&ue.dataMeasureKind?{"data-testimonial-measure":ue.dataMeasureKind}:{},style:{...Re(q,n),textAlign:U,pointerEvents:"auto",...typeof(ue==null?void 0:ue.minHeightPx)=="number"&&ue.minHeightPx>0?{minHeight:ue.minHeightPx}:{}},children:a.jsx(xt,{content:X})})]},Y),[x,U,n]),Q=m.useCallback((q,X,Y)=>{var ue,ee,me;return a.jsxs("div",{style:{padding:`${w(S.top)} ${w(S.right)} ${w(S.bottom)} ${w(S.left)}`,width:w(_+y*2),height:"100%",borderRadius:w(C),border:`${w(y)} solid ${p}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:d}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:x,textAlign:U},children:[q.text&&K(te,q.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${r}-control`,style:{height:w(h)}}),a.jsx("div",{style:{width:w(v),height:w(T)},children:((ue=q.logo)==null?void 0:ue.url)&&a.jsx("img",{src:q.logo.url,alt:((ee=q.logo)==null?void 0:ee.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((me=q.logo)==null?void 0:me.objectFit)||"contain"}})})]}),q.caption&&K(J,q.caption,"caption",{controlsName:"captionMarginTop",marginTop:O,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},X)},[d,O,J,_,C,T,h,v,x,U,S.bottom,S.left,S.right,S.top,K,y,p,te,n]),le=m.useCallback(q=>{ce(q.maxTextPx),ge(q.maxCaptionPx)},[]);m.useLayoutEffect(()=>{if(!se){le({maxTextPx:0,maxCaptionPx:0});return}const q=j.current;if(!q)return;const X=()=>{k.readTestimonialTextMeasure(q,le)};X();const Y=new ResizeObserver(X);return Y.observe(q),()=>{Y.disconnect()}},[se,le,t,Q]);const ae=se?{textMinHeightPx:Z,captionMinHeightPx:re}:void 0,ie=se?a.jsx("div",{ref:j,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((q,X)=>Q(q,`measure-${X}`,{dataMeasureAttrs:!0}))}):null,fe=(q,X)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Q(q,`card-${X}`,ae),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${w(c)})`,width:w(c),height:"100%",pointerEvents:"auto",zIndex:2}})]},X);return P&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:R,className:he(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...b>0?{height:b}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_o(r)}}),ie,a.jsx("div",{ref:V,className:`${r}-marquee-track`,"data-direction":l,onMouseEnter:pe,onMouseLeave:M,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...A?{"--marquee-play-state":I?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:z},(q,X)=>a.jsx("div",{ref:X===0?L:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:w(c),paddingRight:w(c)},"aria-hidden":X>0,children:t==null?void 0:t.map((Y,ue)=>fe(Y,`${X}-${ue}`))},`set-${X}`))})]}):a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_o(r)}}),ie,a.jsx("div",{style:{gap:w(c),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((q,X)=>fe(q,X))})]})},tl=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2138
2165
|
import cn from 'classnames';
|
|
2139
2166
|
import { CommonComponentProps } from '../props';
|
|
2140
2167
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -2365,19 +2392,29 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2365
2392
|
setTrackHeight(0);
|
|
2366
2393
|
return;
|
|
2367
2394
|
}
|
|
2395
|
+
const set = setRef.current;
|
|
2368
2396
|
const track = trackRef.current;
|
|
2369
|
-
if (!track) return;
|
|
2397
|
+
if (!set || !track) return;
|
|
2370
2398
|
const measure = () => {
|
|
2371
|
-
|
|
2399
|
+
let next = 0;
|
|
2400
|
+
for (let i = 0; i < set.children.length; i++) {
|
|
2401
|
+
const wrapper = set.children[i] as HTMLElement;
|
|
2402
|
+
const card = wrapper.firstElementChild as HTMLElement | null;
|
|
2403
|
+
if (card) next = Math.max(next, card.offsetHeight);
|
|
2404
|
+
}
|
|
2405
|
+
if (next <= 0) {
|
|
2406
|
+
next = track.offsetHeight;
|
|
2407
|
+
}
|
|
2372
2408
|
setTrackHeight(next > 0 ? next : 0);
|
|
2373
2409
|
};
|
|
2374
2410
|
measure();
|
|
2375
2411
|
const ro = new ResizeObserver(measure);
|
|
2412
|
+
ro.observe(set);
|
|
2376
2413
|
ro.observe(track);
|
|
2377
2414
|
return () => {
|
|
2378
2415
|
ro.disconnect();
|
|
2379
2416
|
};
|
|
2380
|
-
}, [autoplayEnabled, copies, content, isEditor, gap, cardWidth, padding, stroke, corners, logoWidth, logoHeight]);
|
|
2417
|
+
}, [autoplayEnabled, copies, content, isEditor, gap, cardWidth, padding, stroke, corners, logoWidth, logoHeight, measuredTextMinPx, measuredCaptionMinPx]);
|
|
2381
2418
|
|
|
2382
2419
|
const onTrackEnter = () => {
|
|
2383
2420
|
if (!hoverPauseEnabled) return;
|
|
@@ -2453,7 +2490,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2453
2490
|
key={key}
|
|
2454
2491
|
style={{
|
|
2455
2492
|
padding: \`\${scaled(padding.top)} \${scaled(padding.right)} \${scaled(padding.bottom)} \${scaled(padding.left)}\`,
|
|
2456
|
-
width: scaled(cardWidth + stroke * 2),
|
|
2493
|
+
width: scaled(cardWidth + (stroke * 2)),
|
|
2457
2494
|
height: '100%',
|
|
2458
2495
|
borderRadius: scaled(corners),
|
|
2459
2496
|
border: \`\${scaled(stroke)} solid \${strokeColor}\`,
|
|
@@ -2730,7 +2767,7 @@ type TestimonialsSettings = {
|
|
|
2730
2767
|
logoHeight: number;
|
|
2731
2768
|
captionMarginTop: number;
|
|
2732
2769
|
};
|
|
2733
|
-
`,
|
|
2770
|
+
`,Eo={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},nl={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"switch-toggle-2",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"range-control"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"range-control"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"range-control"}},strokeColor:{type:"string",scope:"common",title:"Stroke color",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG color",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"range-control"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"range-control"}},textColor:{type:"string",scope:"common",title:"Text color",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption color",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Eo.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:{...Eo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{autoplay:"on",direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","autoplay","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",items:["align","direction"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners","stroke"]},{type:"group",title:"",items:["padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},ol={element:el,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonials.png"},defaultSize:{width:"100%",height:320},schema:nl,sourceCode:tl,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function rl(e){return`
|
|
2734
2771
|
.${e}-container {
|
|
2735
2772
|
position: relative;
|
|
2736
2773
|
overflow-x: clip;
|
|
@@ -2854,7 +2891,7 @@ type TestimonialsSettings = {
|
|
|
2854
2891
|
width: 100%;
|
|
2855
2892
|
height: 100%;
|
|
2856
2893
|
}
|
|
2857
|
-
`}const
|
|
2894
|
+
`}const il=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:r}=k.useScopedStyles(),s=t||[],{autoplay:i,delay:u,align:l,width:g,imageMarginTop:c,textMarginTop:_,captionMarginTop:C,imageWidth:y,imageHeight:p,controlsWidth:d,controlsColor:S,controlsHoverColor:h}=e,v=i==="on"&&!o,[T,O]=m.useState(0),[P,E]=m.useState(null),[f,w]=m.useState(!1),R=m.useRef(null),V=m.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),L=m.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]);m.useEffect(()=>{O(0),E(null),w(!1)},[s.length]);const N=s[T],W=P===null?null:s[P],B=z=>{var M,x,U,K,Q;return{fontSettings:{fontFamily:(e==null?void 0:e[`${z}FontFamily`])??"Arial",fontWeight:((M=e==null?void 0:e[`${z}FontSettings`])==null?void 0:M.fontWeight)??400,fontStyle:((x=e==null?void 0:e[`${z}FontSettings`])==null?void 0:x.fontStyle)??"normal"},textAppearance:{textTransform:((U=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:U.textTransform)??"none",textDecoration:((K=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:K.textDecoration)??"none",fontVariant:((Q=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:Q.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${z}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${z}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${z}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${z}WordSpacing`])??0,color:(e==null?void 0:e[`${z}Color`])??"#000000"}},D=B("text"),b=B("caption"),F=s.length>1&&s.some(z=>{var pe,M;return(((pe=z.text)==null?void 0:pe.length)??0)>0||(((M=z.caption)==null?void 0:M.length)??0)>0}),A=m.useRef(null),[I,$]=m.useState(0),[j,Z]=m.useState(0),ce=e.controls??{mode:"Off",icon:null},re=s.length>1,ge=m.useCallback((z,pe)=>!re||pe===z?z:(R.current&&window.clearTimeout(R.current),E(z),w(!0),R.current=window.setTimeout(()=>{E(null),w(!1),R.current=null},300),pe),[re]),H=m.useCallback(()=>{re&&O(z=>ge(z,(z-1+s.length)%s.length))},[re,ge,s.length]),oe=m.useCallback(()=>{re&&O(z=>ge(z,(z+1)%s.length))},[re,ge,s.length]);m.useEffect(()=>{if(!v||!re)return;const z=Math.max(300,Number.isFinite(u*1e3)?u*1e3:0),pe=window.setInterval(()=>{O(M=>ge(M,(M+1)%s.length))},z);return()=>{window.clearInterval(pe)}},[v,re,ge,s.length,u]),m.useEffect(()=>()=>{R.current&&window.clearTimeout(R.current)},[]);const te=(z,pe)=>{var K,Q,le,ae;const M=pe==null?void 0:pe.textMinHeightPx,x=pe==null?void 0:pe.captionMinHeightPx,U=pe==null?void 0:pe.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[z.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${r}-control`,style:{height:k.scalingValue(_??0,n??!1)}}),a.jsx("div",{...U&&{"data-testimonial-measure":"text"},style:{...Re(D,n),...M&&M>0?{minHeight:M}:{},textAlign:L,pointerEvents:"auto"},children:a.jsx(xt,{content:z.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${r}-control`,style:{height:k.scalingValue(c??0,n??!1)}}),a.jsx("div",{style:{width:k.scalingValue(y??0,n??!1),height:k.scalingValue(p??0,n??!1)},children:((K=z.image)==null?void 0:K.url)&&a.jsx("img",{src:(Q=z.image)==null?void 0:Q.url,alt:((le=z.image)==null?void 0:le.name)??"",className:`${r}-icon`,style:{objectFit:((ae=z.image)==null?void 0:ae.objectFit)||"contain"}})})]}),z.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${r}-control`,style:{height:k.scalingValue(C??0,n??!1)}}),a.jsx("div",{...U?{"data-testimonial-measure":"caption"}:{},style:{...Re(b,n),...x&&x>0?{minHeight:x}:{},textAlign:L,pointerEvents:"auto"},children:a.jsx(xt,{content:z.caption})})]})]})},J=m.useCallback(z=>{$(z.maxTextPx),Z(z.maxCaptionPx)},[]);if(m.useLayoutEffect(()=>{if(!F){J({maxTextPx:0,maxCaptionPx:0});return}const z=A.current;if(!z)return;const pe=()=>{k.readTestimonialTextMeasure(z,J)};pe();const M=new ResizeObserver(pe);return M.observe(z),()=>{M.disconnect()}},[F,J,t]),!N)return a.jsx(a.Fragment,{});const se=F?{textMinHeightPx:I,captionMinHeightPx:j}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rl(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:k.scalingValue(g??0,n??!1),alignItems:V},children:[F&&a.jsx("div",{ref:A,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((z,pe)=>a.jsx("div",{style:{width:"100%"},children:te(z,{dataMeasureAttrs:!0})},pe))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[W&&f&&a.jsx("div",{className:he(`${r}-fade-item-prev`,`${r}-fade-out`),children:te(W,se)}),a.jsx("div",{className:he(`${r}-fade-item-current`,f?`${r}-fade-in`:void 0),children:te(N,se)})]})]}),ce.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:k.scalingValue(d??.02,n??!1),height:k.scalingValue(d??.02,n??!1),"--arrow-hover-color":h},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:H,disabled:!re,"aria-label":"Previous testimonial",children:ce.icon&&a.jsx(Xe,{url:ce.icon,fill:S,hoverFill:h,className:he(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:he(`${r}-arrow`,`${r}-next-arrow`),style:{width:k.scalingValue(d??.02,n??!1),height:k.scalingValue(d??.02,n??!1),"--arrow-hover-color":h},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:oe,disabled:!re,"aria-label":"Next testimonial",children:ce.icon&&a.jsx(Xe,{url:ce.icon,fill:S,hoverFill:h,className:`${r}-arrow-img`})})})]})]})})},al=`import cn from 'classnames';
|
|
2858
2895
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2859
2896
|
import { CommonComponentProps } from '../props';
|
|
2860
2897
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3346,4 +3383,4 @@ type TestimonialsSettings = {
|
|
|
3346
3383
|
icon?: string | null;
|
|
3347
3384
|
};
|
|
3348
3385
|
};
|
|
3349
|
-
`,
|
|
3386
|
+
`,sl="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>'),ko={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},ll={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},delay:{type:"number",scope:"layout",title:"Delay(s)",display:{type:"step-control"},step:1,min:1,max:8},align:{type:"string",scope:"common",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"range-control"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"range-control"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"range-control"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max: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:"range-control"}},controlsColor:{type:"string",scope:"common",title:"Controls Color",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...ko.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Color"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...ko.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"}},defaults:{autoplay:"on",controls:{mode:"On",icon:sl},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:["controls",{type:"group",title:"",items:["delay","width"]}]},{type:"row",items:["controlsWidth","align"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},cl={element:il,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonialsSingle.png"},defaultSize:{width:700,height:300},schema:ll,sourceCode:al,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}},ul=[Aa,Wa,$s,Rs,Os,Js,ol,cl];exports.components=ul;exports.isSchemaV1=xr;
|