@cntrl-site/components 1.0.12-2 → 1.0.12-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Grid/GridComponent.d.ts +1 -0
- package/dist/Components/List/List.d.ts +61 -9
- package/dist/Components/List/ListComponent.d.ts +1 -0
- package/dist/Components/Marquee/Marquee.d.ts +26 -0
- package/dist/Components/Marquee/MarqueeComponent.d.ts +40 -0
- package/dist/index.js +1621 -376
- package/dist/index.mjs +5721 -3749
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),xt=require("classnames"),S=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),_i=require("react-dom");function Cr(t){return t.type==="object"&&t.version===1}const Sr="ControlSlider-module__wrapper___sHEkd",$r="ControlSlider-module__hoverArrow___A-dOH",wr="ControlSlider-module__sliderItem___QQSkR",Tr="ControlSlider-module__sliderImage___9hRl-",Lr="ControlSlider-module__arrow___05ghY",_r="ControlSlider-module__arrowVertical___tBfVN",Er="ControlSlider-module__nextArrow___-30Yc",Pr="ControlSlider-module__arrowInner___aEra3",Wr="ControlSlider-module__arrowIcon___S4ztF",Fr="ControlSlider-module__arrowImg___2dwJW",Rr="ControlSlider-module__mirror___brd6U",Ir="ControlSlider-module__pagination___bicLF",Ar="ControlSlider-module__paginationInner___bT-P-",kr="ControlSlider-module__paginationVertical___zYqKw",Mr="ControlSlider-module__paginationItem___nTRbk",Or="ControlSlider-module__dot___p1Qun",Nr="ControlSlider-module__activeDot___LHFaj",Hr="ControlSlider-module__paginationInsideBottom___R3FWn",Br="ControlSlider-module__paginationInsideTop___V-qb-",zr="ControlSlider-module__paginationOutsideBottom___14w8D",Dr="ControlSlider-module__paginationOutsideTop___SCLqB",jr="ControlSlider-module__paginationInsideLeft___yOBRZ",Vr="ControlSlider-module__paginationInsideRight___Rtt3o",Kr="ControlSlider-module__paginationOutsideLeft___lahaw",Ur="ControlSlider-module__paginationOutsideRight___EtuQa",Gr="ControlSlider-module__imgWrapper___UjEgB",Yr="ControlSlider-module__captionBlock___dJ6-j",qr="ControlSlider-module__captionTextWrapper___HFlpf",Xr="ControlSlider-module__captionText___uGBVc",Zr="ControlSlider-module__active___WZK4G",Jr="ControlSlider-module__withPointerEvents___t-18M",Qr="ControlSlider-module__topLeftAlignment___zjnGM",ta="ControlSlider-module__topCenterAlignment___gD1xW",ea="ControlSlider-module__topRightAlignment___NMapS",na="ControlSlider-module__middleLeftAlignment___OnUrY",oa="ControlSlider-module__middleCenterAlignment___Tdkl0",ia="ControlSlider-module__middleRightAlignment___wEbfX",ra="ControlSlider-module__bottomLeftAlignment___cTP2-",aa="ControlSlider-module__bottomCenterAlignment___c54fB",sa="ControlSlider-module__bottomRightAlignment___kEwrz",la="ControlSlider-module__clickOverlay___DZA28",ca="ControlSlider-module__contain___pLyq7",da="ControlSlider-module__cover___KdDat",tt={wrapper:Sr,hoverArrow:$r,sliderItem:wr,sliderImage:Tr,arrow:Lr,arrowVertical:_r,nextArrow:Er,arrowInner:Pr,arrowIcon:Wr,arrowImg:Fr,mirror:Rr,pagination:Ir,paginationInner:Ar,paginationVertical:kr,paginationItem:Mr,dot:Or,activeDot:Nr,paginationInsideBottom:Hr,paginationInsideTop:Br,paginationOutsideBottom:zr,paginationOutsideTop:Dr,paginationInsideLeft:jr,paginationInsideRight:Vr,paginationOutsideLeft:Kr,paginationOutsideRight:Ur,imgWrapper:Gr,captionBlock:Yr,captionTextWrapper:qr,captionText:Xr,active:Zr,withPointerEvents:Jr,topLeftAlignment:Qr,topCenterAlignment:ta,topRightAlignment:ea,middleLeftAlignment:na,middleCenterAlignment:oa,middleRightAlignment:ia,bottomLeftAlignment:ra,bottomCenterAlignment:aa,bottomRightAlignment:sa,clickOverlay:la,contain:ca,cover:da};function ua(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function pa(t,e,n){return e&&ua(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Zo="(prefers-reduced-motion: reduce)",Me=1,ma=2,He=3,Ue=4,gn=5,In=6,Bn=7,ga={CREATED:Me,MOUNTED:ma,IDLE:He,MOVING:Ue,SCROLLING:gn,DRAGGING:In,DESTROYED:Bn};function me(t){t.length=0}function Ce(t,e,n){return Array.prototype.slice.call(t,e,n)}function wt(t){return t.bind.apply(t,[null].concat(Ce(arguments,1)))}var Ei=setTimeout,fo=function(){};function Jo(t){return requestAnimationFrame(t)}function Kn(t,e){return typeof e===t}function on(t){return!Lo(t)&&Kn("object",t)}var To=Array.isArray,Pi=wt(Kn,"function"),be=wt(Kn,"string"),hn=wt(Kn,"undefined");function Lo(t){return t===null}function Wi(t){try{return t instanceof(t.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function fn(t){return To(t)?t:[t]}function Zt(t,e){fn(t).forEach(e)}function _o(t,e){return t.indexOf(e)>-1}function An(t,e){return t.push.apply(t,fn(e)),t}function ce(t,e,n){t&&Zt(e,function(o){o&&t.classList[n?"add":"remove"](o)})}function re(t,e){ce(t,be(e)?e.split(" "):e,!0)}function yn(t,e){Zt(e,t.appendChild.bind(t))}function Eo(t,e){Zt(t,function(n){var o=(e||n).parentNode;o&&o.insertBefore(n,e)})}function rn(t,e){return Wi(t)&&(t.msMatchesSelector||t.matches).call(t,e)}function Fi(t,e){var n=t?Ce(t.children):[];return e?n.filter(function(o){return rn(o,e)}):n}function vn(t,e){return e?Fi(t,e)[0]:t.firstElementChild}var an=Object.keys;function _e(t,e,n){return t&&(n?an(t).reverse():an(t)).forEach(function(o){o!=="__proto__"&&e(t[o],o)}),t}function sn(t){return Ce(arguments,1).forEach(function(e){_e(e,function(n,o){t[o]=e[o]})}),t}function ye(t){return Ce(arguments,1).forEach(function(e){_e(e,function(n,o){To(n)?t[o]=n.slice():on(n)?t[o]=ye({},on(t[o])?t[o]:{},n):t[o]=n})}),t}function Qo(t,e){Zt(e||an(t),function(n){delete t[n]})}function ae(t,e){Zt(t,function(n){Zt(e,function(o){n&&n.removeAttribute(o)})})}function mt(t,e,n){on(e)?_e(e,function(o,i){mt(t,i,o)}):Zt(t,function(o){Lo(n)||n===""?ae(o,e):o.setAttribute(e,String(n))})}function Oe(t,e,n){var o=document.createElement(t);return e&&(be(e)?re(o,e):mt(o,e)),n&&yn(n,o),o}function te(t,e,n){if(hn(n))return getComputedStyle(t)[e];Lo(n)||(t.style[e]=""+n)}function ln(t,e){te(t,"display",e)}function Ri(t){t.setActive&&t.setActive()||t.focus({preventScroll:!0})}function ee(t,e){return t.getAttribute(e)}function ti(t,e){return t&&t.classList.contains(e)}function Yt(t){return t.getBoundingClientRect()}function Ee(t){Zt(t,function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}function Ii(t){return vn(new DOMParser().parseFromString(t,"text/html").body)}function le(t,e){t.preventDefault(),e&&(t.stopPropagation(),t.stopImmediatePropagation())}function Ai(t,e){return t&&t.querySelector(e)}function Po(t,e){return e?Ce(t.querySelectorAll(e)):[]}function de(t,e){ce(t,e,!1)}function yo(t){return t.timeStamp}function we(t){return be(t)?t:t?t+"px":""}var bn="splide",Wo="data-"+bn;function en(t,e){if(!t)throw new Error("["+bn+"] "+(e||""))}var xe=Math.min,zn=Math.max,Dn=Math.floor,cn=Math.ceil,zt=Math.abs;function ki(t,e,n){return zt(t-e)<n}function kn(t,e,n,o){var i=xe(e,n),l=zn(e,n);return o?i<t&&t<l:i<=t&&t<=l}function Ae(t,e,n){var o=xe(e,n),i=zn(e,n);return xe(zn(o,t),i)}function vo(t){return+(t>0)-+(t<0)}function bo(t,e){return Zt(e,function(n){t=t.replace("%s",""+n)}),t}function Fo(t){return t<10?"0"+t:""+t}var ei={};function ha(t){return""+t+Fo(ei[t]=(ei[t]||0)+1)}function Mi(){var t=[];function e(r,s,d,u){i(r,s,function(c,L,v){var h="addEventListener"in c,p=h?c.removeEventListener.bind(c,L,d,u):c.removeListener.bind(c,d);h?c.addEventListener(L,d,u):c.addListener(d),t.push([c,L,v,d,p])})}function n(r,s,d){i(r,s,function(u,c,L){t=t.filter(function(v){return v[0]===u&&v[1]===c&&v[2]===L&&(!d||v[3]===d)?(v[4](),!1):!0})})}function o(r,s,d){var u,c=!0;return typeof CustomEvent=="function"?u=new CustomEvent(s,{bubbles:c,detail:d}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(s,c,!1,d)),r.dispatchEvent(u),u}function i(r,s,d){Zt(r,function(u){u&&Zt(s,function(c){c.split(" ").forEach(function(L){var v=L.split(".");d(u,v[0],v[1])})})})}function l(){t.forEach(function(r){r[4]()}),me(t)}return{bind:e,unbind:n,dispatch:o,destroy:l}}var Se="mounted",xo="ready",ge="move",Ge="moved",Ro="click",Oi="active",Ni="inactive",Hi="visible",Bi="hidden",Ft="refresh",Nt="updated",Be="resize",Un="resized",zi="drag",Di="dragging",ji="dragged",Gn="scroll",We="scrolled",fa="overflow",Io="destroy",Vi="arrows:mounted",Ki="arrows:updated",Ui="pagination:mounted",Gi="pagination:updated",Ao="navigation:mounted",ko="autoplay:play",Yi="autoplay:playing",Mo="autoplay:pause",Oo="lazyload:loaded",qi="sk",Xi="sh",jn="ei";function _t(t){var e=t?t.event.bus:document.createDocumentFragment(),n=Mi();function o(l,r){n.bind(e,fn(l).join(" "),function(s){r.apply(r,To(s.detail)?s.detail:[])})}function i(l){n.dispatch(e,l,Ce(arguments,1))}return t&&t.event.on(Io,n.destroy),sn(n,{bus:e,on:o,off:wt(n.unbind,e),emit:i})}function Yn(t,e,n,o){var i=Date.now,l,r=0,s,d=!0,u=0;function c(){if(!d){if(r=t?xe((i()-l)/t,1):1,n&&n(r),r>=1&&(e(),l=i(),o&&++u>=o))return v();s=Jo(c)}}function L(f){f||p(),l=i()-(f?r*t:0),d=!1,s=Jo(c)}function v(){d=!0}function h(){l=i(),r=0,n&&n(r)}function p(){s&&cancelAnimationFrame(s),r=0,s=0,d=!0}function g(f){t=f}function $(){return d}return{start:L,rewind:h,pause:v,cancel:p,set:g,isPaused:$}}function ya(t){var e=t;function n(i){e=i}function o(i){return _o(fn(i),e)}return{set:n,is:o}}function va(t,e){var n=Yn(0,t,null,1);return function(){n.isPaused()&&n.start()}}function ba(t,e,n){var o=t.state,i=n.breakpoints||{},l=n.reducedMotion||{},r=Mi(),s=[];function d(){var p=n.mediaQuery==="min";an(i).sort(function(g,$){return p?+g-+$:+$-+g}).forEach(function(g){c(i[g],"("+(p?"min":"max")+"-width:"+g+"px)")}),c(l,Zo),L()}function u(p){p&&r.destroy()}function c(p,g){var $=matchMedia(g);r.bind($,"change",L),s.push([p,$])}function L(){var p=o.is(Bn),g=n.direction,$=s.reduce(function(f,x){return ye(f,x[1].matches?x[0]:{})},{});Qo(n),h($),n.destroy?t.destroy(n.destroy==="completely"):p?(u(!0),t.mount()):g!==n.direction&&t.refresh()}function v(p){matchMedia(Zo).matches&&(p?ye(n,l):Qo(n,an(l)))}function h(p,g,$){ye(n,p),g&&ye(Object.getPrototypeOf(n),p),($||!o.is(Me))&&t.emit(Nt,n)}return{setup:d,destroy:u,reduce:v,set:h}}var qn="Arrow",Xn=qn+"Left",Zn=qn+"Right",Zi=qn+"Up",Ji=qn+"Down",ni="rtl",Jn="ttb",so={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Zi,Zn],ArrowRight:[Ji,Xn]};function xa(t,e,n){function o(l,r,s){s=s||n.direction;var d=s===ni&&!r?1:s===Jn?0:-1;return so[l]&&so[l][d]||l.replace(/width|left|right/i,function(u,c){var L=so[u.toLowerCase()][d]||u;return c>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function i(l){return l*(n.direction===ni?1:-1)}return{resolve:o,orient:i}}var ue="role",Ne="tabindex",Ca="disabled",ne="aria-",xn=ne+"controls",Qi=ne+"current",oi=ne+"selected",qt=ne+"label",No=ne+"labelledby",tr=ne+"hidden",Ho=ne+"orientation",dn=ne+"roledescription",ii=ne+"live",ri=ne+"busy",ai=ne+"atomic",Bo=[ue,Ne,Ca,xn,Qi,qt,No,tr,Ho,dn],se=bn+"__",$e="is-",lo=bn,si=se+"track",Sa=se+"list",Qn=se+"slide",er=Qn+"--clone",$a=Qn+"__container",zo=se+"arrows",to=se+"arrow",nr=to+"--prev",or=to+"--next",eo=se+"pagination",ir=eo+"__page",wa=se+"progress",Ta=wa+"__bar",La=se+"toggle",_a=se+"spinner",Ea=se+"sr",Pa=$e+"initialized",Pe=$e+"active",rr=$e+"prev",ar=$e+"next",Co=$e+"visible",So=$e+"loading",sr=$e+"focus-in",lr=$e+"overflow",Wa=[Pe,Co,rr,ar,So,sr,lr],Fa={slide:Qn,clone:er,arrows:zo,arrow:to,prev:nr,next:or,pagination:eo,page:ir,spinner:_a};function Ra(t,e){if(Pi(t.closest))return t.closest(e);for(var n=t;n&&n.nodeType===1&&!rn(n,e);)n=n.parentElement;return n}var Ia=5,li=200,cr="touchstart mousedown",co="touchmove mousemove",uo="touchend touchcancel mouseup click";function Aa(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=t.root,s=n.i18n,d={},u=[],c=[],L=[],v,h,p;function g(){b(),R(),x()}function $(){i(Ft,f),i(Ft,g),i(Nt,x),l(document,cr+" keydown",function(y){p=y.type==="keydown"},{capture:!0}),l(r,"focusin",function(){ce(r,sr,!!p)})}function f(y){var w=Bo.concat("style");me(u),de(r,c),de(v,L),ae([v,h],w),ae(r,y?w:["style",dn])}function x(){de(r,c),de(v,L),c=_(lo),L=_(si),re(r,c),re(v,L),mt(r,qt,n.label),mt(r,No,n.labelledby)}function b(){v=W("."+si),h=vn(v,"."+Sa),en(v&&h,"A track/list element is missing."),An(u,Fi(h,"."+Qn+":not(."+er+")")),_e({arrows:zo,pagination:eo,prev:nr,next:or,bar:Ta,toggle:La},function(y,w){d[w]=W("."+y)}),sn(d,{root:r,track:v,list:h,slides:u})}function R(){var y=r.id||ha(bn),w=n.role;r.id=y,v.id=v.id||y+"-track",h.id=h.id||y+"-list",!ee(r,ue)&&r.tagName!=="SECTION"&&w&&mt(r,ue,w),mt(r,dn,s.carousel),mt(h,ue,"presentation")}function W(y){var w=Ai(r,y);return w&&Ra(w,"."+lo)===r?w:void 0}function _(y){return[y+"--"+n.type,y+"--"+n.direction,n.drag&&y+"--draggable",n.isNavigation&&y+"--nav",y===lo&&Pe]}return sn(d,{setup:g,mount:$,destroy:f})}var ze="slide",Ye="loop",Cn="fade";function ka(t,e,n,o){var i=_t(t),l=i.on,r=i.emit,s=i.bind,d=t.Components,u=t.root,c=t.options,L=c.isNavigation,v=c.updateOnMove,h=c.i18n,p=c.pagination,g=c.slideFocus,$=d.Direction.resolve,f=ee(o,"style"),x=ee(o,qt),b=n>-1,R=vn(o,"."+$a),W;function _(){b||(o.id=u.id+"-slide"+Fo(e+1),mt(o,ue,p?"tabpanel":"group"),mt(o,dn,h.slide),mt(o,qt,x||bo(h.slideLabel,[e+1,t.length]))),y()}function y(){s(o,"click",wt(r,Ro,I)),s(o,"keydown",wt(r,qi,I)),l([Ge,Xi,We],F),l(Ao,E),v&&l(ge,H)}function w(){W=!0,i.destroy(),de(o,Wa),ae(o,Bo),mt(o,"style",f),mt(o,qt,x||"")}function E(){var A=t.splides.map(function(P){var N=P.splide.Components.Slides.getAt(e);return N?N.slide.id:""}).join(" ");mt(o,qt,bo(h.slideX,(b?n:e)+1)),mt(o,xn,A),mt(o,ue,g?"button":""),g&&ae(o,dn)}function H(){W||F()}function F(){if(!W){var A=t.index;O(),z(),ce(o,rr,e===A-1),ce(o,ar,e===A+1)}}function O(){var A=K();A!==ti(o,Pe)&&(ce(o,Pe,A),mt(o,Qi,L&&A||""),r(A?Oi:Ni,I))}function z(){var A=C(),P=!A&&(!K()||b);if(t.state.is([Ue,gn])||mt(o,tr,P||""),mt(Po(o,c.focusableNodes||""),Ne,P?-1:""),g&&mt(o,Ne,P?-1:0),A!==ti(o,Co)&&(ce(o,Co,A),r(A?Hi:Bi,I)),!A&&document.activeElement===o){var N=d.Slides.getAt(t.index);N&&Ri(N.slide)}}function V(A,P,N){te(N&&R||o,A,P)}function K(){var A=t.index;return A===e||c.cloneStatus&&A===n}function C(){if(t.is(Cn))return K();var A=Yt(d.Elements.track),P=Yt(o),N=$("left",!0),Q=$("right",!0);return Dn(A[N])<=cn(P[N])&&Dn(P[Q])<=cn(A[Q])}function k(A,P){var N=zt(A-e);return!b&&(c.rewind||t.is(Ye))&&(N=xe(N,t.length-N)),N<=P}var I={index:e,slideIndex:n,slide:o,container:R,isClone:b,mount:_,destroy:w,update:F,style:V,isWithin:k};return I}function Ma(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=o.bind,s=e.Elements,d=s.slides,u=s.list,c=[];function L(){v(),i(Ft,h),i(Ft,v)}function v(){d.forEach(function(F,O){g(F,O,-1)})}function h(){W(function(F){F.destroy()}),me(c)}function p(){W(function(F){F.update()})}function g(F,O,z){var V=ka(t,O,z,F);V.mount(),c.push(V),c.sort(function(K,C){return K.index-C.index})}function $(F){return F?_(function(O){return!O.isClone}):c}function f(F){var O=e.Controller,z=O.toIndex(F),V=O.hasFocus()?1:n.perPage;return _(function(K){return kn(K.index,z,z+V-1)})}function x(F){return _(F)[0]}function b(F,O){Zt(F,function(z){if(be(z)&&(z=Ii(z)),Wi(z)){var V=d[O];V?Eo(z,V):yn(u,z),re(z,n.classes.slide),w(z,wt(l,Be))}}),l(Ft)}function R(F){Ee(_(F).map(function(O){return O.slide})),l(Ft)}function W(F,O){$(O).forEach(F)}function _(F){return c.filter(Pi(F)?F:function(O){return be(F)?rn(O.slide,F):_o(fn(F),O.index)})}function y(F,O,z){W(function(V){V.style(F,O,z)})}function w(F,O){var z=Po(F,"img"),V=z.length;V?z.forEach(function(K){r(K,"load error",function(){--V||O()})}):O()}function E(F){return F?d.length:c.length}function H(){return c.length>n.perPage}return{mount:L,destroy:h,update:p,register:g,get:$,getIn:f,getAt:x,add:b,remove:R,forEach:W,filter:_,style:y,getLength:E,isEnough:H}}function Oa(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=o.emit,s=e.Slides,d=e.Direction.resolve,u=e.Elements,c=u.root,L=u.track,v=u.list,h=s.getAt,p=s.style,g,$,f;function x(){b(),l(window,"resize load",va(wt(r,Be))),i([Nt,Ft],b),i(Be,R)}function b(){g=n.direction===Jn,te(c,"maxWidth",we(n.width)),te(L,d("paddingLeft"),W(!1)),te(L,d("paddingRight"),W(!0)),R(!0)}function R(I){var A=Yt(c);(I||$.width!==A.width||$.height!==A.height)&&(te(L,"height",_()),p(d("marginRight"),we(n.gap)),p("width",w()),p("height",E(),!0),$=A,r(Un),f!==(f=k())&&(ce(c,lr,f),r(fa,f)))}function W(I){var A=n.padding,P=d(I?"right":"left");return A&&we(A[P]||(on(A)?0:A))||"0px"}function _(){var I="";return g&&(I=y(),en(I,"height or heightRatio is missing."),I="calc("+I+" - "+W(!1)+" - "+W(!0)+")"),I}function y(){return we(n.height||Yt(v).width*n.heightRatio)}function w(){return n.autoWidth?null:we(n.fixedWidth)||(g?"":H())}function E(){return we(n.fixedHeight)||(g?n.autoHeight?null:H():y())}function H(){var I=we(n.gap);return"calc((100%"+(I&&" + "+I)+")/"+(n.perPage||1)+(I&&" - "+I)+")"}function F(){return Yt(v)[d("width")]}function O(I,A){var P=h(I||0);return P?Yt(P.slide)[d("width")]+(A?0:K()):0}function z(I,A){var P=h(I);if(P){var N=Yt(P.slide)[d("right")],Q=Yt(v)[d("left")];return zt(N-Q)+(A?0:K())}return 0}function V(I){return z(t.length-1)-z(0)+O(0,I)}function K(){var I=h(0);return I&&parseFloat(te(I.slide,d("marginRight")))||0}function C(I){return parseFloat(te(L,d("padding"+(I?"Right":"Left"))))||0}function k(){return t.is(Cn)||V(!0)>F()}return{mount:x,resize:R,listSize:F,slideSize:O,sliderSize:V,totalSize:z,getPadding:C,isOverflow:k}}var Na=2;function Ha(t,e,n){var o=_t(t),i=o.on,l=e.Elements,r=e.Slides,s=e.Direction.resolve,d=[],u;function c(){i(Ft,L),i([Nt,Be],h),(u=$())&&(p(u),e.Layout.resize(!0))}function L(){v(),c()}function v(){Ee(d),me(d),o.destroy()}function h(){var f=$();u!==f&&(u<f||!f)&&o.emit(Ft)}function p(f){var x=r.get().slice(),b=x.length;if(b){for(;x.length<f;)An(x,x);An(x.slice(-f),x.slice(0,f)).forEach(function(R,W){var _=W<f,y=g(R.slide,W);_?Eo(y,x[0].slide):yn(l.list,y),An(d,y),r.register(y,W-f+(_?0:b),R.index)})}}function g(f,x){var b=f.cloneNode(!0);return re(b,n.classes.clone),b.id=t.root.id+"-clone"+Fo(x+1),b}function $(){var f=n.clones;if(!t.is(Ye))f=0;else if(hn(f)){var x=n[s("fixedWidth")]&&e.Layout.slideSize(0),b=x&&cn(Yt(l.track)[s("width")]/x);f=b||n[s("autoWidth")]&&t.length||n.perPage*Na}return f}return{mount:c,destroy:v}}function Ba(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=t.state.set,s=e.Layout,d=s.slideSize,u=s.getPadding,c=s.totalSize,L=s.listSize,v=s.sliderSize,h=e.Direction,p=h.resolve,g=h.orient,$=e.Elements,f=$.list,x=$.track,b;function R(){b=e.Transition,i([Se,Un,Nt,Ft],W)}function W(){e.Controller.isBusy()||(e.Scroll.cancel(),y(t.index),e.Slides.update())}function _(P,N,Q,st){P!==N&&I(P>Q)&&(F(),w(H(V(),P>Q),!0)),r(Ue),l(ge,N,Q,P),b.start(N,function(){r(He),l(Ge,N,Q,P),st&&st()})}function y(P){w(z(P,!0))}function w(P,N){if(!t.is(Cn)){var Q=N?P:E(P);te(f,"transform","translate"+p("X")+"("+Q+"px)"),P!==Q&&l(Xi)}}function E(P){if(t.is(Ye)){var N=O(P),Q=N>e.Controller.getEnd(),st=N<0;(st||Q)&&(P=H(P,Q))}return P}function H(P,N){var Q=P-k(N),st=v();return P-=g(st*(cn(zt(Q)/st)||1))*(N?1:-1),P}function F(){w(V(),!0),b.cancel()}function O(P){for(var N=e.Slides.get(),Q=0,st=1/0,ot=0;ot<N.length;ot++){var ut=N[ot].index,M=zt(z(ut,!0)-P);if(M<=st)st=M,Q=ut;else break}return Q}function z(P,N){var Q=g(c(P-1)-C(P));return N?K(Q):Q}function V(){var P=p("left");return Yt(f)[P]-Yt(x)[P]+g(u(!1))}function K(P){return n.trimSpace&&t.is(ze)&&(P=Ae(P,0,g(v(!0)-L()))),P}function C(P){var N=n.focus;return N==="center"?(L()-d(P,!0))/2:+N*d(P)||0}function k(P){return z(P?e.Controller.getEnd():0,!!n.trimSpace)}function I(P){var N=g(H(V(),P));return P?N>=0:N<=f[p("scrollWidth")]-Yt(x)[p("width")]}function A(P,N){N=hn(N)?V():N;var Q=P!==!0&&g(N)<g(k(!1)),st=P!==!1&&g(N)>g(k(!0));return Q||st}return{mount:R,move:_,jump:y,translate:w,shift:H,cancel:F,toIndex:O,toPosition:z,getPosition:V,getLimit:k,exceededLimit:A,reposition:W}}function za(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=e.Move,s=r.getPosition,d=r.getLimit,u=r.toPosition,c=e.Slides,L=c.isEnough,v=c.getLength,h=n.omitEnd,p=t.is(Ye),g=t.is(ze),$=wt(V,!1),f=wt(V,!0),x=n.start||0,b,R=x,W,_,y;function w(){E(),i([Nt,Ft,jn],E),i(Un,H)}function E(){W=v(!0),_=n.perMove,y=n.perPage,b=I();var M=Ae(x,0,h?b:W-1);M!==x&&(x=M,r.reposition())}function H(){b!==I()&&l(jn)}function F(M,J,ht){if(!ut()){var pt=z(M),gt=k(pt);gt>-1&&(J||gt!==x)&&(Q(gt),r.move(pt,gt,R,ht))}}function O(M,J,ht,pt){e.Scroll.scroll(M,J,ht,function(){var gt=k(r.toIndex(s()));Q(h?xe(gt,b):gt),pt&&pt()})}function z(M){var J=x;if(be(M)){var ht=M.match(/([+\-<>])(\d+)?/)||[],pt=ht[1],gt=ht[2];pt==="+"||pt==="-"?J=K(x+ +(""+pt+(+gt||1)),x):pt===">"?J=gt?A(+gt):$(!0):pt==="<"&&(J=f(!0))}else J=p?M:Ae(M,0,b);return J}function V(M,J){var ht=_||(ot()?1:y),pt=K(x+ht*(M?-1:1),x,!(_||ot()));return pt===-1&&g&&!ki(s(),d(!M),1)?M?0:b:J?pt:k(pt)}function K(M,J,ht){if(L()||ot()){var pt=C(M);pt!==M&&(J=M,M=pt,ht=!1),M<0||M>b?!_&&(kn(0,M,J,!0)||kn(b,J,M,!0))?M=A(P(M)):p?M=ht?M<0?-(W%y||y):W:M:n.rewind?M=M<0?b:0:M=-1:ht&&M!==J&&(M=A(P(J)+(M<J?-1:1)))}else M=-1;return M}function C(M){if(g&&n.trimSpace==="move"&&M!==x)for(var J=s();J===u(M,!0)&&kn(M,0,t.length-1,!n.rewind);)M<x?--M:++M;return M}function k(M){return p?(M+W)%W||0:M}function I(){for(var M=W-(ot()||p&&_?1:y);h&&M-- >0;)if(u(W-1,!0)!==u(M,!0)){M++;break}return Ae(M,0,W-1)}function A(M){return Ae(ot()?M:y*M,0,b)}function P(M){return ot()?xe(M,b):Dn((M>=b?W-1:M)/y)}function N(M){var J=r.toIndex(M);return g?Ae(J,0,b):J}function Q(M){M!==x&&(R=x,x=M)}function st(M){return M?R:x}function ot(){return!hn(n.focus)||n.isNavigation}function ut(){return t.state.is([Ue,gn])&&!!n.waitForTransition}return{mount:w,go:F,scroll:O,getNext:$,getPrev:f,getAdjacent:V,getEnd:I,setIndex:Q,getIndex:st,toIndex:A,toPage:P,toDest:N,hasFocus:ot,isBusy:ut}}var Da="http://www.w3.org/2000/svg",ja="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",Ln=40;function Va(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=o.emit,s=n.classes,d=n.i18n,u=e.Elements,c=e.Controller,L=u.arrows,v=u.track,h=L,p=u.prev,g=u.next,$,f,x={};function b(){W(),i(Nt,R)}function R(){_(),b()}function W(){var O=n.arrows;O&&!(p&&g)&&E(),p&&g&&(sn(x,{prev:p,next:g}),ln(h,O?"":"none"),re(h,f=zo+"--"+n.direction),O&&(y(),F(),mt([p,g],xn,v.id),r(Vi,p,g)))}function _(){o.destroy(),de(h,f),$?(Ee(L?[p,g]:h),p=g=null):ae([p,g],Bo)}function y(){i([Se,Ge,Ft,We,jn],F),l(g,"click",wt(w,">")),l(p,"click",wt(w,"<"))}function w(O){c.go(O,!0)}function E(){h=L||Oe("div",s.arrows),p=H(!0),g=H(!1),$=!0,yn(h,[p,g]),!L&&Eo(h,v)}function H(O){var z='<button class="'+s.arrow+" "+(O?s.prev:s.next)+'" type="button"><svg xmlns="'+Da+'" viewBox="0 0 '+Ln+" "+Ln+'" width="'+Ln+'" height="'+Ln+'" focusable="false"><path d="'+(n.arrowPath||ja)+'" />';return Ii(z)}function F(){if(p&&g){var O=t.index,z=c.getPrev(),V=c.getNext(),K=z>-1&&O<z?d.last:d.prev,C=V>-1&&O>V?d.first:d.next;p.disabled=z<0,g.disabled=V<0,mt(p,qt,K),mt(g,qt,C),r(Ki,p,g,z,V)}}return{arrows:x,mount:b,destroy:_,update:F}}var Ka=Wo+"-interval";function Ua(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=o.emit,s=Yn(n.interval,t.go.bind(t,">"),y),d=s.isPaused,u=e.Elements,c=e.Elements,L=c.root,v=c.toggle,h=n.autoplay,p,g,$=h==="pause";function f(){h&&(x(),v&&mt(v,xn,u.track.id),$||b(),_())}function x(){n.pauseOnHover&&l(L,"mouseenter mouseleave",function(E){p=E.type==="mouseenter",W()}),n.pauseOnFocus&&l(L,"focusin focusout",function(E){g=E.type==="focusin",W()}),v&&l(v,"click",function(){$?b():R(!0)}),i([ge,Gn,Ft],s.rewind),i(ge,w)}function b(){d()&&e.Slides.isEnough()&&(s.start(!n.resetProgress),g=p=$=!1,_(),r(ko))}function R(E){E===void 0&&(E=!0),$=!!E,_(),d()||(s.pause(),r(Mo))}function W(){$||(p||g?R(!1):b())}function _(){v&&(ce(v,Pe,!$),mt(v,qt,n.i18n[$?"play":"pause"]))}function y(E){var H=u.bar;H&&te(H,"width",E*100+"%"),r(Yi,E)}function w(E){var H=e.Slides.getAt(E);s.set(H&&+ee(H.slide,Ka)||n.interval)}return{mount:f,destroy:s.cancel,play:b,pause:R,isPaused:d}}function Ga(t,e,n){var o=_t(t),i=o.on;function l(){n.cover&&(i(Oo,wt(s,!0)),i([Se,Nt,Ft],wt(r,!0)))}function r(d){e.Slides.forEach(function(u){var c=vn(u.container||u.slide,"img");c&&c.src&&s(d,c,u)})}function s(d,u,c){c.style("background",d?'center/cover no-repeat url("'+u.src+'")':"",!0),ln(u,d?"none":"")}return{mount:l,destroy:wt(r,!1)}}var Ya=10,qa=600,Xa=.6,Za=1.5,Ja=800;function Qa(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=t.state.set,s=e.Move,d=s.getPosition,u=s.getLimit,c=s.exceededLimit,L=s.translate,v=t.is(ze),h,p,g=1;function $(){i(ge,R),i([Nt,Ft],W)}function f(y,w,E,H,F){var O=d();if(R(),E&&(!v||!c())){var z=e.Layout.sliderSize(),V=vo(y)*z*Dn(zt(y)/z)||0;y=s.toPosition(e.Controller.toDest(y%z))+V}var K=ki(O,y,1);g=1,w=K?0:w||zn(zt(y-O)/Za,Ja),p=H,h=Yn(w,x,wt(b,O,y,F),1),r(gn),l(Gn),h.start()}function x(){r(He),p&&p(),l(We)}function b(y,w,E,H){var F=d(),O=y+(w-y)*_(H),z=(O-F)*g;L(F+z),v&&!E&&c()&&(g*=Xa,zt(z)<Ya&&f(u(c(!0)),qa,!1,p,!0))}function R(){h&&h.cancel()}function W(){h&&!h.isPaused()&&(R(),x())}function _(y){var w=n.easingFunc;return w?w(y):1-Math.pow(1-y,4)}return{mount:$,destroy:R,scroll:f,cancel:W}}var ke={passive:!1,capture:!0};function ts(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=o.bind,s=o.unbind,d=t.state,u=e.Move,c=e.Scroll,L=e.Controller,v=e.Elements.track,h=e.Media.reduce,p=e.Direction,g=p.resolve,$=p.orient,f=u.getPosition,x=u.exceededLimit,b,R,W,_,y,w=!1,E,H,F;function O(){r(v,co,fo,ke),r(v,uo,fo,ke),r(v,cr,V,ke),r(v,"click",k,{capture:!0}),r(v,"dragstart",le),i([Se,Nt],z)}function z(){var B=n.drag;at(!B),_=B==="free"}function V(B){if(E=!1,!H){var T=gt(B);pt(B.target)&&(T||!B.button)&&(L.isBusy()?le(B,!0):(F=T?v:window,y=d.is([Ue,gn]),W=null,r(F,co,K,ke),r(F,uo,C,ke),u.cancel(),c.cancel(),I(B)))}}function K(B){if(d.is(In)||(d.set(In),l(zi)),B.cancelable)if(y){u.translate(b+ht(ot(B)));var T=ut(B)>li,U=w!==(w=x());(T||U)&&I(B),E=!0,l(Di),le(B)}else N(B)&&(y=P(B),le(B))}function C(B){d.is(In)&&(d.set(He),l(ji)),y&&(A(B),le(B)),s(F,co,K),s(F,uo,C),y=!1}function k(B){!H&&E&&le(B,!0)}function I(B){W=R,R=B,b=f()}function A(B){var T=Q(B),U=st(T),q=n.rewind&&n.rewindByDrag;h(!1),_?L.scroll(U,0,n.snap):t.is(Cn)?L.go($(vo(T))<0?q?"<":"-":q?">":"+"):t.is(ze)&&w&&q?L.go(x(!0)?">":"<"):L.go(L.toDest(U),!0),h(!0)}function P(B){var T=n.dragMinThreshold,U=on(T),q=U&&T.mouse||0,Z=(U?T.touch:+T)||10;return zt(ot(B))>(gt(B)?Z:q)}function N(B){return zt(ot(B))>zt(ot(B,!0))}function Q(B){if(t.is(Ye)||!w){var T=ut(B);if(T&&T<li)return ot(B)/T}return 0}function st(B){return f()+vo(B)*xe(zt(B)*(n.flickPower||600),_?1/0:e.Layout.listSize()*(n.flickMaxPages||1))}function ot(B,T){return J(B,T)-J(M(B),T)}function ut(B){return yo(B)-yo(M(B))}function M(B){return R===B&&W||R}function J(B,T){return(gt(B)?B.changedTouches[0]:B)["page"+g(T?"Y":"X")]}function ht(B){return B/(w&&t.is(ze)?Ia:1)}function pt(B){var T=n.noDrag;return!rn(B,"."+ir+", ."+to)&&(!T||!rn(B,T))}function gt(B){return typeof TouchEvent<"u"&&B instanceof TouchEvent}function D(){return y}function at(B){H=B}return{mount:O,disable:at,isDragging:D}}var es={Spacebar:" ",Right:Zn,Left:Xn,Up:Zi,Down:Ji};function Do(t){return t=be(t)?t:t.key,es[t]||t}var ci="keydown";function ns(t,e,n){var o=_t(t),i=o.on,l=o.bind,r=o.unbind,s=t.root,d=e.Direction.resolve,u,c;function L(){v(),i(Nt,h),i(Nt,v),i(ge,g)}function v(){var f=n.keyboard;f&&(u=f==="global"?window:s,l(u,ci,$))}function h(){r(u,ci)}function p(f){c=f}function g(){var f=c;c=!0,Ei(function(){c=f})}function $(f){if(!c){var x=Do(f);x===d(Xn)?t.go("<"):x===d(Zn)&&t.go(">")}}return{mount:L,destroy:h,disable:p}}var nn=Wo+"-lazy",Mn=nn+"-srcset",os="["+nn+"], ["+Mn+"]";function is(t,e,n){var o=_t(t),i=o.on,l=o.off,r=o.bind,s=o.emit,d=n.lazyLoad==="sequential",u=[Ge,We],c=[];function L(){n.lazyLoad&&(v(),i(Ft,v))}function v(){me(c),h(),d?f():(l(u),i(u,p),p())}function h(){e.Slides.forEach(function(x){Po(x.slide,os).forEach(function(b){var R=ee(b,nn),W=ee(b,Mn);if(R!==b.src||W!==b.srcset){var _=n.classes.spinner,y=b.parentElement,w=vn(y,"."+_)||Oe("span",_,y);c.push([b,x,w]),b.src||ln(b,"none")}})})}function p(){c=c.filter(function(x){var b=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(t.index,b)?g(x):!0}),c.length||l(u)}function g(x){var b=x[0];re(x[1].slide,So),r(b,"load error",wt($,x)),mt(b,"src",ee(b,nn)),mt(b,"srcset",ee(b,Mn)),ae(b,nn),ae(b,Mn)}function $(x,b){var R=x[0],W=x[1];de(W.slide,So),b.type!=="error"&&(Ee(x[2]),ln(R,""),s(Oo,R,W),s(Be)),d&&f()}function f(){c.length&&g(c.shift())}return{mount:L,destroy:wt(me,c),check:p}}function rs(t,e,n){var o=_t(t),i=o.on,l=o.emit,r=o.bind,s=e.Slides,d=e.Elements,u=e.Controller,c=u.hasFocus,L=u.getIndex,v=u.go,h=e.Direction.resolve,p=d.pagination,g=[],$,f;function x(){b(),i([Nt,Ft,jn],x);var H=n.pagination;p&&ln(p,H?"":"none"),H&&(i([ge,Gn,We],E),R(),E(),l(Ui,{list:$,items:g},w(t.index)))}function b(){$&&(Ee(p?Ce($.children):$),de($,f),me(g),$=null),o.destroy()}function R(){var H=t.length,F=n.classes,O=n.i18n,z=n.perPage,V=c()?u.getEnd()+1:cn(H/z);$=p||Oe("ul",F.pagination,d.track.parentElement),re($,f=eo+"--"+y()),mt($,ue,"tablist"),mt($,qt,O.select),mt($,Ho,y()===Jn?"vertical":"");for(var K=0;K<V;K++){var C=Oe("li",null,$),k=Oe("button",{class:F.page,type:"button"},C),I=s.getIn(K).map(function(P){return P.slide.id}),A=!c()&&z>1?O.pageX:O.slideX;r(k,"click",wt(W,K)),n.paginationKeyboard&&r(k,"keydown",wt(_,K)),mt(C,ue,"presentation"),mt(k,ue,"tab"),mt(k,xn,I.join(" ")),mt(k,qt,bo(A,K+1)),mt(k,Ne,-1),g.push({li:C,button:k,page:K})}}function W(H){v(">"+H,!0)}function _(H,F){var O=g.length,z=Do(F),V=y(),K=-1;z===h(Zn,!1,V)?K=++H%O:z===h(Xn,!1,V)?K=(--H+O)%O:z==="Home"?K=0:z==="End"&&(K=O-1);var C=g[K];C&&(Ri(C.button),v(">"+K),le(F,!0))}function y(){return n.paginationDirection||n.direction}function w(H){return g[u.toPage(H)]}function E(){var H=w(L(!0)),F=w(L());if(H){var O=H.button;de(O,Pe),ae(O,oi),mt(O,Ne,-1)}if(F){var z=F.button;re(z,Pe),mt(z,oi,!0),mt(z,Ne,"")}l(Gi,{list:$,items:g},H,F)}return{items:g,mount:x,destroy:b,getAt:w,update:E}}var as=[" ","Enter"];function ss(t,e,n){var o=n.isNavigation,i=n.slideFocus,l=[];function r(){t.splides.forEach(function(p){p.isParent||(u(t,p.splide),u(p.splide,t))}),o&&c()}function s(){l.forEach(function(p){p.destroy()}),me(l)}function d(){s(),r()}function u(p,g){var $=_t(p);$.on(ge,function(f,x,b){g.go(g.is(Ye)?b:f)}),l.push($)}function c(){var p=_t(t),g=p.on;g(Ro,v),g(qi,h),g([Se,Nt],L),l.push(p),p.emit(Ao,t.splides)}function L(){mt(e.Elements.list,Ho,n.direction===Jn?"vertical":"")}function v(p){t.go(p.index)}function h(p,g){_o(as,Do(g))&&(v(p),le(g))}return{setup:wt(e.Media.set,{slideFocus:hn(i)?o:i},!0),mount:r,destroy:s,remount:d}}function ls(t,e,n){var o=_t(t),i=o.bind,l=0;function r(){n.wheel&&i(e.Elements.track,"wheel",s,ke)}function s(u){if(u.cancelable){var c=u.deltaY,L=c<0,v=yo(u),h=n.wheelMinThreshold||0,p=n.wheelSleep||0;zt(c)>h&&v-l>p&&(t.go(L?"<":">"),l=v),d(L)&&le(u)}}function d(u){return!n.releaseWheel||t.state.is(Ue)||e.Controller.getAdjacent(u)!==-1}return{mount:r}}var cs=90;function ds(t,e,n){var o=_t(t),i=o.on,l=e.Elements.track,r=n.live&&!n.isNavigation,s=Oe("span",Ea),d=Yn(cs,wt(c,!1));function u(){r&&(v(!e.Autoplay.isPaused()),mt(l,ai,!0),s.textContent="…",i(ko,wt(v,!0)),i(Mo,wt(v,!1)),i([Ge,We],wt(c,!0)))}function c(h){mt(l,ri,h),h?(yn(l,s),d.start()):(Ee(s),d.cancel())}function L(){ae(l,[ii,ai,ri]),Ee(s)}function v(h){r&&mt(l,ii,h?"off":"polite")}return{mount:u,disable:v,destroy:L}}var us=Object.freeze({__proto__:null,Media:ba,Direction:xa,Elements:Aa,Slides:Ma,Layout:Oa,Clones:Ha,Move:Ba,Controller:za,Arrows:Va,Autoplay:Ua,Cover:Ga,Scroll:Qa,Drag:ts,Keyboard:ns,LazyLoad:is,Pagination:rs,Sync:ss,Wheel:ls,Live:ds}),ps={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},ms={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Fa,i18n:ps,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function gs(t,e,n){var o=e.Slides;function i(){_t(t).on([Se,Ft],l)}function l(){o.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function r(s,d){o.style("transition","opacity "+n.speed+"ms "+n.easing),Ei(d)}return{mount:i,start:r,cancel:fo}}function hs(t,e,n){var o=e.Move,i=e.Controller,l=e.Scroll,r=e.Elements.list,s=wt(te,r,"transition"),d;function u(){_t(t).bind(r,"transitionend",function(h){h.target===r&&d&&(L(),d())})}function c(h,p){var g=o.toPosition(h,!0),$=o.getPosition(),f=v(h);zt(g-$)>=1&&f>=1?n.useScroll?l.scroll(g,f,!1,p):(s("transform "+f+"ms "+n.easing),o.translate(g,!0),d=p):(o.jump(h),p())}function L(){s(""),l.cancel()}function v(h){var p=n.rewindSpeed;if(t.is(ze)&&p){var g=i.getIndex(!0),$=i.getEnd();if(g===0&&h>=$||g>=$&&h===0)return p}return n.speed}return{mount:u,start:c,cancel:L}}var fs=(function(){function t(n,o){this.event=_t(),this.Components={},this.state=ya(Me),this.splides=[],this._o={},this._E={};var i=be(n)?Ai(document,n):n;en(i,i+" is invalid."),this.root=i,o=ye({label:ee(i,qt)||"",labelledby:ee(i,No)||""},ms,t.defaults,o||{});try{ye(o,JSON.parse(ee(i,Wo)))}catch{en(!1,"Invalid JSON")}this._o=Object.create(ye({},o))}var e=t.prototype;return e.mount=function(o,i){var l=this,r=this.state,s=this.Components;en(r.is([Me,Bn]),"Already mounted!"),r.set(Me),this._C=s,this._T=i||this._T||(this.is(Cn)?gs:hs),this._E=o||this._E;var d=sn({},us,this._E,{Transition:this._T});return _e(d,function(u,c){var L=u(l,s,l._o);s[c]=L,L.setup&&L.setup()}),_e(s,function(u){u.mount&&u.mount()}),this.emit(Se),re(this.root,Pa),r.set(He),this.emit(xo),this},e.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(He)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},e.go=function(o){return this._C.Controller.go(o),this},e.on=function(o,i){return this.event.on(o,i),this},e.off=function(o){return this.event.off(o),this},e.emit=function(o){var i;return(i=this.event).emit.apply(i,[o].concat(Ce(arguments,1))),this},e.add=function(o,i){return this._C.Slides.add(o,i),this},e.remove=function(o){return this._C.Slides.remove(o),this},e.is=function(o){return this._o.type===o},e.refresh=function(){return this.emit(Ft),this},e.destroy=function(o){o===void 0&&(o=!0);var i=this.event,l=this.state;return l.is(Me)?_t(this).on(xo,this.destroy.bind(this,o)):(_e(this._C,function(r){r.destroy&&r.destroy(o)},!0),i.emit(Io),i.destroy(),o&&me(this.splides),l.set(Bn)),this},pa(t,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),t})(),jo=fs;jo.defaults={};jo.STATES=ga;var di=[[Se,"onMounted"],[xo,"onReady"],[ge,"onMove"],[Ge,"onMoved"],[Ro,"onClick"],[Oi,"onActive"],[Ni,"onInactive"],[Hi,"onVisible"],[Bi,"onHidden"],[Ft,"onRefresh"],[Nt,"onUpdated"],[Be,"onResize"],[Un,"onResized"],[zi,"onDrag"],[Di,"onDragging"],[ji,"onDragged"],[Gn,"onScroll"],[We,"onScrolled"],[Io,"onDestroy"],[Vi,"onArrowsMounted"],[Ki,"onArrowsUpdated"],[Ui,"onPaginationMounted"],[Gi,"onPaginationUpdated"],[Ao,"onNavigationMounted"],[ko,"onAutoplayPlay"],[Yi,"onAutoplayPlaying"],[Mo,"onAutoplayPause"],[Oo,"onLazyLoadLoaded"]];function Vo(...t){return t.filter(Boolean).join(" ")}function Vn(t){return t!==null&&typeof t=="object"}function $o(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&!t.some((n,o)=>!$o(n,e[o]));if(Vn(t)&&Vn(e)){const n=Object.keys(t),o=Object.keys(e);return n.length===o.length&&!n.some(i=>!Object.prototype.hasOwnProperty.call(e,i)||!$o(t[i],e[i]))}return t===e}function ys(t,e){return t.length===e.length&&!t.some((n,o)=>n!==e[o])}function vs(t,e){if(t){const n=Object.keys(t);for(let o=0;o<n.length;o++){const i=n[o];if(i!=="__proto__"&&e(t[i],i)===!1)break}}return t}function wo(t,e){const n=t;return vs(e,(o,i)=>{Array.isArray(o)?n[i]=o.slice():Vn(o)?n[i]=wo(Vn(n[i])?n[i]:{},o):n[i]=o}),n}var bs=({children:t,className:e,...n})=>m.createElement("div",{className:Vo("splide__track",e),...n},m.createElement("ul",{className:"splide__list"},t)),Ko=class extends m.Component{constructor(){super(...arguments),this.splideRef=m.createRef(),this.slides=[]}componentDidMount(){const{options:t,extensions:e,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new jo(o,t),this.bind(this.splide),this.splide.mount(e,n),this.options=wo({},t||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:t}=this.props;t&&!$o(this.options,t)&&(this.splide.options=t,this.options=wo({},t));const e=this.getSlides();ys(this.slides,e)||(this.splide.refresh(),this.slides=e)}sync(t){var e;(e=this.splide)==null||e.sync(t)}go(t){var e;(e=this.splide)==null||e.go(t)}getSlides(){var t;if(this.splide){const e=(t=this.splide.Components.Elements)==null?void 0:t.list.children;return e&&Array.prototype.slice.call(e)||[]}return[]}bind(t){di.forEach(([e,n])=>{const o=this.props[n];typeof o=="function"&&t.on(e,(...i)=>{o(t,...i)})})}omit(t,e){return e.forEach(n=>{Object.prototype.hasOwnProperty.call(t,n)&&delete t[n]}),t}render(){const{className:t,tag:e="div",hasTrack:n=!0,children:o,...i}=this.props;return m.createElement(e,{className:Vo("splide",t),ref:this.splideRef,...this.omit(i,["options",...di.map(l=>l[1])])},n?m.createElement(bs,null,o):o)}},Uo=({children:t,className:e,...n})=>m.createElement("li",{className:Vo("splide__slide",e),...n},t);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),ve=require("classnames"),T=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Bi=require("react-dom");function Nr(e){return e.type==="object"&&e.version===1}const Or="ControlSlider-module__wrapper___sHEkd",Hr="ControlSlider-module__hoverArrow___A-dOH",Br="ControlSlider-module__sliderItem___QQSkR",Vr="ControlSlider-module__sliderImage___9hRl-",Dr="ControlSlider-module__arrow___05ghY",zr="ControlSlider-module__arrowVertical___tBfVN",jr="ControlSlider-module__nextArrow___-30Yc",Kr="ControlSlider-module__arrowInner___aEra3",Ur="ControlSlider-module__arrowIcon___S4ztF",qr="ControlSlider-module__arrowImg___2dwJW",Gr="ControlSlider-module__mirror___brd6U",Yr="ControlSlider-module__pagination___bicLF",Xr="ControlSlider-module__paginationInner___bT-P-",Zr="ControlSlider-module__paginationVertical___zYqKw",Jr="ControlSlider-module__paginationItem___nTRbk",Qr="ControlSlider-module__dot___p1Qun",ea="ControlSlider-module__activeDot___LHFaj",ta="ControlSlider-module__paginationInsideBottom___R3FWn",na="ControlSlider-module__paginationInsideTop___V-qb-",oa="ControlSlider-module__paginationOutsideBottom___14w8D",ia="ControlSlider-module__paginationOutsideTop___SCLqB",ra="ControlSlider-module__paginationInsideLeft___yOBRZ",aa="ControlSlider-module__paginationInsideRight___Rtt3o",sa="ControlSlider-module__paginationOutsideLeft___lahaw",la="ControlSlider-module__paginationOutsideRight___EtuQa",ca="ControlSlider-module__imgWrapper___UjEgB",da="ControlSlider-module__captionBlock___dJ6-j",ua="ControlSlider-module__captionTextWrapper___HFlpf",pa="ControlSlider-module__captionText___uGBVc",ma="ControlSlider-module__active___WZK4G",ga="ControlSlider-module__withPointerEvents___t-18M",ha="ControlSlider-module__topLeftAlignment___zjnGM",fa="ControlSlider-module__topCenterAlignment___gD1xW",ya="ControlSlider-module__topRightAlignment___NMapS",va="ControlSlider-module__middleLeftAlignment___OnUrY",ba="ControlSlider-module__middleCenterAlignment___Tdkl0",xa="ControlSlider-module__middleRightAlignment___wEbfX",Ca="ControlSlider-module__bottomLeftAlignment___cTP2-",Sa="ControlSlider-module__bottomCenterAlignment___c54fB",wa="ControlSlider-module__bottomRightAlignment___kEwrz",$a="ControlSlider-module__clickOverlay___DZA28",Ta="ControlSlider-module__contain___pLyq7",La="ControlSlider-module__cover___KdDat",ae={wrapper:Or,hoverArrow:Hr,sliderItem:Br,sliderImage:Vr,arrow:Dr,arrowVertical:zr,nextArrow:jr,arrowInner:Kr,arrowIcon:Ur,arrowImg:qr,mirror:Gr,pagination:Yr,paginationInner:Xr,paginationVertical:Zr,paginationItem:Jr,dot:Qr,activeDot:ea,paginationInsideBottom:ta,paginationInsideTop:na,paginationOutsideBottom:oa,paginationOutsideTop:ia,paginationInsideLeft:ra,paginationInsideRight:aa,paginationOutsideLeft:sa,paginationOutsideRight:la,imgWrapper:ca,captionBlock:da,captionTextWrapper:ua,captionText:pa,active:ma,withPointerEvents:ga,topLeftAlignment:ha,topCenterAlignment:fa,topRightAlignment:ya,middleLeftAlignment:va,middleCenterAlignment:ba,middleRightAlignment:xa,bottomLeftAlignment:Ca,bottomCenterAlignment:Sa,bottomRightAlignment:wa,clickOverlay:$a,contain:Ta,cover:La};function Ea(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _a(e,t,n){return t&&Ea(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var li="(prefers-reduced-motion: reduce)",Ut=1,Pa=2,Yt=3,nn=4,Cn=5,On=6,Kn=7,Aa={CREATED:Ut,MOUNTED:Pa,IDLE:Yt,MOVING:nn,SCROLLING:Cn,DRAGGING:On,DESTROYED:Kn};function vt(e){e.length=0}function _t(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ee(e){return e.bind.apply(e,[null].concat(_t(arguments,1)))}var Vi=setTimeout,So=function(){};function ci(e){return requestAnimationFrame(e)}function Xn(e,t){return typeof t===e}function un(e){return!Fo(e)&&Xn("object",e)}var Io=Array.isArray,Di=Ee(Xn,"function"),Tt=Ee(Xn,"string"),Sn=Ee(Xn,"undefined");function Fo(e){return e===null}function zi(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function wn(e){return Io(e)?e:[e]}function tt(e,t){wn(e).forEach(t)}function Ro(e,t){return e.indexOf(t)>-1}function Hn(e,t){return e.push.apply(e,wn(t)),e}function gt(e,t,n){e&&tt(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function ct(e,t){gt(e,Tt(t)?t.split(" "):t,!0)}function $n(e,t){tt(t,e.appendChild.bind(e))}function ko(e,t){tt(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function pn(e,t){return zi(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ji(e,t){var n=e?_t(e.children):[];return t?n.filter(function(o){return pn(o,t)}):n}function Tn(e,t){return t?ji(e,t)[0]:e.firstElementChild}var mn=Object.keys;function Nt(e,t,n){return e&&(n?mn(e).reverse():mn(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function gn(e){return _t(arguments,1).forEach(function(t){Nt(t,function(n,o){e[o]=t[o]})}),e}function wt(e){return _t(arguments,1).forEach(function(t){Nt(t,function(n,o){Io(n)?e[o]=n.slice():un(n)?e[o]=wt({},un(e[o])?e[o]:{},n):e[o]=n})}),e}function di(e,t){tt(t||mn(e),function(n){delete e[n]})}function dt(e,t){tt(e,function(n){tt(t,function(o){n&&n.removeAttribute(o)})})}function fe(e,t,n){un(t)?Nt(t,function(o,i){fe(e,i,o)}):tt(e,function(o){Fo(n)||n===""?dt(o,t):o.setAttribute(t,String(n))})}function qt(e,t,n){var o=document.createElement(e);return t&&(Tt(t)?ct(o,t):fe(o,t)),n&&$n(n,o),o}function at(e,t,n){if(Sn(n))return getComputedStyle(e)[t];Fo(n)||(e.style[t]=""+n)}function hn(e,t){at(e,"display",t)}function Ki(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function st(e,t){return e.getAttribute(t)}function ui(e,t){return e&&e.classList.contains(t)}function Je(e){return e.getBoundingClientRect()}function Ot(e){tt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ui(e){return Tn(new DOMParser().parseFromString(e,"text/html").body)}function mt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function qi(e,t){return e&&e.querySelector(t)}function Mo(e,t){return t?_t(e.querySelectorAll(t)):[]}function ht(e,t){gt(e,t,!1)}function wo(e){return e.timeStamp}function Rt(e){return Tt(e)?e:e?e+"px":""}var Ln="splide",No="data-"+Ln;function cn(e,t){if(!e)throw new Error("["+Ln+"] "+(t||""))}var Lt=Math.min,Un=Math.max,qn=Math.floor,fn=Math.ceil,ze=Math.abs;function Gi(e,t,n){return ze(e-t)<n}function Bn(e,t,n,o){var i=Lt(t,n),l=Un(t,n);return o?i<e&&e<l:i<=e&&e<=l}function jt(e,t,n){var o=Lt(t,n),i=Un(t,n);return Lt(Un(o,e),i)}function $o(e){return+(e>0)-+(e<0)}function To(e,t){return tt(t,function(n){e=e.replace("%s",""+n)}),e}function Oo(e){return e<10?"0"+e:""+e}var pi={};function Wa(e){return""+e+Oo(pi[e]=(pi[e]||0)+1)}function Yi(){var e=[];function t(r,s,c,p){i(r,s,function(d,$,h){var f="addEventListener"in d,m=f?d.removeEventListener.bind(d,$,c,p):d.removeListener.bind(d,c);f?d.addEventListener($,c,p):d.addListener(c),e.push([d,$,h,c,m])})}function n(r,s,c){i(r,s,function(p,d,$){e=e.filter(function(h){return h[0]===p&&h[1]===d&&h[2]===$&&(!c||h[3]===c)?(h[4](),!1):!0})})}function o(r,s,c){var p,d=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:d,detail:c}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,d,!1,c)),r.dispatchEvent(p),p}function i(r,s,c){tt(r,function(p){p&&tt(s,function(d){d.split(" ").forEach(function($){var h=$.split(".");c(p,h[0],h[1])})})})}function l(){e.forEach(function(r){r[4]()}),vt(e)}return{bind:t,unbind:n,dispatch:o,destroy:l}}var Pt="mounted",Lo="ready",bt="move",on="moved",Ho="click",Xi="active",Zi="inactive",Ji="visible",Qi="hidden",Ie="refresh",De="updated",Xt="resize",Zn="resized",er="drag",tr="dragging",nr="dragged",Jn="scroll",Vt="scrolled",Ia="overflow",Bo="destroy",or="arrows:mounted",ir="arrows:updated",rr="pagination:mounted",ar="pagination:updated",Vo="navigation:mounted",Do="autoplay:play",sr="autoplay:playing",zo="autoplay:pause",jo="lazyload:loaded",lr="sk",cr="sh",Gn="ei";function _e(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Yi();function o(l,r){n.bind(t,wn(l).join(" "),function(s){r.apply(r,Io(s.detail)?s.detail:[])})}function i(l){n.dispatch(t,l,_t(arguments,1))}return e&&e.event.on(Bo,n.destroy),gn(n,{bus:t,on:o,off:Ee(n.unbind,t),emit:i})}function Qn(e,t,n,o){var i=Date.now,l,r=0,s,c=!0,p=0;function d(){if(!c){if(r=e?Lt((i()-l)/e,1):1,n&&n(r),r>=1&&(t(),l=i(),o&&++p>=o))return h();s=ci(d)}}function $(y){y||m(),l=i()-(y?r*e:0),c=!1,s=ci(d)}function h(){c=!0}function f(){l=i(),r=0,n&&n(r)}function m(){s&&cancelAnimationFrame(s),r=0,s=0,c=!0}function g(y){e=y}function C(){return c}return{start:$,rewind:f,pause:h,cancel:m,set:g,isPaused:C}}function Fa(e){var t=e;function n(i){t=i}function o(i){return Ro(wn(i),t)}return{set:n,is:o}}function Ra(e,t){var n=Qn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ka(e,t,n){var o=e.state,i=n.breakpoints||{},l=n.reducedMotion||{},r=Yi(),s=[];function c(){var m=n.mediaQuery==="min";mn(i).sort(function(g,C){return m?+g-+C:+C-+g}).forEach(function(g){d(i[g],"("+(m?"min":"max")+"-width:"+g+"px)")}),d(l,li),$()}function p(m){m&&r.destroy()}function d(m,g){var C=matchMedia(g);r.bind(C,"change",$),s.push([m,C])}function $(){var m=o.is(Kn),g=n.direction,C=s.reduce(function(y,x){return wt(y,x[1].matches?x[0]:{})},{});di(n),f(C),n.destroy?e.destroy(n.destroy==="completely"):m?(p(!0),e.mount()):g!==n.direction&&e.refresh()}function h(m){matchMedia(li).matches&&(m?wt(n,l):di(n,mn(l)))}function f(m,g,C){wt(n,m),g&&wt(Object.getPrototypeOf(n),m),(C||!o.is(Ut))&&e.emit(De,n)}return{setup:c,destroy:p,reduce:h,set:f}}var eo="Arrow",to=eo+"Left",no=eo+"Right",dr=eo+"Up",ur=eo+"Down",mi="rtl",oo="ttb",po={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[dr,no],ArrowRight:[ur,to]};function Ma(e,t,n){function o(l,r,s){s=s||n.direction;var c=s===mi&&!r?1:s===oo?0:-1;return po[l]&&po[l][c]||l.replace(/width|left|right/i,function(p,d){var $=po[p.toLowerCase()][c]||p;return d>0?$.charAt(0).toUpperCase()+$.slice(1):$})}function i(l){return l*(n.direction===mi?1:-1)}return{resolve:o,orient:i}}var ft="role",Gt="tabindex",Na="disabled",lt="aria-",En=lt+"controls",pr=lt+"current",gi=lt+"selected",Qe=lt+"label",Ko=lt+"labelledby",mr=lt+"hidden",Uo=lt+"orientation",yn=lt+"roledescription",hi=lt+"live",fi=lt+"busy",yi=lt+"atomic",qo=[ft,Gt,Na,En,pr,Qe,Ko,mr,Uo,yn],ut=Ln+"__",At="is-",mo=Ln,vi=ut+"track",Oa=ut+"list",io=ut+"slide",gr=io+"--clone",Ha=io+"__container",Go=ut+"arrows",ro=ut+"arrow",hr=ro+"--prev",fr=ro+"--next",ao=ut+"pagination",yr=ao+"__page",Ba=ut+"progress",Va=Ba+"__bar",Da=ut+"toggle",za=ut+"spinner",ja=ut+"sr",Ka=At+"initialized",Ht=At+"active",vr=At+"prev",br=At+"next",Eo=At+"visible",_o=At+"loading",xr=At+"focus-in",Cr=At+"overflow",Ua=[Ht,Eo,vr,br,_o,xr,Cr],qa={slide:io,clone:gr,arrows:Go,arrow:ro,prev:hr,next:fr,pagination:ao,page:yr,spinner:za};function Ga(e,t){if(Di(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!pn(n,t);)n=n.parentElement;return n}var Ya=5,bi=200,Sr="touchstart mousedown",go="touchmove mousemove",ho="touchend touchcancel mouseup click";function Xa(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=e.root,s=n.i18n,c={},p=[],d=[],$=[],h,f,m;function g(){P(),L(),x()}function C(){i(Ie,y),i(Ie,g),i(De,x),l(document,Sr+" keydown",function(v){m=v.type==="keydown"},{capture:!0}),l(r,"focusin",function(){gt(r,xr,!!m)})}function y(v){var w=qo.concat("style");vt(p),ht(r,d),ht(h,$),dt([h,f],w),dt(r,v?w:["style",yn])}function x(){ht(r,d),ht(h,$),d=E(mo),$=E(vi),ct(r,d),ct(h,$),fe(r,Qe,n.label),fe(r,Ko,n.labelledby)}function P(){h=_("."+vi),f=Tn(h,"."+Oa),cn(h&&f,"A track/list element is missing."),Hn(p,ji(f,"."+io+":not(."+gr+")")),Nt({arrows:Go,pagination:ao,prev:hr,next:fr,bar:Va,toggle:Da},function(v,w){c[w]=_("."+v)}),gn(c,{root:r,track:h,list:f,slides:p})}function L(){var v=r.id||Wa(Ln),w=n.role;r.id=v,h.id=h.id||v+"-track",f.id=f.id||v+"-list",!st(r,ft)&&r.tagName!=="SECTION"&&w&&fe(r,ft,w),fe(r,yn,s.carousel),fe(f,ft,"presentation")}function _(v){var w=qi(r,v);return w&&Ga(w,"."+mo)===r?w:void 0}function E(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===mo&&Ht]}return gn(c,{setup:g,mount:C,destroy:y})}var Zt="slide",rn="loop",_n="fade";function Za(e,t,n,o){var i=_e(e),l=i.on,r=i.emit,s=i.bind,c=e.Components,p=e.root,d=e.options,$=d.isNavigation,h=d.updateOnMove,f=d.i18n,m=d.pagination,g=d.slideFocus,C=c.Direction.resolve,y=st(o,"style"),x=st(o,Qe),P=n>-1,L=Tn(o,"."+Ha),_;function E(){P||(o.id=p.id+"-slide"+Oo(t+1),fe(o,ft,m?"tabpanel":"group"),fe(o,yn,f.slide),fe(o,Qe,x||To(f.slideLabel,[t+1,e.length]))),v()}function v(){s(o,"click",Ee(r,Ho,k)),s(o,"keydown",Ee(r,lr,k)),l([on,cr,Vt],A),l(Vo,R),h&&l(bt,V)}function w(){_=!0,i.destroy(),ht(o,Ua),dt(o,qo),fe(o,"style",y),fe(o,Qe,x||"")}function R(){var M=e.splides.map(function(W){var B=W.splide.Components.Slides.getAt(t);return B?B.slide.id:""}).join(" ");fe(o,Qe,To(f.slideX,(P?n:t)+1)),fe(o,En,M),fe(o,ft,g?"button":""),g&&dt(o,yn)}function V(){_||A()}function A(){if(!_){var M=e.index;H(),D(),gt(o,vr,t===M-1),gt(o,br,t===M+1)}}function H(){var M=U();M!==ui(o,Ht)&&(gt(o,Ht,M),fe(o,pr,$&&M||""),r(M?Xi:Zi,k))}function D(){var M=S(),W=!M&&(!U()||P);if(e.state.is([nn,Cn])||fe(o,mr,W||""),fe(Mo(o,d.focusableNodes||""),Gt,W?-1:""),g&&fe(o,Gt,W?-1:0),M!==ui(o,Eo)&&(gt(o,Eo,M),r(M?Ji:Qi,k)),!M&&document.activeElement===o){var B=c.Slides.getAt(e.index);B&&Ki(B.slide)}}function j(M,W,B){at(B&&L||o,M,W)}function U(){var M=e.index;return M===t||d.cloneStatus&&M===n}function S(){if(e.is(_n))return U();var M=Je(c.Elements.track),W=Je(o),B=C("left",!0),ee=C("right",!0);return qn(M[B])<=fn(W[B])&&qn(W[ee])<=fn(M[ee])}function N(M,W){var B=ze(M-t);return!P&&(d.rewind||e.is(rn))&&(B=Lt(B,e.length-B)),B<=W}var k={index:t,slideIndex:n,slide:o,container:L,isClone:P,mount:E,destroy:w,update:A,style:j,isWithin:N};return k}function Ja(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=t.Elements,c=s.slides,p=s.list,d=[];function $(){h(),i(Ie,f),i(Ie,h)}function h(){c.forEach(function(A,H){g(A,H,-1)})}function f(){_(function(A){A.destroy()}),vt(d)}function m(){_(function(A){A.update()})}function g(A,H,D){var j=Za(e,H,D,A);j.mount(),d.push(j),d.sort(function(U,S){return U.index-S.index})}function C(A){return A?E(function(H){return!H.isClone}):d}function y(A){var H=t.Controller,D=H.toIndex(A),j=H.hasFocus()?1:n.perPage;return E(function(U){return Bn(U.index,D,D+j-1)})}function x(A){return E(A)[0]}function P(A,H){tt(A,function(D){if(Tt(D)&&(D=Ui(D)),zi(D)){var j=c[H];j?ko(D,j):$n(p,D),ct(D,n.classes.slide),w(D,Ee(l,Xt))}}),l(Ie)}function L(A){Ot(E(A).map(function(H){return H.slide})),l(Ie)}function _(A,H){C(H).forEach(A)}function E(A){return d.filter(Di(A)?A:function(H){return Tt(A)?pn(H.slide,A):Ro(wn(A),H.index)})}function v(A,H,D){_(function(j){j.style(A,H,D)})}function w(A,H){var D=Mo(A,"img"),j=D.length;j?D.forEach(function(U){r(U,"load error",function(){--j||H()})}):H()}function R(A){return A?c.length:d.length}function V(){return d.length>n.perPage}return{mount:$,destroy:f,update:m,register:g,get:C,getIn:y,getAt:x,add:P,remove:L,forEach:_,filter:E,style:v,getLength:R,isEnough:V}}function Qa(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=t.Slides,c=t.Direction.resolve,p=t.Elements,d=p.root,$=p.track,h=p.list,f=s.getAt,m=s.style,g,C,y;function x(){P(),l(window,"resize load",Ra(Ee(r,Xt))),i([De,Ie],P),i(Xt,L)}function P(){g=n.direction===oo,at(d,"maxWidth",Rt(n.width)),at($,c("paddingLeft"),_(!1)),at($,c("paddingRight"),_(!0)),L(!0)}function L(k){var M=Je(d);(k||C.width!==M.width||C.height!==M.height)&&(at($,"height",E()),m(c("marginRight"),Rt(n.gap)),m("width",w()),m("height",R(),!0),C=M,r(Zn),y!==(y=N())&&(gt(d,Cr,y),r(Ia,y)))}function _(k){var M=n.padding,W=c(k?"right":"left");return M&&Rt(M[W]||(un(M)?0:M))||"0px"}function E(){var k="";return g&&(k=v(),cn(k,"height or heightRatio is missing."),k="calc("+k+" - "+_(!1)+" - "+_(!0)+")"),k}function v(){return Rt(n.height||Je(h).width*n.heightRatio)}function w(){return n.autoWidth?null:Rt(n.fixedWidth)||(g?"":V())}function R(){return Rt(n.fixedHeight)||(g?n.autoHeight?null:V():v())}function V(){var k=Rt(n.gap);return"calc((100%"+(k&&" + "+k)+")/"+(n.perPage||1)+(k&&" - "+k)+")"}function A(){return Je(h)[c("width")]}function H(k,M){var W=f(k||0);return W?Je(W.slide)[c("width")]+(M?0:U()):0}function D(k,M){var W=f(k);if(W){var B=Je(W.slide)[c("right")],ee=Je(h)[c("left")];return ze(B-ee)+(M?0:U())}return 0}function j(k){return D(e.length-1)-D(0)+H(0,k)}function U(){var k=f(0);return k&&parseFloat(at(k.slide,c("marginRight")))||0}function S(k){return parseFloat(at($,c("padding"+(k?"Right":"Left"))))||0}function N(){return e.is(_n)||j(!0)>A()}return{mount:x,resize:L,listSize:A,slideSize:H,sliderSize:j,totalSize:D,getPadding:S,isOverflow:N}}var es=2;function ts(e,t,n){var o=_e(e),i=o.on,l=t.Elements,r=t.Slides,s=t.Direction.resolve,c=[],p;function d(){i(Ie,$),i([De,Xt],f),(p=C())&&(m(p),t.Layout.resize(!0))}function $(){h(),d()}function h(){Ot(c),vt(c),o.destroy()}function f(){var y=C();p!==y&&(p<y||!y)&&o.emit(Ie)}function m(y){var x=r.get().slice(),P=x.length;if(P){for(;x.length<y;)Hn(x,x);Hn(x.slice(-y),x.slice(0,y)).forEach(function(L,_){var E=_<y,v=g(L.slide,_);E?ko(v,x[0].slide):$n(l.list,v),Hn(c,v),r.register(v,_-y+(E?0:P),L.index)})}}function g(y,x){var P=y.cloneNode(!0);return ct(P,n.classes.clone),P.id=e.root.id+"-clone"+Oo(x+1),P}function C(){var y=n.clones;if(!e.is(rn))y=0;else if(Sn(y)){var x=n[s("fixedWidth")]&&t.Layout.slideSize(0),P=x&&fn(Je(l.track)[s("width")]/x);y=P||n[s("autoWidth")]&&e.length||n.perPage*es}return y}return{mount:d,destroy:h}}function ns(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=e.state.set,s=t.Layout,c=s.slideSize,p=s.getPadding,d=s.totalSize,$=s.listSize,h=s.sliderSize,f=t.Direction,m=f.resolve,g=f.orient,C=t.Elements,y=C.list,x=C.track,P;function L(){P=t.Transition,i([Pt,Zn,De,Ie],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function E(W,B,ee,de){W!==B&&k(W>ee)&&(A(),w(V(j(),W>ee),!0)),r(nn),l(bt,B,ee,W),P.start(B,function(){r(Yt),l(on,B,ee,W),de&&de()})}function v(W){w(D(W,!0))}function w(W,B){if(!e.is(_n)){var ee=B?W:R(W);at(y,"transform","translate"+m("X")+"("+ee+"px)"),W!==ee&&l(cr)}}function R(W){if(e.is(rn)){var B=H(W),ee=B>t.Controller.getEnd(),de=B<0;(de||ee)&&(W=V(W,ee))}return W}function V(W,B){var ee=W-N(B),de=h();return W-=g(de*(fn(ze(ee)/de)||1))*(B?1:-1),W}function A(){w(j(),!0),P.cancel()}function H(W){for(var B=t.Slides.get(),ee=0,de=1/0,re=0;re<B.length;re++){var me=B[re].index,O=ze(D(me,!0)-W);if(O<=de)de=O,ee=me;else break}return ee}function D(W,B){var ee=g(d(W-1)-S(W));return B?U(ee):ee}function j(){var W=m("left");return Je(y)[W]-Je(x)[W]+g(p(!1))}function U(W){return n.trimSpace&&e.is(Zt)&&(W=jt(W,0,g(h(!0)-$()))),W}function S(W){var B=n.focus;return B==="center"?($()-c(W,!0))/2:+B*c(W)||0}function N(W){return D(W?t.Controller.getEnd():0,!!n.trimSpace)}function k(W){var B=g(V(j(),W));return W?B>=0:B<=y[m("scrollWidth")]-Je(x)[m("width")]}function M(W,B){B=Sn(B)?j():B;var ee=W!==!0&&g(B)<g(N(!1)),de=W!==!1&&g(B)>g(N(!0));return ee||de}return{mount:L,move:E,jump:v,translate:w,shift:V,cancel:A,toIndex:H,toPosition:D,getPosition:j,getLimit:N,exceededLimit:M,reposition:_}}function os(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=t.Move,s=r.getPosition,c=r.getLimit,p=r.toPosition,d=t.Slides,$=d.isEnough,h=d.getLength,f=n.omitEnd,m=e.is(rn),g=e.is(Zt),C=Ee(j,!1),y=Ee(j,!0),x=n.start||0,P,L=x,_,E,v;function w(){R(),i([De,Ie,Gn],R),i(Zn,V)}function R(){_=h(!0),E=n.perMove,v=n.perPage,P=k();var O=jt(x,0,f?P:_-1);O!==x&&(x=O,r.reposition())}function V(){P!==k()&&l(Gn)}function A(O,te,Y){if(!me()){var X=D(O),ne=N(X);ne>-1&&(te||ne!==x)&&(ee(ne),r.move(X,ne,L,Y))}}function H(O,te,Y,X){t.Scroll.scroll(O,te,Y,function(){var ne=N(r.toIndex(s()));ee(f?Lt(ne,P):ne),X&&X()})}function D(O){var te=x;if(Tt(O)){var Y=O.match(/([+\-<>])(\d+)?/)||[],X=Y[1],ne=Y[2];X==="+"||X==="-"?te=U(x+ +(""+X+(+ne||1)),x):X===">"?te=ne?M(+ne):C(!0):X==="<"&&(te=y(!0))}else te=m?O:jt(O,0,P);return te}function j(O,te){var Y=E||(re()?1:v),X=U(x+Y*(O?-1:1),x,!(E||re()));return X===-1&&g&&!Gi(s(),c(!O),1)?O?0:P:te?X:N(X)}function U(O,te,Y){if($()||re()){var X=S(O);X!==O&&(te=O,O=X,Y=!1),O<0||O>P?!E&&(Bn(0,O,te,!0)||Bn(P,te,O,!0))?O=M(W(O)):m?O=Y?O<0?-(_%v||v):_:O:n.rewind?O=O<0?P:0:O=-1:Y&&O!==te&&(O=M(W(te)+(O<te?-1:1)))}else O=-1;return O}function S(O){if(g&&n.trimSpace==="move"&&O!==x)for(var te=s();te===p(O,!0)&&Bn(O,0,e.length-1,!n.rewind);)O<x?--O:++O;return O}function N(O){return m?(O+_)%_||0:O}function k(){for(var O=_-(re()||m&&E?1:v);f&&O-- >0;)if(p(_-1,!0)!==p(O,!0)){O++;break}return jt(O,0,_-1)}function M(O){return jt(re()?O:v*O,0,P)}function W(O){return re()?Lt(O,P):qn((O>=P?_-1:O)/v)}function B(O){var te=r.toIndex(O);return g?jt(te,0,P):te}function ee(O){O!==x&&(L=x,x=O)}function de(O){return O?L:x}function re(){return!Sn(n.focus)||n.isNavigation}function me(){return e.state.is([nn,Cn])&&!!n.waitForTransition}return{mount:w,go:A,scroll:H,getNext:C,getPrev:y,getAdjacent:j,getEnd:k,setIndex:ee,getIndex:de,toIndex:M,toPage:W,toDest:B,hasFocus:re,isBusy:me}}var is="http://www.w3.org/2000/svg",rs="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",Wn=40;function as(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=n.classes,c=n.i18n,p=t.Elements,d=t.Controller,$=p.arrows,h=p.track,f=$,m=p.prev,g=p.next,C,y,x={};function P(){_(),i(De,L)}function L(){E(),P()}function _(){var H=n.arrows;H&&!(m&&g)&&R(),m&&g&&(gn(x,{prev:m,next:g}),hn(f,H?"":"none"),ct(f,y=Go+"--"+n.direction),H&&(v(),A(),fe([m,g],En,h.id),r(or,m,g)))}function E(){o.destroy(),ht(f,y),C?(Ot($?[m,g]:f),m=g=null):dt([m,g],qo)}function v(){i([Pt,on,Ie,Vt,Gn],A),l(g,"click",Ee(w,">")),l(m,"click",Ee(w,"<"))}function w(H){d.go(H,!0)}function R(){f=$||qt("div",s.arrows),m=V(!0),g=V(!1),C=!0,$n(f,[m,g]),!$&&ko(f,h)}function V(H){var D='<button class="'+s.arrow+" "+(H?s.prev:s.next)+'" type="button"><svg xmlns="'+is+'" viewBox="0 0 '+Wn+" "+Wn+'" width="'+Wn+'" height="'+Wn+'" focusable="false"><path d="'+(n.arrowPath||rs)+'" />';return Ui(D)}function A(){if(m&&g){var H=e.index,D=d.getPrev(),j=d.getNext(),U=D>-1&&H<D?c.last:c.prev,S=j>-1&&H>j?c.first:c.next;m.disabled=D<0,g.disabled=j<0,fe(m,Qe,U),fe(g,Qe,S),r(ir,m,g,D,j)}}return{arrows:x,mount:P,destroy:E,update:A}}var ss=No+"-interval";function ls(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=Qn(n.interval,e.go.bind(e,">"),v),c=s.isPaused,p=t.Elements,d=t.Elements,$=d.root,h=d.toggle,f=n.autoplay,m,g,C=f==="pause";function y(){f&&(x(),h&&fe(h,En,p.track.id),C||P(),E())}function x(){n.pauseOnHover&&l($,"mouseenter mouseleave",function(R){m=R.type==="mouseenter",_()}),n.pauseOnFocus&&l($,"focusin focusout",function(R){g=R.type==="focusin",_()}),h&&l(h,"click",function(){C?P():L(!0)}),i([bt,Jn,Ie],s.rewind),i(bt,w)}function P(){c()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),g=m=C=!1,E(),r(Do))}function L(R){R===void 0&&(R=!0),C=!!R,E(),c()||(s.pause(),r(zo))}function _(){C||(m||g?L(!1):P())}function E(){h&&(gt(h,Ht,!C),fe(h,Qe,n.i18n[C?"play":"pause"]))}function v(R){var V=p.bar;V&&at(V,"width",R*100+"%"),r(sr,R)}function w(R){var V=t.Slides.getAt(R);s.set(V&&+st(V.slide,ss)||n.interval)}return{mount:y,destroy:s.cancel,play:P,pause:L,isPaused:c}}function cs(e,t,n){var o=_e(e),i=o.on;function l(){n.cover&&(i(jo,Ee(s,!0)),i([Pt,De,Ie],Ee(r,!0)))}function r(c){t.Slides.forEach(function(p){var d=Tn(p.container||p.slide,"img");d&&d.src&&s(c,d,p)})}function s(c,p,d){d.style("background",c?'center/cover no-repeat url("'+p.src+'")':"",!0),hn(p,c?"none":"")}return{mount:l,destroy:Ee(r,!1)}}var ds=10,us=600,ps=.6,ms=1.5,gs=800;function hs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=e.state.set,s=t.Move,c=s.getPosition,p=s.getLimit,d=s.exceededLimit,$=s.translate,h=e.is(Zt),f,m,g=1;function C(){i(bt,L),i([De,Ie],_)}function y(v,w,R,V,A){var H=c();if(L(),R&&(!h||!d())){var D=t.Layout.sliderSize(),j=$o(v)*D*qn(ze(v)/D)||0;v=s.toPosition(t.Controller.toDest(v%D))+j}var U=Gi(H,v,1);g=1,w=U?0:w||Un(ze(v-H)/ms,gs),m=V,f=Qn(w,x,Ee(P,H,v,A),1),r(Cn),l(Jn),f.start()}function x(){r(Yt),m&&m(),l(Vt)}function P(v,w,R,V){var A=c(),H=v+(w-v)*E(V),D=(H-A)*g;$(A+D),h&&!R&&d()&&(g*=ps,ze(D)<ds&&y(p(d(!0)),us,!1,m,!0))}function L(){f&&f.cancel()}function _(){f&&!f.isPaused()&&(L(),x())}function E(v){var w=n.easingFunc;return w?w(v):1-Math.pow(1-v,4)}return{mount:C,destroy:L,scroll:y,cancel:_}}var Kt={passive:!1,capture:!0};function fs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=o.unbind,c=e.state,p=t.Move,d=t.Scroll,$=t.Controller,h=t.Elements.track,f=t.Media.reduce,m=t.Direction,g=m.resolve,C=m.orient,y=p.getPosition,x=p.exceededLimit,P,L,_,E,v,w=!1,R,V,A;function H(){r(h,go,So,Kt),r(h,ho,So,Kt),r(h,Sr,j,Kt),r(h,"click",N,{capture:!0}),r(h,"dragstart",mt),i([Pt,De],D)}function D(){var I=n.drag;oe(!I),E=I==="free"}function j(I){if(R=!1,!V){var b=ne(I);X(I.target)&&(b||!I.button)&&($.isBusy()?mt(I,!0):(A=b?h:window,v=c.is([nn,Cn]),_=null,r(A,go,U,Kt),r(A,ho,S,Kt),p.cancel(),d.cancel(),k(I)))}}function U(I){if(c.is(On)||(c.set(On),l(er)),I.cancelable)if(v){p.translate(P+Y(re(I)));var b=me(I)>bi,z=w!==(w=x());(b||z)&&k(I),R=!0,l(tr),mt(I)}else B(I)&&(v=W(I),mt(I))}function S(I){c.is(On)&&(c.set(Yt),l(nr)),v&&(M(I),mt(I)),s(A,go,U),s(A,ho,S),v=!1}function N(I){!V&&R&&mt(I,!0)}function k(I){_=L,L=I,P=y()}function M(I){var b=ee(I),z=de(b),q=n.rewind&&n.rewindByDrag;f(!1),E?$.scroll(z,0,n.snap):e.is(_n)?$.go(C($o(b))<0?q?"<":"-":q?">":"+"):e.is(Zt)&&w&&q?$.go(x(!0)?">":"<"):$.go($.toDest(z),!0),f(!0)}function W(I){var b=n.dragMinThreshold,z=un(b),q=z&&b.mouse||0,Z=(z?b.touch:+b)||10;return ze(re(I))>(ne(I)?Z:q)}function B(I){return ze(re(I))>ze(re(I,!0))}function ee(I){if(e.is(rn)||!w){var b=me(I);if(b&&b<bi)return re(I)/b}return 0}function de(I){return y()+$o(I)*Lt(ze(I)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(I,b){return te(I,b)-te(O(I),b)}function me(I){return wo(I)-wo(O(I))}function O(I){return L===I&&_||L}function te(I,b){return(ne(I)?I.changedTouches[0]:I)["page"+g(b?"Y":"X")]}function Y(I){return I/(w&&e.is(Zt)?Ya:1)}function X(I){var b=n.noDrag;return!pn(I,"."+yr+", ."+ro)&&(!b||!pn(I,b))}function ne(I){return typeof TouchEvent<"u"&&I instanceof TouchEvent}function F(){return v}function oe(I){V=I}return{mount:H,disable:oe,isDragging:F}}var ys={Spacebar:" ",Right:no,Left:to,Up:dr,Down:ur};function Yo(e){return e=Tt(e)?e:e.key,ys[e]||e}var xi="keydown";function vs(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.unbind,s=e.root,c=t.Direction.resolve,p,d;function $(){h(),i(De,f),i(De,h),i(bt,g)}function h(){var y=n.keyboard;y&&(p=y==="global"?window:s,l(p,xi,C))}function f(){r(p,xi)}function m(y){d=y}function g(){var y=d;d=!0,Vi(function(){d=y})}function C(y){if(!d){var x=Yo(y);x===c(to)?e.go("<"):x===c(no)&&e.go(">")}}return{mount:$,destroy:f,disable:m}}var dn=No+"-lazy",Vn=dn+"-srcset",bs="["+dn+"], ["+Vn+"]";function xs(e,t,n){var o=_e(e),i=o.on,l=o.off,r=o.bind,s=o.emit,c=n.lazyLoad==="sequential",p=[on,Vt],d=[];function $(){n.lazyLoad&&(h(),i(Ie,h))}function h(){vt(d),f(),c?y():(l(p),i(p,m),m())}function f(){t.Slides.forEach(function(x){Mo(x.slide,bs).forEach(function(P){var L=st(P,dn),_=st(P,Vn);if(L!==P.src||_!==P.srcset){var E=n.classes.spinner,v=P.parentElement,w=Tn(v,"."+E)||qt("span",E,v);d.push([P,x,w]),P.src||hn(P,"none")}})})}function m(){d=d.filter(function(x){var P=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(e.index,P)?g(x):!0}),d.length||l(p)}function g(x){var P=x[0];ct(x[1].slide,_o),r(P,"load error",Ee(C,x)),fe(P,"src",st(P,dn)),fe(P,"srcset",st(P,Vn)),dt(P,dn),dt(P,Vn)}function C(x,P){var L=x[0],_=x[1];ht(_.slide,_o),P.type!=="error"&&(Ot(x[2]),hn(L,""),s(jo,L,_),s(Xt)),c&&y()}function y(){d.length&&g(d.shift())}return{mount:$,destroy:Ee(vt,d),check:m}}function Cs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=t.Slides,c=t.Elements,p=t.Controller,d=p.hasFocus,$=p.getIndex,h=p.go,f=t.Direction.resolve,m=c.pagination,g=[],C,y;function x(){P(),i([De,Ie,Gn],x);var V=n.pagination;m&&hn(m,V?"":"none"),V&&(i([bt,Jn,Vt],R),L(),R(),l(rr,{list:C,items:g},w(e.index)))}function P(){C&&(Ot(m?_t(C.children):C),ht(C,y),vt(g),C=null),o.destroy()}function L(){var V=e.length,A=n.classes,H=n.i18n,D=n.perPage,j=d()?p.getEnd()+1:fn(V/D);C=m||qt("ul",A.pagination,c.track.parentElement),ct(C,y=ao+"--"+v()),fe(C,ft,"tablist"),fe(C,Qe,H.select),fe(C,Uo,v()===oo?"vertical":"");for(var U=0;U<j;U++){var S=qt("li",null,C),N=qt("button",{class:A.page,type:"button"},S),k=s.getIn(U).map(function(W){return W.slide.id}),M=!d()&&D>1?H.pageX:H.slideX;r(N,"click",Ee(_,U)),n.paginationKeyboard&&r(N,"keydown",Ee(E,U)),fe(S,ft,"presentation"),fe(N,ft,"tab"),fe(N,En,k.join(" ")),fe(N,Qe,To(M,U+1)),fe(N,Gt,-1),g.push({li:S,button:N,page:U})}}function _(V){h(">"+V,!0)}function E(V,A){var H=g.length,D=Yo(A),j=v(),U=-1;D===f(no,!1,j)?U=++V%H:D===f(to,!1,j)?U=(--V+H)%H:D==="Home"?U=0:D==="End"&&(U=H-1);var S=g[U];S&&(Ki(S.button),h(">"+U),mt(A,!0))}function v(){return n.paginationDirection||n.direction}function w(V){return g[p.toPage(V)]}function R(){var V=w($(!0)),A=w($());if(V){var H=V.button;ht(H,Ht),dt(H,gi),fe(H,Gt,-1)}if(A){var D=A.button;ct(D,Ht),fe(D,gi,!0),fe(D,Gt,"")}l(ar,{list:C,items:g},V,A)}return{items:g,mount:x,destroy:P,getAt:w,update:R}}var Ss=[" ","Enter"];function ws(e,t,n){var o=n.isNavigation,i=n.slideFocus,l=[];function r(){e.splides.forEach(function(m){m.isParent||(p(e,m.splide),p(m.splide,e))}),o&&d()}function s(){l.forEach(function(m){m.destroy()}),vt(l)}function c(){s(),r()}function p(m,g){var C=_e(m);C.on(bt,function(y,x,P){g.go(g.is(rn)?P:y)}),l.push(C)}function d(){var m=_e(e),g=m.on;g(Ho,h),g(lr,f),g([Pt,De],$),l.push(m),m.emit(Vo,e.splides)}function $(){fe(t.Elements.list,Uo,n.direction===oo?"vertical":"")}function h(m){e.go(m.index)}function f(m,g){Ro(Ss,Yo(g))&&(h(m),mt(g))}return{setup:Ee(t.Media.set,{slideFocus:Sn(i)?o:i},!0),mount:r,destroy:s,remount:c}}function $s(e,t,n){var o=_e(e),i=o.bind,l=0;function r(){n.wheel&&i(t.Elements.track,"wheel",s,Kt)}function s(p){if(p.cancelable){var d=p.deltaY,$=d<0,h=wo(p),f=n.wheelMinThreshold||0,m=n.wheelSleep||0;ze(d)>f&&h-l>m&&(e.go($?"<":">"),l=h),c($)&&mt(p)}}function c(p){return!n.releaseWheel||e.state.is(nn)||t.Controller.getAdjacent(p)!==-1}return{mount:r}}var Ts=90;function Ls(e,t,n){var o=_e(e),i=o.on,l=t.Elements.track,r=n.live&&!n.isNavigation,s=qt("span",ja),c=Qn(Ts,Ee(d,!1));function p(){r&&(h(!t.Autoplay.isPaused()),fe(l,yi,!0),s.textContent="…",i(Do,Ee(h,!0)),i(zo,Ee(h,!1)),i([on,Vt],Ee(d,!0)))}function d(f){fe(l,fi,f),f?($n(l,s),c.start()):(Ot(s),c.cancel())}function $(){dt(l,[hi,yi,fi]),Ot(s)}function h(f){r&&fe(l,hi,f?"off":"polite")}return{mount:p,disable:h,destroy:$}}var Es=Object.freeze({__proto__:null,Media:ka,Direction:Ma,Elements:Xa,Slides:Ja,Layout:Qa,Clones:ts,Move:ns,Controller:os,Arrows:as,Autoplay:ls,Cover:cs,Scroll:hs,Drag:fs,Keyboard:vs,LazyLoad:xs,Pagination:Cs,Sync:ws,Wheel:$s,Live:Ls}),_s={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},Ps={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:qa,i18n:_s,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function As(e,t,n){var o=t.Slides;function i(){_e(e).on([Pt,Ie],l)}function l(){o.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function r(s,c){o.style("transition","opacity "+n.speed+"ms "+n.easing),Vi(c)}return{mount:i,start:r,cancel:So}}function Ws(e,t,n){var o=t.Move,i=t.Controller,l=t.Scroll,r=t.Elements.list,s=Ee(at,r,"transition"),c;function p(){_e(e).bind(r,"transitionend",function(f){f.target===r&&c&&($(),c())})}function d(f,m){var g=o.toPosition(f,!0),C=o.getPosition(),y=h(f);ze(g-C)>=1&&y>=1?n.useScroll?l.scroll(g,y,!1,m):(s("transform "+y+"ms "+n.easing),o.translate(g,!0),c=m):(o.jump(f),m())}function $(){s(""),l.cancel()}function h(f){var m=n.rewindSpeed;if(e.is(Zt)&&m){var g=i.getIndex(!0),C=i.getEnd();if(g===0&&f>=C||g>=C&&f===0)return m}return n.speed}return{mount:p,start:d,cancel:$}}var Is=(function(){function e(n,o){this.event=_e(),this.Components={},this.state=Fa(Ut),this.splides=[],this._o={},this._E={};var i=Tt(n)?qi(document,n):n;cn(i,i+" is invalid."),this.root=i,o=wt({label:st(i,Qe)||"",labelledby:st(i,Ko)||""},Ps,e.defaults,o||{});try{wt(o,JSON.parse(st(i,No)))}catch{cn(!1,"Invalid JSON")}this._o=Object.create(wt({},o))}var t=e.prototype;return t.mount=function(o,i){var l=this,r=this.state,s=this.Components;cn(r.is([Ut,Kn]),"Already mounted!"),r.set(Ut),this._C=s,this._T=i||this._T||(this.is(_n)?As:Ws),this._E=o||this._E;var c=gn({},Es,this._E,{Transition:this._T});return Nt(c,function(p,d){var $=p(l,s,l._o);s[d]=$,$.setup&&$.setup()}),Nt(s,function(p){p.mount&&p.mount()}),this.emit(Pt),ct(this.root,Ka),r.set(Yt),this.emit(Lo),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(Yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,i){return this.event.on(o,i),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var i;return(i=this.event).emit.apply(i,[o].concat(_t(arguments,1))),this},t.add=function(o,i){return this._C.Slides.add(o,i),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Ie),this},t.destroy=function(o){o===void 0&&(o=!0);var i=this.event,l=this.state;return l.is(Ut)?_e(this).on(Lo,this.destroy.bind(this,o)):(Nt(this._C,function(r){r.destroy&&r.destroy(o)},!0),i.emit(Bo),i.destroy(),o&&vt(this.splides),l.set(Kn)),this},_a(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Xo=Is;Xo.defaults={};Xo.STATES=Aa;var Ci=[[Pt,"onMounted"],[Lo,"onReady"],[bt,"onMove"],[on,"onMoved"],[Ho,"onClick"],[Xi,"onActive"],[Zi,"onInactive"],[Ji,"onVisible"],[Qi,"onHidden"],[Ie,"onRefresh"],[De,"onUpdated"],[Xt,"onResize"],[Zn,"onResized"],[er,"onDrag"],[tr,"onDragging"],[nr,"onDragged"],[Jn,"onScroll"],[Vt,"onScrolled"],[Bo,"onDestroy"],[or,"onArrowsMounted"],[ir,"onArrowsUpdated"],[rr,"onPaginationMounted"],[ar,"onPaginationUpdated"],[Vo,"onNavigationMounted"],[Do,"onAutoplayPlay"],[sr,"onAutoplayPlaying"],[zo,"onAutoplayPause"],[jo,"onLazyLoadLoaded"]];function Zo(...e){return e.filter(Boolean).join(" ")}function Yn(e){return e!==null&&typeof e=="object"}function Po(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Po(n,t[o]));if(Yn(e)&&Yn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(i=>!Object.prototype.hasOwnProperty.call(t,i)||!Po(e[i],t[i]))}return e===t}function Fs(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function Rs(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];if(i!=="__proto__"&&t(e[i],i)===!1)break}}return e}function Ao(e,t){const n=e;return Rs(t,(o,i)=>{Array.isArray(o)?n[i]=o.slice():Yn(o)?n[i]=Ao(Yn(n[i])?n[i]:{},o):n[i]=o}),n}var ks=({children:e,className:t,...n})=>u.createElement("div",{className:Zo("splide__track",t),...n},u.createElement("ul",{className:"splide__list"},e)),Jo=class extends u.Component{constructor(){super(...arguments),this.splideRef=u.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Xo(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ao({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!Po(this.options,e)&&(this.splide.options=e,this.options=Ao({},e));const t=this.getSlides();Fs(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){Ci.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...i)=>{o(e,...i)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:o,...i}=this.props;return u.createElement(t,{className:Zo("splide",e),ref:this.splideRef,...this.omit(i,["options",...Ci.map(l=>l[1])])},n?u.createElement(ks,null,o):o)}},Qo=({children:e,className:t,...n})=>u.createElement("li",{className:Zo("splide__slide",t),...n},e);/*!
|
|
2
2
|
* Splide.js
|
|
3
3
|
* Version : 4.1.3
|
|
4
4
|
* License : MIT
|
|
5
5
|
* Copyright: 2022 Naotoshi Fujita
|
|
6
|
-
*/const xs="RichTextRenderer-module__link___BWeZ2",Cs={link:xs},Ss=t=>{const e=t.trim();return!e||e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?!1:e.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},no=t=>t&&t.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Ss(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function pe(t){const{color:e,...n}=t;return n}function Vt(t,e){var n,o,i;return{fontFamily:no(t.fontSettings.fontFamily),fontWeight:t.fontSettings.fontWeight,fontStyle:t.fontSettings.fontStyle,letterSpacing:S.scalingValue(t.letterSpacing,e),wordSpacing:S.scalingValue(t.wordSpacing,e),fontSize:S.scalingValue(t.fontSize,e),lineHeight:t.lineHeight!==void 0?S.scalingValue(t.lineHeight,e):void 0,textTransform:(n=t.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=t.textAppearance)==null?void 0:o.textDecoration,fontVariant:(i=t.textAppearance)==null?void 0:i.fontVariant,color:t.color}}const un=({content:t})=>{const e=n=>n.map((o,i)=>o.type==="link"?a.jsx("a",{className:Cs.link,href:o.value,target:o.target,children:e(o.children)},i):a.jsx("span",{style:$s(o),children:o.text},i));return a.jsx(a.Fragment,{children:t.map((n,o)=>{const i=n.children;return a.jsx("div",{children:e(i)},o)})})};function $s(t){return{...t.fontFamily&&{fontFamily:no(t.fontFamily)},...t.fontWeight&&{fontWeight:t.fontWeight},...t.fontStyle&&{fontStyle:t.fontStyle},...t.textDecoration&&{textDecoration:t.textDecoration},...t.textTransform&&{textTransform:t.textTransform},...t.fontVariant&&{fontVariant:t.fontVariant},...t.verticalAlign&&{verticalAlign:t.verticalAlign,lineHeight:"0px"}}}const ws="SvgImage-module__svg___q3xE-",Ts="SvgImage-module__img___VsTm-",ui={svg:ws,img:Ts},Ls=t=>{const e=t.trim();return e.startsWith("data:image/svg+xml")?!0:(e.split(/[?#]/)[0]??e).endsWith(".svg")},_s=t=>`url("${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,ve=({url:t,fill:e="#000000",hoverFill:n="#CCCCCC",className:o="",style:i})=>{const[l,r]=m.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return m.useEffect(()=>{if(typeof window<"u"&&window.CSS){const s=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');r(s)}},[]),!Ls(t)||!l?a.jsx("img",{src:t,alt:"",className:xt(ui.img,o),style:i}):a.jsx("span",{"data-supports-mask":l,className:xt(ui.svg,o),style:{"--svg":_s(t),"--fill":e,"--hover-fill":n,...i??{}}})},Es={"top-left":tt.topLeftAlignment,"top-center":tt.topCenterAlignment,"top-right":tt.topRightAlignment,"middle-left":tt.middleLeftAlignment,"middle-center":tt.middleCenterAlignment,"middle-right":tt.middleRightAlignment,"bottom-left":tt.bottomLeftAlignment,"bottom-center":tt.bottomCenterAlignment,"bottom-right":tt.bottomRightAlignment};function Ps({settings:t,content:e,styles:n,isEditor:o}){const[i,l]=m.useState(null),{widthSettings:r,fontSettings:s,letterSpacing:d,textAlign:u,wordSpacing:c,fontSizeLineHeight:L,textAppearance:v,color:h}=n.imageCaption,[p,g]=m.useState(void 0),[$,f]=m.useState(null),[x,b]=m.useState(0),[R,W]=m.useState(0),{direction:_,transition:y,controls:w,pagination:E,imageCaption:H,triggers:F}=t,O=m.useRef(y.type),{x:z,y:V}=t.controls.offset,K=C=>{i&&i.go(C)};return m.useEffect(()=>{if(!$)return;const C=new ResizeObserver(k=>{if(!i)return;const[I]=k;g({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return C.observe($),()=>C.unobserve($)},[$]),m.useEffect(()=>{!i||O.current===y.type||(W(C=>C+1),O.current=y.type)},[y.type]),a.jsx("div",{className:xt(tt.wrapper,{[tt.editor]:o}),ref:f,children:a.jsxs("div",{className:tt.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:y.backgroundColor&&y.type==="fade in"?y.backgroundColor:"transparent"},children:[t.imageCaption.isActive&&a.jsx("div",{className:xt(tt.captionBlock),children:a.jsx("div",{className:tt.captionTextWrapper,children:e.map((C,k)=>a.jsx("div",{className:xt(tt.captionText,Es[H.alignment],{[tt.withPointerEvents]:k===x&&o,[tt.active]:k===x}),style:{fontFamily:no(s.fontFamily),fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:r.sizing==="auto"?"max-content":S.scalingValue(r.width,o),letterSpacing:S.scalingValue(d,o),wordSpacing:S.scalingValue(c,o),textAlign:u,fontSize:S.scalingValue(L.fontSize,o),lineHeight:S.scalingValue(L.lineHeight,o),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:h,transitionDuration:y.duration?`${Math.round(parseInt(y.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:tt.captionTextInner,style:{"--link-hover-color":H.linkHoverColor,"--link-color":H.linkColor,position:"relative",top:S.scalingValue(H.offset.y,o),left:S.scalingValue(H.offset.x,o)},children:a.jsx(un,{content:C.imageCaption})})},k))})}),a.jsx(Ko,{onMove:C=>{b(C.index)},ref:l,options:{arrows:!1,speed:y.duration?parseInt(y.duration):500,autoplay:F.autoPlay!==null,...F.autoPlay!==null&&{interval:parseInt(F.autoPlay)*1e3},direction:_==="horiz"||y.type==="fade in"?"ltr":"ttb",pagination:!1,drag:F.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:y.type==="fade in"?"fade":"loop",rewind:!0},children:e.map((C,k)=>a.jsx(Uo,{children:a.jsx("div",{className:tt.sliderItem,children:a.jsx("div",{className:tt.imgWrapper,children:a.jsx("img",{className:xt(tt.sliderImage,{[tt.contain]:C.image.objectFit==="contain",[tt.cover]:C.image.objectFit==="cover"}),src:C.image.url,alt:C.image.name??""})})})},k))},R),w.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:xt(tt.arrow,{[tt.arrowVertical]:_==="vert",[tt.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{onClick:()=>{K("-1")},className:tt.arrowInner,style:{transform:`translate(${S.scalingValue(z,o)}, ${S.scalingValue(V*(_==="horiz"?1:-1),o)}) scale(${t.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx(ve,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:xt(tt.arrowImg,tt.mirror)}),!w.arrowsImgUrl&&a.jsx(pi,{color:w.color,className:xt(tt.arrowIcon,tt.arrowImg,tt.mirror)})]})}),a.jsx("div",{className:xt(tt.arrow,tt.nextArrow,{[tt.arrowVertical]:_==="vert",[tt.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{className:tt.arrowInner,onClick:()=>K("+1"),style:{transform:`translate(${S.scalingValue(z*(_==="horiz"?-1:1),o)}, ${S.scalingValue(V,o)}) scale(${t.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx(ve,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:tt.arrowImg}),!w.arrowsImgUrl&&a.jsx(pi,{color:w.color,className:xt(tt.arrowIcon,tt.arrowImg)})]})})]}),F.triggersList.click&&a.jsx("div",{className:tt.clickOverlay,onClick:()=>{i&&i.go("+1")}}),E.isActive&&a.jsx("div",{className:xt(tt.pagination,{[tt.paginationInsideBottom]:E.position==="inside-1"&&_==="horiz",[tt.paginationInsideTop]:E.position==="inside-2"&&_==="horiz",[tt.paginationOutsideBottom]:E.position==="outside-1"&&_==="horiz",[tt.paginationOutsideTop]:E.position==="outside-2"&&_==="horiz",[tt.paginationInsideLeft]:E.position==="inside-1"&&_==="vert",[tt.paginationInsideRight]:E.position==="inside-2"&&_==="vert",[tt.paginationOutsideLeft]:E.position==="outside-1"&&_==="vert",[tt.paginationOutsideRight]:E.position==="outside-2"&&_==="vert",[tt.paginationVertical]:_==="vert"}),children:a.jsx("div",{className:tt.paginationInner,style:{backgroundColor:E.colors[2],transform:`scale(${E.scale/100}) translate(${S.scalingValue(E.offset.x,o)}, ${S.scalingValue(E.offset.y,o)}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:e.map((C,k)=>a.jsx("button",{onClick:()=>{i&&i.go(k)},className:xt(tt.paginationItem),children:a.jsx("div",{className:xt(tt.dot,{[tt.activeDot]:k===x}),style:{backgroundColor:k===x?E.colors[0]:E.colors[1],"--pagination-hover-color":E.hover}})},k))})})]})})}function pi({color:t,className:e}){return a.jsx("svg",{viewBox:"0 0 10 18",className:e,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:t,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Ws={element:Ps,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Fs="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Rs="ImageRevealSlider-module__image___Qjt-e",Is="ImageRevealSlider-module__link___N-iLG",As="ImageRevealSlider-module__cursor___2U03d",Ie={imageRevealSlider:Fs,image:Rs,link:Is,cursor:As};function mi(t,e,n){for(const o of n){const i=new Image;i.src=o.url;const l=o.width?Number.parseFloat(o.width):i.naturalWidth,r=i.naturalHeight/i.naturalWidth*l,s=l/2,d=r/2;if(t>=o.x-s&&t<=o.x+s&&e>=o.y-d&&e<=o.y+d)return!0}return!1}function po(t){return new Promise(e=>{const n=new Image;n.src=t,n.onload=()=>{e({width:n.naturalWidth,height:n.naturalHeight})}})}async function ks(t,e,n,o){let i,l;if(e==="custom"){i=n;const r=await po(t);l=r.height/r.width*i}else if(e==="random"){i=Math.random()*(o.max-o.min)+o.min;const r=await po(t);l=r.height/r.width*i}else{const r=await po(t);i=r.width,l=r.height}return{width:i,height:l,finalWidth:`${i}px`}}function Ms({settings:t,content:e,isEditor:n}){const[o,i]=m.useState(null),[l,r]=m.useState([]),[s,d]=m.useState(0),u=m.useRef(0),[c,L]=m.useState({x:0,y:0}),[v,h]=m.useState(1),[p,g]=m.useState("none"),$=m.useRef({x:0,y:0}),[f,x]=m.useState(!1),{sizeType:b,imageWidth:R,randomRangeImageWidth:W}=t.imageSize,{revealPosition:_,visible:y}=t.position,{cursorType:w,target:E,defaultCursorScale:H,defaultCursor:F,hoverCursorScale:O,hoverCursor:z}=t.cursor;m.useEffect(()=>{if(!o)return;const C=(A,P)=>{const N=o.getBoundingClientRect(),Q=A-N.left,st=P-N.top;if(L({x:Q,y:st}),w==="system"){g("none"),h(1);return}const ot=Q,ut=st,M=document.elementFromPoint(N.left+ot,N.top+ut);if(M&&M.closest("a")){g("none"),h(1);return}const J=mi(ot,ut,l)||E==="area"?{img:z??"none",scale:O}:{img:F??"none",scale:H};g(J.img),h(J.scale)},k=A=>{A.stopPropagation(),$.current={x:A.clientX,y:A.clientY},C(A.clientX,A.clientY)},I=()=>{f&&C($.current.x,$.current.y)};return o.addEventListener("mousemove",k),window.addEventListener("scroll",I,!0),()=>{o.removeEventListener("mousemove",k),window.removeEventListener("scroll",I,!0)}},[o,f,c,w,E,z,F,O,H,l]),m.useEffect(()=>{f||(g("none"),h(0))},[f]);const V=async(C,k,I,A={})=>{const{width:P,height:N,finalWidth:Q}=await ks(C.image.url,b,R,W);let st=0,ot=0;_==="same"?(st=k/2,ot=I/2):(st=A.x??Math.random()*k,ot=A.y??Math.random()*I);const ut=Math.min(Math.max(st,P/2),k-P/2),M=Math.min(Math.max(ot,N/2),I-N/2);return{id:u.current++,url:C.image.url,link:C.link,name:C.image.name,x:ut,y:M,width:Q}};m.useEffect(()=>{if(!o||e.length===0)return;const C=o.getBoundingClientRect(),k=C.width,I=C.height,A=[];(async()=>{const N=e[0],Q=await V(N,k,I);A.push(Q),r(A),d(1)})()},[b,R,W,_,o]),m.useEffect(()=>{y==="last One"&&r(C=>C.length>0?[C[C.length-1]]:[])},[y]);const K=async C=>{if(!o)return;const k=o.getBoundingClientRect(),I=C.clientX-k.left,A=C.clientY-k.top;if(E==="image"&&!mi(I,A,l))return;let P=0,N=0;_==="on Click"?(P=I,N=A):_==="same"?(P=k.width/2,N=k.height/2):(P=Math.random()*k.width,N=Math.random()*k.height);const Q=e[s],st=await V(Q,k.width,k.height,{x:P,y:N});r(ot=>y==="all"?[...ot,st]:[st]),d(ot=>ot>=e.length-1?0:ot+1)};return a.jsxs("div",{ref:i,onClick:K,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:Ie.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[l.map(C=>a.jsx("div",{className:Ie.wrapper,style:{top:`${C.y}px`,left:`${C.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:C.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:E==="area"&&C.link?a.jsx("a",{href:C.link,target:"_blank",className:Ie.link,children:a.jsx("img",{src:C.url,alt:C.name,className:Ie.image},C.id)}):a.jsx("img",{src:C.url,alt:C.name,className:Ie.image},C.id)},C.id)),f&&a.jsx("div",{className:Ie.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Os={element:Ms,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Ns="LightBox-module__hidden___9s-9x",Hs="LightBox-module__heroImage___sTxNF",Bs="LightBox-module__background___rm9ml",zs="LightBox-module__editor___4ACaY",Ds="LightBox-module__contentStyle___Bgnsq",js="LightBox-module__imageStyle___tLIlB",Vs="LightBox-module__imgWrapper___LuFUp",Ks="LightBox-module__contain___8-yaS",Us="LightBox-module__cover___hNvOG",Gs="LightBox-module__caption___b6L2I",Ys="LightBox-module__captionTextInner___rCGNH",qs="LightBox-module__lightboxSplide___XFuWC",Xs="LightBox-module__arrow___iz38X",Zs="LightBox-module__arrowVertical___Zfz81",Js="LightBox-module__nextArrow___zkAQN",Qs="LightBox-module__arrowInner___p48sW",tl="LightBox-module__arrowIcon___3VaFf",el="LightBox-module__arrowImg___pNV88",nl="LightBox-module__mirror___pjeXc",ol="LightBox-module__thumbsWrapper___GB-nU",il="LightBox-module__thumbsContainerVertical___wttk5",rl="LightBox-module__thumbsContainer___osSma",al="LightBox-module__thumbsAlignStart___MO6tY",sl="LightBox-module__thumbsAlignCenter___Q4sUx",ll="LightBox-module__thumbsAlignEnd___p4y9R",cl="LightBox-module__thumbItem___HvnF3",dl="LightBox-module__closeButton___g2khP",ul="LightBox-module__fadeIn___0m5GW",pl="LightBox-module__slideInLeft___gPYwC",ml="LightBox-module__slideInRight___S-pPp",gl="LightBox-module__slideInTop___DFdAj",hl="LightBox-module__slideInBottom___m27kZ",fl="LightBox-module__fadeOut___55qBR",yl="LightBox-module__slideOutLeft___NvU7P",vl="LightBox-module__slideOutRight___SK7eC",bl="LightBox-module__slideOutTop___Vgg0z",xl="LightBox-module__slideOutBottom___nJ0Ef",Cl="LightBox-module__scaleSlide___vZriG",G={hidden:Ns,heroImage:Hs,background:Bs,editor:zs,contentStyle:Ds,imageStyle:js,imgWrapper:Vs,contain:Ks,cover:Us,caption:Gs,captionTextInner:Ys,lightboxSplide:qs,arrow:Xs,arrowVertical:Zs,nextArrow:Js,arrowInner:Qs,arrowIcon:tl,arrowImg:el,mirror:nl,thumbsWrapper:ol,thumbsContainerVertical:il,thumbsContainer:rl,thumbsAlignStart:al,thumbsAlignCenter:sl,thumbsAlignEnd:ll,thumbItem:cl,closeButton:dl,fadeIn:ul,slideInLeft:pl,slideInRight:ml,slideInTop:gl,slideInBottom:hl,fadeOut:fl,slideOutLeft:yl,slideOutRight:vl,slideOutTop:bl,slideOutBottom:xl,scaleSlide:Cl},_n=(t,e,n)=>{const o={},[i,l]=t.split("-");return i==="top"?(o.top="0",o.bottom="auto"):i==="middle"?(o.top="50%",o.bottom="auto"):i==="bottom"&&(o.top="auto",o.bottom="0"),l==="left"?(o.left="0",o.right="auto"):l==="center"?(o.left="50%",o.right="auto"):l==="right"&&(o.left="auto",o.right="0"),i==="middle"&&l==="center"?o.transform=`translate(calc(-50% + ${S.scalingValue(e.x,n)}), calc(-50% + ${S.scalingValue(e.y,n)}))`:i==="middle"?o.transform=`translate(${S.scalingValue(e.x,n)}, calc(-50% + ${S.scalingValue(e.y,n)}))`:l==="center"?o.transform=`translate(calc(-50% + ${S.scalingValue(e.x,n)}), ${S.scalingValue(e.y,n)})`:o.transform=`translate(${S.scalingValue(e.x,n)}, ${S.scalingValue(e.y,n)})`,o};function dr(t){const e=window.getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,right:parseFloat(e.paddingRight)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0}}function gi(t){const e=t.getBoundingClientRect(),n=dr(t),o=Math.max(0,e.width-n.left-n.right),i=Math.max(0,e.height-n.top-n.bottom),l=t.naturalWidth,r=t.naturalHeight,s=o/i,d=l/r;let u,c;d>s?(u=o,c=o/d):(c=i,u=i*d);const L=e.left+n.left,v=e.top+n.top,h=(o-u)/2+L,p=(i-c)/2+v;return{x:h,y:p,width:u,height:c}}function hi(t){const e=t.getBoundingClientRect(),n=dr(t);return{left:e.left+n.left,right:e.right-n.right,top:e.top+n.top,bottom:e.bottom-n.bottom}}function fi(t){const e=t.match(/rgba?\(([^)]+)\)/);if(e){const o=e[1].split(",").map(i=>parseFloat(i.trim()));return o.length===4?o[3]:1}const n=t.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return t.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Sl(t,e){const n=(()=>{if(t==="fade in")return G.fadeIn;if(t==="slide in"||t==="mix")switch(e){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),o=(()=>{if(t==="fade in"||t==="mix")return G.fadeIn;if(t==="slide in")switch(e){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),i=(()=>{if(t==="fade in"||t==="mix")return G.fadeOut;if(t==="slide in")switch(e){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})(),l=(()=>{if(t==="fade in")return G.fadeOut;if(t==="slide in"||t==="mix")switch(e){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:i,disappearClass:l}}const $l=({settings:t,content:e,styles:n,portalId:o,activeEvent:i,isEditor:l})=>{const[r,s]=m.useState(!1),{url:d}=t.thumbnailBlock.cover;return m.useEffect(()=>{i==="close"&&s(!1),i==="open"&&s(!0)},[i]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:d,alt:"Cover",className:G.heroImage,onClick:()=>s(!0)}),a.jsx(wl,{isOpen:r,onClose:()=>s(!1),content:e,settings:t,lightboxStyles:n,portalId:o,isEditor:l})]})},wl=({isOpen:t,onClose:e,content:n,lightboxStyles:o,settings:i,portalId:l,isEditor:r,metadata:s})=>{var B;const[d,u]=m.useState(0),[c,L]=m.useState(0),[v,h]=m.useState(!1),[p,g]=m.useState(!1),[$,f]=m.useState({}),x=m.useRef(null),b=m.useRef(null),R=m.useRef(null),W=m.useRef(!1),_=m.useRef(null),y=m.useRef(null),w=m.useRef(null),E=m.useRef(null),H=m.useRef(!1),F=m.useRef(null),[O,z]=m.useState(!1),{appear:V,triggers:K,slider:C,thumbnail:k,controls:I,area:A,caption:P,layout:N}=i.lightboxBlock,{appearClass:Q,backdropAppearClass:st,backdropDisappearClass:ot,disappearClass:ut}=Sl(V.type,V.direction),M=(s==null?void 0:s.itemId)??null;m.useEffect(()=>{const T=()=>{setTimeout(()=>{var q,Z;(Z=(q=x.current)==null?void 0:q.splide)==null||Z.refresh()},16)},U=()=>{L(q=>q+1)};return window.addEventListener("ArticleEditor.Layout:change",T),window.addEventListener("ArticleEditor.ComponentContent:change",U),()=>{window.removeEventListener("ArticleEditor.Layout:change",T),window.removeEventListener("ArticleEditor.ComponentContent:change",U)}},[]),m.useEffect(()=>{if(!t||!k.isActive){z(!1);return}const T=F.current;if(!T)return;const U=()=>{C.direction==="horiz"?z(T.scrollWidth>T.clientWidth):z(T.scrollHeight>T.clientHeight)};U();const q=new ResizeObserver(U);return q.observe(T),()=>q.disconnect()},[t,k.isActive,n.length,$,C.direction]);const J=m.useCallback(()=>{const T=window.matchMedia("(max-width: 768px)").matches,U=fi(A.color);T&&!r&&U>.9&&(document.body.style.backgroundColor=""),h(!0),W.current=!0;const q=Z=>{Z.target===_.current&&Z.animationName&&(_.current&&y.current&&_.current.removeEventListener("animationend",y.current),y.current=null,W.current&&(W.current=!1,e()),h(!1))};_.current&&(y.current=q,_.current.addEventListener("animationend",q))},[e,A.color,r]),ht=(T,U,q)=>{var Z,it;if(T){if(K.type==="click"&&K.switch==="image")K.repeat==="close"&&d===n.length-1?J():(Z=x.current)==null||Z.go("+1");else if(K.type==="click"&&K.switch==="50/50"){const rt=T.getBoundingClientRect(),et=U-rt.left,dt=q-rt.top,j=rt.width,X=rt.height;let Y;C.direction==="horiz"?Y=et<j/2?"-1":"+1":Y=dt<X/2?"-1":"+1",(it=x.current)==null||it.go(Y)}}},pt=T=>{if(H.current){H.current=!1;return}const U=n[d],q=(U==null?void 0:U.image.objectFit)==="cover";let Z,it;if("changedTouches"in T&&T.changedTouches.length>0)Z=T.changedTouches[0].clientX,it=T.changedTouches[0].clientY;else if("clientX"in T)Z=T.clientX,it=T.clientY;else return;let rt;if(q&&R.current){const et=hi(R.current);rt=Z>=et.left&&Z<=et.right&&it>=et.top&&it<=et.bottom}else{const et=R.current?gi(R.current):null;if(!et){T.target===T.currentTarget&&J();return}rt=Z>=et.x&&Z<=et.x+et.width&&it>=et.y&&it<=et.y+et.height}rt?ht(R.current,Z,it):J()},gt=T=>{const U=T.target;(U.classList.contains(G.thumbsWrapper)||U.classList.contains(G.thumbsContainer))&&pt(T)};m.useEffect(()=>{if(!t)return;const T=U=>{var q,Z;if(U.key==="Escape"){J();return}if(U.key==="ArrowRight"){u(it=>(it+1)%Math.max(n.length,1)),(q=x.current)==null||q.go("+1");return}U.key==="ArrowLeft"&&(u(it=>(it-1+Math.max(n.length,1))%Math.max(n.length,1)),(Z=x.current)==null||Z.go("-1"))};return window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}},[t,J,n.length]),m.useEffect(()=>{if(t){if(u(0),L(U=>U+1),W.current=!1,h(!1),g(!1),f({}),!M)return;const T=new CustomEvent("page-overlay",{detail:{itemId:M}});window.dispatchEvent(T)}return()=>{_.current&&y.current&&(_.current.removeEventListener("animationend",y.current),y.current=null),g(!1)}},[t,M]),m.useEffect(()=>{b.current!==null&&b.current!==C.type&&L(T=>T+1),b.current=C.type},[C.type]),m.useEffect(()=>{if(!t)return;const T=document.body.style.overflow,U=window.matchMedia("(max-width: 768px)").matches,q=fi(A.color);document.body.style.overflow="hidden",g(!1);const Z=rt=>{rt.target===_.current&&!W.current&&rt.animationName&&(U&&!r&&q>.9&&(document.body.style.backgroundColor=A.color),g(!0),_.current&&w.current&&_.current.removeEventListener("animationend",w.current),w.current=null)};_.current&&(w.current=Z,_.current.addEventListener("animationend",Z));const it=rt=>{const et=rt.target;et&&(et.closest(`.${G.thumbsWrapper}`)||et.closest(`.${G.thumbsContainer}`))||C.type!=="slide"&&rt.preventDefault()};return document.addEventListener("touchmove",it,{passive:!1}),()=>{document.body.style.overflow=T,document.removeEventListener("touchmove",it),_.current&&w.current&&(_.current.removeEventListener("animationend",w.current),w.current=null),g(!1)}},[t,r,A.color,C.type]),m.useEffect(()=>{if(!t)return;const T=U=>{var Z,it;if(W.current){U.stopPropagation();return}if(H.current){H.current=!1;return}const q=U.target;if(!(q&&(q.closest(`.${G.thumbsContainer}`)||q.closest(`.${G.thumbItem}`)||q.closest(`.${G.arrow}`)||q.closest(`.${G.closeButton}`)||q.closest(`.${G.caption}`)))){if(C.type==="slide"&&K.type==="drag"&&((it=(Z=x.current)==null?void 0:Z.splide)!=null&&it.root)){const rt=x.current.splide.root;if(q&&(rt.contains(q)||rt===q))return}if(U.touches.length===0&&U.changedTouches.length>0){const rt=n[d],et=(rt==null?void 0:rt.image.objectFit)==="cover",dt=U.changedTouches[0];let j;if(et&&R.current){const X=hi(R.current);j=dt.clientX>=X.left&&dt.clientX<=X.right&&dt.clientY>=X.top&&dt.clientY<=X.bottom}else{const X=R.current?gi(R.current):null;if(!X)return;j=dt.clientX>=X.x&&dt.clientX<=X.x+X.width&&dt.clientY>=X.y&&dt.clientY<=X.y+X.height}if(!j){U.stopPropagation(),W.current=!0;const X=Y=>{Y.stopPropagation(),Y.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),J()}}}};return document.addEventListener("touchend",T,{passive:!0}),()=>{document.removeEventListener("touchend",T)}},[t,J,d,n]);const D=(C.type==="scale"||C.type==="fade")&&C.direction==="vert"&&K.type==="drag";m.useEffect(()=>{var Y,lt;if(!t||!D||!((lt=(Y=x.current)==null?void 0:Y.splide)!=null&<.root))return;const T=x.current.splide.root,U=30,q=(nt,ct)=>{if(E.current){const Ct=Math.abs(nt-E.current.x),Lt=Math.abs(ct-E.current.y);(Ct>0||Lt>0)&&(H.current=!0)}},Z=nt=>{E.current&&(nt.preventDefault(),q(nt.clientX,nt.clientY))},it=nt=>{E.current&&nt.touches.length>0&&(nt.preventDefault(),q(nt.touches[0].clientX,nt.touches[0].clientY))},rt=(nt,ct)=>{if(!E.current||!x.current){E.current=null;return}const Ct=Math.abs(nt-E.current.x),Lt=Math.abs(ct-E.current.y);Lt>U&&Lt>Ct&&x.current.go(ct<E.current.y?"+1":"-1"),E.current=null},et=nt=>{E.current&&rt(nt.clientX,nt.clientY),document.removeEventListener("pointerup",et),document.removeEventListener("pointercancel",et),document.removeEventListener("pointermove",Z)},dt=nt=>{if(E.current){if(nt.changedTouches.length>0){const ct=nt.changedTouches[0];rt(ct.clientX,ct.clientY)}document.removeEventListener("touchend",dt),document.removeEventListener("touchcancel",dt),document.removeEventListener("touchmove",it)}},j=nt=>{E.current={x:nt.clientX,y:nt.clientY},H.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",et),document.addEventListener("pointercancel",et)},X=nt=>{nt.touches.length>0&&(E.current={x:nt.touches[0].clientX,y:nt.touches[0].clientY},H.current=!1,document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",dt),document.addEventListener("touchcancel",dt))};return T.addEventListener("pointerdown",j),T.addEventListener("touchstart",X),()=>{T.removeEventListener("pointerdown",j),T.removeEventListener("touchstart",X),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",et),document.removeEventListener("pointercancel",et),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",dt),document.removeEventListener("touchcancel",dt),E.current=null,H.current=!1}},[t,D,c]);const at={backgroundColor:A.color,backdropFilter:`blur(${A.blur}px)`,animationDuration:`${parseInt(V.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:_i.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:r?null:_,className:xt(G.background,v?ot:st,{[G.editor]:r},{[G.hidden]:!t}),style:{...at,...p&&!r&&!v?{position:"absolute"}:{}}}),a.jsxs("div",{ref:r?_:null,className:xt(G.contentStyle,v?ut:Q,{[G.editor]:r},{[G.hidden]:!t}),style:{animationDuration:`${parseInt(V.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ko,{onMove:T=>u(T.index),ref:x,className:G.lightboxSplide,options:{arrows:!1,speed:C.duration?parseInt(C.duration):500,direction:C.direction==="horiz"||C.type==="fade"||C.type==="scale"?"ltr":"ttb",pagination:!1,drag:K.type==="drag"&&!D,perPage:1,width:"100%",height:"100%",type:C.type==="fade"||C.type==="scale"?"fade":"loop",padding:0,rewind:K.repeat!=="close",start:0},style:{"--splide-speed":C.duration},children:n.map((T,U)=>{const q=_n(N.position,N.offset,r),Z=`${S.scalingValue(N.padding.top,r)} ${S.scalingValue(N.padding.right,r)} ${S.scalingValue(N.padding.bottom,r)} ${S.scalingValue(N.padding.left,r)}`,it=C.type==="scale"?(()=>{const{transform:rt,...et}=q;return{...et,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":rt||"none"}})():{...q,position:"absolute",padding:Z,boxSizing:"border-box"};return a.jsx(Uo,{children:a.jsx("div",{className:G.imgWrapper,onClick:pt,children:a.jsx("img",{ref:U===d?R:null,className:xt(G.imageStyle,{[G.contain]:T.image.objectFit==="contain",[G.cover]:T.image.objectFit==="cover",[G.scaleSlide]:C.type==="scale"}),src:T.image.url,alt:T.image.name??"",style:{...it,pointerEvents:T.image.objectFit==="contain"?"none":"auto"}})})},U)})},c),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:xt(G.arrow,{[G.arrowVertical]:C.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${S.scalingValue(I.offset.x,r)}, ${S.scalingValue(I.offset.y*(C.direction==="horiz"?1:-1),r)}) scale(${I.scale}) rotate(${C.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var T;return(T=x.current)==null?void 0:T.go("-1")},"aria-label":"Previous",children:[I.arrowsImgUrl&&a.jsx(ve,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:xt(G.arrowImg,G.mirror)}),!I.arrowsImgUrl&&a.jsx(yi,{color:I.color,className:xt(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:xt(G.arrow,G.nextArrow,{[G.arrowVertical]:C.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${S.scalingValue(I.offset.x*(C.direction==="horiz"?-1:1),r)}, ${S.scalingValue(I.offset.y,r)}) scale(${I.scale}) rotate(${C.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var T;return(T=x.current)==null?void 0:T.go("+1")},"aria-label":"Next",children:[I.arrowsImgUrl&&a.jsx(ve,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:G.arrowImg}),!I.arrowsImgUrl&&a.jsx(yi,{color:I.color,className:xt(G.arrowIcon,G.arrowImg)})]})})]}),A.closeIconUrl&&(()=>{const T=_n(A.closeIconAlign,A.closeIconOffset,r),U=`scale(${A.closeIconScale})`,q=T.transform?`${T.transform} ${U}`:U;return a.jsx("button",{className:G.closeButton,style:{...T,transform:q},onClick:J,"aria-label":"Close lightbox",children:a.jsx(ve,{url:A.closeIconUrl,fill:A.closeIconColor??"#000000",hoverFill:A.closeIconHover??"#cccccc"})})})(),P&&P.isActive&&o.imageCaption&&((B=n[d])==null?void 0:B.imageCaption)&&(()=>{const{widthSettings:T,fontSettings:U,letterSpacing:q,textAlign:Z,wordSpacing:it,fontSizeLineHeight:rt,textAppearance:et,color:dt}=o.imageCaption;return a.jsx("div",{className:G.caption,style:{..._n(P.alignment,P.offset,r),fontFamily:no(U.fontFamily),fontWeight:U.fontWeight,fontStyle:U.fontStyle,width:T.sizing==="auto"?"max-content":S.scalingValue(T.width,r),letterSpacing:S.scalingValue(q,r),wordSpacing:S.scalingValue(it,r),textAlign:Z,fontSize:S.scalingValue(rt.fontSize,r),lineHeight:S.scalingValue(rt.lineHeight,r),textTransform:et.textTransform??"none",textDecoration:et.textDecoration??"none",fontVariant:et.fontVariant??"normal",color:dt},onClick:j=>j.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":P.linkColor,"--link-hover-color":P.linkHoverColor},children:a.jsx(un,{content:n[d].imageCaption})})})})(),k.isActive&&(()=>{const[T,U]=k.position.split("-"),q=C.direction==="horiz"?`${T}-left`:k.position,Z=_n(q,k.offset,r),it=()=>{if(C.direction==="horiz"){if(U==="left")return"flex-start";if(U==="center")return"center";if(U==="right")return"flex-end"}else{if(T==="top")return"flex-start";if(T==="middle")return"center";if(T==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:F,className:G.thumbsWrapper,onClick:rt=>gt(rt),style:{position:r?"absolute":"fixed",...Z,...C.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:xt(G.thumbsContainer,{[G.thumbsContainerVertical]:C.direction==="vert",[G.thumbsAlignStart]:k.align==="start",[G.thumbsAlignCenter]:k.align==="center",[G.thumbsAlignEnd]:k.align==="end"}),style:{gap:S.scalingValue(k.grid.gap,r),justifyContent:O?"flex-start":it()},children:n.map((rt,et)=>{const dt=et===d,j=$[et],Y=k.grid.size*(dt?k.activeState.scale:1),lt=()=>{if(k.fit!=="fit")return{};if(!j)return C.direction==="horiz"?{height:S.scalingValue(Y,r)}:{width:S.scalingValue(Y,r)};const nt=j.width/j.height;if(C.direction==="horiz"){const ct=Y,Ct=ct*nt;return{width:S.scalingValue(Ct,r),height:S.scalingValue(ct,r)}}else{const ct=Y,Ct=ct/nt;return{width:S.scalingValue(ct,r),height:S.scalingValue(Ct,r)}}};return a.jsx("button",{className:G.thumbItem,style:{...C.direction==="horiz"&&k.fit!=="fit"?{height:S.scalingValue(Y,r)}:{},...C.direction==="vert"&&k.fit!=="fit"?{width:S.scalingValue(Y,r)}:{},...k.fit==="cover"?{width:S.scalingValue(Y,r),height:S.scalingValue(Y,r)}:{},...lt(),transition:dt?"all 0.25s ease-out":"none",opacity:dt?k.activeState.opacity/100:k.opacity/100,"--thumb-hover":k.activeState.opacity/100},onClick:nt=>{var ct;nt.stopPropagation(),u(et),(ct=x.current)==null||ct.go(et)},onMouseEnter:()=>{var nt;k.triggers==="hov"&&((nt=x.current)==null||nt.go(et))},children:a.jsx("img",{src:rt.image.url,alt:rt.image.name??"",onLoad:nt=>{const ct=nt.currentTarget;ct.naturalWidth&&ct.naturalHeight&&f(Ct=>({...Ct,[et]:{width:ct.naturalWidth,height:ct.naturalHeight}}))},style:{objectFit:k.fit==="cover"?"cover":"contain",...k.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...k.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${rt.image.name}-${et}`)})})})})()]})]}),document.getElementById(l))};function yi({color:t,className:e}){return a.jsx("svg",{viewBox:"0 0 10 18",className:e,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:t,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Tl={element:$l,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function En(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Ll(t){return`
|
|
7
|
-
.${
|
|
6
|
+
*/const Ms="RichTextRenderer-module__link___BWeZ2",Ns={link:Ms},Os=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},so=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Os(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function yt(e){const{color:t,...n}=e;return n}function qe(e,t){var n,o,i;return{fontFamily:so(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:T.scalingValue(e.letterSpacing,t),wordSpacing:T.scalingValue(e.wordSpacing,t),fontSize:T.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?T.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(i=e.textAppearance)==null?void 0:i.fontVariant,color:e.color}}const vn=({content:e})=>{const t=n=>n.map((o,i)=>o.type==="link"?a.jsx("a",{className:Ns.link,href:o.value,target:o.target,children:t(o.children)},i):a.jsx("span",{style:Hs(o),children:o.text},i));return a.jsx(a.Fragment,{children:e.map((n,o)=>{const i=n.children;return a.jsx("div",{children:t(i)},o)})})};function Hs(e){return{...e.fontFamily&&{fontFamily:so(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const Bs="SvgImage-module__svg___q3xE-",Vs="SvgImage-module__img___VsTm-",Si={svg:Bs,img:Vs},Ds=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},zs=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,$t=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:i})=>{const[l,r]=u.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return u.useEffect(()=>{if(typeof window<"u"&&window.CSS){const s=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');r(s)}},[]),!Ds(e)||!l?a.jsx("img",{src:e,alt:"",className:ve(Si.img,o),style:i}):a.jsx("span",{"data-supports-mask":l,className:ve(Si.svg,o),style:{"--svg":zs(e),"--fill":t,"--hover-fill":n,...i??{}}})},js={"top-left":ae.topLeftAlignment,"top-center":ae.topCenterAlignment,"top-right":ae.topRightAlignment,"middle-left":ae.middleLeftAlignment,"middle-center":ae.middleCenterAlignment,"middle-right":ae.middleRightAlignment,"bottom-left":ae.bottomLeftAlignment,"bottom-center":ae.bottomCenterAlignment,"bottom-right":ae.bottomRightAlignment};function Ks({settings:e,content:t,styles:n,isEditor:o}){const[i,l]=u.useState(null),{widthSettings:r,fontSettings:s,letterSpacing:c,textAlign:p,wordSpacing:d,fontSizeLineHeight:$,textAppearance:h,color:f}=n.imageCaption,[m,g]=u.useState(void 0),[C,y]=u.useState(null),[x,P]=u.useState(0),[L,_]=u.useState(0),{direction:E,transition:v,controls:w,pagination:R,imageCaption:V,triggers:A}=e,H=u.useRef(v.type),{x:D,y:j}=e.controls.offset,U=S=>{i&&i.go(S)};return u.useEffect(()=>{if(!C)return;const S=new ResizeObserver(N=>{if(!i)return;const[k]=N;g({width:Math.round(k.contentRect.width),height:Math.round(k.contentRect.height)})});return S.observe(C),()=>S.unobserve(C)},[C]),u.useEffect(()=>{!i||H.current===v.type||(_(S=>S+1),H.current=v.type)},[v.type]),a.jsx("div",{className:ve(ae.wrapper,{[ae.editor]:o}),ref:y,children:a.jsxs("div",{className:ae.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ve(ae.captionBlock),children:a.jsx("div",{className:ae.captionTextWrapper,children:t.map((S,N)=>a.jsx("div",{className:ve(ae.captionText,js[V.alignment],{[ae.withPointerEvents]:N===x&&o,[ae.active]:N===x}),style:{fontFamily:so(s.fontFamily),fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:r.sizing==="auto"?"max-content":T.scalingValue(r.width,o),letterSpacing:T.scalingValue(c,o),wordSpacing:T.scalingValue(d,o),textAlign:p,fontSize:T.scalingValue($.fontSize,o),lineHeight:T.scalingValue($.lineHeight,o),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ae.captionTextInner,style:{"--link-hover-color":V.linkHoverColor,"--link-color":V.linkColor,position:"relative",top:T.scalingValue(V.offset.y,o),left:T.scalingValue(V.offset.x,o)},children:a.jsx(vn,{content:S.imageCaption})})},N))})}),a.jsx(Jo,{onMove:S=>{P(S.index)},ref:l,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:A.autoPlay!==null,...A.autoPlay!==null&&{interval:parseInt(A.autoPlay)*1e3},direction:E==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:A.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((S,N)=>a.jsx(Qo,{children:a.jsx("div",{className:ae.sliderItem,children:a.jsx("div",{className:ae.imgWrapper,children:a.jsx("img",{className:ve(ae.sliderImage,{[ae.contain]:S.image.objectFit==="contain",[ae.cover]:S.image.objectFit==="cover"}),src:S.image.url,alt:S.image.name??""})})})},N))},L),w.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(ae.arrow,{[ae.arrowVertical]:E==="vert",[ae.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{onClick:()=>{U("-1")},className:ae.arrowInner,style:{transform:`translate(${T.scalingValue(D,o)}, ${T.scalingValue(j*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx($t,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ve(ae.arrowImg,ae.mirror)}),!w.arrowsImgUrl&&a.jsx(wi,{color:w.color,className:ve(ae.arrowIcon,ae.arrowImg,ae.mirror)})]})}),a.jsx("div",{className:ve(ae.arrow,ae.nextArrow,{[ae.arrowVertical]:E==="vert",[ae.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{className:ae.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${T.scalingValue(D*(E==="horiz"?-1:1),o)}, ${T.scalingValue(j,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx($t,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ae.arrowImg}),!w.arrowsImgUrl&&a.jsx(wi,{color:w.color,className:ve(ae.arrowIcon,ae.arrowImg)})]})})]}),A.triggersList.click&&a.jsx("div",{className:ae.clickOverlay,onClick:()=>{i&&i.go("+1")}}),R.isActive&&a.jsx("div",{className:ve(ae.pagination,{[ae.paginationInsideBottom]:R.position==="inside-1"&&E==="horiz",[ae.paginationInsideTop]:R.position==="inside-2"&&E==="horiz",[ae.paginationOutsideBottom]:R.position==="outside-1"&&E==="horiz",[ae.paginationOutsideTop]:R.position==="outside-2"&&E==="horiz",[ae.paginationInsideLeft]:R.position==="inside-1"&&E==="vert",[ae.paginationInsideRight]:R.position==="inside-2"&&E==="vert",[ae.paginationOutsideLeft]:R.position==="outside-1"&&E==="vert",[ae.paginationOutsideRight]:R.position==="outside-2"&&E==="vert",[ae.paginationVertical]:E==="vert"}),children:a.jsx("div",{className:ae.paginationInner,style:{backgroundColor:R.colors[2],transform:`scale(${R.scale/100}) translate(${T.scalingValue(R.offset.x,o)}, ${T.scalingValue(R.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((S,N)=>a.jsx("button",{onClick:()=>{i&&i.go(N)},className:ve(ae.paginationItem),children:a.jsx("div",{className:ve(ae.dot,{[ae.activeDot]:N===x}),style:{backgroundColor:N===x?R.colors[0]:R.colors[1],"--pagination-hover-color":R.hover}})},N))})})]})})}function wi({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Us={element:Ks,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},qs="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Gs="ImageRevealSlider-module__image___Qjt-e",Ys="ImageRevealSlider-module__link___N-iLG",Xs="ImageRevealSlider-module__cursor___2U03d",zt={imageRevealSlider:qs,image:Gs,link:Ys,cursor:Xs};function $i(e,t,n){for(const o of n){const i=new Image;i.src=o.url;const l=o.width?Number.parseFloat(o.width):i.naturalWidth,r=i.naturalHeight/i.naturalWidth*l,s=l/2,c=r/2;if(e>=o.x-s&&e<=o.x+s&&t>=o.y-c&&t<=o.y+c)return!0}return!1}function fo(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Zs(e,t,n,o){let i,l;if(t==="custom"){i=n;const r=await fo(e);l=r.height/r.width*i}else if(t==="random"){i=Math.random()*(o.max-o.min)+o.min;const r=await fo(e);l=r.height/r.width*i}else{const r=await fo(e);i=r.width,l=r.height}return{width:i,height:l,finalWidth:`${i}px`}}function Js({settings:e,content:t,isEditor:n}){const[o,i]=u.useState(null),[l,r]=u.useState([]),[s,c]=u.useState(0),p=u.useRef(0),[d,$]=u.useState({x:0,y:0}),[h,f]=u.useState(1),[m,g]=u.useState("none"),C=u.useRef({x:0,y:0}),[y,x]=u.useState(!1),{sizeType:P,imageWidth:L,randomRangeImageWidth:_}=e.imageSize,{revealPosition:E,visible:v}=e.position,{cursorType:w,target:R,defaultCursorScale:V,defaultCursor:A,hoverCursorScale:H,hoverCursor:D}=e.cursor;u.useEffect(()=>{if(!o)return;const S=(M,W)=>{const B=o.getBoundingClientRect(),ee=M-B.left,de=W-B.top;if($({x:ee,y:de}),w==="system"){g("none"),f(1);return}const re=ee,me=de,O=document.elementFromPoint(B.left+re,B.top+me);if(O&&O.closest("a")){g("none"),f(1);return}const te=$i(re,me,l)||R==="area"?{img:D??"none",scale:H}:{img:A??"none",scale:V};g(te.img),f(te.scale)},N=M=>{M.stopPropagation(),C.current={x:M.clientX,y:M.clientY},S(M.clientX,M.clientY)},k=()=>{y&&S(C.current.x,C.current.y)};return o.addEventListener("mousemove",N),window.addEventListener("scroll",k,!0),()=>{o.removeEventListener("mousemove",N),window.removeEventListener("scroll",k,!0)}},[o,y,d,w,R,D,A,H,V,l]),u.useEffect(()=>{y||(g("none"),f(0))},[y]);const j=async(S,N,k,M={})=>{const{width:W,height:B,finalWidth:ee}=await Zs(S.image.url,P,L,_);let de=0,re=0;E==="same"?(de=N/2,re=k/2):(de=M.x??Math.random()*N,re=M.y??Math.random()*k);const me=Math.min(Math.max(de,W/2),N-W/2),O=Math.min(Math.max(re,B/2),k-B/2);return{id:p.current++,url:S.image.url,link:S.link,name:S.image.name,x:me,y:O,width:ee}};u.useEffect(()=>{if(!o||t.length===0)return;const S=o.getBoundingClientRect(),N=S.width,k=S.height,M=[];(async()=>{const B=t[0],ee=await j(B,N,k);M.push(ee),r(M),c(1)})()},[P,L,_,E,o]),u.useEffect(()=>{v==="last One"&&r(S=>S.length>0?[S[S.length-1]]:[])},[v]);const U=async S=>{if(!o)return;const N=o.getBoundingClientRect(),k=S.clientX-N.left,M=S.clientY-N.top;if(R==="image"&&!$i(k,M,l))return;let W=0,B=0;E==="on Click"?(W=k,B=M):E==="same"?(W=N.width/2,B=N.height/2):(W=Math.random()*N.width,B=Math.random()*N.height);const ee=t[s],de=await j(ee,N.width,N.height,{x:W,y:B});r(re=>v==="all"?[...re,de]:[de]),c(re=>re>=t.length-1?0:re+1)};return a.jsxs("div",{ref:i,onClick:U,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:zt.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[l.map(S=>a.jsx("div",{className:zt.wrapper,style:{top:`${S.y}px`,left:`${S.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:S.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:R==="area"&&S.link?a.jsx("a",{href:S.link,target:"_blank",className:zt.link,children:a.jsx("img",{src:S.url,alt:S.name,className:zt.image},S.id)}):a.jsx("img",{src:S.url,alt:S.name,className:zt.image},S.id)},S.id)),y&&a.jsx("div",{className:zt.cursor,style:{left:`${d.x}px`,top:`${d.y}px`,transform:`translate(-50%, -50%) scale(${h})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Qs={element:Js,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},el="LightBox-module__hidden___9s-9x",tl="LightBox-module__heroImage___sTxNF",nl="LightBox-module__background___rm9ml",ol="LightBox-module__editor___4ACaY",il="LightBox-module__contentStyle___Bgnsq",rl="LightBox-module__imageStyle___tLIlB",al="LightBox-module__imgWrapper___LuFUp",sl="LightBox-module__contain___8-yaS",ll="LightBox-module__cover___hNvOG",cl="LightBox-module__caption___b6L2I",dl="LightBox-module__captionTextInner___rCGNH",ul="LightBox-module__lightboxSplide___XFuWC",pl="LightBox-module__arrow___iz38X",ml="LightBox-module__arrowVertical___Zfz81",gl="LightBox-module__nextArrow___zkAQN",hl="LightBox-module__arrowInner___p48sW",fl="LightBox-module__arrowIcon___3VaFf",yl="LightBox-module__arrowImg___pNV88",vl="LightBox-module__mirror___pjeXc",bl="LightBox-module__thumbsWrapper___GB-nU",xl="LightBox-module__thumbsContainerVertical___wttk5",Cl="LightBox-module__thumbsContainer___osSma",Sl="LightBox-module__thumbsAlignStart___MO6tY",wl="LightBox-module__thumbsAlignCenter___Q4sUx",$l="LightBox-module__thumbsAlignEnd___p4y9R",Tl="LightBox-module__thumbItem___HvnF3",Ll="LightBox-module__closeButton___g2khP",El="LightBox-module__fadeIn___0m5GW",_l="LightBox-module__slideInLeft___gPYwC",Pl="LightBox-module__slideInRight___S-pPp",Al="LightBox-module__slideInTop___DFdAj",Wl="LightBox-module__slideInBottom___m27kZ",Il="LightBox-module__fadeOut___55qBR",Fl="LightBox-module__slideOutLeft___NvU7P",Rl="LightBox-module__slideOutRight___SK7eC",kl="LightBox-module__slideOutTop___Vgg0z",Ml="LightBox-module__slideOutBottom___nJ0Ef",Nl="LightBox-module__scaleSlide___vZriG",G={hidden:el,heroImage:tl,background:nl,editor:ol,contentStyle:il,imageStyle:rl,imgWrapper:al,contain:sl,cover:ll,caption:cl,captionTextInner:dl,lightboxSplide:ul,arrow:pl,arrowVertical:ml,nextArrow:gl,arrowInner:hl,arrowIcon:fl,arrowImg:yl,mirror:vl,thumbsWrapper:bl,thumbsContainerVertical:xl,thumbsContainer:Cl,thumbsAlignStart:Sl,thumbsAlignCenter:wl,thumbsAlignEnd:$l,thumbItem:Tl,closeButton:Ll,fadeIn:El,slideInLeft:_l,slideInRight:Pl,slideInTop:Al,slideInBottom:Wl,fadeOut:Il,slideOutLeft:Fl,slideOutRight:Rl,slideOutTop:kl,slideOutBottom:Ml,scaleSlide:Nl},In=(e,t,n)=>{const o={},[i,l]=e.split("-");return i==="top"?(o.top="0",o.bottom="auto"):i==="middle"?(o.top="50%",o.bottom="auto"):i==="bottom"&&(o.top="auto",o.bottom="0"),l==="left"?(o.left="0",o.right="auto"):l==="center"?(o.left="50%",o.right="auto"):l==="right"&&(o.left="auto",o.right="0"),i==="middle"&&l==="center"?o.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), calc(-50% + ${T.scalingValue(t.y,n)}))`:i==="middle"?o.transform=`translate(${T.scalingValue(t.x,n)}, calc(-50% + ${T.scalingValue(t.y,n)}))`:l==="center"?o.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), ${T.scalingValue(t.y,n)})`:o.transform=`translate(${T.scalingValue(t.x,n)}, ${T.scalingValue(t.y,n)})`,o};function wr(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Ti(e){const t=e.getBoundingClientRect(),n=wr(e),o=Math.max(0,t.width-n.left-n.right),i=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,r=e.naturalHeight,s=o/i,c=l/r;let p,d;c>s?(p=o,d=o/c):(d=i,p=i*c);const $=t.left+n.left,h=t.top+n.top,f=(o-p)/2+$,m=(i-d)/2+h;return{x:f,y:m,width:p,height:d}}function Li(e){const t=e.getBoundingClientRect(),n=wr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ei(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(i=>parseFloat(i.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ol(e,t){const n=(()=>{if(e==="fade in")return G.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return G.fadeIn;if(e==="slide in")switch(t){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return G.fadeOut;if(e==="slide in")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})(),l=(()=>{if(e==="fade in")return G.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:i,disappearClass:l}}const Hl=({settings:e,content:t,styles:n,portalId:o,activeEvent:i,isEditor:l})=>{const[r,s]=u.useState(!1),{url:c}=e.thumbnailBlock.cover;return u.useEffect(()=>{i==="close"&&s(!1),i==="open"&&s(!0)},[i]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:c,alt:"Cover",className:G.heroImage,onClick:()=>s(!0)}),a.jsx(Bl,{isOpen:r,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:l})]})},Bl=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:i,portalId:l,isEditor:r,metadata:s})=>{var I;const[c,p]=u.useState(0),[d,$]=u.useState(0),[h,f]=u.useState(!1),[m,g]=u.useState(!1),[C,y]=u.useState({}),x=u.useRef(null),P=u.useRef(null),L=u.useRef(null),_=u.useRef(!1),E=u.useRef(null),v=u.useRef(null),w=u.useRef(null),R=u.useRef(null),V=u.useRef(!1),A=u.useRef(null),[H,D]=u.useState(!1),{appear:j,triggers:U,slider:S,thumbnail:N,controls:k,area:M,caption:W,layout:B}=i.lightboxBlock,{appearClass:ee,backdropAppearClass:de,backdropDisappearClass:re,disappearClass:me}=Ol(j.type,j.direction),O=(s==null?void 0:s.itemId)??null;u.useEffect(()=>{const b=()=>{setTimeout(()=>{var q,Z;(Z=(q=x.current)==null?void 0:q.splide)==null||Z.refresh()},16)},z=()=>{$(q=>q+1)};return window.addEventListener("ArticleEditor.Layout:change",b),window.addEventListener("ArticleEditor.ComponentContent:change",z),()=>{window.removeEventListener("ArticleEditor.Layout:change",b),window.removeEventListener("ArticleEditor.ComponentContent:change",z)}},[]),u.useEffect(()=>{if(!e||!N.isActive){D(!1);return}const b=A.current;if(!b)return;const z=()=>{S.direction==="horiz"?D(b.scrollWidth>b.clientWidth):D(b.scrollHeight>b.clientHeight)};z();const q=new ResizeObserver(z);return q.observe(b),()=>q.disconnect()},[e,N.isActive,n.length,C,S.direction]);const te=u.useCallback(()=>{const b=window.matchMedia("(max-width: 768px)").matches,z=Ei(M.color);b&&!r&&z>.9&&(document.body.style.backgroundColor=""),f(!0),_.current=!0;const q=Z=>{Z.target===E.current&&Z.animationName&&(E.current&&v.current&&E.current.removeEventListener("animationend",v.current),v.current=null,_.current&&(_.current=!1,t()),f(!1))};E.current&&(v.current=q,E.current.addEventListener("animationend",q))},[t,M.color,r]),Y=(b,z,q)=>{var Z,se;if(b){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&c===n.length-1?te():(Z=x.current)==null||Z.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const le=b.getBoundingClientRect(),ce=z-le.left,ge=q-le.top,K=le.width,J=le.height;let Q;S.direction==="horiz"?Q=ce<K/2?"-1":"+1":Q=ge<J/2?"-1":"+1",(se=x.current)==null||se.go(Q)}}},X=b=>{if(V.current){V.current=!1;return}const z=n[c],q=(z==null?void 0:z.image.objectFit)==="cover";let Z,se;if("changedTouches"in b&&b.changedTouches.length>0)Z=b.changedTouches[0].clientX,se=b.changedTouches[0].clientY;else if("clientX"in b)Z=b.clientX,se=b.clientY;else return;let le;if(q&&L.current){const ce=Li(L.current);le=Z>=ce.left&&Z<=ce.right&&se>=ce.top&&se<=ce.bottom}else{const ce=L.current?Ti(L.current):null;if(!ce){b.target===b.currentTarget&&te();return}le=Z>=ce.x&&Z<=ce.x+ce.width&&se>=ce.y&&se<=ce.y+ce.height}le?Y(L.current,Z,se):te()},ne=b=>{const z=b.target;(z.classList.contains(G.thumbsWrapper)||z.classList.contains(G.thumbsContainer))&&X(b)};u.useEffect(()=>{if(!e)return;const b=z=>{var q,Z;if(z.key==="Escape"){te();return}if(z.key==="ArrowRight"){p(se=>(se+1)%Math.max(n.length,1)),(q=x.current)==null||q.go("+1");return}z.key==="ArrowLeft"&&(p(se=>(se-1+Math.max(n.length,1))%Math.max(n.length,1)),(Z=x.current)==null||Z.go("-1"))};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[e,te,n.length]),u.useEffect(()=>{if(e){if(p(0),$(z=>z+1),_.current=!1,f(!1),g(!1),y({}),!O)return;const b=new CustomEvent("page-overlay",{detail:{itemId:O}});window.dispatchEvent(b)}return()=>{E.current&&v.current&&(E.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,O]),u.useEffect(()=>{P.current!==null&&P.current!==S.type&&$(b=>b+1),P.current=S.type},[S.type]),u.useEffect(()=>{if(!e)return;const b=document.body.style.overflow,z=window.matchMedia("(max-width: 768px)").matches,q=Ei(M.color);document.body.style.overflow="hidden",g(!1);const Z=le=>{le.target===E.current&&!_.current&&le.animationName&&(z&&!r&&q>.9&&(document.body.style.backgroundColor=M.color),g(!0),E.current&&w.current&&E.current.removeEventListener("animationend",w.current),w.current=null)};E.current&&(w.current=Z,E.current.addEventListener("animationend",Z));const se=le=>{const ce=le.target;ce&&(ce.closest(`.${G.thumbsWrapper}`)||ce.closest(`.${G.thumbsContainer}`))||S.type!=="slide"&&le.preventDefault()};return document.addEventListener("touchmove",se,{passive:!1}),()=>{document.body.style.overflow=b,document.removeEventListener("touchmove",se),E.current&&w.current&&(E.current.removeEventListener("animationend",w.current),w.current=null),g(!1)}},[e,r,M.color,S.type]),u.useEffect(()=>{if(!e)return;const b=z=>{var Z,se;if(_.current){z.stopPropagation();return}if(V.current){V.current=!1;return}const q=z.target;if(!(q&&(q.closest(`.${G.thumbsContainer}`)||q.closest(`.${G.thumbItem}`)||q.closest(`.${G.arrow}`)||q.closest(`.${G.closeButton}`)||q.closest(`.${G.caption}`)))){if(S.type==="slide"&&U.type==="drag"&&((se=(Z=x.current)==null?void 0:Z.splide)!=null&&se.root)){const le=x.current.splide.root;if(q&&(le.contains(q)||le===q))return}if(z.touches.length===0&&z.changedTouches.length>0){const le=n[c],ce=(le==null?void 0:le.image.objectFit)==="cover",ge=z.changedTouches[0];let K;if(ce&&L.current){const J=Li(L.current);K=ge.clientX>=J.left&&ge.clientX<=J.right&&ge.clientY>=J.top&&ge.clientY<=J.bottom}else{const J=L.current?Ti(L.current):null;if(!J)return;K=ge.clientX>=J.x&&ge.clientX<=J.x+J.width&&ge.clientY>=J.y&&ge.clientY<=J.y+J.height}if(!K){z.stopPropagation(),_.current=!0;const J=Q=>{Q.stopPropagation(),Q.preventDefault(),document.removeEventListener("click",J,!0)};document.addEventListener("click",J,!0),te()}}}};return document.addEventListener("touchend",b,{passive:!0}),()=>{document.removeEventListener("touchend",b)}},[e,te,c,n]);const F=(S.type==="scale"||S.type==="fade")&&S.direction==="vert"&&U.type==="drag";u.useEffect(()=>{var Q,pe;if(!e||!F||!((pe=(Q=x.current)==null?void 0:Q.splide)!=null&&pe.root))return;const b=x.current.splide.root,z=30,q=(ie,ue)=>{if(R.current){const Ce=Math.abs(ie-R.current.x),$e=Math.abs(ue-R.current.y);(Ce>0||$e>0)&&(V.current=!0)}},Z=ie=>{R.current&&(ie.preventDefault(),q(ie.clientX,ie.clientY))},se=ie=>{R.current&&ie.touches.length>0&&(ie.preventDefault(),q(ie.touches[0].clientX,ie.touches[0].clientY))},le=(ie,ue)=>{if(!R.current||!x.current){R.current=null;return}const Ce=Math.abs(ie-R.current.x),$e=Math.abs(ue-R.current.y);$e>z&&$e>Ce&&x.current.go(ue<R.current.y?"+1":"-1"),R.current=null},ce=ie=>{R.current&&le(ie.clientX,ie.clientY),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("pointermove",Z)},ge=ie=>{if(R.current){if(ie.changedTouches.length>0){const ue=ie.changedTouches[0];le(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",se)}},K=ie=>{R.current={x:ie.clientX,y:ie.clientY},V.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",ce),document.addEventListener("pointercancel",ce)},J=ie=>{ie.touches.length>0&&(R.current={x:ie.touches[0].clientX,y:ie.touches[0].clientY},V.current=!1,document.addEventListener("touchmove",se,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return b.addEventListener("pointerdown",K),b.addEventListener("touchstart",J),()=>{b.removeEventListener("pointerdown",K),b.removeEventListener("touchstart",J),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("touchmove",se),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),R.current=null,V.current=!1}},[e,F,d]);const oe={backgroundColor:M.color,backdropFilter:`blur(${M.blur}px)`,animationDuration:`${parseInt(j.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Bi.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:r?null:E,className:ve(G.background,h?re:de,{[G.editor]:r},{[G.hidden]:!e}),style:{...oe,...m&&!r&&!h?{position:"absolute"}:{}}}),a.jsxs("div",{ref:r?E:null,className:ve(G.contentStyle,h?me:ee,{[G.editor]:r},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(j.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Jo,{onMove:b=>p(b.index),ref:x,className:G.lightboxSplide,options:{arrows:!1,speed:S.duration?parseInt(S.duration):500,direction:S.direction==="horiz"||S.type==="fade"||S.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!F,perPage:1,width:"100%",height:"100%",type:S.type==="fade"||S.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":S.duration},children:n.map((b,z)=>{const q=In(B.position,B.offset,r),Z=`${T.scalingValue(B.padding.top,r)} ${T.scalingValue(B.padding.right,r)} ${T.scalingValue(B.padding.bottom,r)} ${T.scalingValue(B.padding.left,r)}`,se=S.type==="scale"?(()=>{const{transform:le,...ce}=q;return{...ce,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":le||"none"}})():{...q,position:"absolute",padding:Z,boxSizing:"border-box"};return a.jsx(Qo,{children:a.jsx("div",{className:G.imgWrapper,onClick:X,children:a.jsx("img",{ref:z===c?L:null,className:ve(G.imageStyle,{[G.contain]:b.image.objectFit==="contain",[G.cover]:b.image.objectFit==="cover",[G.scaleSlide]:S.type==="scale"}),src:b.image.url,alt:b.image.name??"",style:{...se,pointerEvents:b.image.objectFit==="contain"?"none":"auto"}})})},z)})},d),k.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(G.arrow,{[G.arrowVertical]:S.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${T.scalingValue(k.offset.x,r)}, ${T.scalingValue(k.offset.y*(S.direction==="horiz"?1:-1),r)}) scale(${k.scale}) rotate(${S.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=x.current)==null?void 0:b.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&a.jsx($t,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:ve(G.arrowImg,G.mirror)}),!k.arrowsImgUrl&&a.jsx(_i,{color:k.color,className:ve(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:ve(G.arrow,G.nextArrow,{[G.arrowVertical]:S.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${T.scalingValue(k.offset.x*(S.direction==="horiz"?-1:1),r)}, ${T.scalingValue(k.offset.y,r)}) scale(${k.scale}) rotate(${S.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=x.current)==null?void 0:b.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&a.jsx($t,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:G.arrowImg}),!k.arrowsImgUrl&&a.jsx(_i,{color:k.color,className:ve(G.arrowIcon,G.arrowImg)})]})})]}),M.closeIconUrl&&(()=>{const b=In(M.closeIconAlign,M.closeIconOffset,r),z=`scale(${M.closeIconScale})`,q=b.transform?`${b.transform} ${z}`:z;return a.jsx("button",{className:G.closeButton,style:{...b,transform:q},onClick:te,"aria-label":"Close lightbox",children:a.jsx($t,{url:M.closeIconUrl,fill:M.closeIconColor??"#000000",hoverFill:M.closeIconHover??"#cccccc"})})})(),W&&W.isActive&&o.imageCaption&&((I=n[c])==null?void 0:I.imageCaption)&&(()=>{const{widthSettings:b,fontSettings:z,letterSpacing:q,textAlign:Z,wordSpacing:se,fontSizeLineHeight:le,textAppearance:ce,color:ge}=o.imageCaption;return a.jsx("div",{className:G.caption,style:{...In(W.alignment,W.offset,r),fontFamily:so(z.fontFamily),fontWeight:z.fontWeight,fontStyle:z.fontStyle,width:b.sizing==="auto"?"max-content":T.scalingValue(b.width,r),letterSpacing:T.scalingValue(q,r),wordSpacing:T.scalingValue(se,r),textAlign:Z,fontSize:T.scalingValue(le.fontSize,r),lineHeight:T.scalingValue(le.lineHeight,r),textTransform:ce.textTransform??"none",textDecoration:ce.textDecoration??"none",fontVariant:ce.fontVariant??"normal",color:ge},onClick:K=>K.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":W.linkColor,"--link-hover-color":W.linkHoverColor},children:a.jsx(vn,{content:n[c].imageCaption})})})})(),N.isActive&&(()=>{const[b,z]=N.position.split("-"),q=S.direction==="horiz"?`${b}-left`:N.position,Z=In(q,N.offset,r),se=()=>{if(S.direction==="horiz"){if(z==="left")return"flex-start";if(z==="center")return"center";if(z==="right")return"flex-end"}else{if(b==="top")return"flex-start";if(b==="middle")return"center";if(b==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:A,className:G.thumbsWrapper,onClick:le=>ne(le),style:{position:r?"absolute":"fixed",...Z,...S.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ve(G.thumbsContainer,{[G.thumbsContainerVertical]:S.direction==="vert",[G.thumbsAlignStart]:N.align==="start",[G.thumbsAlignCenter]:N.align==="center",[G.thumbsAlignEnd]:N.align==="end"}),style:{gap:T.scalingValue(N.grid.gap,r),justifyContent:H?"flex-start":se()},children:n.map((le,ce)=>{const ge=ce===c,K=C[ce],Q=N.grid.size*(ge?N.activeState.scale:1),pe=()=>{if(N.fit!=="fit")return{};if(!K)return S.direction==="horiz"?{height:T.scalingValue(Q,r)}:{width:T.scalingValue(Q,r)};const ie=K.width/K.height;if(S.direction==="horiz"){const ue=Q,Ce=ue*ie;return{width:T.scalingValue(Ce,r),height:T.scalingValue(ue,r)}}else{const ue=Q,Ce=ue/ie;return{width:T.scalingValue(ue,r),height:T.scalingValue(Ce,r)}}};return a.jsx("button",{className:G.thumbItem,style:{...S.direction==="horiz"&&N.fit!=="fit"?{height:T.scalingValue(Q,r)}:{},...S.direction==="vert"&&N.fit!=="fit"?{width:T.scalingValue(Q,r)}:{},...N.fit==="cover"?{width:T.scalingValue(Q,r),height:T.scalingValue(Q,r)}:{},...pe(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?N.activeState.opacity/100:N.opacity/100,"--thumb-hover":N.activeState.opacity/100},onClick:ie=>{var ue;ie.stopPropagation(),p(ce),(ue=x.current)==null||ue.go(ce)},onMouseEnter:()=>{var ie;N.triggers==="hov"&&((ie=x.current)==null||ie.go(ce))},children:a.jsx("img",{src:le.image.url,alt:le.image.name??"",onLoad:ie=>{const ue=ie.currentTarget;ue.naturalWidth&&ue.naturalHeight&&y(Ce=>({...Ce,[ce]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:N.fit==="cover"?"cover":"contain",...N.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...N.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${le.image.name}-${ce}`)})})})})()]})]}),document.getElementById(l))};function _i({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Vl={element:Hl,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function Fn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dl(e){return`
|
|
7
|
+
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${Fn(48)};
|
|
12
12
|
}
|
|
13
|
-
.${
|
|
14
|
-
.${
|
|
13
|
+
.${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
|
|
14
|
+
.${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
|
|
15
15
|
outline: none;
|
|
16
16
|
}
|
|
17
|
-
.${
|
|
17
|
+
.${e}-form {
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
width: 100%;
|
|
21
21
|
}
|
|
22
|
-
.${
|
|
22
|
+
.${e}-fields {
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
flex: 1;
|
|
26
26
|
min-width: 0;
|
|
27
27
|
}
|
|
28
|
-
.${
|
|
28
|
+
.${e}-field-group {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
flex: 1;
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
|
-
.${
|
|
35
|
-
gap: ${
|
|
34
|
+
.${e}-field-group.${e}-labeled {
|
|
35
|
+
gap: ${Fn(4)};
|
|
36
36
|
}
|
|
37
|
-
.${
|
|
37
|
+
.${e}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
39
|
-
color: var(--${
|
|
39
|
+
color: var(--${e}-label-text-color);
|
|
40
40
|
}
|
|
41
|
-
.${
|
|
41
|
+
.${e}-input {
|
|
42
42
|
width: 100%;
|
|
43
43
|
box-sizing: border-box;
|
|
44
44
|
outline: none;
|
|
45
45
|
-webkit-tap-highlight-color: transparent;
|
|
46
|
-
background-color: var(--${
|
|
47
|
-
color: var(--${
|
|
48
|
-
border-color: var(--${
|
|
46
|
+
background-color: var(--${e}-input-color);
|
|
47
|
+
color: var(--${e}-input-text-color);
|
|
48
|
+
border-color: var(--${e}-input-border-color);
|
|
49
49
|
transition: color 250ms, border-color 250ms, background-color 250ms;
|
|
50
50
|
}
|
|
51
|
-
.${
|
|
52
|
-
color: var(--${
|
|
51
|
+
.${e}-input::placeholder {
|
|
52
|
+
color: var(--${e}-placeholder-color);
|
|
53
53
|
opacity: 1;
|
|
54
54
|
transition: color 250ms, opacity 250ms;
|
|
55
55
|
}
|
|
56
|
-
.${
|
|
57
|
-
background-color: var(--${
|
|
58
|
-
color: var(--${
|
|
59
|
-
border-color: var(--${
|
|
60
|
-
}
|
|
61
|
-
.${
|
|
62
|
-
background-color: var(--${
|
|
63
|
-
color: var(--${
|
|
64
|
-
border-color: var(--${
|
|
65
|
-
}
|
|
66
|
-
.${
|
|
67
|
-
.${
|
|
68
|
-
.${
|
|
69
|
-
background-color: var(--${
|
|
70
|
-
color: var(--${
|
|
71
|
-
border-color: var(--${
|
|
72
|
-
}
|
|
73
|
-
.${
|
|
74
|
-
background-color: var(--${
|
|
75
|
-
color: var(--${
|
|
76
|
-
border-color: var(--${
|
|
77
|
-
}
|
|
78
|
-
.${
|
|
79
|
-
background-color: var(--${
|
|
80
|
-
color: var(--${
|
|
81
|
-
border-color: var(--${
|
|
82
|
-
}
|
|
83
|
-
.${
|
|
84
|
-
.${
|
|
56
|
+
.${e}-input:hover {
|
|
57
|
+
background-color: var(--${e}-hover-input-color, var(--${e}-input-color));
|
|
58
|
+
color: var(--${e}-hover-input-text-color, var(--${e}-input-text-color));
|
|
59
|
+
border-color: var(--${e}-hover-input-border-color, var(--${e}-input-border-color));
|
|
60
|
+
}
|
|
61
|
+
.${e}-wrapper.${e}-state-hover .${e}-input {
|
|
62
|
+
background-color: var(--${e}-hover-input-color, var(--${e}-input-color));
|
|
63
|
+
color: var(--${e}-hover-input-text-color, var(--${e}-input-text-color));
|
|
64
|
+
border-color: var(--${e}-hover-input-border-color, var(--${e}-input-border-color));
|
|
65
|
+
}
|
|
66
|
+
.${e}-input:focus,
|
|
67
|
+
.${e}-input:focus-visible,
|
|
68
|
+
.${e}-wrapper.${e}-state-focus .${e}-input {
|
|
69
|
+
background-color: var(--${e}-focus-input-color, var(--${e}-input-color));
|
|
70
|
+
color: var(--${e}-focus-input-text-color, var(--${e}-input-text-color));
|
|
71
|
+
border-color: var(--${e}-focus-input-border-color, var(--${e}-input-border-color));
|
|
72
|
+
}
|
|
73
|
+
.${e}-input[data-filled="true"] {
|
|
74
|
+
background-color: var(--${e}-filled-input-color, var(--${e}-input-color));
|
|
75
|
+
color: var(--${e}-filled-input-text-color, var(--${e}-input-text-color));
|
|
76
|
+
border-color: var(--${e}-filled-input-border-color, var(--${e}-input-border-color));
|
|
77
|
+
}
|
|
78
|
+
.${e}-wrapper.${e}-state-filled .${e}-button {
|
|
79
|
+
background-color: var(--${e}-filled-button-color, var(--${e}-button-color));
|
|
80
|
+
color: var(--${e}-filled-button-text-color, var(--${e}-button-text-color));
|
|
81
|
+
border-color: var(--${e}-filled-button-border-color, var(--${e}-button-border-color));
|
|
82
|
+
}
|
|
83
|
+
.${e}-wrapper.${e}-state-success .${e}-input,
|
|
84
|
+
.${e}-wrapper.${e}-state-success .${e}-button {
|
|
85
85
|
pointer-events: none;
|
|
86
86
|
}
|
|
87
|
-
.${
|
|
87
|
+
.${e}-wrapper.${e}-state-error .${e}-input {
|
|
88
88
|
}
|
|
89
|
-
.${
|
|
89
|
+
.${e}-input[data-field-type="textarea"] {
|
|
90
90
|
resize: vertical;
|
|
91
91
|
}
|
|
92
|
-
.${
|
|
92
|
+
.${e}-input:disabled {
|
|
93
93
|
cursor: not-allowed;
|
|
94
94
|
}
|
|
95
|
-
.${
|
|
95
|
+
.${e}-button {
|
|
96
96
|
cursor: pointer;
|
|
97
97
|
white-space: nowrap;
|
|
98
98
|
box-sizing: border-box;
|
|
99
99
|
outline: none;
|
|
100
|
-
background-color: var(--${
|
|
101
|
-
color: var(--${
|
|
102
|
-
border-color: var(--${
|
|
100
|
+
background-color: var(--${e}-button-color);
|
|
101
|
+
color: var(--${e}-button-text-color);
|
|
102
|
+
border-color: var(--${e}-button-border-color);
|
|
103
103
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
104
104
|
}
|
|
105
|
-
.${
|
|
106
|
-
background-color: var(--${
|
|
107
|
-
color: var(--${
|
|
108
|
-
border-color: var(--${
|
|
109
|
-
}
|
|
110
|
-
.${
|
|
111
|
-
background-color: var(--${
|
|
112
|
-
color: var(--${
|
|
113
|
-
border-color: var(--${
|
|
114
|
-
}
|
|
115
|
-
.${
|
|
116
|
-
.${
|
|
117
|
-
.${
|
|
118
|
-
background-color: var(--${
|
|
119
|
-
color: var(--${
|
|
120
|
-
border-color: var(--${
|
|
121
|
-
}
|
|
122
|
-
.${
|
|
123
|
-
.${
|
|
105
|
+
.${e}-button:hover {
|
|
106
|
+
background-color: var(--${e}-hover-button-color, var(--${e}-button-color));
|
|
107
|
+
color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
|
|
108
|
+
border-color: var(--${e}-hover-button-border-color, var(--${e}-button-border-color));
|
|
109
|
+
}
|
|
110
|
+
.${e}-wrapper.${e}-state-hover .${e}-button {
|
|
111
|
+
background-color: var(--${e}-hover-button-color, var(--${e}-button-color));
|
|
112
|
+
color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
|
|
113
|
+
border-color: var(--${e}-hover-button-border-color, var(--${e}-button-border-color));
|
|
114
|
+
}
|
|
115
|
+
.${e}-button:focus,
|
|
116
|
+
.${e}-button:focus-visible,
|
|
117
|
+
.${e}-wrapper.${e}-state-focus .${e}-button {
|
|
118
|
+
background-color: var(--${e}-focus-button-color, var(--${e}-button-color));
|
|
119
|
+
color: var(--${e}-focus-button-text-color, var(--${e}-button-text-color));
|
|
120
|
+
border-color: var(--${e}-focus-button-border-color, var(--${e}-button-border-color));
|
|
121
|
+
}
|
|
122
|
+
.${e}-input:focus-visible,
|
|
123
|
+
.${e}-wrapper.${e}-state-focus .${e}-input {
|
|
124
124
|
outline: none;
|
|
125
125
|
}
|
|
126
|
-
.${
|
|
127
|
-
.${
|
|
126
|
+
.${e}-button:focus-visible,
|
|
127
|
+
.${e}-wrapper.${e}-state-focus .${e}-button {
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
|
-
.${
|
|
131
|
-
margin-top: ${
|
|
132
|
-
color: var(--${
|
|
130
|
+
.${e}-success {
|
|
131
|
+
margin-top: ${Fn(8)};
|
|
132
|
+
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
133
133
|
}
|
|
134
|
-
.${
|
|
135
|
-
margin-top: ${
|
|
136
|
-
color: var(--${
|
|
134
|
+
.${e}-error {
|
|
135
|
+
margin-top: ${Fn(8)};
|
|
136
|
+
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
137
137
|
}
|
|
138
|
-
.${
|
|
138
|
+
.${e}-overlay-anchor {
|
|
139
139
|
position: relative;
|
|
140
140
|
height: auto;
|
|
141
141
|
}
|
|
142
|
-
`}function
|
|
142
|
+
`}function zl({settings:e,isEditor:t,metadata:n,activeEvent:o}){const{prefix:i}=T.useScopedStyles(),{type:l="A",fieldsToShow:r=2,fields:s=[],buttonLabel:c,gap:p,fieldsGap:d,buttonCorners:$,buttonStroke:h,buttonPadding:f,isButtonFullWidth:m,inputCorners:g,inputStroke:C,inputPadding:y,inputColor:x,inputTextColor:P,inputBorderColor:L,placeholderColor:_,buttonColor:E,buttonTextColor:v,buttonBorderColor:w,labelTextColor:R,successColor:V,errorColor:A,fontFamily:H,inputFontSettings:D,inputFontSize:j,inputLineHeight:U,inputLetterSpacing:S,inputWordSpacing:N,inputTextAppearance:k,buttonFontSettings:M,buttonFontSize:W,buttonLineHeight:B,buttonLetterSpacing:ee,buttonWordSpacing:de,buttonTextAppearance:re,labelFontSettings:me,labelFontSize:O,labelLineHeight:te,labelLetterSpacing:Y,labelWordSpacing:X,labelTextAppearance:ne,statusFontSettings:F,statusFontSize:oe,statusLineHeight:I,statusLetterSpacing:b,statusWordSpacing:z,statusTextAppearance:q,successMessage:Z,errorMessage:se,stateOverrides:le}=e,ce=l==="B",ge=s.slice(0,Math.min(r,s.length)),K={fontSettings:{fontFamily:H,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:j??.01,lineHeight:U,letterSpacing:S??0,wordSpacing:N??0,textAppearance:k,color:P},J=yt(qe(K,t)),Q=T.scalingValue(C??0,t),pe=T.scalingValue((U??j??.01)+((y==null?void 0:y.top)??0)+((y==null?void 0:y.bottom)??0)+(l==="C"?C??0:(C??0)*2),t),ie={...J,borderStyle:"solid",borderRadius:l==="C"?0:T.scalingValue(g??0,t),...l==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Q,borderLeftWidth:0}:{borderWidth:Q},paddingTop:T.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:T.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:T.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:T.scalingValue((y==null?void 0:y.left)??0,t),height:pe,minHeight:pe},ue={fontSettings:{fontFamily:H,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:W??.01,lineHeight:B,letterSpacing:ee??0,wordSpacing:de??0,textAppearance:re,color:v},Ce=yt(qe(ue,t)),$e=T.scalingValue(h??0,t),Pe={fontSettings:{fontFamily:H,fontWeight:(me==null?void 0:me.fontWeight)??400,fontStyle:(me==null?void 0:me.fontStyle)??"normal"},fontSize:O??.01,lineHeight:te,letterSpacing:Y??0,wordSpacing:X??0,textAppearance:ne,color:R},je=qe(Pe,t),we={fontSettings:{fontFamily:H,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:I,letterSpacing:b??0,wordSpacing:z??0,textAppearance:q,color:V},Me=yt(qe(we,t)),Ge=T.buildColorVars(i,{inputColor:x,inputTextColor:P,inputBorderColor:L,placeholderColor:_!=null&&_.trim()?_:"#cccccc",buttonColor:E,buttonTextColor:v,buttonBorderColor:w,labelTextColor:R,successColor:V,errorColor:A},jl,Kl,le),[ye,Ae]=u.useState(()=>Object.fromEntries(ge.map(be=>[be.name,""]))),[Te,Be]=u.useState("idle"),[Ne,Fe]=u.useState(null),ke=o==="success"?"success":o==="error"?"error":Te,Ye=o==="error"?se:Ne,nt=o==="filled",ot=u.useMemo(()=>{if(!nt)return ye;let be=null;for(const it of ge)(ye[it.name]??"").trim().length>0||(be=be??{...ye},be[it.name]="Filled");return be??ye},[ye,nt,ge]),lo=ke==="error"?T.getFormFieldValidationError(ge,ot):null,uo=`${o&&o!=="default"?`${i}-state-${o}`:""}`.trim(),Se=n==null?void 0:n.submitUrl,an=(be,it)=>{Ae(Ke=>({...Ke,[be]:it}))},Pn=async be=>{be.preventDefault();const it=Object.fromEntries(ge.map(Ve=>{var Xe;return[Ve.name,((Xe=ye[Ve.name])==null?void 0:Xe.trim())??""]}).filter(([,Ve])=>Ve));if(!Se){Be("error"),Fe("No integrations were found for this form.");return}if(Object.keys(it).length===0)return;const Ke=T.getFormFieldValidationError(ge,ye);if(Ke){Be("error"),Fe(Ke);return}Be("submitting"),Fe(null);try{const Ve=await fetch(Se,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(it)});if(!Ve.ok){const Xe=await Ve.text();throw new Error(Xe||`Request failed: ${Ve.status}`)}Be("success"),Ae(Object.fromEntries(ge.map(Xe=>[Xe.name,""])))}catch(Ve){Be("error"),Fe(Ve instanceof Error?Ve.message:"Something went wrong")}};return a.jsxs("div",{className:`${i}-wrapper ${i}-type-${l} ${uo}`.trim(),style:Ge,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dl(i)}}),a.jsxs("form",{onSubmit:Pn,className:`${i}-form`,style:{gap:T.scalingValue(p??0,t)},children:[a.jsx("div",{className:`${i}-fields`,style:{gap:T.scalingValue(d??0,t)},children:ge.map((be,it)=>a.jsxs("div",{className:`${i}-field-group${ce?` ${i}-labeled`:""}`,children:[ce&&a.jsx("span",{className:`${i}-field-label`,style:je?{...je,lineHeight:je.fontSize}:void 0,children:be.label||be.name}),be.type==="textarea"?a.jsx("textarea",{name:be.name,autoComplete:"off",value:ot[be.name]??"",onChange:Ke=>an(be.name,Ke.target.value),placeholder:be.placeholder,className:`${i}-input`,style:ie,rows:1,"data-filled":nt||(ot[be.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:be.type==="phone"?"tel":be.type==="email"?"email":"text",name:be.name,autoComplete:"off",value:ot[be.name]??"",onChange:Ke=>an(be.name,Ke.target.value),placeholder:be.placeholder,required:be.isRequired??be.type==="email",className:`${i}-input`,style:ie,"data-filled":nt||(ot[be.name]??"").trim().length>0})]},it))}),a.jsx("div",{className:`${i}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${i}-button`,style:{borderStyle:"solid",borderRadius:T.scalingValue($??0,t),borderWidth:$e,paddingTop:T.scalingValue((f==null?void 0:f.top)??0,t),paddingRight:T.scalingValue((f==null?void 0:f.right)??0,t),paddingBottom:T.scalingValue((f==null?void 0:f.bottom)??0,t),paddingLeft:T.scalingValue((f==null?void 0:f.left)??0,t),...Ce,...m?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${i}-overlay-anchor`,style:m?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Te==="submitting"?"...":c})})})]}),ke==="success"&&a.jsx("p",{className:`${i}-success`,style:{...Me},children:Z}),ke==="error"&&a.jsx("p",{className:`${i}-error`,style:{...Me},role:"alert",children:lo??Ye??se})]})}const jl={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},Kl=["hover","focus","filled","success","error"],Ul=`import React, { useMemo, useState } from 'react';
|
|
143
143
|
import { CommonComponentProps } from '../props';
|
|
144
144
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
145
145
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -740,8 +740,8 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
740
740
|
};
|
|
741
741
|
|
|
742
742
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
743
|
-
`,Fl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],Pn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Rl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Il={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Input Stroke",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Button Stroke",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Color",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Pn.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...Pn.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...Pn.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...Pn.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:Fl,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["isButtonFullWidth"]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Rl],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Al={element:_l,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:Il,sourceCode:Wl};function Wn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function kl(t){return`
|
|
744
|
-
.${
|
|
743
|
+
`,ql=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],Rn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Gl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Yl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Rn.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...Rn.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...Rn.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...Rn.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:ql,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["isButtonFullWidth"]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Gl],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Xl={element:zl,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:Yl,sourceCode:Ul};function kn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zl(e){return`
|
|
744
|
+
.${e}-wrapper {
|
|
745
745
|
display: flex;
|
|
746
746
|
flex-direction: column;
|
|
747
747
|
width: 100%;
|
|
@@ -749,90 +749,90 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
749
749
|
align-items: stretch;
|
|
750
750
|
justify-content: center;
|
|
751
751
|
}
|
|
752
|
-
.${
|
|
752
|
+
.${e}-form {
|
|
753
753
|
display: flex;
|
|
754
754
|
width: 100%;
|
|
755
755
|
align-items: stretch;
|
|
756
756
|
overflow: hidden;
|
|
757
|
-
border-color: var(--${
|
|
757
|
+
border-color: var(--${e}-stroke-color);
|
|
758
758
|
transition: border-color 250ms;
|
|
759
759
|
}
|
|
760
|
-
.${
|
|
761
|
-
border-color: var(--${
|
|
760
|
+
.${e}-form:hover {
|
|
761
|
+
border-color: var(--${e}-hover-stroke-color, var(--${e}-stroke-color));
|
|
762
762
|
}
|
|
763
|
-
.${
|
|
764
|
-
border-color: var(--${
|
|
763
|
+
.${e}-form:focus-within {
|
|
764
|
+
border-color: var(--${e}-focus-stroke-color, var(--${e}-stroke-color));
|
|
765
765
|
}
|
|
766
|
-
.${
|
|
767
|
-
border-color: var(--${
|
|
766
|
+
.${e}-wrapper.${e}-state-hover .${e}-form {
|
|
767
|
+
border-color: var(--${e}-hover-stroke-color, var(--${e}-stroke-color));
|
|
768
768
|
}
|
|
769
|
-
.${
|
|
770
|
-
border-color: var(--${
|
|
769
|
+
.${e}-wrapper.${e}-state-focus .${e}-form {
|
|
770
|
+
border-color: var(--${e}-focus-stroke-color, var(--${e}-stroke-color));
|
|
771
771
|
}
|
|
772
|
-
.${
|
|
773
|
-
border-color: var(--${
|
|
772
|
+
.${e}-wrapper.${e}-state-filled .${e}-form {
|
|
773
|
+
border-color: var(--${e}-filled-stroke-color, var(--${e}-stroke-color));
|
|
774
774
|
}
|
|
775
|
-
.${
|
|
775
|
+
.${e}-inputWrap {
|
|
776
776
|
position: relative;
|
|
777
777
|
display: flex;
|
|
778
778
|
align-items: center;
|
|
779
779
|
flex: 1;
|
|
780
780
|
min-width: 0;
|
|
781
|
-
background-color: var(--${
|
|
781
|
+
background-color: var(--${e}-input-color);
|
|
782
782
|
transition: background-color 250ms;
|
|
783
783
|
}
|
|
784
|
-
.${
|
|
785
|
-
.${
|
|
786
|
-
background-color: var(--${
|
|
784
|
+
.${e}-inputWrap:hover,
|
|
785
|
+
.${e}-wrapper.${e}-state-hover .${e}-inputWrap {
|
|
786
|
+
background-color: var(--${e}-hover-input-color, var(--${e}-input-color));
|
|
787
787
|
}
|
|
788
|
-
.${
|
|
789
|
-
.${
|
|
790
|
-
background-color: var(--${
|
|
788
|
+
.${e}-inputWrap:focus-within,
|
|
789
|
+
.${e}-wrapper.${e}-state-focus .${e}-inputWrap {
|
|
790
|
+
background-color: var(--${e}-focus-input-color, var(--${e}-input-color));
|
|
791
791
|
}
|
|
792
|
-
.${
|
|
793
|
-
background-color: var(--${
|
|
792
|
+
.${e}-wrapper.${e}-state-filled .${e}-inputWrap {
|
|
793
|
+
background-color: var(--${e}-filled-input-color, var(--${e}-input-color));
|
|
794
794
|
}
|
|
795
|
-
.${
|
|
795
|
+
.${e}-input {
|
|
796
796
|
flex: 1;
|
|
797
797
|
min-width: 0;
|
|
798
798
|
background: transparent;
|
|
799
799
|
border: none;
|
|
800
800
|
outline: none;
|
|
801
801
|
-webkit-tap-highlight-color: transparent;
|
|
802
|
-
color: var(--${
|
|
802
|
+
color: var(--${e}-input-text-color);
|
|
803
803
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
804
804
|
}
|
|
805
|
-
.${
|
|
806
|
-
color: var(--${
|
|
805
|
+
.${e}-input:hover {
|
|
806
|
+
color: var(--${e}-hover-input-text-color, var(--${e}-input-text-color));
|
|
807
807
|
}
|
|
808
|
-
.${
|
|
809
|
-
.${
|
|
810
|
-
color: var(--${
|
|
808
|
+
.${e}-inputWrap:hover .${e}-input,
|
|
809
|
+
.${e}-wrapper.${e}-state-hover .${e}-input {
|
|
810
|
+
color: var(--${e}-hover-input-text-color, var(--${e}-input-text-color));
|
|
811
811
|
}
|
|
812
|
-
.${
|
|
813
|
-
.${
|
|
814
|
-
color: var(--${
|
|
812
|
+
.${e}-input:focus,
|
|
813
|
+
.${e}-wrapper.${e}-state-focus .${e}-input {
|
|
814
|
+
color: var(--${e}-focus-input-text-color, var(--${e}-input-text-color));
|
|
815
815
|
}
|
|
816
|
-
.${
|
|
817
|
-
color: var(--${
|
|
816
|
+
.${e}-wrapper.${e}-state-filled .${e}-input {
|
|
817
|
+
color: var(--${e}-filled-input-text-color, var(--${e}-input-text-color));
|
|
818
818
|
}
|
|
819
|
-
.${
|
|
820
|
-
color: var(--${
|
|
819
|
+
.${e}-input::placeholder {
|
|
820
|
+
color: var(--${e}-placeholder-color);
|
|
821
821
|
opacity: 1;
|
|
822
822
|
transition: color 250ms, opacity 250ms;
|
|
823
823
|
}
|
|
824
|
-
.${
|
|
825
|
-
.${
|
|
826
|
-
color: var(--${
|
|
824
|
+
.${e}-inputWrap:hover .${e}-input::placeholder,
|
|
825
|
+
.${e}-wrapper.${e}-state-hover .${e}-input::placeholder {
|
|
826
|
+
color: var(--${e}-hover-placeholder-color, var(--${e}-placeholder-color));
|
|
827
827
|
}
|
|
828
|
-
.${
|
|
829
|
-
.${
|
|
830
|
-
color: var(--${
|
|
828
|
+
.${e}-inputWrap:focus-within .${e}-input::placeholder,
|
|
829
|
+
.${e}-wrapper.${e}-state-focus .${e}-input::placeholder {
|
|
830
|
+
color: var(--${e}-focus-placeholder-color, var(--${e}-placeholder-color));
|
|
831
831
|
}
|
|
832
|
-
.${
|
|
833
|
-
color: var(--${
|
|
832
|
+
.${e}-wrapper.${e}-state-filled .${e}-input::placeholder {
|
|
833
|
+
color: var(--${e}-filled-placeholder-color, var(--${e}-placeholder-color));
|
|
834
834
|
}
|
|
835
|
-
.${
|
|
835
|
+
.${e}-submitBtn {
|
|
836
836
|
box-sizing: border-box;
|
|
837
837
|
height: 100%;
|
|
838
838
|
display: flex;
|
|
@@ -841,13 +841,13 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
841
841
|
border: none;
|
|
842
842
|
cursor: pointer;
|
|
843
843
|
white-space: nowrap;
|
|
844
|
-
background-color: var(--${
|
|
845
|
-
color: var(--${
|
|
844
|
+
background-color: var(--${e}-button-color);
|
|
845
|
+
color: var(--${e}-button-text-color);
|
|
846
846
|
border-left-style: solid;
|
|
847
|
-
border-left-color: var(--${
|
|
847
|
+
border-left-color: var(--${e}-stroke-color);
|
|
848
848
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
849
849
|
}
|
|
850
|
-
.${
|
|
850
|
+
.${e}-submitBtn img {
|
|
851
851
|
display: block;
|
|
852
852
|
box-sizing: border-box;
|
|
853
853
|
flex: 0 1 auto;
|
|
@@ -858,7 +858,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
858
858
|
max-height: 100%;
|
|
859
859
|
object-fit: contain;
|
|
860
860
|
}
|
|
861
|
-
.${
|
|
861
|
+
.${e}-submitBtn svg {
|
|
862
862
|
display: block;
|
|
863
863
|
box-sizing: border-box;
|
|
864
864
|
flex: 0 1 auto;
|
|
@@ -868,7 +868,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
868
868
|
max-width: 100%;
|
|
869
869
|
max-height: 100%;
|
|
870
870
|
}
|
|
871
|
-
.${
|
|
871
|
+
.${e}-submitBtn .${e}-submitBtnIcon {
|
|
872
872
|
position: relative;
|
|
873
873
|
top: auto;
|
|
874
874
|
left: auto;
|
|
@@ -884,54 +884,54 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
884
884
|
max-width: 100%;
|
|
885
885
|
max-height: 100%;
|
|
886
886
|
}
|
|
887
|
-
.${
|
|
888
|
-
.${
|
|
889
|
-
background-color: var(--${
|
|
890
|
-
color: var(--${
|
|
891
|
-
border-left-color: var(--${
|
|
887
|
+
.${e}-submitBtn:hover,
|
|
888
|
+
.${e}-wrapper.${e}-state-hover .${e}-submitBtn {
|
|
889
|
+
background-color: var(--${e}-hover-button-color, var(--${e}-button-color));
|
|
890
|
+
color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
|
|
891
|
+
border-left-color: var(--${e}-hover-stroke-color, var(--${e}-stroke-color));
|
|
892
892
|
}
|
|
893
|
-
.${
|
|
894
|
-
.${
|
|
895
|
-
background-color: var(--${
|
|
896
|
-
color: var(--${
|
|
897
|
-
border-left-color: var(--${
|
|
893
|
+
.${e}-submitBtn:focus,
|
|
894
|
+
.${e}-wrapper.${e}-state-focus .${e}-submitBtn {
|
|
895
|
+
background-color: var(--${e}-focus-button-color, var(--${e}-button-color));
|
|
896
|
+
color: var(--${e}-focus-button-text-color, var(--${e}-button-text-color));
|
|
897
|
+
border-left-color: var(--${e}-focus-stroke-color, var(--${e}-stroke-color));
|
|
898
898
|
}
|
|
899
|
-
.${
|
|
900
|
-
background-color: var(--${
|
|
901
|
-
color: var(--${
|
|
902
|
-
border-left-color: var(--${
|
|
899
|
+
.${e}-wrapper.${e}-state-filled .${e}-submitBtn {
|
|
900
|
+
background-color: var(--${e}-filled-button-color, var(--${e}-button-color));
|
|
901
|
+
color: var(--${e}-filled-button-text-color, var(--${e}-button-text-color));
|
|
902
|
+
border-left-color: var(--${e}-filled-stroke-color, var(--${e}-stroke-color));
|
|
903
903
|
}
|
|
904
|
-
.${
|
|
905
|
-
.${
|
|
906
|
-
background-color: var(--${
|
|
904
|
+
.${e}-submitBtn:hover .${e}-submitBtnIcon,
|
|
905
|
+
.${e}-wrapper.${e}-state-hover .${e}-submitBtn .${e}-submitBtnIcon {
|
|
906
|
+
background-color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
|
|
907
907
|
}
|
|
908
|
-
.${
|
|
909
|
-
.${
|
|
910
|
-
background-color: var(--${
|
|
908
|
+
.${e}-submitBtn:focus .${e}-submitBtnIcon,
|
|
909
|
+
.${e}-wrapper.${e}-state-focus .${e}-submitBtn .${e}-submitBtnIcon {
|
|
910
|
+
background-color: var(--${e}-focus-button-text-color, var(--${e}-button-text-color));
|
|
911
911
|
}
|
|
912
|
-
.${
|
|
913
|
-
background-color: var(--${
|
|
912
|
+
.${e}-wrapper.${e}-state-filled .${e}-submitBtn .${e}-submitBtnIcon {
|
|
913
|
+
background-color: var(--${e}-filled-button-text-color, var(--${e}-button-text-color));
|
|
914
914
|
}
|
|
915
|
-
.${
|
|
916
|
-
.${
|
|
915
|
+
.${e}-wrapper.${e}-state-success .${e}-input,
|
|
916
|
+
.${e}-wrapper.${e}-state-success .${e}-submitBtn {
|
|
917
917
|
pointer-events: none;
|
|
918
918
|
}
|
|
919
|
-
.${
|
|
919
|
+
.${e}-overlayAnchor {
|
|
920
920
|
position: relative;
|
|
921
921
|
display: flex;
|
|
922
922
|
align-items: center;
|
|
923
923
|
}
|
|
924
|
-
.${
|
|
925
|
-
margin-top: ${
|
|
926
|
-
font-size: ${
|
|
927
|
-
color: var(--${
|
|
924
|
+
.${e}-success {
|
|
925
|
+
margin-top: ${kn(8)};
|
|
926
|
+
font-size: ${kn(14)};
|
|
927
|
+
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
928
928
|
}
|
|
929
|
-
.${
|
|
930
|
-
margin-top: ${
|
|
931
|
-
font-size: ${
|
|
932
|
-
color: var(--${
|
|
929
|
+
.${e}-error {
|
|
930
|
+
margin-top: ${kn(8)};
|
|
931
|
+
font-size: ${kn(14)};
|
|
932
|
+
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
933
933
|
}
|
|
934
|
-
`}const
|
|
934
|
+
`}const Jl=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:i}=T.useScopedStyles(),{fields:l=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:r,buttonLabel:s,fieldsToShow:c=1,fontFamily:p,inputFontSettings:d,inputFontSize:$,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:m,inputTextAppearance:g,buttonFontSettings:C,buttonFontSize:y,buttonLineHeight:x,buttonLetterSpacing:P,buttonWordSpacing:L,buttonTextAppearance:_,statusFontSettings:E,statusFontSize:v,statusLineHeight:w,statusLetterSpacing:R,statusWordSpacing:V,statusTextAppearance:A,iconMaxWidth:H,minHeight:D,corners:j,stroke:U,stateOverrides:S,inputPadding:N,buttonPadding:k,successMessage:M="Thanks for subscribing!",errorMessage:W="Please, fill all required fields."}=e,B=l.slice(0,Math.min(c,l.length)),[ee,de]=u.useState(()=>Object.fromEntries(B.map(we=>[we.name,""]))),[re,me]=u.useState("idle"),[O,te]=u.useState(null),Y=o==="success"?"success":o==="error"?"error":re,X=o==="error"?W:O,ne=o==="filled",F=u.useMemo(()=>{if(!ne)return ee;let we=null;for(const Me of B)(ee[Me.name]??"").trim().length>0||(we=we??{...ee},we[Me.name]="Filled");return we??ee},[ne,ee,B]),oe=Y==="error"?T.getFormFieldValidationError(B,F):null,I=o&&o!=="default"?`${i}-state-${o}`:"",b=B.some(we=>(F[we.name]??"").trim().length>0),z=I!==`${i}-state-filled`&&b?`${i}-state-filled`:"",q=`${I} ${z}`.trim(),Z=n==null?void 0:n.submitUrl,se=s??"",le=(r==null?void 0:r.icon)??"",ce=(r==null?void 0:r.mode)==="On",ge=se||"Submit",K={fontSettings:{fontFamily:p,fontWeight:(d==null?void 0:d.fontWeight)??400,fontStyle:(d==null?void 0:d.fontStyle)??"normal"},fontSize:$??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:m??0,textAppearance:g,color:e.inputTextColor??"#111111"},J={fontSettings:{fontFamily:p,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:y??.01,lineHeight:x,letterSpacing:P??0,wordSpacing:L??0,textAppearance:_,color:e.buttonTextColor??"#ffffff"},Q={fontSettings:{fontFamily:p,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:v??.01,lineHeight:w,letterSpacing:R??0,wordSpacing:V??0,textAppearance:A,color:e.successColor??"#22c55e"},pe=yt(qe(K,t)),ie=yt(qe(J,t)),ue=yt(qe(Q,t)),Ce=T.buildColorVars(i,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(K==null?void 0:K.color)??"#111111",buttonTextColor:e.buttonTextColor??(J==null?void 0:J.color)??"#ffffff"},Ql,ec,S),$e={borderRadius:T.scalingValue(j,t),borderWidth:T.scalingValue(U,t),borderStyle:"solid"},Pe={borderLeftWidth:T.scalingValue(U,t)},je=async we=>{we.preventDefault();const Me=Object.fromEntries(B.map(ye=>{var Ae;return[ye.name,((Ae=ee[ye.name])==null?void 0:Ae.trim())??""]}).filter(([,ye])=>ye));if(!Z){me("error"),te("No integrations were found for this form.");return}if(Object.keys(Me).length===0)return;const Ge=T.getFormFieldValidationError(B,ee);if(Ge){me("error"),te(Ge);return}me("submitting"),te(null);try{const ye=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Me)});if(!ye.ok){const Ae=await ye.text();throw new Error(Ae||`Request failed: ${ye.status}`)}me("success"),de(Object.fromEntries(B.map(Ae=>[Ae.name,""])))}catch(ye){me("error"),te(ye instanceof Error?ye.message:"Something went wrong")}};return a.jsxs("div",{className:`${i}-wrapper ${q}`.trim(),style:Ce,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Zl(i)}}),a.jsxs("form",{onSubmit:je,className:`${i}-form`,style:{...$e,height:T.scalingValue(D,t),minHeight:T.scalingValue(D,t)},children:[a.jsx("div",{className:`${i}-inputWrap ${i}-overlayAnchor`,style:{flex:1,minWidth:0},children:B.map(we=>a.jsx("input",{type:we.type==="email"?"email":we.type==="phone"?"tel":"text",name:we.name,autoComplete:"off",value:F[we.name]??"",onChange:Me=>de(Ge=>({...Ge,[we.name]:Me.target.value})),placeholder:we.placeholder,required:we.isRequired??we.type==="email",className:`${i}-input`,style:{...pe,paddingRight:T.scalingValue(N.right,t),paddingLeft:T.scalingValue(N.left,t),paddingTop:T.scalingValue(N.top,t),paddingBottom:T.scalingValue(N.bottom,t)}},we.name))}),a.jsx("div",{className:`${i}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${i}-submitBtn`,"aria-label":ge,style:{...ie,...Pe,paddingRight:T.scalingValue(k.right,t),paddingLeft:T.scalingValue(k.left,t),paddingTop:T.scalingValue(k.top,t),paddingBottom:T.scalingValue(k.bottom,t)},children:re==="submitting"?"...":ce?le&&a.jsx($t,{url:le,className:`${i}-submitBtnIcon`,style:{maxWidth:T.scalingValue(H??0,t)},fill:`var(--${i}-button-text-color)`,hoverFill:`var(--${i}-button-text-color)`}):se})})]}),Y==="success"&&a.jsx("p",{className:`${i}-success`,style:{...ue},children:M}),Y==="error"&&a.jsx("p",{className:`${i}-error`,style:{...ue},role:"alert",children:oe??X??W})]})},Ql={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},ec=["hover","focus","filled","success","error"],tc=`import React, { useMemo, useState } from 'react';
|
|
935
935
|
import { CommonComponentProps } from '../props';
|
|
936
936
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
937
937
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1503,24 +1503,755 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1503
1503
|
};
|
|
1504
1504
|
|
|
1505
1505
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1506
|
-
`,Bl="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),zl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],mo={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Dl=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],jl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...mo.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...mo.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...mo.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:zl,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Bl},fontFamily:"Arial",strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#0088D7",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:0,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:0,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Dl],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Vl={element:Ml,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:jl,sourceCode:Hl};function vi(t){return`
|
|
1507
|
-
.${
|
|
1506
|
+
`,nc="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),oc=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],yo={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ic=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],rc={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...yo.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...yo.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...yo.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:oc,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:nc},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...ic],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},ac={element:Jl,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:rc,sourceCode:tc};function Pi(e){return`
|
|
1507
|
+
.${e}-marquee-wrapper {
|
|
1508
1508
|
overflow: hidden;
|
|
1509
1509
|
width: 100%;
|
|
1510
1510
|
height: auto;
|
|
1511
1511
|
}
|
|
1512
1512
|
|
|
1513
|
-
@keyframes ${
|
|
1513
|
+
@keyframes ${e}-marquee-left {
|
|
1514
1514
|
from { transform: translate3d(0, 0, 0); }
|
|
1515
1515
|
to { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1516
1516
|
}
|
|
1517
1517
|
|
|
1518
|
-
@keyframes ${
|
|
1518
|
+
@keyframes ${e}-marquee-right {
|
|
1519
1519
|
from { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1520
1520
|
to { transform: translate3d(0, 0, 0); }
|
|
1521
1521
|
}
|
|
1522
1522
|
|
|
1523
|
-
.${
|
|
1523
|
+
.${e}-marquee-track {
|
|
1524
|
+
display: flex;
|
|
1525
|
+
flex-direction: row;
|
|
1526
|
+
width: max-content;
|
|
1527
|
+
will-change: transform;
|
|
1528
|
+
backface-visibility: hidden;
|
|
1529
|
+
transform: translateZ(0);
|
|
1530
|
+
-webkit-backface-visibility: hidden;
|
|
1531
|
+
-webkit-transform: translateZ(0);
|
|
1532
|
+
flex-wrap: nowrap;
|
|
1533
|
+
animation-duration: var(--marquee-duration);
|
|
1534
|
+
animation-timing-function: linear;
|
|
1535
|
+
animation-iteration-count: infinite;
|
|
1536
|
+
animation-play-state: var(--marquee-play-state, running);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
1540
|
+
animation-name: ${e}-marquee-left;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
1544
|
+
animation-name: ${e}-marquee-right;
|
|
1545
|
+
}
|
|
1546
|
+
.${e}-marquee-row {
|
|
1547
|
+
display: flex;
|
|
1548
|
+
flex-direction: row;
|
|
1549
|
+
align-items: flex-start;
|
|
1550
|
+
}
|
|
1551
|
+
.${e}-marquee-set {
|
|
1552
|
+
flex: 0 0 auto;
|
|
1553
|
+
}
|
|
1554
|
+
.${e}-marquee-static {
|
|
1555
|
+
justify-content: center;
|
|
1556
|
+
overflow-x: auto;
|
|
1557
|
+
}
|
|
1558
|
+
.${e}-marquee-card {
|
|
1559
|
+
position: relative;
|
|
1560
|
+
flex: 0 0 auto;
|
|
1561
|
+
align-self: flex-start;
|
|
1562
|
+
transform: translateZ(0);
|
|
1563
|
+
backface-visibility: hidden;
|
|
1564
|
+
-webkit-backface-visibility: hidden;
|
|
1565
|
+
will-change: transform;
|
|
1566
|
+
}
|
|
1567
|
+
.${e}-wrapper {
|
|
1568
|
+
position: relative;
|
|
1569
|
+
width: 100%;
|
|
1570
|
+
height: 100%;
|
|
1571
|
+
order: 1;
|
|
1572
|
+
}
|
|
1573
|
+
.${e}-cover {
|
|
1574
|
+
position: absolute;
|
|
1575
|
+
width: 100%;
|
|
1576
|
+
height: 100%;
|
|
1577
|
+
top: 0;
|
|
1578
|
+
left: 0;
|
|
1579
|
+
}
|
|
1580
|
+
.${e}-elements-overlay {
|
|
1581
|
+
position: relative;
|
|
1582
|
+
inset: 0;
|
|
1583
|
+
display: flex;
|
|
1584
|
+
flex-direction: column;
|
|
1585
|
+
pointer-events: none;
|
|
1586
|
+
}
|
|
1587
|
+
.${e}-control {
|
|
1588
|
+
position: relative;
|
|
1589
|
+
z-index: 2;
|
|
1590
|
+
width: 100%;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
.${e}-marquee-link {
|
|
1594
|
+
display: flex;
|
|
1595
|
+
flex-direction: column;
|
|
1596
|
+
justify-content: center;
|
|
1597
|
+
align-items: center;
|
|
1598
|
+
width: 100%;
|
|
1599
|
+
height: 100%;
|
|
1600
|
+
text-decoration: none;
|
|
1601
|
+
color: inherit;
|
|
1602
|
+
}
|
|
1603
|
+
.${e}-marquee-link-contain {
|
|
1604
|
+
width: auto;
|
|
1605
|
+
height: auto;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
.${e}-control::before {
|
|
1609
|
+
content: "";
|
|
1610
|
+
position: absolute;
|
|
1611
|
+
top: 0;
|
|
1612
|
+
left: 0;
|
|
1613
|
+
width: 100%;
|
|
1614
|
+
height: 100%;
|
|
1615
|
+
min-height: 20px;
|
|
1616
|
+
pointer-events: auto;
|
|
1617
|
+
z-index: 10;
|
|
1618
|
+
}
|
|
1619
|
+
.${e}-image-hover-brightness img {
|
|
1620
|
+
transition: filter 0.3s ease;
|
|
1621
|
+
}
|
|
1622
|
+
.${e}-image-hover-brightness:hover img {
|
|
1623
|
+
filter: brightness(1.25);
|
|
1624
|
+
}
|
|
1625
|
+
.${e}-image-hover-grayscale img {
|
|
1626
|
+
transition: filter 0.3s ease;
|
|
1627
|
+
}
|
|
1628
|
+
.${e}-image-hover-grayscale:hover img {
|
|
1629
|
+
filter: grayscale(100%);
|
|
1630
|
+
}
|
|
1631
|
+
.${e}-image-hover-saturate img {
|
|
1632
|
+
transition: filter 0.3s ease;
|
|
1633
|
+
}
|
|
1634
|
+
.${e}-image-hover-saturate:hover img {
|
|
1635
|
+
filter: saturate(2);
|
|
1636
|
+
}
|
|
1637
|
+
`}const sc=30,vo=2,lc=2,cc=(e,t)=>Array.from({length:t},()=>e).flat(),dc=(e,t)=>{const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return o.right>n.left&&o.left<n.right},uc=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(o=>dc(o,e))},pc=({item:e,prefix:t,imageFit:n,imageMaxWidth:o,imageMaxHeight:i,imageHoverClass:l,isFirstSet:r,scaled:s,onFirstSetImageDone:c})=>{var h,f,m;const p=u.useRef(null);u.useLayoutEffect(()=>{if(!r)return;const g=p.current;g!=null&&g.complete&&(c==null||c())},[r,(h=e.image)==null?void 0:h.url,c]);const d=n==="cover",$=((f=e.image)==null?void 0:f.url)&&a.jsx("img",{ref:p,src:e.image.url,alt:((m=e.image)==null?void 0:m.name)??"",style:d?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:s(o),objectFit:"contain"},onLoad:r?c:void 0,onError:r?c:void 0});return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...d?{width:s(o)}:{width:"fit-content",maxWidth:s(o),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...d?{width:"100%",height:s(i),overflow:"hidden"}:{width:"fit-content",maxWidth:s(o),height:s(i)}},children:$&&e.link?a.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:ve(`${t}-marquee-link`,!d&&`${t}-marquee-link-contain`),children:$}):$})})},mc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),{speed:l,direction:r,pauseOnHover:s,gap:c,imageMaxWidth:p,imageMaxHeight:d,imageFit:$,hoverEffect:h}=e,f=h==="off"||h==="randomize"?void 0:`${i}-image-hover-${h}`,m=!o,g=Math.max(0,l)*sc,C=Y=>T.scalingValue(Y,n??!1),y=u.useRef(null),x=u.useRef(null),P=u.useRef(null),[L,_]=u.useState(0),[E,v]=u.useState(0),w=m&&s==="on",[R,V]=u.useState(!1),[A,H]=u.useState({}),D=u.useRef(A);D.current=A;const j=u.useRef(null),U=u.useRef(0),S=u.useRef(null),N=u.useMemo(()=>(t??[]).map(Y=>{var X;return((X=Y.image)==null?void 0:X.url)??""}).join("\0"),[t]),[k,M]=u.useState(vo),W=u.useMemo(()=>{const Y=t??[];return!m||Y.length===0?Y:cc(Y,k)},[t,m,k]),B=u.useMemo(()=>W.filter(Y=>{var X;return!!((X=Y.image)!=null&&X.url)}).length,[W]),ee=u.useMemo(()=>!m||((t==null?void 0:t.length)??0)===0?1:lc,[m,t==null?void 0:t.length]);u.useLayoutEffect(()=>{U.current=0,H({}),j.current=null,M(vo),_(0)},[N]),u.useEffect(()=>{if(h!=="randomize")return;const Y=y.current;if(!Y)return;const X=I=>{H(b=>{let z=null;for(const q of I)q in b&&(uc(Y,q)||(z||(z={...b}),delete z[q]));return z??b})},ne=new IntersectionObserver(I=>{const b=new Set;for(const z of I){const q=z.target.dataset.marqueeItemIndex,Z=q!==void 0?Number(q):NaN;Number.isNaN(Z)||b.add(Z)}b.size>0&&X(b)},{root:Y,threshold:0});Object.keys(A).forEach(I=>{const b=Number(I);Y.querySelectorAll(`[data-marquee-item-index="${b}"]`).forEach(z=>ne.observe(z))});let F=0;const oe=()=>{const I=Object.keys(D.current);I.length!==0&&(X(I.map(Number)),F=requestAnimationFrame(oe))};return Object.keys(D.current).length>0&&(F=requestAnimationFrame(oe)),()=>{cancelAnimationFrame(F),ne.disconnect()}},[h,A]),u.useLayoutEffect(()=>{if(!m)return;const Y=y.current,X=P.current;if(!Y||!X)return;let ne=0;const F=()=>{const b=Y.getBoundingClientRect().width,z=X.getBoundingClientRect().width,q=j.current,Z=typeof q=="number"&&Math.abs(q-z)<=.25;if(j.current=z,z>0&&k>0){const se=z/k;if(se>0&&b>0){const le=Math.max(vo,Math.ceil(b/se)+1);if(le!==k){M(le);return}}}if(z>0&&L<=0){_(z);return}Z&&z!==L?_(z):!Z&&L<=0&&(cancelAnimationFrame(ne),ne=requestAnimationFrame(F))},oe=()=>{cancelAnimationFrame(ne),ne=requestAnimationFrame(F)};S.current=oe,oe();const I=new ResizeObserver(oe);return I.observe(Y),I.observe(X),()=>{S.current=null,cancelAnimationFrame(ne),I.disconnect()}},[m,L,N,k]),u.useLayoutEffect(()=>{const Y=x.current;if(!m||!Y)return;const X=L>0?L:0,ne=X>0&&g>0?X/g*1e3:0,F=`${Math.max(0,ne)/1e3}s`;Y.style.setProperty("--marquee-distance",`${X}px`),Y.style.setProperty("--marquee-duration",F)},[m,g,L]),u.useLayoutEffect(()=>{if(!m){v(0);return}if(L<=0){v(0);return}const Y=x.current;if(!Y)return;const X=()=>{const F=Y.getBoundingClientRect().height;v(F>0?F:0)};X();const ne=new ResizeObserver(X);return ne.observe(Y),()=>ne.disconnect()},[m,ee,W,n,c,p,d,L,$,A]);const de=()=>{w&&V(!0)},re=()=>{w&&V(!1)},me=u.useCallback(()=>{var Y;U.current=Math.min(B,U.current+1),(Y=S.current)==null||Y.call(S)},[B]),O=u.useCallback((Y,X)=>{H(ne=>{const F=ne[Y]??X,oe=(t??[]).filter(b=>b!==F);if(oe.length===0)return ne;const I=oe[Math.floor(Math.random()*oe.length)];return{...ne,[Y]:I}})},[t]),te=(Y,X,ne,F)=>{const oe=h==="randomize"&&$==="cover"?A[ne]??Y:Y;return a.jsxs("div",{className:`${i}-marquee-card`,"data-marquee-item-index":ne,onMouseEnter:h==="randomize"&&$==="cover"?()=>O(ne,Y):void 0,children:[a.jsx(pc,{item:oe,prefix:i,imageFit:$,imageMaxWidth:p,imageMaxHeight:d,imageHoverClass:f,isEditor:n,isFirstSet:F,scaled:C,onFirstSetImageDone:me}),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${C(c)})`,width:C(c),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${X}-${ne}`)};return m&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:y,className:ve(`${i}-wrapper`,`${i}-marquee-wrapper`),"aria-label":"Marquee",style:L>0&&E>0?{height:E}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Pi(i)}}),a.jsx("div",{ref:x,className:`${i}-marquee-track`,"data-direction":r,onMouseEnter:de,onMouseLeave:re,style:{...w?{"--marquee-play-state":R?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:ee},(Y,X)=>a.jsx("div",{ref:X===0?P:void 0,className:ve(`${i}-marquee-row`,`${i}-marquee-set`),style:{gap:C(c),paddingRight:C(c)},"aria-hidden":X>0,children:W.map((ne,F)=>te(ne,X,F,X===0))},`set-${X}`))},"marquee-track")]}):a.jsxs("div",{ref:y,className:`${i}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Pi(i)}}),a.jsx("div",{className:ve(`${i}-marquee-row`,`${i}-marquee-static`),style:{gap:C(c),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Y,X)=>te(Y,0,X))},"marquee-static")]})},gc=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1638
|
+
import cn from 'classnames';
|
|
1639
|
+
import { CommonComponentProps } from '../props';
|
|
1640
|
+
import { scalingValue } from '../utils/scalingValue';
|
|
1641
|
+
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
1642
|
+
|
|
1643
|
+
function getCSS(P: string): string {
|
|
1644
|
+
return \`
|
|
1645
|
+
.\${P}-marquee-wrapper {
|
|
1646
|
+
overflow: hidden;
|
|
1647
|
+
width: 100%;
|
|
1648
|
+
height: auto;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
@keyframes \${P}-marquee-left {
|
|
1652
|
+
from { transform: translate3d(0, 0, 0); }
|
|
1653
|
+
to { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
@keyframes \${P}-marquee-right {
|
|
1657
|
+
from { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1658
|
+
to { transform: translate3d(0, 0, 0); }
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
.\${P}-marquee-track {
|
|
1662
|
+
display: flex;
|
|
1663
|
+
flex-direction: row;
|
|
1664
|
+
width: max-content;
|
|
1665
|
+
will-change: transform;
|
|
1666
|
+
backface-visibility: hidden;
|
|
1667
|
+
transform: translateZ(0);
|
|
1668
|
+
-webkit-backface-visibility: hidden;
|
|
1669
|
+
-webkit-transform: translateZ(0);
|
|
1670
|
+
flex-wrap: nowrap;
|
|
1671
|
+
animation-duration: var(--marquee-duration);
|
|
1672
|
+
animation-timing-function: linear;
|
|
1673
|
+
animation-iteration-count: infinite;
|
|
1674
|
+
animation-play-state: var(--marquee-play-state, running);
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.\${P}-marquee-track[data-direction="left"] {
|
|
1678
|
+
animation-name: \${P}-marquee-left;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.\${P}-marquee-track[data-direction="right"] {
|
|
1682
|
+
animation-name: \${P}-marquee-right;
|
|
1683
|
+
}
|
|
1684
|
+
.\${P}-marquee-row {
|
|
1685
|
+
display: flex;
|
|
1686
|
+
flex-direction: row;
|
|
1687
|
+
align-items: flex-start;
|
|
1688
|
+
}
|
|
1689
|
+
.\${P}-marquee-set {
|
|
1690
|
+
flex: 0 0 auto;
|
|
1691
|
+
}
|
|
1692
|
+
.\${P}-marquee-static {
|
|
1693
|
+
justify-content: center;
|
|
1694
|
+
overflow-x: auto;
|
|
1695
|
+
}
|
|
1696
|
+
.\${P}-marquee-card {
|
|
1697
|
+
position: relative;
|
|
1698
|
+
flex: 0 0 auto;
|
|
1699
|
+
align-self: flex-start;
|
|
1700
|
+
transform: translateZ(0);
|
|
1701
|
+
backface-visibility: hidden;
|
|
1702
|
+
-webkit-backface-visibility: hidden;
|
|
1703
|
+
will-change: transform;
|
|
1704
|
+
}
|
|
1705
|
+
.\${P}-wrapper {
|
|
1706
|
+
position: relative;
|
|
1707
|
+
width: 100%;
|
|
1708
|
+
height: 100%;
|
|
1709
|
+
order: 1;
|
|
1710
|
+
}
|
|
1711
|
+
.\${P}-cover {
|
|
1712
|
+
position: absolute;
|
|
1713
|
+
width: 100%;
|
|
1714
|
+
height: 100%;
|
|
1715
|
+
top: 0;
|
|
1716
|
+
left: 0;
|
|
1717
|
+
}
|
|
1718
|
+
.\${P}-elements-overlay {
|
|
1719
|
+
position: relative;
|
|
1720
|
+
inset: 0;
|
|
1721
|
+
display: flex;
|
|
1722
|
+
flex-direction: column;
|
|
1723
|
+
pointer-events: none;
|
|
1724
|
+
}
|
|
1725
|
+
.\${P}-control {
|
|
1726
|
+
position: relative;
|
|
1727
|
+
z-index: 2;
|
|
1728
|
+
width: 100%;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
.\${P}-marquee-link {
|
|
1732
|
+
display: flex;
|
|
1733
|
+
flex-direction: column;
|
|
1734
|
+
justify-content: center;
|
|
1735
|
+
align-items: center;
|
|
1736
|
+
width: 100%;
|
|
1737
|
+
height: 100%;
|
|
1738
|
+
text-decoration: none;
|
|
1739
|
+
color: inherit;
|
|
1740
|
+
}
|
|
1741
|
+
.\${P}-marquee-link-contain {
|
|
1742
|
+
width: auto;
|
|
1743
|
+
height: auto;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
.\${P}-control::before {
|
|
1747
|
+
content: "";
|
|
1748
|
+
position: absolute;
|
|
1749
|
+
top: 0;
|
|
1750
|
+
left: 0;
|
|
1751
|
+
width: 100%;
|
|
1752
|
+
height: 100%;
|
|
1753
|
+
min-height: 20px;
|
|
1754
|
+
pointer-events: auto;
|
|
1755
|
+
z-index: 10;
|
|
1756
|
+
}
|
|
1757
|
+
.\${P}-image-hover-brightness img {
|
|
1758
|
+
transition: filter 0.3s ease;
|
|
1759
|
+
}
|
|
1760
|
+
.\${P}-image-hover-brightness:hover img {
|
|
1761
|
+
filter: brightness(1.25);
|
|
1762
|
+
}
|
|
1763
|
+
.\${P}-image-hover-grayscale img {
|
|
1764
|
+
transition: filter 0.3s ease;
|
|
1765
|
+
}
|
|
1766
|
+
.\${P}-image-hover-grayscale:hover img {
|
|
1767
|
+
filter: grayscale(100%);
|
|
1768
|
+
}
|
|
1769
|
+
.\${P}-image-hover-saturate img {
|
|
1770
|
+
transition: filter 0.3s ease;
|
|
1771
|
+
}
|
|
1772
|
+
.\${P}-image-hover-saturate:hover img {
|
|
1773
|
+
filter: saturate(2);
|
|
1774
|
+
}
|
|
1775
|
+
\`;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
const PX_PER_SEC_PER_SPEED_UNIT = 30;
|
|
1779
|
+
const MIN_CONTENT_SEQUENCE_REPEAT = 2;
|
|
1780
|
+
const OUTER_SET_COPIES = 2;
|
|
1781
|
+
|
|
1782
|
+
const expandSetContent = (items: MarqueeItem[], repeat: number) =>
|
|
1783
|
+
Array.from({ length: repeat }, () => items).flat();
|
|
1784
|
+
|
|
1785
|
+
const isCardInMarqueeView = (card: Element, wrapper: Element): boolean => {
|
|
1786
|
+
const wrapperRect = wrapper.getBoundingClientRect();
|
|
1787
|
+
const rect = card.getBoundingClientRect();
|
|
1788
|
+
return rect.right > wrapperRect.left && rect.left < wrapperRect.right;
|
|
1789
|
+
};
|
|
1790
|
+
|
|
1791
|
+
const isAnyCopyOfSlotInView = (wrapper: Element, itemIndex: number): boolean => {
|
|
1792
|
+
const cards = wrapper.querySelectorAll<HTMLElement>(\`[data-marquee-item-index="\${itemIndex}"]\`);
|
|
1793
|
+
return Array.from(cards).some((card) => isCardInMarqueeView(card, wrapper));
|
|
1794
|
+
};
|
|
1795
|
+
|
|
1796
|
+
type MarqueeItemCardProps = {
|
|
1797
|
+
item: MarqueeItem;
|
|
1798
|
+
prefix: string;
|
|
1799
|
+
imageFit: 'cover' | 'contain';
|
|
1800
|
+
imageMaxWidth: number;
|
|
1801
|
+
imageMaxHeight: number;
|
|
1802
|
+
imageHoverClass?: string;
|
|
1803
|
+
isEditor?: boolean;
|
|
1804
|
+
isFirstSet?: boolean;
|
|
1805
|
+
scaled: (value: number) => string;
|
|
1806
|
+
onFirstSetImageDone?: () => void;
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1809
|
+
const MarqueeItemCard = ({
|
|
1810
|
+
item,
|
|
1811
|
+
prefix: P,
|
|
1812
|
+
imageFit,
|
|
1813
|
+
imageMaxWidth,
|
|
1814
|
+
imageMaxHeight,
|
|
1815
|
+
imageHoverClass,
|
|
1816
|
+
isFirstSet,
|
|
1817
|
+
scaled,
|
|
1818
|
+
onFirstSetImageDone,
|
|
1819
|
+
}: MarqueeItemCardProps) => {
|
|
1820
|
+
const imageRef = useRef<HTMLImageElement | null>(null);
|
|
1821
|
+
|
|
1822
|
+
useLayoutEffect(() => {
|
|
1823
|
+
if (!isFirstSet) return;
|
|
1824
|
+
const el = imageRef.current;
|
|
1825
|
+
if (el?.complete) onFirstSetImageDone?.();
|
|
1826
|
+
}, [isFirstSet, item.image?.url, onFirstSetImageDone]);
|
|
1827
|
+
|
|
1828
|
+
const isCover = imageFit === 'cover';
|
|
1829
|
+
const imageNode =
|
|
1830
|
+
item.image?.url &&
|
|
1831
|
+
(
|
|
1832
|
+
<img
|
|
1833
|
+
ref={imageRef}
|
|
1834
|
+
src={item.image.url}
|
|
1835
|
+
alt={item.image?.name ?? ''}
|
|
1836
|
+
style={
|
|
1837
|
+
isCover
|
|
1838
|
+
? {
|
|
1839
|
+
pointerEvents: 'auto',
|
|
1840
|
+
display: 'block',
|
|
1841
|
+
width: '100%',
|
|
1842
|
+
height: '100%',
|
|
1843
|
+
objectFit: 'cover',
|
|
1844
|
+
}
|
|
1845
|
+
: {
|
|
1846
|
+
pointerEvents: 'auto',
|
|
1847
|
+
display: 'block',
|
|
1848
|
+
height: '100%',
|
|
1849
|
+
width: 'auto',
|
|
1850
|
+
maxWidth: scaled(imageMaxWidth),
|
|
1851
|
+
objectFit: 'contain',
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
onLoad={isFirstSet ? onFirstSetImageDone : undefined}
|
|
1855
|
+
onError={isFirstSet ? onFirstSetImageDone : undefined}
|
|
1856
|
+
/>
|
|
1857
|
+
);
|
|
1858
|
+
return (
|
|
1859
|
+
<div
|
|
1860
|
+
style={{
|
|
1861
|
+
display: 'flex',
|
|
1862
|
+
flexDirection: 'column',
|
|
1863
|
+
alignItems: 'start',
|
|
1864
|
+
...(isCover
|
|
1865
|
+
? { width: scaled(imageMaxWidth) }
|
|
1866
|
+
: { width: 'fit-content', maxWidth: scaled(imageMaxWidth), minWidth: 0 }),
|
|
1867
|
+
}}
|
|
1868
|
+
>
|
|
1869
|
+
<div
|
|
1870
|
+
className={imageHoverClass}
|
|
1871
|
+
style={{
|
|
1872
|
+
display: 'flex',
|
|
1873
|
+
flexDirection: 'column',
|
|
1874
|
+
justifyContent: 'center',
|
|
1875
|
+
alignItems: 'center',
|
|
1876
|
+
flexShrink: 0,
|
|
1877
|
+
...(isCover
|
|
1878
|
+
? { width: '100%', height: scaled(imageMaxHeight), overflow: 'hidden' }
|
|
1879
|
+
: {
|
|
1880
|
+
width: 'fit-content',
|
|
1881
|
+
maxWidth: scaled(imageMaxWidth),
|
|
1882
|
+
height: scaled(imageMaxHeight),
|
|
1883
|
+
}),
|
|
1884
|
+
}}
|
|
1885
|
+
>
|
|
1886
|
+
{imageNode && item.link
|
|
1887
|
+
? (
|
|
1888
|
+
<a
|
|
1889
|
+
href={item.link}
|
|
1890
|
+
target='_blank'
|
|
1891
|
+
rel='noopener noreferrer'
|
|
1892
|
+
className={cn(\`\${P}-marquee-link\`, !isCover && \`\${P}-marquee-link-contain\`)}
|
|
1893
|
+
>
|
|
1894
|
+
{imageNode}
|
|
1895
|
+
</a>
|
|
1896
|
+
)
|
|
1897
|
+
: imageNode
|
|
1898
|
+
}
|
|
1899
|
+
</div>
|
|
1900
|
+
</div>
|
|
1901
|
+
);
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeProps) => {
|
|
1905
|
+
const { prefix: P } = useScopedStyles();
|
|
1906
|
+
const { speed, direction, pauseOnHover, gap, imageMaxWidth, imageMaxHeight, imageFit, hoverEffect } = settings;
|
|
1907
|
+
const imageHoverClass = hoverEffect === 'off' || hoverEffect === 'randomize' ? undefined : \`\${P}-image-hover-\${hoverEffect}\`;
|
|
1908
|
+
const autoplayEnabled = !isPreviewMode;
|
|
1909
|
+
const pxPerSec = Math.max(0, speed) * PX_PER_SEC_PER_SPEED_UNIT;
|
|
1910
|
+
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
1911
|
+
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
1912
|
+
const trackRef = useRef<HTMLDivElement | null>(null);
|
|
1913
|
+
const setRef = useRef<HTMLDivElement | null>(null);
|
|
1914
|
+
const [setWidth, setSetWidth] = useState(0);
|
|
1915
|
+
const [trackHeight, setTrackHeight] = useState(0);
|
|
1916
|
+
const hoverPauseEnabled = autoplayEnabled && pauseOnHover === 'on';
|
|
1917
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
1918
|
+
const [swappedSlots, setSwappedSlots] = useState<Record<number, MarqueeItem>>({});
|
|
1919
|
+
const swappedSlotsRef = useRef(swappedSlots);
|
|
1920
|
+
swappedSlotsRef.current = swappedSlots;
|
|
1921
|
+
const stableCandidateRef = useRef<number | null>(null);
|
|
1922
|
+
const loadedFirstSetImagesRef = useRef(0);
|
|
1923
|
+
const scheduleRemeasureRef = useRef<(() => void) | null>(null);
|
|
1924
|
+
const contentImageUrlsKey = useMemo(() => (content ?? []).map((i) => i.image?.url ?? '').join('\\0'),[content]);
|
|
1925
|
+
const [contentSequenceRepeat, setContentSequenceRepeat] = useState(MIN_CONTENT_SEQUENCE_REPEAT);
|
|
1926
|
+
const setContent = useMemo(() => {
|
|
1927
|
+
const items = content ?? [];
|
|
1928
|
+
if (!autoplayEnabled || items.length === 0) return items;
|
|
1929
|
+
return expandSetContent(items, contentSequenceRepeat);
|
|
1930
|
+
}, [content, autoplayEnabled, contentSequenceRepeat]);
|
|
1931
|
+
const firstSetImageUrlCount = useMemo(
|
|
1932
|
+
() => setContent.filter((i) => Boolean(i.image?.url)).length,
|
|
1933
|
+
[setContent],
|
|
1934
|
+
);
|
|
1935
|
+
const copies = useMemo(() => {
|
|
1936
|
+
if (!autoplayEnabled || (content?.length ?? 0) === 0) return 1;
|
|
1937
|
+
return OUTER_SET_COPIES;
|
|
1938
|
+
}, [autoplayEnabled, content?.length]);
|
|
1939
|
+
|
|
1940
|
+
useLayoutEffect(() => {
|
|
1941
|
+
loadedFirstSetImagesRef.current = 0;
|
|
1942
|
+
setSwappedSlots({});
|
|
1943
|
+
stableCandidateRef.current = null;
|
|
1944
|
+
setContentSequenceRepeat(MIN_CONTENT_SEQUENCE_REPEAT);
|
|
1945
|
+
setSetWidth(0);
|
|
1946
|
+
}, [contentImageUrlsKey]);
|
|
1947
|
+
|
|
1948
|
+
useEffect(() => {
|
|
1949
|
+
if (hoverEffect !== 'randomize') return;
|
|
1950
|
+
const wrapper = wrapperRef.current;
|
|
1951
|
+
if (!wrapper) return;
|
|
1952
|
+
|
|
1953
|
+
const revertSwappedSlotsOutOfView = (itemIndices: Iterable<number>) => {
|
|
1954
|
+
setSwappedSlots((prev) => {
|
|
1955
|
+
let next: Record<number, MarqueeItem> | null = null;
|
|
1956
|
+
for (const itemIndex of itemIndices) {
|
|
1957
|
+
if (!(itemIndex in prev)) continue;
|
|
1958
|
+
if (isAnyCopyOfSlotInView(wrapper, itemIndex)) continue;
|
|
1959
|
+
if (!next) next = { ...prev };
|
|
1960
|
+
delete next[itemIndex];
|
|
1961
|
+
}
|
|
1962
|
+
return next ?? prev;
|
|
1963
|
+
});
|
|
1964
|
+
};
|
|
1965
|
+
|
|
1966
|
+
const observer = new IntersectionObserver((entries) => {
|
|
1967
|
+
const itemIndices = new Set<number>();
|
|
1968
|
+
for (const entry of entries) {
|
|
1969
|
+
const raw = (entry.target as HTMLElement).dataset.marqueeItemIndex;
|
|
1970
|
+
const itemIndex = raw !== undefined ? Number(raw) : NaN;
|
|
1971
|
+
if (!Number.isNaN(itemIndex)) itemIndices.add(itemIndex);
|
|
1972
|
+
}
|
|
1973
|
+
if (itemIndices.size > 0) revertSwappedSlotsOutOfView(itemIndices);
|
|
1974
|
+
}, { root: wrapper, threshold: 0 });
|
|
1975
|
+
|
|
1976
|
+
Object.keys(swappedSlots).forEach((rawItemIndex) => {
|
|
1977
|
+
const itemIndex = Number(rawItemIndex);
|
|
1978
|
+
wrapper
|
|
1979
|
+
.querySelectorAll<HTMLDivElement>(\`[data-marquee-item-index="\${itemIndex}"]\`)
|
|
1980
|
+
.forEach((card) => observer.observe(card));
|
|
1981
|
+
});
|
|
1982
|
+
|
|
1983
|
+
let raf = 0;
|
|
1984
|
+
const tick = () => {
|
|
1985
|
+
const swappedKeys = Object.keys(swappedSlotsRef.current);
|
|
1986
|
+
if (swappedKeys.length === 0) return;
|
|
1987
|
+
revertSwappedSlotsOutOfView(swappedKeys.map(Number));
|
|
1988
|
+
raf = requestAnimationFrame(tick);
|
|
1989
|
+
};
|
|
1990
|
+
if (Object.keys(swappedSlotsRef.current).length > 0) {
|
|
1991
|
+
raf = requestAnimationFrame(tick);
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
return () => {
|
|
1995
|
+
cancelAnimationFrame(raf);
|
|
1996
|
+
observer.disconnect();
|
|
1997
|
+
};
|
|
1998
|
+
}, [hoverEffect, swappedSlots]);
|
|
1999
|
+
|
|
2000
|
+
useLayoutEffect(() => {
|
|
2001
|
+
if (!autoplayEnabled) return;
|
|
2002
|
+
const wrapper = wrapperRef.current;
|
|
2003
|
+
const set = setRef.current;
|
|
2004
|
+
if (!wrapper || !set) return;
|
|
2005
|
+
let raf = 0;
|
|
2006
|
+
const measure = () => {
|
|
2007
|
+
const nextContainerWidth = wrapper.getBoundingClientRect().width;
|
|
2008
|
+
const nextRawSetWidth = set.getBoundingClientRect().width;
|
|
2009
|
+
const prevCandidate = stableCandidateRef.current;
|
|
2010
|
+
const isStableNow =
|
|
2011
|
+
typeof prevCandidate === 'number' &&
|
|
2012
|
+
Math.abs(prevCandidate - nextRawSetWidth) <= 0.25;
|
|
2013
|
+
stableCandidateRef.current = nextRawSetWidth;
|
|
2014
|
+
if (nextRawSetWidth > 0 && contentSequenceRepeat > 0) {
|
|
2015
|
+
const singleCycleWidth = nextRawSetWidth / contentSequenceRepeat;
|
|
2016
|
+
if (singleCycleWidth > 0 && nextContainerWidth > 0) {
|
|
2017
|
+
const targetRepeat = Math.max(
|
|
2018
|
+
MIN_CONTENT_SEQUENCE_REPEAT,
|
|
2019
|
+
Math.ceil(nextContainerWidth / singleCycleWidth) + 1,
|
|
2020
|
+
);
|
|
2021
|
+
if (targetRepeat !== contentSequenceRepeat) {
|
|
2022
|
+
setContentSequenceRepeat(targetRepeat);
|
|
2023
|
+
return;
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
if (nextRawSetWidth > 0 && setWidth <= 0) {
|
|
2028
|
+
setSetWidth(nextRawSetWidth);
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
if (isStableNow && nextRawSetWidth !== setWidth) {
|
|
2032
|
+
setSetWidth(nextRawSetWidth);
|
|
2033
|
+
} else if (!isStableNow && setWidth <= 0) {
|
|
2034
|
+
cancelAnimationFrame(raf);
|
|
2035
|
+
raf = requestAnimationFrame(measure);
|
|
2036
|
+
}
|
|
2037
|
+
};
|
|
2038
|
+
const schedule = () => {
|
|
2039
|
+
cancelAnimationFrame(raf);
|
|
2040
|
+
raf = requestAnimationFrame(measure);
|
|
2041
|
+
};
|
|
2042
|
+
scheduleRemeasureRef.current = schedule;
|
|
2043
|
+
schedule();
|
|
2044
|
+
const ro = new ResizeObserver(schedule);
|
|
2045
|
+
ro.observe(wrapper);
|
|
2046
|
+
ro.observe(set);
|
|
2047
|
+
return () => {
|
|
2048
|
+
scheduleRemeasureRef.current = null;
|
|
2049
|
+
cancelAnimationFrame(raf);
|
|
2050
|
+
ro.disconnect();
|
|
2051
|
+
};
|
|
2052
|
+
}, [autoplayEnabled, setWidth, contentImageUrlsKey, contentSequenceRepeat]);
|
|
2053
|
+
|
|
2054
|
+
useLayoutEffect(() => {
|
|
2055
|
+
const track = trackRef.current;
|
|
2056
|
+
if (!autoplayEnabled || !track) return;
|
|
2057
|
+
const safeSetWidth = setWidth > 0 ? setWidth : 0;
|
|
2058
|
+
const durationMs = safeSetWidth > 0 && pxPerSec > 0 ? (safeSetWidth / pxPerSec) * 1000 : 0;
|
|
2059
|
+
const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
|
|
2060
|
+
track.style.setProperty('--marquee-distance', \`\${safeSetWidth}px\`);
|
|
2061
|
+
track.style.setProperty('--marquee-duration', durationS);
|
|
2062
|
+
}, [autoplayEnabled, pxPerSec, setWidth]);
|
|
2063
|
+
|
|
2064
|
+
useLayoutEffect(() => {
|
|
2065
|
+
if (!autoplayEnabled) {
|
|
2066
|
+
setTrackHeight(0);
|
|
2067
|
+
return;
|
|
2068
|
+
}
|
|
2069
|
+
if (setWidth <= 0) {
|
|
2070
|
+
setTrackHeight(0);
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2073
|
+
const track = trackRef.current;
|
|
2074
|
+
if (!track) return;
|
|
2075
|
+
const measure = () => {
|
|
2076
|
+
const next = track.getBoundingClientRect().height;
|
|
2077
|
+
setTrackHeight(next > 0 ? next : 0);
|
|
2078
|
+
};
|
|
2079
|
+
measure();
|
|
2080
|
+
const ro = new ResizeObserver(measure);
|
|
2081
|
+
ro.observe(track);
|
|
2082
|
+
return () => ro.disconnect();
|
|
2083
|
+
}, [autoplayEnabled, copies, setContent, isEditor, gap, imageMaxWidth, imageMaxHeight, setWidth, imageFit, swappedSlots]);
|
|
2084
|
+
|
|
2085
|
+
const onTrackEnter = () => {
|
|
2086
|
+
if (!hoverPauseEnabled) return;
|
|
2087
|
+
setIsHovering(true);
|
|
2088
|
+
};
|
|
2089
|
+
const onTrackLeave = () => {
|
|
2090
|
+
if (!hoverPauseEnabled) return;
|
|
2091
|
+
setIsHovering(false);
|
|
2092
|
+
};
|
|
2093
|
+
|
|
2094
|
+
const onFirstSetImageDone = useCallback(() => {
|
|
2095
|
+
loadedFirstSetImagesRef.current = Math.min(
|
|
2096
|
+
firstSetImageUrlCount,
|
|
2097
|
+
loadedFirstSetImagesRef.current + 1,
|
|
2098
|
+
);
|
|
2099
|
+
scheduleRemeasureRef.current?.();
|
|
2100
|
+
}, [firstSetImageUrlCount]);
|
|
2101
|
+
|
|
2102
|
+
const handleRandomizeEnter = useCallback((slotIndex: number, item: MarqueeItem) => {
|
|
2103
|
+
setSwappedSlots((prev) => {
|
|
2104
|
+
const current = prev[slotIndex] ?? item;
|
|
2105
|
+
const candidates = (content ?? []).filter((c) => c !== current);
|
|
2106
|
+
if (candidates.length === 0) return prev;
|
|
2107
|
+
const next = candidates[Math.floor(Math.random() * candidates.length)];
|
|
2108
|
+
return { ...prev, [slotIndex]: next };
|
|
2109
|
+
});
|
|
2110
|
+
}, [content]);
|
|
2111
|
+
|
|
2112
|
+
const renderCardWrapper = (item: MarqueeItem, copyIndex: number, slotIndex: number, isFirstSet?: boolean) => {
|
|
2113
|
+
const displayItem = hoverEffect === 'randomize' && imageFit === 'cover' ? (swappedSlots[slotIndex] ?? item) : item;
|
|
2114
|
+
return (
|
|
2115
|
+
<div
|
|
2116
|
+
key={\`\${copyIndex}-\${slotIndex}\`}
|
|
2117
|
+
className={\`\${P}-marquee-card\`}
|
|
2118
|
+
data-marquee-item-index={slotIndex}
|
|
2119
|
+
onMouseEnter={hoverEffect === 'randomize' && imageFit === 'cover' ? () => handleRandomizeEnter(slotIndex, item) : undefined}
|
|
2120
|
+
>
|
|
2121
|
+
<MarqueeItemCard
|
|
2122
|
+
item={displayItem}
|
|
2123
|
+
prefix={P}
|
|
2124
|
+
imageFit={imageFit}
|
|
2125
|
+
imageMaxWidth={imageMaxWidth}
|
|
2126
|
+
imageMaxHeight={imageMaxHeight}
|
|
2127
|
+
imageHoverClass={imageHoverClass}
|
|
2128
|
+
isEditor={isEditor}
|
|
2129
|
+
isFirstSet={isFirstSet}
|
|
2130
|
+
scaled={scaled}
|
|
2131
|
+
onFirstSetImageDone={onFirstSetImageDone}
|
|
2132
|
+
/>
|
|
2133
|
+
{isEditor && (
|
|
2134
|
+
<div
|
|
2135
|
+
data-controls="gap"
|
|
2136
|
+
data-controls-axis="x"
|
|
2137
|
+
style={{
|
|
2138
|
+
position: 'absolute',
|
|
2139
|
+
top: 0,
|
|
2140
|
+
right: \`calc(-1 * \${scaled(gap)})\`,
|
|
2141
|
+
width: scaled(gap),
|
|
2142
|
+
height: '100%',
|
|
2143
|
+
pointerEvents: 'auto',
|
|
2144
|
+
zIndex: 2,
|
|
2145
|
+
}}
|
|
2146
|
+
/>
|
|
2147
|
+
)}
|
|
2148
|
+
</div>
|
|
2149
|
+
);
|
|
2150
|
+
};
|
|
2151
|
+
|
|
2152
|
+
if (autoplayEnabled && (content?.length ?? 0) > 0) {
|
|
2153
|
+
return (
|
|
2154
|
+
<div
|
|
2155
|
+
ref={wrapperRef}
|
|
2156
|
+
className={cn(\`\${P}-wrapper\`, \`\${P}-marquee-wrapper\`)}
|
|
2157
|
+
aria-label="Marquee"
|
|
2158
|
+
style={setWidth > 0 && trackHeight > 0 ? { height: trackHeight } : undefined}
|
|
2159
|
+
>
|
|
2160
|
+
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
2161
|
+
<div
|
|
2162
|
+
key="marquee-track"
|
|
2163
|
+
ref={trackRef}
|
|
2164
|
+
className={\`\${P}-marquee-track\`}
|
|
2165
|
+
data-direction={direction}
|
|
2166
|
+
onMouseEnter={onTrackEnter}
|
|
2167
|
+
onMouseLeave={onTrackLeave}
|
|
2168
|
+
style={{
|
|
2169
|
+
...(hoverPauseEnabled
|
|
2170
|
+
? ({ '--marquee-play-state': isHovering ? 'paused' : 'running' } as React.CSSProperties)
|
|
2171
|
+
: ({ '--marquee-play-state': 'running' } as React.CSSProperties)),
|
|
2172
|
+
}}
|
|
2173
|
+
>
|
|
2174
|
+
{Array.from({ length: copies }, (_, copyIndex) => (
|
|
2175
|
+
<div
|
|
2176
|
+
key={\`set-\${copyIndex}\`}
|
|
2177
|
+
ref={copyIndex === 0 ? setRef : undefined}
|
|
2178
|
+
className={cn(\`\${P}-marquee-row\`, \`\${P}-marquee-set\`)}
|
|
2179
|
+
style={{
|
|
2180
|
+
gap: scaled(gap),
|
|
2181
|
+
paddingRight: scaled(gap),
|
|
2182
|
+
}}
|
|
2183
|
+
aria-hidden={copyIndex > 0}
|
|
2184
|
+
>
|
|
2185
|
+
{setContent.map((marqueeItem, slotIndex) =>
|
|
2186
|
+
renderCardWrapper(marqueeItem, copyIndex, slotIndex, copyIndex === 0),
|
|
2187
|
+
)}
|
|
2188
|
+
</div>
|
|
2189
|
+
))}
|
|
2190
|
+
</div>
|
|
2191
|
+
</div>
|
|
2192
|
+
);
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
return (
|
|
2196
|
+
<div ref={wrapperRef} className={\`\${P}-wrapper\`}>
|
|
2197
|
+
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
2198
|
+
<div
|
|
2199
|
+
key="marquee-static"
|
|
2200
|
+
className={cn(\`\${P}-marquee-row\`, \`\${P}-marquee-static\`)}
|
|
2201
|
+
style={{ gap: scaled(gap), transform: 'none' }}
|
|
2202
|
+
aria-label="Marquee"
|
|
2203
|
+
>
|
|
2204
|
+
{content?.map((marqueeItem, itemIndex) =>
|
|
2205
|
+
renderCardWrapper(marqueeItem, 0, itemIndex),
|
|
2206
|
+
)}
|
|
2207
|
+
</div>
|
|
2208
|
+
</div>
|
|
2209
|
+
);
|
|
2210
|
+
};
|
|
2211
|
+
|
|
2212
|
+
export type MarqueeItem = {
|
|
2213
|
+
image?: {
|
|
2214
|
+
url?: string;
|
|
2215
|
+
name?: string;
|
|
2216
|
+
};
|
|
2217
|
+
link?: string;
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
export type MarqueeSettings = {
|
|
2221
|
+
speed: number;
|
|
2222
|
+
direction: 'left' | 'right';
|
|
2223
|
+
pauseOnHover: 'on' | 'off';
|
|
2224
|
+
hoverEffect: 'off' | 'brightness' | 'grayscale' | 'saturate' | 'randomize';
|
|
2225
|
+
gap: number;
|
|
2226
|
+
imageMaxWidth: number;
|
|
2227
|
+
imageMaxHeight: number;
|
|
2228
|
+
imageFit: 'cover' | 'contain';
|
|
2229
|
+
};
|
|
2230
|
+
|
|
2231
|
+
type MarqueeProps = {
|
|
2232
|
+
settings: MarqueeSettings;
|
|
2233
|
+
content?: MarqueeItem[];
|
|
2234
|
+
isEditor?: boolean;
|
|
2235
|
+
isPreviewMode?: boolean;
|
|
2236
|
+
} & CommonComponentProps;
|
|
2237
|
+
`,hc={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale","saturate","randomize"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,max:400,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,max:400,display:{type:"numeric-input"}},imageFit:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["cover","contain"]}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:"contain"},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21},d:{speed:1.64,gap:.02,imageMaxWidth:.15,imageMaxHeight:.1}},displayRules:[{if:{name:"imageFit",value:"contain"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","saturate"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["direction"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZNCQFC3T744H0KX6R3FR.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZRTSS60YBFT6Y37ZX00T.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ9M9YJPQ5JWKCHDEW5M1GJD.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S04EHBXQS1T4KVAMZNZQM.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S08Q40WHD39024VNDWF2Q.jpeg",name:""},link:""}]}},fc={element:mc,id:"marquee",name:"Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:140},m:{width:390,height:80}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/marquee.png"},schema:hc,sourceCode:gc,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function Ai(e){return`
|
|
2238
|
+
.${e}-marquee-wrapper {
|
|
2239
|
+
overflow: hidden;
|
|
2240
|
+
width: 100%;
|
|
2241
|
+
height: auto;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
@keyframes ${e}-marquee-left {
|
|
2245
|
+
from { transform: translate3d(0, 0, 0); }
|
|
2246
|
+
to { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
@keyframes ${e}-marquee-right {
|
|
2250
|
+
from { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
2251
|
+
to { transform: translate3d(0, 0, 0); }
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
.${e}-marquee-track {
|
|
1524
2255
|
display: flex;
|
|
1525
2256
|
flex-direction: row;
|
|
1526
2257
|
width: max-content;
|
|
@@ -1536,28 +2267,28 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1536
2267
|
animation-play-state: var(--marquee-play-state, running);
|
|
1537
2268
|
}
|
|
1538
2269
|
|
|
1539
|
-
.${
|
|
1540
|
-
animation-name: ${
|
|
2270
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
2271
|
+
animation-name: ${e}-marquee-left;
|
|
1541
2272
|
}
|
|
1542
2273
|
|
|
1543
|
-
.${
|
|
1544
|
-
animation-name: ${
|
|
2274
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
2275
|
+
animation-name: ${e}-marquee-right;
|
|
1545
2276
|
}
|
|
1546
2277
|
|
|
1547
|
-
.${
|
|
2278
|
+
.${e}-marquee-set {
|
|
1548
2279
|
display: flex;
|
|
1549
2280
|
flex-direction: row;
|
|
1550
2281
|
flex: 0 0 auto;
|
|
1551
2282
|
}
|
|
1552
2283
|
|
|
1553
|
-
.${
|
|
2284
|
+
.${e}-wrapper {
|
|
1554
2285
|
position: relative;
|
|
1555
2286
|
width: 100%;
|
|
1556
2287
|
height: 100%;
|
|
1557
2288
|
order: 1;
|
|
1558
2289
|
}
|
|
1559
2290
|
|
|
1560
|
-
.${
|
|
2291
|
+
.${e}-cover {
|
|
1561
2292
|
position: absolute;
|
|
1562
2293
|
width: 100%;
|
|
1563
2294
|
height: 100%;
|
|
@@ -1565,7 +2296,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1565
2296
|
left: 0;
|
|
1566
2297
|
}
|
|
1567
2298
|
|
|
1568
|
-
.${
|
|
2299
|
+
.${e}-elements-overlay {
|
|
1569
2300
|
position: relative;
|
|
1570
2301
|
inset: 0;
|
|
1571
2302
|
display: flex;
|
|
@@ -1573,13 +2304,13 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1573
2304
|
pointer-events: none;
|
|
1574
2305
|
}
|
|
1575
2306
|
|
|
1576
|
-
.${
|
|
2307
|
+
.${e}-control {
|
|
1577
2308
|
position: relative;
|
|
1578
2309
|
z-index: 2;
|
|
1579
2310
|
width: 100%;
|
|
1580
2311
|
}
|
|
1581
2312
|
|
|
1582
|
-
.${
|
|
2313
|
+
.${e}-control::before {
|
|
1583
2314
|
content: "";
|
|
1584
2315
|
position: absolute;
|
|
1585
2316
|
top: 0;
|
|
@@ -1590,7 +2321,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1590
2321
|
pointer-events: auto;
|
|
1591
2322
|
z-index: 10;
|
|
1592
2323
|
}
|
|
1593
|
-
`}const
|
|
2324
|
+
`}const yc=30,vc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),{autoplay:l,align:r,speed:s,direction:c,pauseOnHover:p,gap:d,cardWidth:$,corners:h,stroke:f,strokeColor:m,bgColor:g,padding:C,logoMarginTop:y,logoWidth:x,logoHeight:P,captionMarginTop:L}=e,_=l==="on"&&!o,E=_,v=Math.max(0,s)*yc,w=K=>T.scalingValue(K,n??!1),R=u.useRef(null),V=u.useRef(null),A=u.useRef(null),[H,D]=u.useState(0),[j,U]=u.useState(0),[S,N]=u.useState(0),k=E&&p==="on",[M,W]=u.useState(!1),B=u.useRef(null),[ee,de]=u.useState(0),[re,me]=u.useState(0),O=u.useRef(null),te=K=>{var Q,pe,ie,ue,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${K}FontFamily`])??"Arial",fontWeight:((Q=e==null?void 0:e[`${K}FontSettings`])==null?void 0:Q.fontWeight)??400,fontStyle:((pe=e==null?void 0:e[`${K}FontSettings`])==null?void 0:pe.fontStyle)??"normal"},textAppearance:{textTransform:((ie=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:ie.textTransform)??"none",textDecoration:((ue=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:ue.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${K}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${K}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${K}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${K}LineHeight`])??.01,color:(e==null?void 0:e[`${K}Color`])??"#000000"}},Y=te("text"),X=te("caption"),ne=u.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(K=>{var J,Q;return(((J=K.text)==null?void 0:J.length)??0)>0||(((Q=K.caption)==null?void 0:Q.length)??0)>0}),[t]),F=u.useMemo(()=>!_||(t==null?void 0:t.length)===0?1:j<=0||H<=0?2:Math.max(2,Math.ceil(H/j)+1),[_,t==null?void 0:t.length,j,H]);u.useLayoutEffect(()=>{if(!_)return;const K=R.current,J=A.current;if(!K||!J)return;let Q=0;const pe=()=>{const Ce=K.getBoundingClientRect().width,$e=J.getBoundingClientRect().width,Pe=O.current,je=typeof Pe=="number"&&Math.abs(Pe-$e)<=.25;if(O.current=$e,D(Ce),typeof $e=="number"&&$e>0&&j<=0){U($e);return}je&&$e!==j?U($e):!je&&j<=0&&(cancelAnimationFrame(Q),Q=requestAnimationFrame(pe))},ie=()=>{cancelAnimationFrame(Q),Q=requestAnimationFrame(pe)};ie();const ue=new ResizeObserver(ie);return ue.observe(K),ue.observe(J),()=>{cancelAnimationFrame(Q),ue.disconnect()}},[_,j]),u.useLayoutEffect(()=>{const K=V.current;if(!_||!K||!E)return;const J=j>0?j:0,Q=J>0&&v>0?J/v*1e3:0,pe=`${Math.max(0,Q)/1e3}s`;K.style.setProperty("--marquee-distance",`${J}px`),K.style.setProperty("--marquee-duration",pe)},[_,E,v,j]),u.useLayoutEffect(()=>{if(!_){N(0);return}const K=A.current,J=V.current;if(!K||!J)return;const Q=()=>{let ie=0;for(let ue=0;ue<K.children.length;ue++){const $e=K.children[ue].firstElementChild;$e&&(ie=Math.max(ie,$e.offsetHeight))}ie<=0&&(ie=J.offsetHeight),N(ie>0?ie:0)};Q();const pe=new ResizeObserver(Q);return pe.observe(K),pe.observe(J),()=>{pe.disconnect()}},[_,F,t,n,d,$,C,f,h,x,P,ee,re]);const oe=()=>{k&&W(!0)},I=()=>{k&&W(!1)},b=u.useMemo(()=>{switch(r){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[r]),z=u.useMemo(()=>{switch(r){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[r]),q=u.useCallback((K,J,Q,pe)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:b,width:"100%"},children:[a.jsx("div",{"data-controls":pe==null?void 0:pe.controlsName,"data-controls-axis":"y",className:`${i}-control`,style:{height:w((pe==null?void 0:pe.marginTop)??0)}}),a.jsx("div",{...pe!=null&&pe.dataMeasureKind?{"data-testimonial-measure":pe.dataMeasureKind}:{},style:{...qe(K,n),textAlign:z,pointerEvents:"auto",...typeof(pe==null?void 0:pe.minHeightPx)=="number"&&pe.minHeightPx>0?{minHeight:pe.minHeightPx}:{}},children:a.jsx(vn,{content:J})})]},Q),[b,z,n]),Z=u.useCallback((K,J,Q)=>{var pe,ie,ue;return a.jsxs("div",{style:{padding:`${w(C.top)} ${w(C.right)} ${w(C.bottom)} ${w(C.left)}`,width:w($+f*2),height:"100%",borderRadius:w(h),border:`${w(f)} solid ${m}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${i}-cover`,style:{background:g}}),a.jsxs("div",{className:`${i}-elements-overlay`,style:{alignItems:b,textAlign:z},children:[K.text&&q(Y,K.text,"text",Q!=null&&Q.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Q==null?void 0:Q.textMinHeightPx)=="number"&&Q.textMinHeightPx>0?{minHeightPx:Q.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:b,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${i}-control`,style:{height:w(y)}}),a.jsx("div",{style:{width:w(x),height:w(P)},children:((pe=K.logo)==null?void 0:pe.url)&&a.jsx("img",{src:K.logo.url,alt:((ie=K.logo)==null?void 0:ie.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ue=K.logo)==null?void 0:ue.objectFit)||"contain"}})})]}),K.caption&&q(X,K.caption,"caption",{controlsName:"captionMarginTop",marginTop:L,...Q!=null&&Q.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Q==null?void 0:Q.captionMinHeightPx)=="number"&&Q.captionMinHeightPx>0?{minHeightPx:Q.captionMinHeightPx}:{}})]})]},J)},[g,L,X,$,h,P,y,x,b,z,C.bottom,C.left,C.right,C.top,q,f,m,Y,n]),se=u.useCallback(K=>{de(K.maxTextPx),me(K.maxCaptionPx)},[]);u.useLayoutEffect(()=>{if(!ne){se({maxTextPx:0,maxCaptionPx:0});return}const K=B.current;if(!K)return;const J=()=>{T.readTestimonialTextMeasure(K,se)};J();const Q=new ResizeObserver(J);return Q.observe(K),()=>{Q.disconnect()}},[ne,se,t,Z]);const le=ne?{textMinHeightPx:ee,captionMinHeightPx:re}:void 0,ce=ne?a.jsx("div",{ref:B,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((K,J)=>Z(K,`measure-${J}`,{dataMeasureAttrs:!0}))}):null,ge=(K,J)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Z(K,`card-${J}`,le),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${w(d)})`,width:w(d),height:"100%",pointerEvents:"auto",zIndex:2}})]},J);return _&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:R,className:ve(`${i}-wrapper`,`${i}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...S>0?{height:S}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ai(i)}}),ce,a.jsx("div",{ref:V,className:`${i}-marquee-track`,"data-direction":c,onMouseEnter:oe,onMouseLeave:I,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...k?{"--marquee-play-state":M?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:F},(K,J)=>a.jsx("div",{ref:J===0?A:void 0,className:`${i}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:w(d),paddingRight:w(d)},"aria-hidden":J>0,children:t==null?void 0:t.map((Q,pe)=>ge(Q,`${J}-${pe}`))},`set-${J}`))})]}):a.jsxs("div",{className:`${i}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ai(i)}}),ce,a.jsx("div",{style:{gap:w(d),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((K,J)=>ge(K,J))})]})},bc=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1594
2325
|
import cn from 'classnames';
|
|
1595
2326
|
import { CommonComponentProps } from '../props';
|
|
1596
2327
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -1821,19 +2552,29 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
1821
2552
|
setTrackHeight(0);
|
|
1822
2553
|
return;
|
|
1823
2554
|
}
|
|
2555
|
+
const set = setRef.current;
|
|
1824
2556
|
const track = trackRef.current;
|
|
1825
|
-
if (!track) return;
|
|
2557
|
+
if (!set || !track) return;
|
|
1826
2558
|
const measure = () => {
|
|
1827
|
-
|
|
2559
|
+
let next = 0;
|
|
2560
|
+
for (let i = 0; i < set.children.length; i++) {
|
|
2561
|
+
const wrapper = set.children[i] as HTMLElement;
|
|
2562
|
+
const card = wrapper.firstElementChild as HTMLElement | null;
|
|
2563
|
+
if (card) next = Math.max(next, card.offsetHeight);
|
|
2564
|
+
}
|
|
2565
|
+
if (next <= 0) {
|
|
2566
|
+
next = track.offsetHeight;
|
|
2567
|
+
}
|
|
1828
2568
|
setTrackHeight(next > 0 ? next : 0);
|
|
1829
2569
|
};
|
|
1830
2570
|
measure();
|
|
1831
2571
|
const ro = new ResizeObserver(measure);
|
|
2572
|
+
ro.observe(set);
|
|
1832
2573
|
ro.observe(track);
|
|
1833
2574
|
return () => {
|
|
1834
2575
|
ro.disconnect();
|
|
1835
2576
|
};
|
|
1836
|
-
}, [autoplayEnabled, copies, content, isEditor, gap, cardWidth, padding, stroke, corners, logoWidth, logoHeight]);
|
|
2577
|
+
}, [autoplayEnabled, copies, content, isEditor, gap, cardWidth, padding, stroke, corners, logoWidth, logoHeight, measuredTextMinPx, measuredCaptionMinPx]);
|
|
1837
2578
|
|
|
1838
2579
|
const onTrackEnter = () => {
|
|
1839
2580
|
if (!hoverPauseEnabled) return;
|
|
@@ -1909,7 +2650,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
1909
2650
|
key={key}
|
|
1910
2651
|
style={{
|
|
1911
2652
|
padding: \`\${scaled(padding.top)} \${scaled(padding.right)} \${scaled(padding.bottom)} \${scaled(padding.left)}\`,
|
|
1912
|
-
width: scaled(cardWidth + stroke * 2),
|
|
2653
|
+
width: scaled(cardWidth + (stroke * 2)),
|
|
1913
2654
|
height: '100%',
|
|
1914
2655
|
borderRadius: scaled(corners),
|
|
1915
2656
|
border: \`\${scaled(stroke)} solid \${strokeColor}\`,
|
|
@@ -2186,8 +2927,8 @@ type TestimonialsSettings = {
|
|
|
2186
2927
|
logoHeight: number;
|
|
2187
2928
|
captionMarginTop: number;
|
|
2188
2929
|
};
|
|
2189
|
-
`,
|
|
2190
|
-
.${
|
|
2930
|
+
`,Wi={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},xc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{autoplay:"on",direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","autoplay","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Cc={element:vc,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonials.png"},defaultSize:{d:{width:"100%",height:320}},schema:xc,sourceCode:bc,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Sc(e){return`
|
|
2931
|
+
.${e}-container {
|
|
2191
2932
|
position: relative;
|
|
2192
2933
|
overflow-x: clip;
|
|
2193
2934
|
display: flex;
|
|
@@ -2196,7 +2937,7 @@ type TestimonialsSettings = {
|
|
|
2196
2937
|
align-items: center;
|
|
2197
2938
|
}
|
|
2198
2939
|
|
|
2199
|
-
.${
|
|
2940
|
+
.${e}-wrapper {
|
|
2200
2941
|
position: relative;
|
|
2201
2942
|
width: 100%;
|
|
2202
2943
|
order: 1;
|
|
@@ -2208,42 +2949,42 @@ type TestimonialsSettings = {
|
|
|
2208
2949
|
height: auto;
|
|
2209
2950
|
}
|
|
2210
2951
|
|
|
2211
|
-
.${
|
|
2952
|
+
.${e}-fade-stack {
|
|
2212
2953
|
position: relative;
|
|
2213
2954
|
width: 100%;
|
|
2214
2955
|
}
|
|
2215
2956
|
|
|
2216
|
-
.${
|
|
2957
|
+
.${e}-fade-item-prev {
|
|
2217
2958
|
position: absolute;
|
|
2218
2959
|
inset: 0;
|
|
2219
2960
|
width: 100%;
|
|
2220
2961
|
height: 100%;
|
|
2221
2962
|
}
|
|
2222
2963
|
|
|
2223
|
-
.${
|
|
2964
|
+
.${e}-fade-item-current {
|
|
2224
2965
|
position: relative;
|
|
2225
2966
|
width: 100%;
|
|
2226
2967
|
}
|
|
2227
2968
|
|
|
2228
|
-
@keyframes ${
|
|
2969
|
+
@keyframes ${e}-testimonial-fade-in {
|
|
2229
2970
|
from { opacity: 0; }
|
|
2230
2971
|
to { opacity: 1; }
|
|
2231
2972
|
}
|
|
2232
2973
|
|
|
2233
|
-
@keyframes ${
|
|
2974
|
+
@keyframes ${e}-testimonial-fade-out {
|
|
2234
2975
|
from { opacity: 1; }
|
|
2235
2976
|
to { opacity: 0; }
|
|
2236
2977
|
}
|
|
2237
2978
|
|
|
2238
|
-
.${
|
|
2239
|
-
animation: ${
|
|
2979
|
+
.${e}-fade-in {
|
|
2980
|
+
animation: ${e}-testimonial-fade-in 300ms ease-in forwards;
|
|
2240
2981
|
}
|
|
2241
2982
|
|
|
2242
|
-
.${
|
|
2243
|
-
animation: ${
|
|
2983
|
+
.${e}-fade-out {
|
|
2984
|
+
animation: ${e}-testimonial-fade-out 300ms ease-in forwards;
|
|
2244
2985
|
}
|
|
2245
2986
|
|
|
2246
|
-
.${
|
|
2987
|
+
.${e}-controls {
|
|
2247
2988
|
position: absolute;
|
|
2248
2989
|
inset: 0;
|
|
2249
2990
|
pointer-events: none;
|
|
@@ -2253,7 +2994,7 @@ type TestimonialsSettings = {
|
|
|
2253
2994
|
justify-content: space-between;
|
|
2254
2995
|
}
|
|
2255
2996
|
|
|
2256
|
-
.${
|
|
2997
|
+
.${e}-arrow {
|
|
2257
2998
|
pointer-events: auto;
|
|
2258
2999
|
position: relative;
|
|
2259
3000
|
display: flex;
|
|
@@ -2265,11 +3006,11 @@ type TestimonialsSettings = {
|
|
|
2265
3006
|
padding: 0;
|
|
2266
3007
|
}
|
|
2267
3008
|
|
|
2268
|
-
.${
|
|
3009
|
+
.${e}-next-arrow {
|
|
2269
3010
|
left: unset;
|
|
2270
3011
|
}
|
|
2271
3012
|
|
|
2272
|
-
.${
|
|
3013
|
+
.${e}-arrow-inner {
|
|
2273
3014
|
all: unset;
|
|
2274
3015
|
cursor: pointer;
|
|
2275
3016
|
width: 100%;
|
|
@@ -2277,25 +3018,25 @@ type TestimonialsSettings = {
|
|
|
2277
3018
|
pointer-events: auto;
|
|
2278
3019
|
}
|
|
2279
3020
|
|
|
2280
|
-
.${
|
|
3021
|
+
.${e}-arrow-img {
|
|
2281
3022
|
position: absolute;
|
|
2282
3023
|
top: 50%;
|
|
2283
3024
|
left: 50%;
|
|
2284
3025
|
transform: translate(-50%, -50%);
|
|
2285
3026
|
}
|
|
2286
3027
|
|
|
2287
|
-
.${
|
|
3028
|
+
.${e}-mirror {
|
|
2288
3029
|
transform: translate(-50%, -50%) scaleX(-1) !important;
|
|
2289
3030
|
}
|
|
2290
3031
|
|
|
2291
|
-
.${
|
|
3032
|
+
.${e}-control {
|
|
2292
3033
|
position: relative;
|
|
2293
3034
|
z-index: 2;
|
|
2294
3035
|
pointer-events: auto;
|
|
2295
3036
|
width: 100%;
|
|
2296
3037
|
}
|
|
2297
3038
|
|
|
2298
|
-
.${
|
|
3039
|
+
.${e}-control::before {
|
|
2299
3040
|
content: "";
|
|
2300
3041
|
position: absolute;
|
|
2301
3042
|
top: 0;
|
|
@@ -2305,12 +3046,12 @@ type TestimonialsSettings = {
|
|
|
2305
3046
|
pointer-events: auto;
|
|
2306
3047
|
z-index: 10;
|
|
2307
3048
|
}
|
|
2308
|
-
.${
|
|
3049
|
+
.${e}-icon {
|
|
2309
3050
|
pointer-events: auto;
|
|
2310
3051
|
width: 100%;
|
|
2311
3052
|
height: 100%;
|
|
2312
3053
|
}
|
|
2313
|
-
`}const
|
|
3054
|
+
`}const wc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),l=t||[],{autoplay:r,delay:s,align:c,width:p,imageMarginTop:d,textMarginTop:$,captionMarginTop:h,imageWidth:f,imageHeight:m,controlsWidth:g,controlsColor:C,controlsHoverColor:y}=e,x=r==="on"&&!o,[P,L]=u.useState(0),[_,E]=u.useState(null),[v,w]=u.useState(!1),R=u.useRef(null),V=u.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),A=u.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);u.useEffect(()=>{L(0),E(null),w(!1)},[l.length]);const H=l[P],D=_===null?null:l[_],j=F=>{var I,b,z,q,Z;return{fontSettings:{fontFamily:(e==null?void 0:e[`${F}FontFamily`])??"Arial",fontWeight:((I=e==null?void 0:e[`${F}FontSettings`])==null?void 0:I.fontWeight)??400,fontStyle:((b=e==null?void 0:e[`${F}FontSettings`])==null?void 0:b.fontStyle)??"normal"},textAppearance:{textTransform:((z=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:z.textTransform)??"none",textDecoration:((q=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:q.textDecoration)??"none",fontVariant:((Z=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:Z.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${F}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${F}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${F}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${F}WordSpacing`])??0,color:(e==null?void 0:e[`${F}Color`])??"#000000"}},U=j("text"),S=j("caption"),N=l.length>1&&l.some(F=>{var oe,I;return(((oe=F.text)==null?void 0:oe.length)??0)>0||(((I=F.caption)==null?void 0:I.length)??0)>0}),k=u.useRef(null),[M,W]=u.useState(0),[B,ee]=u.useState(0),de=e.controls??{mode:"Off",icon:null},re=l.length>1,me=u.useCallback((F,oe)=>!re||oe===F?F:(R.current&&window.clearTimeout(R.current),E(F),w(!0),R.current=window.setTimeout(()=>{E(null),w(!1),R.current=null},300),oe),[re]),O=u.useCallback(()=>{re&&L(F=>me(F,(F-1+l.length)%l.length))},[re,me,l.length]),te=u.useCallback(()=>{re&&L(F=>me(F,(F+1)%l.length))},[re,me,l.length]);u.useEffect(()=>{if(!x||!re)return;const F=Math.max(300,Number.isFinite(s*1e3)?s*1e3:0),oe=window.setInterval(()=>{L(I=>me(I,(I+1)%l.length))},F);return()=>{window.clearInterval(oe)}},[x,re,me,l.length,s]),u.useEffect(()=>()=>{R.current&&window.clearTimeout(R.current)},[]);const Y=(F,oe)=>{var q,Z,se,le;const I=oe==null?void 0:oe.textMinHeightPx,b=oe==null?void 0:oe.captionMinHeightPx,z=oe==null?void 0:oe.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[F.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${i}-control`,style:{height:T.scalingValue($??0,n??!1)}}),a.jsx("div",{...z&&{"data-testimonial-measure":"text"},style:{...qe(U,n),...I&&I>0?{minHeight:I}:{},textAlign:A,pointerEvents:"auto"},children:a.jsx(vn,{content:F.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${i}-control`,style:{height:T.scalingValue(d??0,n??!1)}}),a.jsx("div",{style:{width:T.scalingValue(f??0,n??!1),height:T.scalingValue(m??0,n??!1)},children:((q=F.image)==null?void 0:q.url)&&a.jsx("img",{src:(Z=F.image)==null?void 0:Z.url,alt:((se=F.image)==null?void 0:se.name)??"",className:`${i}-icon`,style:{objectFit:((le=F.image)==null?void 0:le.objectFit)||"contain"}})})]}),F.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:V,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${i}-control`,style:{height:T.scalingValue(h??0,n??!1)}}),a.jsx("div",{...z?{"data-testimonial-measure":"caption"}:{},style:{...qe(S,n),...b&&b>0?{minHeight:b}:{},textAlign:A,pointerEvents:"auto"},children:a.jsx(vn,{content:F.caption})})]})]})},X=u.useCallback(F=>{W(F.maxTextPx),ee(F.maxCaptionPx)},[]);if(u.useLayoutEffect(()=>{if(!N){X({maxTextPx:0,maxCaptionPx:0});return}const F=k.current;if(!F)return;const oe=()=>{T.readTestimonialTextMeasure(F,X)};oe();const I=new ResizeObserver(oe);return I.observe(F),()=>{I.disconnect()}},[N,X,t]),!H)return a.jsx(a.Fragment,{});const ne=N?{textMinHeightPx:M,captionMinHeightPx:B}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${i}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Sc(i)}}),a.jsxs("div",{className:`${i}-wrapper`,style:{width:T.scalingValue(p??0,n??!1),alignItems:V},children:[N&&a.jsx("div",{ref:k,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((F,oe)=>a.jsx("div",{style:{width:"100%"},children:Y(F,{dataMeasureAttrs:!0})},oe))}),a.jsxs("div",{className:`${i}-fade-stack`,children:[D&&v&&a.jsx("div",{className:ve(`${i}-fade-item-prev`,`${i}-fade-out`),children:Y(D,ne)}),a.jsx("div",{className:ve(`${i}-fade-item-current`,v?`${i}-fade-in`:void 0),children:Y(H,ne)})]})]}),de.mode==="On"&&a.jsxs("div",{className:`${i}-controls`,children:[a.jsx("div",{className:`${i}-arrow`,style:{width:T.scalingValue(g??.02,n??!1),height:T.scalingValue(g??.02,n??!1),"--arrow-hover-color":y},children:a.jsx("button",{type:"button",className:`${i}-arrow-inner`,onClick:O,disabled:!re,"aria-label":"Previous testimonial",children:de.icon&&a.jsx($t,{url:de.icon,fill:C,hoverFill:y,className:ve(`${i}-arrow-img`,`${i}-mirror`)})})}),a.jsx("div",{className:ve(`${i}-arrow`,`${i}-next-arrow`),style:{width:T.scalingValue(g??.02,n??!1),height:T.scalingValue(g??.02,n??!1),"--arrow-hover-color":y},children:a.jsx("button",{type:"button",className:`${i}-arrow-inner`,onClick:te,disabled:!re,"aria-label":"Next testimonial",children:de.icon&&a.jsx($t,{url:de.icon,fill:C,hoverFill:y,className:`${i}-arrow-img`})})})]})]})})},$c=`import cn from 'classnames';
|
|
2314
3055
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2315
3056
|
import { CommonComponentProps } from '../props';
|
|
2316
3057
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -2802,84 +3543,84 @@ type TestimonialsSettings = {
|
|
|
2802
3543
|
icon?: string | null;
|
|
2803
3544
|
};
|
|
2804
3545
|
};
|
|
2805
|
-
`,
|
|
2806
|
-
.${
|
|
3546
|
+
`,Tc="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Ii={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Lc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},delay:{type:"number",scope:"layout",title:"Delay(s)",display:{type:"percentage-input"},step:1,min:1,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Ii.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Ii.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Text"}},defaults:{autoplay:"on",controls:{mode:"On",icon:Tc},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{delay:3,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{delay:3,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},displayRules:[{if:{name:"autoplay",value:"off"},then:{name:"properties.delay.display.enabled",value:!1}}],layout:["__componentName__","autoplay","delay","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","delay"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Ec={element:wc,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonialsSingle.png"},defaultSize:{d:{width:700,height:300},t:{width:373,height:300},m:{width:334,height:300}},schema:Lc,sourceCode:$c,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function _c(){return window.navigator.platform==="Win32"||window.navigator.platform==="Win64"?'"InputMono-Regular", monospace':'"DepartureMono-Regular", monospace'}function Pc(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ac(e){return`
|
|
3547
|
+
.${e}-wrapper {
|
|
2807
3548
|
display: grid;
|
|
2808
3549
|
align-items: start;
|
|
2809
|
-
min-height: ${
|
|
3550
|
+
min-height: ${Pc(48)};
|
|
2810
3551
|
}
|
|
2811
|
-
.${
|
|
3552
|
+
.${e}-item {
|
|
2812
3553
|
display: flex;
|
|
2813
3554
|
flex-direction: column;
|
|
2814
3555
|
justify-content: center;
|
|
2815
3556
|
align-items: center;
|
|
2816
3557
|
}
|
|
2817
|
-
.${
|
|
3558
|
+
.${e}-item-inner {
|
|
2818
3559
|
display: flex;
|
|
2819
3560
|
flex-direction: column;
|
|
2820
3561
|
align-items: center;
|
|
2821
3562
|
outline: 1px solid #ccc;
|
|
2822
3563
|
}
|
|
2823
|
-
.${
|
|
3564
|
+
.${e}-item-inner-hidden {
|
|
2824
3565
|
display: flex;
|
|
2825
3566
|
flex-direction: column;
|
|
2826
3567
|
align-items: center;
|
|
2827
3568
|
}
|
|
2828
|
-
.${
|
|
3569
|
+
.${e}-item-image-wrapper {
|
|
2829
3570
|
display: flex;
|
|
2830
3571
|
justify-content: center;
|
|
2831
3572
|
align-items: center;
|
|
2832
3573
|
}
|
|
2833
|
-
.${
|
|
3574
|
+
.${e}-item-image-link {
|
|
2834
3575
|
width: 100%;
|
|
2835
3576
|
height: 100%;
|
|
2836
3577
|
display: flex;
|
|
2837
3578
|
flex-direction: column;
|
|
2838
3579
|
align-items: center;
|
|
2839
3580
|
}
|
|
2840
|
-
.${
|
|
3581
|
+
.${e}-item-image {
|
|
2841
3582
|
width: 100%;
|
|
2842
3583
|
height: 100%;
|
|
2843
3584
|
display: block;
|
|
2844
3585
|
}
|
|
2845
|
-
.${
|
|
2846
|
-
.${
|
|
2847
|
-
.${
|
|
2848
|
-
.${
|
|
3586
|
+
.${e}-item-slider,
|
|
3587
|
+
.${e}-item-slider .splide__track,
|
|
3588
|
+
.${e}-item-slider .splide__list,
|
|
3589
|
+
.${e}-item-slider .splide__slide {
|
|
2849
3590
|
width: 100%;
|
|
2850
3591
|
height: 100%;
|
|
2851
3592
|
}
|
|
2852
|
-
.${
|
|
3593
|
+
.${e}-item-slider .splide__slide {
|
|
2853
3594
|
display: flex;
|
|
2854
3595
|
justify-content: center;
|
|
2855
3596
|
align-items: center;
|
|
2856
3597
|
}
|
|
2857
|
-
.${
|
|
3598
|
+
.${e}-item-title {
|
|
2858
3599
|
white-space: normal;
|
|
2859
3600
|
overflow-wrap: anywhere;
|
|
2860
3601
|
word-break: break-word;
|
|
2861
3602
|
text-align: center;
|
|
2862
3603
|
margin-bottom: 0px;
|
|
2863
3604
|
margin-top: 0px;
|
|
2864
|
-
color: var(--${
|
|
3605
|
+
color: var(--${e}-title-color);
|
|
2865
3606
|
}
|
|
2866
|
-
.${
|
|
3607
|
+
.${e}-item-subtitle {
|
|
2867
3608
|
white-space: normal;
|
|
2868
3609
|
overflow-wrap: anywhere;
|
|
2869
3610
|
word-break: break-word;
|
|
2870
3611
|
text-align: center;
|
|
2871
3612
|
margin-bottom: 0px;
|
|
2872
3613
|
margin-top: 0px;
|
|
2873
|
-
color: var(--${
|
|
3614
|
+
color: var(--${e}-subtitle-color);
|
|
2874
3615
|
}
|
|
2875
3616
|
|
|
2876
|
-
.${
|
|
3617
|
+
.${e}-control {
|
|
2877
3618
|
position: relative;
|
|
2878
3619
|
z-index: 2;
|
|
2879
3620
|
width: 100%;
|
|
2880
3621
|
}
|
|
2881
3622
|
|
|
2882
|
-
.${
|
|
3623
|
+
.${e}-control::before {
|
|
2883
3624
|
content: "";
|
|
2884
3625
|
position: absolute;
|
|
2885
3626
|
top: 0;
|
|
@@ -2890,7 +3631,7 @@ type TestimonialsSettings = {
|
|
|
2890
3631
|
pointer-events: auto;
|
|
2891
3632
|
z-index: 10;
|
|
2892
3633
|
}
|
|
2893
|
-
`}const
|
|
3634
|
+
`}const St=500,kt="cubic-bezier(0.22, 1, 0.36, 1)";function Wc({images:e,index:t,imageDisplay:n,originRect:o,reverseClose:i,onClose:l,onPrev:r,onNext:s}){const c=u.useRef(null),p=u.useRef(null),[d,$]=u.useState(null),[h,f]=u.useState(o?"opening":"open"),[m,g]=u.useState(!0),C=u.useRef(t),y=u.useCallback(()=>{const v=c.current,w=p.current;if(!v||!w)return;const R=v.getBoundingClientRect(),V=R.width,A=R.height,H=w.naturalWidth,D=w.naturalHeight;if(!V||!A||!H||!D)return;if(n==="Cover"){$({width:V,height:A,left:R.left,top:R.top});return}const j=H/D,U=V/A;if(j>U){const S=V/j;$({width:V,height:S,left:R.left,top:R.top+(A-S)/2})}else{const S=A*j;$({width:S,height:A,left:R.left+(V-S)/2,top:R.top})}},[n]);u.useEffect(()=>{y();const v=c.current;if(!v)return;const w=new ResizeObserver(()=>y());return w.observe(v),()=>w.disconnect()},[y,t]),u.useEffect(()=>{if(h!=="opening"||!d)return;const v={id:0};return v.id=requestAnimationFrame(()=>{v.id=requestAnimationFrame(()=>f("open"))}),()=>cancelAnimationFrame(v.id)},[h,d]),u.useEffect(()=>{if(h!=="closing")return;const v=setTimeout(()=>l(),St);return()=>clearTimeout(v)},[h,l]),u.useEffect(()=>{C.current!==t&&g(!1),C.current=t},[t]);const x=()=>{h!=="closing"&&f("closing")},P=h==="open",L=h==="closing",_=L&&i&&!!o,E=h==="opening"?o??d:_?o:d;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:x,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:P?1:0,transition:`opacity ${St}ms ${kt}`,pointerEvents:"none"}}),a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:c,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",color:"#E6E6E6",letterSpacing:"-0.6px",lineHeight:"16px",opacity:P?1:0,transition:`opacity ${St}ms ${kt}`,fontFamily:_c()},children:e.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:t+1}),a.jsx("p",{children:"/"}),a.jsx("p",{children:e.length})]})})]}),E&&a.jsx("img",{ref:p,src:e[t],onLoad:y,style:{position:"fixed",top:E.top,left:E.left,width:E.width,height:E.height,objectFit:n==="Cover"?"cover":"contain",opacity:L&&!_?0:1,transition:L&&!_?`opacity ${St}ms ${kt}`:_||m?`top ${St}ms ${kt}, left ${St}ms ${kt}, width ${St}ms ${kt}, height ${St}ms ${kt}`:"none",pointerEvents:"none",zIndex:9998}}),P&&d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:d.top,left:d.left,width:d.width/2,height:d.height,cursor:"w-resize",zIndex:9999},onClick:v=>{v.stopPropagation(),r()}}),a.jsx("div",{style:{position:"fixed",top:d.top,left:d.left+d.width/2,width:d.width/2,height:d.height,cursor:"e-resize",zIndex:9999},onClick:v=>{v.stopPropagation(),s()}})]})]})}function Ic({settings:e,content:t,isEditor:n,isPreviewMode:o,metadata:i,activeEvent:l,layoutId:r}){const{prefix:s}=T.useScopedStyles(),{type:c="A",gridLayout:p,textBoxWidth:d,verticalGap:$,entriesCount:h,lightbox:f,imageDisplay:m,slider:g,sliderTiming:C,direction:y,transition:x,titleMarginTop:P,subtitleMarginTop:L,titleColor:_,subtitleColor:E,titleFontFamily:v,titleFontSettings:w,titleFontSize:R,titleLineHeight:V,titleLetterSpacing:A,titleWordSpacing:H,titleTextAppearance:D,subtitleFontFamily:j,subtitleFontSettings:U,subtitleFontSize:S,subtitleLineHeight:N,subtitleLetterSpacing:k,subtitleWordSpacing:M,subtitleTextAppearance:W}=e,B={fontSettings:{fontFamily:v,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:R??.01,lineHeight:V,letterSpacing:A??0,wordSpacing:H??0,textAppearance:D,color:_},de={...yt(qe(B,n))},re={fontSettings:{fontFamily:j,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:S??.01,lineHeight:N,letterSpacing:k??0,wordSpacing:M??0,textAppearance:W,color:E},O={...yt(qe(re,n))},te=T.buildColorVars(s,{titleColor:_,subtitleColor:E},Fc,Rc),X=`${l&&l!=="default"?`${s}-state-${l}`:""}`.trim(),ne=h===0?1/0:h,F=(t??[]).slice(0,ne),oe=p.entryWidth??.2,I=(m==null?void 0:m.display)==="Cover",b=(m==null?void 0:m.ratioValue)??"1:1",z=(m==null?void 0:m.reversed)??!1,[q,Z]=b.split(":").map(Number),se=z?Z:q,le=z?q:Z,ce=`${se} / ${le}`,ge=se>=le,K={objectFit:I?"cover":"contain",...I&&{aspectRatio:ce,width:ge?"100%":"auto",height:ge?"auto":"100%"}},[J,Q]=u.useState("ltr"),[pe,ie]=u.useState(0),ue=u.useRef(null);u.useEffect(()=>{const Te=ue.current;if(!Te)return;const Be=new ResizeObserver(Ne=>{ie(Math.round(Ne[0].contentRect.width))});return Be.observe(Te),()=>Be.disconnect()},[]);const[Ce,$e]=u.useState(!1),[Pe,je]=u.useState([]),[we,Me]=u.useState(0),[Ge,ye]=u.useState(null),Ae=(Te,Be,Ne)=>{if(f==="Off")return;const Fe=Te.currentTarget.getBoundingClientRect();ye({top:Fe.top,left:Fe.left,width:Fe.width,height:Fe.height}),je(Be),Me(Ne),$e(!0)};return u.useEffect(()=>{if(!Ce||f!=="On"||typeof document>"u")return;const Te=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Te}},[Ce,f]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ac(s)}}),a.jsx("div",{style:te,children:a.jsx("div",{ref:ue,className:`${s}-wrapper ${s}-type-${c} ${X}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:T.scalingValue($??0,n),columnGap:T.scalingValue(p.horizontalGap??0,n),width:T.scalingValue(p.wrapperWidth??0,n)},children:F.map((Te,Be)=>{var Ne,Fe;return a.jsx("div",{className:`${s}-item`.trim(),children:a.jsx("div",{className:o?`${s}-item-inner`:`${s}-item-inner-hidden`,style:{width:(d??0)>100?`calc(${T.scalingValue(oe??0,n)} * (${d} / 100))`:T.scalingValue(oe??0,n)},children:a.jsxs("a",{href:(((Ne=Te.link)==null?void 0:Ne.length)??0)>0&&f==="Off"?Te.link:void 0,target:"_blank",className:`${s}-item-image-link`,children:[a.jsx("div",{className:`${s}-item-image-wrapper`,style:{width:T.scalingValue(oe??0,n),height:T.scalingValue(oe??0,n)},children:(((Fe=Te.image)==null?void 0:Fe.length)??0)===0?null:g==="Off"?a.jsx("img",{src:Te.image[0].url,alt:Te.image[0].name,className:`${s}-item-image`.trim(),style:K,onClick:ke=>Ae(ke,Te.image.map(Ye=>Ye.url),0)}):a.jsx(Jo,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:500,type:x==="Fade"?"fade":"loop",rewind:x==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:x==="Fade"?"ltr":y!=="Random"?y==="Horizontal"?"ltr":"ttb":J},onMoved:ke=>{if(y!=="Random"||x==="Fade")return;const Ye=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";Q(Ye),setTimeout(()=>{ke.refresh()},0)},children:Te.image.map((ke,Ye)=>a.jsx(Qo,{children:a.jsx("img",{src:ke.url,alt:ke.name,className:`${s}-item-image`.trim(),style:K,onClick:nt=>Ae(nt,Te.image.map(ot=>ot.url),Ye)})},Ye))},`${x}-${oe}-${y}-${C}-${pe}-${r}`)}),a.jsx("div",{"data-controls":"titleMarginTop",className:`${s}-control`,style:{height:T.scalingValue(P??0,n),width:T.scalingValue(oe*d/100,n)}}),a.jsx("p",{className:`${s}-item-title`.trim(),style:{width:`calc(${T.scalingValue(oe??0,n)} * (${d} / 100))`,...de},children:Te.title}),c==="B"&&a.jsx("div",{"data-controls":"subtitleMarginTop",className:`${s}-control`,style:{height:T.scalingValue(L??0,n),width:T.scalingValue(oe*d/100,n)}}),c==="B"&&a.jsx("p",{className:`${s}-item-subtitle`.trim(),style:{width:`calc(${T.scalingValue(oe??0,n)} * (${d} / 100))`,...O},children:Te.subtitle})]})})},Be)})})}),Ce&&typeof document&&document.getElementById("grid-component-lightbox-portal")&&f==="On"&&Bi.createPortal(a.jsx("div",{"data-selection":"none",children:a.jsx(Wc,{images:Pe,index:we,imageDisplay:m.display,originRect:Ge,reverseClose:g==="Off",onClose:()=>$e(!1),onPrev:()=>Me(Te=>(Te-1+Pe.length)%Pe.length),onNext:()=>Me(Te=>(Te+1)%Pe.length)})}),document.body)]})}const Fc={titleColor:"title-color",subtitleColor:"subtitle-color"},Rc=["hover","focus","filled","success","error"],kc=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
2894
3635
|
import '@splidejs/react-splide/css/core';
|
|
2895
3636
|
import { CommonComponentProps } from '../props';
|
|
2896
3637
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -3549,17 +4290,17 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
3549
4290
|
};
|
|
3550
4291
|
|
|
3551
4292
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
3552
|
-
`,
|
|
3553
|
-
.${
|
|
4293
|
+
`,Fi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Mc=["titleColor","subtitleColor"],Nc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Title 1",subtitle:"Subtitle 1",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Grid-1.png",objectFit:"cover"}],link:""},{title:"Title 2",subtitle:"Subtitle 2",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Grid-2.png",objectFit:"cover"}],link:""},{title:"Title 3",subtitle:"Subtitle 3",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Grid-3.png",objectFit:"cover"}],link:""}]}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["On","Off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["On","Off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["Horizontal","Vertical","Random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["Fade","Slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Color",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Color",display:{type:"palette-color-picker",visible:!1}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...Fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"Off",imageDisplay:{display:"Fit",ratioValue:"16:9",reversed:!1},type:"A",slider:"Off",sliderTiming:5,direction:"Horizontal",transition:"Slide",titleColor:"#767676",subtitleColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Arial",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.043,titleLineHeight:.043,subtitleFontSize:.0373,subtitleLineHeight:.0373},d:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.01,titleLineHeight:.01,subtitleFontSize:.01,subtitleLineHeight:.01}},displayRules:[{if:{name:"transition",value:"Fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"type",value:"B"},then:{name:"properties.subtitleColor.display.visible",value:!0}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","entriesCount","lightbox","imageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","entriesCount"]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"Image",items:["imageDisplay","lightbox"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","sliderTiming"]},{type:"group",title:"",items:["direction","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]}]}],paletteBookmark:{items:[...Mc],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},Oc={element:Ic,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Nc,sourceCode:kc};function Dn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Hc(e){return String(e??"").trim().length>0}function Bc(e,t,n,o,i,l,r){const s=T.scalingValue(l,r),c=T.scalingValue(0,r),p=e===0,d=e===t-1&&!i;return{borderTopWidth:p&&n?s:c,borderBottomWidth:!d||o?s:c}}function Vc(e,t,n){const o=T.scalingValue(t,n),i=T.scalingValue(0,n);return{borderTopWidth:i,borderBottomWidth:e?o:i}}function Dc(e){return`
|
|
4294
|
+
.${e}-wrapper {
|
|
3554
4295
|
display: grid;
|
|
3555
4296
|
align-items: start;
|
|
3556
|
-
min-height: ${
|
|
4297
|
+
min-height: ${Dn(48)};
|
|
3557
4298
|
position: relative;
|
|
3558
4299
|
overflow: visible;
|
|
3559
4300
|
box-sizing: border-box;
|
|
3560
4301
|
}
|
|
3561
4302
|
|
|
3562
|
-
.${
|
|
4303
|
+
.${e}-hover-image {
|
|
3563
4304
|
position: absolute;
|
|
3564
4305
|
right: 0;
|
|
3565
4306
|
bottom: 0;
|
|
@@ -3569,7 +4310,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
3569
4310
|
height: auto;
|
|
3570
4311
|
}
|
|
3571
4312
|
|
|
3572
|
-
.${
|
|
4313
|
+
.${e}-list-item {
|
|
3573
4314
|
display: flex;
|
|
3574
4315
|
flex-direction: column;
|
|
3575
4316
|
align-items: stretch;
|
|
@@ -3578,96 +4319,128 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
3578
4319
|
position: relative;
|
|
3579
4320
|
box-sizing: content-box;
|
|
3580
4321
|
user-select: none;
|
|
3581
|
-
background: var(--${
|
|
4322
|
+
background: var(--${e}-background-color);
|
|
3582
4323
|
}
|
|
3583
4324
|
|
|
3584
|
-
.${
|
|
4325
|
+
.${e}-wrapper.${e}-divider-top .${e}-list-item {
|
|
3585
4326
|
border-top-style: solid;
|
|
3586
|
-
border-top-color: var(--${
|
|
4327
|
+
border-top-color: var(--${e}-divider-color);
|
|
3587
4328
|
}
|
|
3588
4329
|
|
|
3589
|
-
.${
|
|
4330
|
+
.${e}-wrapper.${e}-divider-bottom .${e}-list-item {
|
|
3590
4331
|
border-bottom-style: solid;
|
|
3591
|
-
border-bottom-color: var(--${
|
|
4332
|
+
border-bottom-color: var(--${e}-divider-color);
|
|
3592
4333
|
}
|
|
3593
4334
|
|
|
3594
|
-
.${
|
|
4335
|
+
.${e}-list-cols-row {
|
|
3595
4336
|
display: flex;
|
|
3596
4337
|
align-items: start;
|
|
3597
4338
|
width: 100%;
|
|
3598
4339
|
box-sizing: border-box;
|
|
3599
4340
|
}
|
|
3600
4341
|
|
|
3601
|
-
.${
|
|
4342
|
+
.${e}-list-cols-row-h {
|
|
4343
|
+
align-items: stretch;
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4346
|
+
.${e}-list-cols-row-h [data-list-col] {
|
|
4347
|
+
display: flex;
|
|
4348
|
+
flex-direction: column;
|
|
4349
|
+
align-self: stretch;
|
|
4350
|
+
min-height: 100%;
|
|
4351
|
+
}
|
|
4352
|
+
|
|
4353
|
+
.${e}-list-cols-row-h .${e}-list-col {
|
|
4354
|
+
flex: 1;
|
|
4355
|
+
display: flex;
|
|
4356
|
+
flex-direction: column;
|
|
4357
|
+
align-items: flex-start;
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
.${e}-list-cols-row-h .${e}-list-col-title {
|
|
4361
|
+
flex: 0 1 auto;
|
|
4362
|
+
align-self: stretch;
|
|
4363
|
+
}
|
|
4364
|
+
|
|
4365
|
+
.${e}-wrapper.${e}-type-b .${e}-list-cols-row {
|
|
3602
4366
|
flex-direction: column;
|
|
3603
4367
|
align-items: stretch;
|
|
3604
4368
|
}
|
|
3605
4369
|
|
|
3606
|
-
.${
|
|
4370
|
+
.${e}-wrapper.${e}-type-b .${e}-list-col {
|
|
3607
4371
|
width: 100%;
|
|
3608
4372
|
min-width: 0;
|
|
3609
4373
|
justify-content: center;
|
|
3610
4374
|
align-items: flex-start;
|
|
3611
4375
|
}
|
|
3612
4376
|
|
|
3613
|
-
.${
|
|
4377
|
+
.${e}-wrapper.${e}-type-b .${e}-list-col-title {
|
|
3614
4378
|
text-align: center;
|
|
3615
4379
|
}
|
|
3616
4380
|
|
|
3617
|
-
.${
|
|
4381
|
+
.${e}-wrapper.${e}-type-b .${e}-cut-item .${e}-list-cols-row {
|
|
3618
4382
|
flex-direction: row;
|
|
3619
4383
|
align-items: center;
|
|
3620
4384
|
justify-content: center;
|
|
3621
4385
|
}
|
|
3622
4386
|
|
|
3623
|
-
.${
|
|
4387
|
+
.${e}-wrapper.${e}-type-b .${e}-cut-label {
|
|
3624
4388
|
text-align: center;
|
|
3625
4389
|
width: 100%;
|
|
3626
4390
|
box-sizing: border-box;
|
|
3627
4391
|
}
|
|
3628
4392
|
|
|
3629
|
-
.${
|
|
4393
|
+
.${e}-wrapper.${e}-type-b .${e}-list-col-last {
|
|
3630
4394
|
flex: 0 0 auto;
|
|
3631
4395
|
min-width: 0;
|
|
3632
4396
|
}
|
|
3633
4397
|
|
|
3634
|
-
a.${
|
|
4398
|
+
a.${e}-list-item {
|
|
3635
4399
|
text-decoration: none;
|
|
3636
4400
|
color: inherit;
|
|
3637
4401
|
cursor: pointer;
|
|
3638
4402
|
}
|
|
3639
4403
|
|
|
3640
|
-
.${
|
|
4404
|
+
.${e}-list-col {
|
|
3641
4405
|
flex-shrink: 0;
|
|
3642
4406
|
overflow: visible;
|
|
3643
4407
|
box-sizing: border-box;
|
|
3644
|
-
min-width: ${
|
|
4408
|
+
min-width: ${Dn(50)};
|
|
3645
4409
|
position: relative;
|
|
3646
4410
|
display: flex;
|
|
3647
|
-
align-items:
|
|
4411
|
+
align-items: flex-start;
|
|
3648
4412
|
}
|
|
3649
4413
|
|
|
3650
|
-
.${
|
|
4414
|
+
.${e}-list-col-last {
|
|
3651
4415
|
flex: 1 1 auto;
|
|
3652
|
-
min-width: ${
|
|
4416
|
+
min-width: ${Dn(50)};
|
|
3653
4417
|
}
|
|
3654
4418
|
|
|
3655
|
-
.${
|
|
3656
|
-
color: var(--${
|
|
4419
|
+
.${e}-list-col-title {
|
|
4420
|
+
color: var(--${e}-text-color);
|
|
3657
4421
|
white-space: pre-wrap;
|
|
3658
4422
|
overflow-wrap: anywhere;
|
|
3659
4423
|
word-break: break-word;
|
|
3660
4424
|
flex: 1;
|
|
3661
4425
|
min-width: 0;
|
|
3662
4426
|
width: 100%;
|
|
4427
|
+
box-sizing: border-box;
|
|
4428
|
+
}
|
|
4429
|
+
|
|
4430
|
+
.${e}-baseline-probe {
|
|
4431
|
+
display: inline-block;
|
|
4432
|
+
width: 0;
|
|
4433
|
+
height: 0;
|
|
4434
|
+
overflow: hidden;
|
|
4435
|
+
vertical-align: baseline;
|
|
3663
4436
|
}
|
|
3664
4437
|
|
|
3665
|
-
.${
|
|
3666
|
-
.${
|
|
4438
|
+
.${e}-col-resize-handle,
|
|
4439
|
+
.${e}-padding-control-handle {
|
|
3667
4440
|
background: transparent;
|
|
3668
4441
|
}
|
|
3669
4442
|
|
|
3670
|
-
.${
|
|
4443
|
+
.${e}-row-padding-handle {
|
|
3671
4444
|
position: relative;
|
|
3672
4445
|
z-index: 2;
|
|
3673
4446
|
width: 100%;
|
|
@@ -3675,7 +4448,7 @@ a.${t}-list-item {
|
|
|
3675
4448
|
background: transparent;
|
|
3676
4449
|
}
|
|
3677
4450
|
|
|
3678
|
-
.${
|
|
4451
|
+
.${e}-row-padding-handle::before {
|
|
3679
4452
|
content: "";
|
|
3680
4453
|
position: absolute;
|
|
3681
4454
|
top: 0;
|
|
@@ -3687,7 +4460,7 @@ a.${t}-list-item {
|
|
|
3687
4460
|
z-index: 10;
|
|
3688
4461
|
}
|
|
3689
4462
|
|
|
3690
|
-
.${
|
|
4463
|
+
.${e}-col-resize-handle::after {
|
|
3691
4464
|
content: '';
|
|
3692
4465
|
position: absolute;
|
|
3693
4466
|
top: 0;
|
|
@@ -3699,7 +4472,7 @@ a.${t}-list-item {
|
|
|
3699
4472
|
pointer-events: none;
|
|
3700
4473
|
}
|
|
3701
4474
|
|
|
3702
|
-
.${
|
|
4475
|
+
.${e}-wrapper.${e}-type-b .${e}-col-resize-handle::after {
|
|
3703
4476
|
top: 50%;
|
|
3704
4477
|
left: 0;
|
|
3705
4478
|
transform: translateY(-50%);
|
|
@@ -3707,7 +4480,7 @@ a.${t}-list-item {
|
|
|
3707
4480
|
height: 2px;
|
|
3708
4481
|
}
|
|
3709
4482
|
|
|
3710
|
-
.${
|
|
4483
|
+
.${e}-padding-control-handle::after {
|
|
3711
4484
|
content: '';
|
|
3712
4485
|
position: absolute;
|
|
3713
4486
|
top: 50%;
|
|
@@ -3722,16 +4495,16 @@ a.${t}-list-item {
|
|
|
3722
4495
|
box-sizing: border-box;
|
|
3723
4496
|
}
|
|
3724
4497
|
|
|
3725
|
-
.${
|
|
4498
|
+
.${e}-wrapper.${e}-type-b .${e}-padding-control-handle::after {
|
|
3726
4499
|
width: 12px;
|
|
3727
4500
|
height: 4px;
|
|
3728
4501
|
}
|
|
3729
4502
|
|
|
3730
|
-
.${
|
|
4503
|
+
.${e}-text-padding-lr-handle {
|
|
3731
4504
|
background: transparent;
|
|
3732
4505
|
}
|
|
3733
4506
|
|
|
3734
|
-
.${
|
|
4507
|
+
.${e}-text-padding-lr-handle::after {
|
|
3735
4508
|
content: '';
|
|
3736
4509
|
position: absolute;
|
|
3737
4510
|
top: 50%;
|
|
@@ -3746,73 +4519,73 @@ a.${t}-list-item {
|
|
|
3746
4519
|
box-sizing: border-box;
|
|
3747
4520
|
}
|
|
3748
4521
|
|
|
3749
|
-
.${
|
|
3750
|
-
.${
|
|
3751
|
-
.${
|
|
3752
|
-
.${
|
|
4522
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item,
|
|
4523
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item,
|
|
4524
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-cut-item,
|
|
4525
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item {
|
|
3753
4526
|
transition: background-color 250ms, border-color 250ms;
|
|
3754
4527
|
}
|
|
3755
4528
|
|
|
3756
|
-
.${
|
|
3757
|
-
.${
|
|
3758
|
-
.${
|
|
3759
|
-
.${
|
|
4529
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-list-col-title,
|
|
4530
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-col-title,
|
|
4531
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-cut-label,
|
|
4532
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-label {
|
|
3760
4533
|
transition: color 250ms;
|
|
3761
4534
|
}
|
|
3762
4535
|
|
|
3763
|
-
.${
|
|
3764
|
-
.${
|
|
3765
|
-
.${
|
|
3766
|
-
.${
|
|
3767
|
-
background: var(--${
|
|
4536
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item:hover,
|
|
4537
|
+
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-list-item,
|
|
4538
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-cut-item:hover,
|
|
4539
|
+
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-cut-item {
|
|
4540
|
+
background: var(--${e}-background-hover-color);
|
|
3768
4541
|
}
|
|
3769
4542
|
|
|
3770
|
-
.${
|
|
3771
|
-
.${
|
|
3772
|
-
.${
|
|
3773
|
-
.${
|
|
3774
|
-
.${
|
|
3775
|
-
.${
|
|
3776
|
-
.${
|
|
3777
|
-
.${
|
|
3778
|
-
.${
|
|
3779
|
-
.${
|
|
3780
|
-
.${
|
|
3781
|
-
.${
|
|
3782
|
-
border-bottom-color: var(--${
|
|
4543
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:hover,
|
|
4544
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:has(+ .${e}-list-item:hover),
|
|
4545
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:has(+ .${e}-cut-item:hover),
|
|
4546
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default.${e}-state-hover .${e}-list-item,
|
|
4547
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-cut-item:hover,
|
|
4548
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default.${e}-state-hover .${e}-cut-item,
|
|
4549
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:hover,
|
|
4550
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:has(+ .${e}-list-item:hover),
|
|
4551
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:has(+ .${e}-cut-item:hover),
|
|
4552
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item,
|
|
4553
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-cut-item:hover,
|
|
4554
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds.${e}-state-hover .${e}-cut-item {
|
|
4555
|
+
border-bottom-color: var(--${e}-divider-hover-color);
|
|
3783
4556
|
}
|
|
3784
4557
|
|
|
3785
|
-
.${
|
|
3786
|
-
.${
|
|
3787
|
-
.${
|
|
3788
|
-
.${
|
|
3789
|
-
border-top-color: var(--${
|
|
4558
|
+
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-default .${e}-list-item:hover:first-child,
|
|
4559
|
+
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-default.${e}-state-hover .${e}-list-item:first-child,
|
|
4560
|
+
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-blinds .${e}-list-item:hover:first-child,
|
|
4561
|
+
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item:first-child {
|
|
4562
|
+
border-top-color: var(--${e}-divider-hover-color);
|
|
3790
4563
|
}
|
|
3791
4564
|
|
|
3792
|
-
.${
|
|
3793
|
-
.${
|
|
3794
|
-
.${
|
|
3795
|
-
.${
|
|
3796
|
-
border-top-color: var(--${
|
|
4565
|
+
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:hover:first-child,
|
|
4566
|
+
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-default.${e}-state-hover .${e}-list-item:first-child,
|
|
4567
|
+
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:hover:first-child,
|
|
4568
|
+
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item:first-child {
|
|
4569
|
+
border-top-color: var(--${e}-divider-hover-color);
|
|
3797
4570
|
}
|
|
3798
4571
|
|
|
3799
|
-
.${
|
|
3800
|
-
.${
|
|
3801
|
-
.${
|
|
3802
|
-
.${
|
|
3803
|
-
.${
|
|
3804
|
-
.${
|
|
3805
|
-
.${
|
|
3806
|
-
.${
|
|
3807
|
-
color: var(--${
|
|
4572
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item:hover .${e}-list-col-title,
|
|
4573
|
+
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-list-item .${e}-list-col-title,
|
|
4574
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-cut-item:hover .${e}-cut-label,
|
|
4575
|
+
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-cut-item .${e}-cut-label,
|
|
4576
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item:hover .${e}-list-col-title,
|
|
4577
|
+
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item .${e}-list-col-title,
|
|
4578
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item:hover .${e}-cut-label,
|
|
4579
|
+
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-cut-item .${e}-cut-label {
|
|
4580
|
+
color: var(--${e}-text-hover-color);
|
|
3808
4581
|
}
|
|
3809
4582
|
|
|
3810
|
-
.${
|
|
3811
|
-
.${
|
|
4583
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item::before,
|
|
4584
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item::before {
|
|
3812
4585
|
content: '';
|
|
3813
4586
|
position: absolute;
|
|
3814
4587
|
inset: 0;
|
|
3815
|
-
background: var(--${
|
|
4588
|
+
background: var(--${e}-background-hover-color);
|
|
3816
4589
|
transform: scaleY(0);
|
|
3817
4590
|
transform-origin: center center;
|
|
3818
4591
|
transition: transform 250ms;
|
|
@@ -3820,20 +4593,20 @@ a.${t}-list-item {
|
|
|
3820
4593
|
pointer-events: none;
|
|
3821
4594
|
}
|
|
3822
4595
|
|
|
3823
|
-
.${
|
|
3824
|
-
.${
|
|
4596
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-col,
|
|
4597
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-label {
|
|
3825
4598
|
position: relative;
|
|
3826
4599
|
z-index: 1;
|
|
3827
4600
|
}
|
|
3828
4601
|
|
|
3829
|
-
.${
|
|
3830
|
-
.${
|
|
3831
|
-
.${
|
|
3832
|
-
.${
|
|
4602
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item:hover::before,
|
|
4603
|
+
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item::before,
|
|
4604
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item:hover::before,
|
|
4605
|
+
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-cut-item::before {
|
|
3833
4606
|
transform: scaleY(1);
|
|
3834
4607
|
}
|
|
3835
4608
|
|
|
3836
|
-
.${
|
|
4609
|
+
.${e}-cut-item {
|
|
3837
4610
|
display: flex;
|
|
3838
4611
|
align-items: center;
|
|
3839
4612
|
justify-content: center;
|
|
@@ -3843,30 +4616,125 @@ a.${t}-list-item {
|
|
|
3843
4616
|
z-index: 3;
|
|
3844
4617
|
box-sizing: border-box;
|
|
3845
4618
|
user-select: none;
|
|
3846
|
-
background: var(--${
|
|
4619
|
+
background: var(--${e}-background-color);
|
|
3847
4620
|
}
|
|
3848
4621
|
|
|
3849
|
-
.${
|
|
4622
|
+
.${e}-wrapper.${e}-divider-bottom .${e}-cut-item {
|
|
3850
4623
|
border-bottom-style: solid;
|
|
3851
|
-
border-bottom-color: var(--${
|
|
4624
|
+
border-bottom-color: var(--${e}-divider-color);
|
|
3852
4625
|
}
|
|
3853
4626
|
|
|
3854
|
-
.${
|
|
4627
|
+
.${e}-cut-label {
|
|
3855
4628
|
all: unset;
|
|
3856
4629
|
cursor: pointer;
|
|
3857
4630
|
position: relative;
|
|
3858
4631
|
z-index: 1;
|
|
3859
|
-
color: var(--${
|
|
4632
|
+
color: var(--${e}-text-color);
|
|
3860
4633
|
white-space: pre-wrap;
|
|
3861
4634
|
overflow-wrap: anywhere;
|
|
3862
4635
|
word-break: break-word;
|
|
3863
4636
|
}
|
|
3864
|
-
`}const De=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],qe=["AColumn","BColumn","CColumn","DColumn","EColumn"],yc={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"},vc=["textFontFamily","textFontSettings","textFontSize","textLineHeight","textLetterSpacing","textWordSpacing","textTextAppearance"];function Go(t,e){return`${t}${e.replace(/^text/,"Text")}`}function bc(t){return{textFontFamily:t.textFontFamily??"Arial",textFontSettings:t.textFontSettings??{fontWeight:400,fontStyle:"normal"},textFontSize:t.textFontSize,textLineHeight:t.textLineHeight,textLetterSpacing:t.textLetterSpacing??0,textWordSpacing:t.textWordSpacing??0,textTextAppearance:t.textTextAppearance,textColor:t.textColor}}function xc(t,e){const n=o=>{const i=Go(e,o),l=t[i];return l!==void 0?l:t[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAppearance:n("textTextAppearance"),textColor:t.textColor}}function Si(t,e){var r,s;const n=t.textFontSize??.01,o=n*1.2,i=Math.max(t.textLineHeight??n,o),l={fontSettings:{fontFamily:t.textFontFamily,fontWeight:((r=t.textFontSettings)==null?void 0:r.fontWeight)??400,fontStyle:((s=t.textFontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:n,lineHeight:i,letterSpacing:t.textLetterSpacing,wordSpacing:t.textWordSpacing,textAppearance:t.textTextAppearance,color:t.textColor??"#767676"};return pe(Vt(l,e))}function Cc(t,e){const n={};let o=!1;for(const i of vc)if(t[i]!==e[i]&&t[i]!==void 0){o=!0;for(const l of qe)n[Go(l,i)]=t[i]}return o?n:null}const Xt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],je=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ve=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ke=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Sc={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},$c=["hover","focus","filled","success","error"],$i=.004,Qe=.004,Yo=50,pn=1440,mn=Yo/pn;function ur(t){const e=typeof t=="number"&&t>0?t:pn;return Yo/e}function wc(t){let e=t??null;for(;e;){const n=e.style.getPropertyValue("--cntrl-article-width").trim();if(n){const i=parseFloat(n);if(Number.isFinite(i)&&i>0)return i}const o=getComputedStyle(e).getPropertyValue("--cntrl-article-width").trim();if(o){const i=parseFloat(o);if(Number.isFinite(i)&&i>0)return i}e=e.parentElement}return pn}const pr={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Nn(t){const e=typeof t.wrapperWidth=="number"?t.wrapperWidth:1;return Math.max(0,e)}function Tc(t,e=1){const n=e/t;return Object.fromEntries(Xt.map(o=>[o,n]))}function Lc(){return Object.fromEntries([...je.map(t=>[t,0]),...Ve.map(t=>[t,0])])}function _c(){return Object.fromEntries(Ke.map(t=>[t,0]))}function Fn(t){return Object.fromEntries(Xt.map(e=>[e,typeof t[e]=="number"?t[e]:pr[e]]))}function mr(t,e,n){const o=t-mn,i=e+n;if(i<=0||i<=o)return{paddingLeft:e,paddingRight:n};if(o<=0)return{paddingLeft:0,paddingRight:0};const l=o/i;return{paddingLeft:e*l,paddingRight:n*l}}function Hn(t,e,n){const o=qo(t,e,n);if(t<=0)return[];const i=o.slice(0,t-1).reduce((l,r)=>l+r,0);return[...o.slice(0,t-1),Math.max(0,e-i)]}function Ec(t,e,n){const o={};for(let i=0;i<t;i+=1){const l=je[i],r=Ve[i],s=typeof n[l]=="number"?n[l]:0,d=typeof n[r]=="number"?n[r]:0,u=mr(e[i]??0,s,d);u.paddingLeft!==s&&(o[l]=u.paddingLeft),u.paddingRight!==d&&(o[r]=u.paddingRight)}return o}function qo(t,e,n){if(t<=0)return[];const o=Xt.slice(0,t).map(u=>n[u]);if(t===1)return o;const i=o.slice(0,t-1),r=i.reduce((u,c)=>u+c,0)+mn;if(e>=r)return o;const s=[...i];let d=r-e;for(let u=s.length-1;u>=0&&d>0;u-=1){const c=s[u]-mn;if(c<=0)continue;const L=Math.min(d,c);s[u]-=L,d-=L}return[...s,o[t-1]]}function Pc(t,e,n){if(t<=1)return{};const o=qo(t,e,n),i={};for(let l=0;l<t-1;l+=1){const r=Xt[l];o[l]!==n[r]&&(i[r]=o[l])}return i}function wi(t){return Array.isArray(t.columnsOrder)&&t.columnsOrder.length>0?t.columnsOrder:[...De]}function Wc(t,e){return t.length!==e.length?!1:t.every((n,o)=>n===e[o])}function Fc(t,e,n,o){const i=Math.min(o,t.length,Xt.length),l={};for(let r=0;r<i;r+=1){const s=t[r],d=e.indexOf(s);if(d===-1)continue;const u=Xt[d],c=je[d],L=Ve[d],v=Ke[d],h=Xt[r],p=je[r],g=Ve[r],$=Ke[r],f=n[u],x=n[c],b=n[L],R=n[v];typeof f=="number"&&(l[h]=f),typeof x=="number"&&(l[p]=x),typeof b=="number"&&(l[g]=b),typeof R=="number"&&(l[$]=R)}return l}function Rc(t,e,n){const o=Cc(t,e);o&&(t={...t,...o});const i=ur(n==null?void 0:n.designWidth),l=t.columns,r=e.columns,s=Nn(t),d=Nn(e),u=t.type==="B"||t.type===void 0&&e.type==="B",c=typeof l=="number"?l:typeof r=="number"?r:De.length,L=b=>{if(u)return b;const R=Fn({...e,...b}),W=Nn(b),_=Hn(c,W,R),y=Ec(c,_,{...e,...b});return Object.keys(y).length===0?b:{...b,...y}};if(typeof l=="number"&&l!==r){const b={...t,...Tc(l,s),...Lc()};if(u)for(const R of Ke)typeof e[R]=="number"&&(b[R]=e[R]);else Object.assign(b,_c());return b}const v=wi(t),h=wi(e);if(!Wc(v,h))return L({...t,...Fc(v,h,e,c)});if(s<d&&typeof c=="number"&&!u){const b=Fn({...e,...t});return L({...t,...Pc(c,s,b)})}if(u){const b=typeof t.textPaddingLR=="number"?t.textPaddingLR:0,R=Math.max(0,(s-i)/2);return b>R?{...t,textPaddingLR:R}:t}const p=Fn({...e,...t}),g=Hn(c,d,Fn(e)),f=Hn(c,s,p).some((b,R)=>b<(g[R]??b)),x=Xt.some(b=>{const R=t[b],W=e[b];return typeof R=="number"&&typeof W=="number"&&R!==W});return f||x?L(t):t}function Ic(t,e,n,o){const i=e.slice(0,t).reduce((r,s)=>r+s,0),l=n.slice(t+1,e.length-1).reduce((r,s)=>r+s,0);return Math.max(mn,o-i-l-mn)}function Ac(t,e){return Math.random()*(e-t)+t}function kc(t){return Object.fromEntries(Xt.map(e=>[e,typeof t[e]=="number"?t[e]:pr[e]]))}function go(t,e,n=0){return Object.fromEntries(e.map(o=>[o,typeof t[o]=="number"?t[o]:n]))}function Mc(t,e,n,o,i,l){return t.slice(0,e).map((r,s)=>{const d=je[s],u=Ve[s],c=Ke[s];return{key:r,textPrefix:yc[r],widthKey:Xt[s],width:n[Xt[s]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:c,paddingLeft:o[d],paddingRight:i[u],paddingBottom:l[c]}})}function Oc({settings:t,content:e,isEditor:n,isPreviewMode:o,activeEvent:i,layoutId:l,onUpdateSettings:r}){const{prefix:s}=S.useScopedStyles(),d=!!(n&&o),{columns:u,type:c,wrapperWidth:L,entriesCount:v,cellMinHeight:h,dividerWidth:p,showVisibility:g,cut:$,showCut:f,cutCellMinHeight:x,cutLabel:b,imageSize:R,imageOnHover:W,entryHoverEffect:_,rowPaddingTop:y,rowPaddingBottom:w,rowPaddingTopB:E,columnsOrder:H,textPaddingLR:F,textColor:O,textFontFamily:z,textFontSettings:V,textFontSize:K,textLineHeight:C,textLetterSpacing:k,textWordSpacing:I,textTextAppearance:A,backgroundColor:P,dividerColor:N,textHoverColor:Q,backgroundHoverColor:st,dividerHoverColor:ot}=t,[ut,M]=m.useState(void 0),[J,ht]=m.useState(null),pt=W==="On",gt=($??0)>0,D=c==="B",at=m.useRef(null),[B,T]=m.useState(pn),U=ur(B),q=Math.max(0,((L??0)-U)/2),Z=Math.min(F??0,q),it=Math.max(Z,Qe),rt=((L??0)+U)/2;m.useLayoutEffect(()=>{if(!n){T(pn);return}const ft=()=>{T(wc(at.current))};ft();const Tt=at.current;if(!Tt)return;const Ht=new ResizeObserver(ft);Ht.observe(Tt);let Bt=Tt;for(;Bt&&!Bt.style.getPropertyValue("--cntrl-article-width");)Bt=Bt.parentElement;return Bt&&Ht.observe(Bt),()=>Ht.disconnect()},[n,l]),m.useEffect(()=>{M(void 0)},[$,f,e,v]);const et=Si(bc(t),n),dt=m.useMemo(()=>Object.fromEntries(qe.map(ft=>[ft,Si(xc(t,ft),n)])),[t,z,V,K,C,k,I,A,O,n]),j=S.buildColorVars(s,{textColor:O,backgroundColor:P,dividerColor:N,textHoverColor:Q,backgroundHoverColor:st,dividerHoverColor:ot},Sc,$c),X=i&&i!=="default"?`${s}-state-${i}`:"",lt=`${_==="Default"?`${s}-entry-hover-default`:_==="Blinds"?`${s}-entry-hover-blinds`:""} ${X}`.trim(),nt=(g==null?void 0:g[0])??!1,ct=(g==null?void 0:g[1])??!1,Ct=m.useRef(t),Lt=m.useRef(l);m.useEffect(()=>{if(!r||!n){Ct.current=t,Lt.current=l;return}if(Lt.current!==l){Ct.current=t,Lt.current=l;return}const ft=Ct.current,Tt=Rc(t,ft,{designWidth:B});Ct.current=t,Tt!==t&&r(Tt)},[t,r,n,l,B]);const Pt=m.useMemo(()=>kc(t),[t.AColumnWidth,t.BColumnWidth,t.CColumnWidth,t.DColumnWidth,t.EColumnWidth]),Dt=m.useMemo(()=>go(t,je),[t.AColumnPaddingLeft,t.BColumnPaddingLeft,t.CColumnPaddingLeft,t.DColumnPaddingLeft,t.EColumnPaddingLeft]),St=m.useMemo(()=>go(t,Ve),[t.AColumnPaddingRight,t.BColumnPaddingRight,t.CColumnPaddingRight,t.DColumnPaddingRight,t.EColumnPaddingRight]),At=m.useMemo(()=>go(t,Ke),[t.AColumnPaddingBottom,t.BColumnPaddingBottom,t.CColumnPaddingBottom,t.DColumnPaddingBottom,t.EColumnPaddingBottom]),Kt=m.useMemo(()=>Array.isArray(H)&&H.length>0?H:[...De],[H]),yt=m.useMemo(()=>Mc(Kt,u,Pt,Dt,St,At),[Kt,u,Pt,Dt,St,At]),Wt=Nn(t),$t=m.useMemo(()=>Xt.slice(0,u).map(ft=>Pt[ft]),[u,Pt]),Mt=m.useMemo(()=>qo(u,Wt,Pt),[u,Wt,Pt]),kt=m.useMemo(()=>Hn(u,Wt,Pt),[u,Wt,Pt]),Rt=m.useMemo(()=>yt.map((ft,Tt)=>mr(kt[Tt]??0,ft.paddingLeft,ft.paddingRight)),[yt,kt]),It=m.useMemo(()=>{const ft=v===0?1/0:v;return(e??[]).slice(0,ft).map((Ht,Bt)=>({id:Bt,cells:Object.fromEntries(De.map(he=>[he,Ht[he]??""])),image:Ht.image,link:Ht.link}))},[e,v]),Ut=gt?ut??$:It.length,oe=m.useMemo(()=>gt?It.slice(0,Ut):It,[It,gt,Ut]),Jt=gt&&Ut<It.length,oo=oe.length>1||Jt,io=[nt?`${s}-divider-top`:"",ct||oo?`${s}-divider-bottom`:""].filter(Boolean).join(" "),ro=()=>{const ft=ut??$;if(!f){M(It.length);return}M(Math.min(ft+f,It.length))},bt=ft=>S.scalingValue(ft,n??!1),Xe=D?E??0:y??0,Sn=w??0,vt=h??0,Qt=D?"rowPaddingTopB":"rowPaddingTop",jt=yt[0],Ot=yt[yt.length-1],Gt=Rt[0],Ze=Rt[Rt.length-1],gr=jt&&Gt?Math.max(Gt.paddingLeft,Qe):0,Xo=Ot&&Ze?Math.max(Ze.paddingRight,Qe):0,hr=Wt,fr=ft=>{if(!pt)return;const Tt=ft.image;if(!(Tt!=null&&Tt.url)){ht(null);return}if((J==null?void 0:J.rowId)===ft.id)return;const Ht=(R==null?void 0:R.min)??80,Bt=(R==null?void 0:R.max)??320;ht({rowId:ft.id,url:Tt.url,objectFit:Tt.objectFit??"cover",widthPx:Ac(Ht,Bt)})},yr=()=>{ht(null)};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:fc(s)}}),a.jsx("div",{style:j,children:a.jsxs("div",{ref:at,className:`${s}-wrapper ${lt}${io?` ${io}`:""}${D?` ${s}-type-b`:""}`.trim(),style:{width:S.scalingValue(L??0,n)},onMouseLeave:pt?yr:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[oe.map((ft,Tt)=>{var Je;const Ht=(((Je=ft.link)==null?void 0:Je.length)??0)>0,Bt=Ht?"a":"div",he=gc(Tt,oe.length,nt,ct,Jt,p??0,n??!1);return a.jsxs(Bt,{className:`${s}-list-item`,...Ht?{href:ft.link,target:"_blank"}:{},style:he,onMouseEnter:pt?()=>fr(ft):void 0,children:[(Xe>0||d)&&a.jsx("div",{...d?{"data-controls":Qt,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:bt(Xe)}}),a.jsx("div",{className:`${s}-list-cols-row`,style:D?void 0:{minHeight:bt(vt)},children:yt.map((ie,Re)=>{const $n=Re===yt.length-1,wn=Rt[Re],Tn=ie.paddingBottom,ao=mc(ft.cells[ie.key]),vr=D&&ao&&(Tn>0||d),br=D?{minHeight:bt(vt)}:$n?{}:{width:bt(kt[Re])},xr=D?{paddingLeft:bt(Z),paddingRight:bt(Z)}:{paddingLeft:bt(wn.paddingLeft),paddingRight:bt(wn.paddingRight)};return a.jsxs("div",{children:[a.jsx("div",{className:`${s}-list-col${$n?` ${s}-list-col-last`:""}`,style:{...xr,...br},"data-test":ie.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:dt[ie.textPrefix]??et,children:ft.cells[ie.key]??null})}),vr&&a.jsx("div",{...d?{"data-controls":ie.paddingBottomKey,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:bt(Tn)}})]},ie.key)})}),!D&&(Sn>0||d)&&a.jsx("div",{...d?{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:bt(Sn)}})]},ft.id)}),Jt&&a.jsx("div",{className:`${s}-cut-item`,style:{minHeight:bt(x??0),...hc(ct,p??0,n??!1)},children:a.jsx("div",{className:`${s}-list-cols-row`,style:D?{paddingLeft:bt(Z),paddingRight:bt(Z)}:{justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${s}-cut-label`,style:et,onClick:ro,children:b})})})]}),d&&!D&&jt&&Ot&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":jt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(kt[0]-((Gt==null?void 0:Gt.paddingRight)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:0,width:bt(gr),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Ot.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(kt[yt.length-1]-((Ze==null?void 0:Ze.paddingLeft)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:bt(hr-Xo),width:bt(Xo),height:"100%",pointerEvents:"auto",zIndex:2}})]},"column-edge-padding-handles"),d&&!D&&yt.slice(0,-1).map((ft,Tt)=>{const Ht=yt[Tt+1],Bt=Ic(Tt,Mt,$t,Wt),he=Mt.slice(0,Tt+1).reduce((Tn,ao)=>Tn+ao,0),Je=Rt[Tt],ie=Rt[Tt+1],Re=Math.max(Je.paddingRight,Qe),$n=Math.max(ie.paddingLeft,Qe),wn=he-$i/2;return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":ft.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(kt[Tt]-Je.paddingLeft),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:bt(he-Re),width:bt(Re),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":ft.widthKey,"data-controls-axis":"x","data-controls-min":String(Yo),"data-controls-max-fraction":String(Bt),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:bt(wn),width:bt($i),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":Ht.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(kt[Tt+1]-ie.paddingRight),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:bt(he),width:bt($n),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${ft.widthKey}-junction`)}),d&&D&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(rt),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:0,width:bt(it),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(rt),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:bt(Math.max(it,Wt-it)),width:bt(it),height:"100%",pointerEvents:"auto",zIndex:2}})]},"text-padding-lr-handles"),pt&&J&&a.jsx("img",{className:`${s}-hover-image`,src:J.url,alt:"",style:{width:On(J.widthPx),objectFit:J.objectFit}})]})})]})}const Nc=`import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4637
|
+
`}const Jt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bt=["AColumn","BColumn","CColumn","DColumn","EColumn"],ei=["A","B","C","D","E"];function $r(e){return`${e}ColumnVerticalAlign`}const zc=["Top","Center","Bottom"];function jc(e){const t=String(e??"Top").trim();return t.toLowerCase().startsWith("baseline")?!1:t==="Top"}function Kc(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ei.includes(n)?n:null}function Tr(e,t,n){const o=Kc(e);return o?o===t?!1:jc(n[$r(o)]):!0}function Wo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ei.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Uc(e,t,n){if(Lr(e,t,n))return Wo(e);const o=Wo(e);return o.kind==="baseline"?{kind:"top"}:o}function Lr(e,t,n){return Tr(e,n,t)?Wo(e).kind==="baseline":!1}function qc(e){if(e.type==="B")return null;const t={};let n=!1;for(const o of ei){const i=$r(o),l=e[i];Tr(l,o,e)||(t[i]="Top",n=!0)}return n?t:null}function Gc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function bo(e,t){if(!e)return 0;const n=document.createElement("i");n.className=t,n.setAttribute("data-baseline-probe",""),n.setAttribute("aria-hidden","true"),e.insertBefore(n,e.firstChild);const o=n.getBoundingClientRect().bottom;return n.remove(),o}function Yc(e,t){return!e||!t?(e&&(e.style.paddingTop="",e.style.marginTop=""),0):(t>0?(e.style.paddingTop=`${t}px`,e.style.marginTop=""):(e.style.paddingTop="",e.style.marginTop=`${t}px`),t)}const Xc={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"},Zc=["textFontFamily","textFontSettings","textFontSize","textLineHeight","textLetterSpacing","textWordSpacing","textTextAppearance"];function ti(e,t){return`${e}${t.replace(/^text/,"Text")}`}function Jc(e){return{textFontFamily:e.textFontFamily??"Arial",textFontSettings:e.textFontSettings??{fontWeight:400,fontStyle:"normal"},textFontSize:e.textFontSize,textLineHeight:e.textLineHeight,textLetterSpacing:e.textLetterSpacing??0,textWordSpacing:e.textWordSpacing??0,textTextAppearance:e.textTextAppearance,textColor:e.textColor}}function Qc(e,t){const n=o=>{const i=ti(t,o),l=e[i];return l!==void 0?l:e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Ri(e,t){var o,i;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((o=e.textFontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((i=e.textFontSettings)==null?void 0:i.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return yt(qe(n,t))}function ed(e,t){const n={};let o=!1;for(const i of Zc)if(e[i]!==t[i]&&e[i]!==void 0){o=!0;for(const l of Bt)Object.assign(n,{[ti(l,i)]:e[i]})}return o?n:null}const et=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Qt=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],en=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],tn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],td={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},nd=["hover","focus","filled","success","error"],ki=.004,ln=.004,ni=50,bn=1440,xn=ni/bn;function Er(e){const t=typeof e=="number"&&e>0?e:bn;return ni/t}function od(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const i=parseFloat(n);if(Number.isFinite(i)&&i>0)return i}const o=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(o){const i=parseFloat(o);if(Number.isFinite(i)&&i>0)return i}t=t.parentElement}return bn}const _r={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function zn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function id(e,t=1){const n=t/e;return Object.fromEntries(et.map(o=>[o,n]))}function rd(){return Object.fromEntries([...Qt.map(e=>[e,0]),...en.map(e=>[e,0])])}function ad(){return Object.fromEntries(tn.map(e=>[e,0]))}function Mn(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:_r[t]]))}function Pr(e,t,n){const o=e-xn,i=t+n;if(i<=0||i<=o)return{paddingLeft:t,paddingRight:n};if(o<=0)return{paddingLeft:0,paddingRight:0};const l=o/i;return{paddingLeft:t*l,paddingRight:n*l}}function jn(e,t,n){const o=oi(e,t,n);if(e<=0)return[];const i=o.slice(0,e-1).reduce((l,r)=>l+r,0);return[...o.slice(0,e-1),Math.max(0,t-i)]}function sd(e,t,n){const o={};for(let i=0;i<e;i+=1){const l=Qt[i],r=en[i],s=typeof n[l]=="number"?n[l]:0,c=typeof n[r]=="number"?n[r]:0,p=Pr(t[i]??0,s,c);p.paddingLeft!==s&&(o[l]=p.paddingLeft),p.paddingRight!==c&&(o[r]=p.paddingRight)}return o}function oi(e,t,n){if(e<=0)return[];const o=et.slice(0,e).map(p=>n[p]);if(e===1)return o;const i=o.slice(0,e-1),r=i.reduce((p,d)=>p+d,0)+xn;if(t>=r)return o;const s=[...i];let c=r-t;for(let p=s.length-1;p>=0&&c>0;p-=1){const d=s[p]-xn;if(d<=0)continue;const $=Math.min(c,d);s[p]-=$,c-=$}return[...s,o[e-1]]}function ld(e,t,n){if(e<=1)return{};const o=oi(e,t,n),i={};for(let l=0;l<e-1;l+=1){const r=et[l];o[l]!==n[r]&&(i[r]=o[l])}return i}function Mi(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Jt]}function cd(e,t){return e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function dd(e,t,n,o){const i=Math.min(o,e.length,et.length),l={};for(let r=0;r<i;r+=1){const s=e[r],c=t.indexOf(s);if(c===-1)continue;const p=et[c],d=Qt[c],$=en[c],h=tn[c],f=et[r],m=Qt[r],g=en[r],C=tn[r],y=n[p],x=n[d],P=n[$],L=n[h];typeof y=="number"&&(l[f]=y),typeof x=="number"&&(l[m]=x),typeof P=="number"&&(l[g]=P),typeof L=="number"&&(l[C]=L)}return l}function ud(e,t,n){const o=ed(e,t);o&&(e={...e,...o});const i=qc(e);i&&(e={...e,...i});const l=Er(n==null?void 0:n.designWidth),r=e.columns,s=t.columns,c=zn(e),p=zn(t),d=e.type==="B"||e.type===void 0&&t.type==="B",$=typeof r=="number"?r:typeof s=="number"?s:Jt.length,h=L=>{if(d)return L;const _=Mn({...t,...L}),E=zn(L),v=jn($,E,_),w=sd($,v,{...t,...L});return Object.keys(w).length===0?L:{...L,...w}};if(typeof r=="number"&&r!==s){const L={...e,...id(r,c),...rd()};if(d)for(const _ of tn)typeof t[_]=="number"&&(L[_]=t[_]);else Object.assign(L,ad());return L}const f=Mi(e),m=Mi(t);if(!cd(f,m))return h({...e,...dd(f,m,t,$)});if(c<p&&typeof $=="number"&&!d){const L=Mn({...t,...e});return h({...e,...ld($,c,L)})}if(d){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,_=Math.max(0,(c-l)/2);return L>_?{...e,textPaddingLR:_}:e}const g=Mn({...t,...e}),C=jn($,p,Mn(t)),x=jn($,c,g).some((L,_)=>L<(C[_]??L)),P=et.some(L=>{const _=e[L],E=t[L];return typeof _=="number"&&typeof E=="number"&&_!==E});return x||P?h(e):e}function pd(e,t,n,o){const i=t.slice(0,e).reduce((r,s)=>r+s,0),l=n.slice(e+1,t.length-1).reduce((r,s)=>r+s,0);return Math.max(xn,o-i-l-xn)}function md(e,t){return Math.random()*(t-e)+e}function gd(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:_r[t]]))}function xo(e,t,n=0){return Object.fromEntries(t.map(o=>[o,typeof e[o]=="number"?e[o]:n]))}function hd(e,t,n,o,i,l){return e.slice(0,t).map((r,s)=>{const c=Qt[s],p=en[s],d=tn[s];return{key:r,textPrefix:Xc[r],widthKey:et[s],width:n[et[s]],paddingLeftKey:c,paddingRightKey:p,paddingBottomKey:d,paddingLeft:o[c],paddingRight:i[p],paddingBottom:l[d]}})}function fd({settings:e,content:t,isEditor:n,isPreviewMode:o,activeEvent:i,layoutId:l,onUpdateSettings:r}){const{prefix:s}=T.useScopedStyles(),c=!!(n&&o),{columns:p,type:d,wrapperWidth:$,entriesCount:h,cellMinHeight:f,dividerWidth:m,showVisibility:g,cut:C,showCut:y,cutCellMinHeight:x,cutLabel:P,imageSize:L,imageOnHover:_,entryHoverEffect:E,rowPaddingTop:v,rowPaddingBottom:w,rowPaddingTopB:R,columnsOrder:V,textPaddingLR:A,textColor:H,textFontFamily:D,textFontSettings:j,textFontSize:U,textLineHeight:S,textLetterSpacing:N,textWordSpacing:k,textTextAppearance:M,backgroundColor:W,dividerColor:B,textHoverColor:ee,backgroundHoverColor:de,dividerHoverColor:re}=e,[me,O]=u.useState(void 0),[te,Y]=u.useState(null),X=_==="On",ne=(C??0)>0,F=d==="B",oe=u.useRef(null),[I,b]=u.useState(bn),z=Er(I),q=Math.max(0,(($??0)-z)/2),Z=Math.min(A??0,q),se=Math.max(Z,ln),le=(($??0)+z)/2;u.useLayoutEffect(()=>{if(!n){b(bn);return}const he=()=>{b(od(oe.current))};he();const xe=oe.current;if(!xe)return;const We=new ResizeObserver(he);We.observe(xe);let Oe=xe;for(;Oe&&!Oe.style.getPropertyValue("--cntrl-article-width");)Oe=Oe.parentElement;return Oe&&We.observe(Oe),()=>We.disconnect()},[n,l]),u.useEffect(()=>{O(void 0)},[C,y,t,h]);const ce=Ri(Jc(e),n),ge=u.useMemo(()=>Object.fromEntries(Bt.map(he=>[he,Ri(Qc(e,he),n)])),[e,D,j,U,S,N,k,M,H,n]),K=T.buildColorVars(s,{textColor:H,backgroundColor:W,dividerColor:B,textHoverColor:ee,backgroundHoverColor:de,dividerHoverColor:re},td,nd),J=i&&i!=="default"?`${s}-state-${i}`:"",pe=`${E==="Default"?`${s}-entry-hover-default`:E==="Blinds"?`${s}-entry-hover-blinds`:""} ${J}`.trim(),ie=(g==null?void 0:g[0])??!1,ue=(g==null?void 0:g[1])??!1,Ce=u.useRef(e),$e=u.useRef(l);u.useEffect(()=>{if(!r||!n){Ce.current=e,$e.current=l;return}if($e.current!==l){Ce.current=e,$e.current=l;return}const he=Ce.current,xe=ud(e,he,{designWidth:I});Ce.current=e,xe!==e&&r(xe)},[e,r,n,l,I]);const Pe=u.useMemo(()=>gd(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),je=u.useMemo(()=>xo(e,Qt),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),we=u.useMemo(()=>xo(e,en),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Me=u.useMemo(()=>xo(e,tn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Ge=u.useMemo(()=>Array.isArray(V)&&V.length>0?V:[...Jt],[V]),ye=u.useMemo(()=>hd(Ge,p,Pe,je,we,Me),[Ge,p,Pe,je,we,Me]),Ae=zn(e),Te=u.useMemo(()=>et.slice(0,p).map(he=>Pe[he]),[p,Pe]),Be=u.useMemo(()=>oi(p,Ae,Pe),[p,Ae,Pe]),Ne=u.useMemo(()=>jn(p,Ae,Pe),[p,Ae,Pe]),Fe=u.useMemo(()=>ye.map((he,xe)=>Pr(Ne[xe]??0,he.paddingLeft,he.paddingRight)),[ye,Ne]),ke=u.useMemo(()=>{const he=h===0?1/0:h;return(t??[]).slice(0,he).map((We,Oe)=>({id:Oe,cells:Object.fromEntries(Jt.map(rt=>[rt,We[rt]??""])),image:We.image,link:We.link}))},[t,h]),Ye=ne?me??C:ke.length,nt=u.useMemo(()=>ne?ke.slice(0,Ye):ke,[ke,ne,Ye]),ot=ne&&Ye<ke.length,lo=nt.length>1||ot,co=[ie?`${s}-divider-top`:"",ue||lo?`${s}-divider-bottom`:""].filter(Boolean).join(" "),uo=()=>{const he=me??C;if(!y){O(ke.length);return}O(Math.min(he+y,ke.length))},Se=he=>T.scalingValue(he,n??!1),an=F?R??0:v??0,Pn=w??0,be=f??0,it=F?"rowPaddingTopB":"rowPaddingTop",Ke=ye[0],Ve=ye[ye.length-1],Xe=Fe[0],sn=Fe[Fe.length-1],Ar=Ke&&Xe?Math.max(Xe.paddingLeft,ln):0,ii=Ve&&sn?Math.max(sn.paddingRight,ln):0,Wr=Ae,Ir=he=>{if(!X)return;const xe=he.image;if(!(xe!=null&&xe.url)){Y(null);return}if((te==null?void 0:te.rowId)===he.id)return;const We=(L==null?void 0:L.min)??80,Oe=(L==null?void 0:L.max)??320;Y({rowId:he.id,url:xe.url,objectFit:xe.objectFit??"cover",widthPx:md(We,Oe)})},Fr=()=>{Y(null)},ri=u.useMemo(()=>!F&&Bt.some(he=>{const xe=he.charAt(0),We=e[`${he}VerticalAlign`];return Lr(We,e,xe)}),[F,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);return u.useLayoutEffect(()=>{var xt;const he=oe.current;if(!he)return;const xe=()=>{he.querySelectorAll("[data-list-col]").forEach(He=>{He.style.transform="";const Ue=He.querySelector(`.${s}-list-col-title`);Ue&&(Ue.style.paddingTop="",Ue.style.marginTop="")})};if(F||!ri){xe();return}const We=()=>{he.querySelectorAll("[data-list-row]").forEach(He=>{const Ue=Array.from(He.querySelectorAll("[data-list-col]"));Ue.forEach(Le=>{Le.style.transform="";const Ze=Le.querySelector(`.${s}-list-col-title`);Ze&&(Ze.style.paddingTop="",Ze.style.marginTop="")});const Ct=`${s}-baseline-probe`,Wt=new Map,Dt=Ue.map(Le=>{const Ze=Le.querySelector(`.${s}-list-col-title`),pt={el:Le,titleEl:Ze,letter:Le.getAttribute("data-col-letter")??"",kind:Le.getAttribute("data-valign")??"top",anchor:Le.getAttribute("data-valign-anchor")};return Wt.set(pt.letter,pt),pt}),It=new Map,An=(Le,Ze)=>{const pt=It.get(Le.letter);if(pt!==void 0)return pt;const Ft=Le.anchor?Wt.get(Le.anchor):void 0;if(Le.kind!=="baseline"||!Ft||Ze.has(Le.letter)){const si=bo(Le.titleEl,Ct);return It.set(Le.letter,si),si}Ze.add(Le.letter);const Rr=An(Ft,Ze);Ze.delete(Le.letter);const kr=bo(Le.titleEl,Ct),Mr=Rr-kr;Yc(Le.titleEl,Mr);const ai=bo(Le.titleEl,Ct);return It.set(Le.letter,ai),ai};Dt.forEach(Le=>An(Le,new Set))})};We();const Oe=new ResizeObserver(()=>We());Oe.observe(he);let rt=!1;return typeof document<"u"&&((xt=document.fonts)!=null&&xt.ready)&&document.fonts.ready.then(()=>{rt||We()}),()=>{rt=!0,Oe.disconnect(),xe()}},[ri,F,e,t,I,nt,Ne,ge]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dc(s)}}),a.jsx("div",{style:K,children:a.jsxs("div",{ref:oe,className:`${s}-wrapper ${pe}${co?` ${co}`:""}${F?` ${s}-type-b`:""}`.trim(),style:{width:T.scalingValue($??0,n)},onMouseLeave:X?Fr:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[nt.map((he,xe)=>{var xt;const We=(((xt=he.link)==null?void 0:xt.length)??0)>0,Oe=We?"a":"div",rt=Bc(xe,nt.length,ie,ue,ot,m??0,n??!1);return a.jsxs(Oe,{className:`${s}-list-item`,...We?{href:he.link,target:"_blank"}:{},style:rt,onMouseEnter:X?()=>Ir(he):void 0,children:[(an>0||c)&&a.jsx("div",{...c?{"data-controls":it,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(an)}}),a.jsx("div",{className:`${s}-list-cols-row${F?"":` ${s}-list-cols-row-h`}`,...F?{}:{"data-list-row":""},style:F?void 0:{minHeight:Se(be)},children:ye.map((He,Ue)=>{const Ct=Ue===ye.length-1,Wt=Fe[Ue],Dt=He.paddingBottom,It=Hc(he.cells[He.key]),An=F&&It&&(Dt>0||c),Le=F?{minHeight:Se(be)}:Ct?{}:{width:Se(Ne[Ue])},Ze=F?{paddingLeft:Se(Z),paddingRight:Se(Z)}:{paddingLeft:Se(Wt.paddingLeft),paddingRight:Se(Wt.paddingRight)},pt=He.textPrefix.charAt(0),Ft=F?{kind:"top"}:Uc(e[`${He.textPrefix}VerticalAlign`],e,pt);return a.jsxs("div",{...F?{}:{"data-list-col":"","data-col-letter":pt,"data-valign":Ft.kind,...Ft.kind==="baseline"?{"data-valign-anchor":Ft.anchorLetter}:{}},children:[a.jsx("div",{className:`${s}-list-col${Ct?` ${s}-list-col-last`:""}`,style:{...Ze,...Le,...F?{}:{justifyContent:Gc(Ft.kind)}},"data-test":He.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:ge[He.textPrefix]??ce,children:he.cells[He.key]??null})}),An&&a.jsx("div",{...c?{"data-controls":He.paddingBottomKey,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(Dt)}})]},He.key)})}),!F&&(Pn>0||c)&&a.jsx("div",{...c?{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(Pn)}})]},he.id)}),ot&&a.jsx("div",{className:`${s}-cut-item`,style:{minHeight:Se(x??0),...Vc(ue,m??0,n??!1)},children:a.jsx("div",{className:`${s}-list-cols-row`,style:F?{paddingLeft:Se(Z),paddingRight:Se(Z)}:{justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${s}-cut-label`,style:ce,onClick:uo,children:P})})})]}),c&&!F&&Ke&&Ve&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ke.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((Xe==null?void 0:Xe.paddingRight)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:0,width:Se(Ar),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Ve.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[ye.length-1]-((sn==null?void 0:sn.paddingLeft)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(Wr-ii),width:Se(ii),height:"100%",pointerEvents:"auto",zIndex:2}})]},"column-edge-padding-handles"),c&&!F&&ye.slice(0,-1).map((he,xe)=>{const We=ye[xe+1],Oe=pd(xe,Be,Te,Ae),rt=Be.slice(0,xe+1).reduce((Dt,It)=>Dt+It,0),xt=Fe[xe],He=Fe[xe+1],Ue=Math.max(xt.paddingRight,ln),Ct=Math.max(He.paddingLeft,ln),Wt=rt-ki/2;return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":he.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe]-xt.paddingLeft),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(rt-Ue),width:Se(Ue),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":he.widthKey,"data-controls-axis":"x","data-controls-min":String(ni),"data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Se(Wt),width:Se(ki),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":We.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe+1]-He.paddingRight),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(rt),width:Se(Ct),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${he.widthKey}-junction`)}),c&&F&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:0,width:Se(se),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:Se(Math.max(se,Ae-se)),width:Se(se),height:"100%",pointerEvents:"auto",zIndex:2}})]},"text-padding-lr-handles"),X&&te&&a.jsx("img",{className:`${s}-hover-image`,src:te.url,alt:"",style:{width:Dn(te.widthPx),objectFit:te.objectFit}})]})})]})}const yd=`import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3865
4638
|
import { CommonComponentProps } from '../props';
|
|
3866
4639
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
3867
4640
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
3868
4641
|
|
|
3869
|
-
type
|
|
4642
|
+
type ListFontSettings = { fontWeight: number; fontStyle: string };
|
|
4643
|
+
|
|
4644
|
+
type ListColumnPrefix = 'AColumn' | 'BColumn' | 'CColumn' | 'DColumn' | 'EColumn';
|
|
4645
|
+
|
|
4646
|
+
type ListColumnTextStyleOverrides = {
|
|
4647
|
+
AColumnVerticalAlign?: string;
|
|
4648
|
+
AColumnTextFontFamily?: string;
|
|
4649
|
+
AColumnTextFontSettings?: ListFontSettings;
|
|
4650
|
+
AColumnTextFontSize?: number;
|
|
4651
|
+
AColumnTextLineHeight?: number;
|
|
4652
|
+
AColumnTextLetterSpacing?: number;
|
|
4653
|
+
AColumnTextWordSpacing?: number;
|
|
4654
|
+
AColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4655
|
+
BColumnVerticalAlign?: string;
|
|
4656
|
+
BColumnTextFontFamily?: string;
|
|
4657
|
+
BColumnTextFontSettings?: ListFontSettings;
|
|
4658
|
+
BColumnTextFontSize?: number;
|
|
4659
|
+
BColumnTextLineHeight?: number;
|
|
4660
|
+
BColumnTextLetterSpacing?: number;
|
|
4661
|
+
BColumnTextWordSpacing?: number;
|
|
4662
|
+
BColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4663
|
+
CColumnVerticalAlign?: string;
|
|
4664
|
+
CColumnTextFontFamily?: string;
|
|
4665
|
+
CColumnTextFontSettings?: ListFontSettings;
|
|
4666
|
+
CColumnTextFontSize?: number;
|
|
4667
|
+
CColumnTextLineHeight?: number;
|
|
4668
|
+
CColumnTextLetterSpacing?: number;
|
|
4669
|
+
CColumnTextWordSpacing?: number;
|
|
4670
|
+
CColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4671
|
+
DColumnVerticalAlign?: string;
|
|
4672
|
+
DColumnTextFontFamily?: string;
|
|
4673
|
+
DColumnTextFontSettings?: ListFontSettings;
|
|
4674
|
+
DColumnTextFontSize?: number;
|
|
4675
|
+
DColumnTextLineHeight?: number;
|
|
4676
|
+
DColumnTextLetterSpacing?: number;
|
|
4677
|
+
DColumnTextWordSpacing?: number;
|
|
4678
|
+
DColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4679
|
+
EColumnVerticalAlign?: string;
|
|
4680
|
+
EColumnTextFontFamily?: string;
|
|
4681
|
+
EColumnTextFontSettings?: ListFontSettings;
|
|
4682
|
+
EColumnTextFontSize?: number;
|
|
4683
|
+
EColumnTextLineHeight?: number;
|
|
4684
|
+
EColumnTextLetterSpacing?: number;
|
|
4685
|
+
EColumnTextWordSpacing?: number;
|
|
4686
|
+
EColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4687
|
+
};
|
|
4688
|
+
|
|
4689
|
+
export type ListColumnVerticalAlignKey = \`\${ListColumnPrefix}VerticalAlign\`;
|
|
4690
|
+
|
|
4691
|
+
type ListColumnVerticalAlignUpdates = {
|
|
4692
|
+
AColumnVerticalAlign?: string;
|
|
4693
|
+
BColumnVerticalAlign?: string;
|
|
4694
|
+
CColumnVerticalAlign?: string;
|
|
4695
|
+
DColumnVerticalAlign?: string;
|
|
4696
|
+
EColumnVerticalAlign?: string;
|
|
4697
|
+
};
|
|
4698
|
+
|
|
4699
|
+
type ListColumnTextStyleSyncUpdates = {
|
|
4700
|
+
AColumnTextFontFamily?: string;
|
|
4701
|
+
AColumnTextFontSettings?: ListFontSettings;
|
|
4702
|
+
AColumnTextFontSize?: number;
|
|
4703
|
+
AColumnTextLineHeight?: number;
|
|
4704
|
+
AColumnTextLetterSpacing?: number;
|
|
4705
|
+
AColumnTextWordSpacing?: number;
|
|
4706
|
+
AColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4707
|
+
BColumnTextFontFamily?: string;
|
|
4708
|
+
BColumnTextFontSettings?: ListFontSettings;
|
|
4709
|
+
BColumnTextFontSize?: number;
|
|
4710
|
+
BColumnTextLineHeight?: number;
|
|
4711
|
+
BColumnTextLetterSpacing?: number;
|
|
4712
|
+
BColumnTextWordSpacing?: number;
|
|
4713
|
+
BColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4714
|
+
CColumnTextFontFamily?: string;
|
|
4715
|
+
CColumnTextFontSettings?: ListFontSettings;
|
|
4716
|
+
CColumnTextFontSize?: number;
|
|
4717
|
+
CColumnTextLineHeight?: number;
|
|
4718
|
+
CColumnTextLetterSpacing?: number;
|
|
4719
|
+
CColumnTextWordSpacing?: number;
|
|
4720
|
+
CColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4721
|
+
DColumnTextFontFamily?: string;
|
|
4722
|
+
DColumnTextFontSettings?: ListFontSettings;
|
|
4723
|
+
DColumnTextFontSize?: number;
|
|
4724
|
+
DColumnTextLineHeight?: number;
|
|
4725
|
+
DColumnTextLetterSpacing?: number;
|
|
4726
|
+
DColumnTextWordSpacing?: number;
|
|
4727
|
+
DColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4728
|
+
EColumnTextFontFamily?: string;
|
|
4729
|
+
EColumnTextFontSettings?: ListFontSettings;
|
|
4730
|
+
EColumnTextFontSize?: number;
|
|
4731
|
+
EColumnTextLineHeight?: number;
|
|
4732
|
+
EColumnTextLetterSpacing?: number;
|
|
4733
|
+
EColumnTextWordSpacing?: number;
|
|
4734
|
+
EColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4735
|
+
};
|
|
4736
|
+
|
|
4737
|
+
export type ListSettings = {
|
|
3870
4738
|
columns: number;
|
|
3871
4739
|
type: 'A' | 'B';
|
|
3872
4740
|
wrapperWidth: number;
|
|
@@ -3908,7 +4776,7 @@ type ListSettings = {
|
|
|
3908
4776
|
textPaddingLR?: number;
|
|
3909
4777
|
textColor: string;
|
|
3910
4778
|
textFontFamily: string;
|
|
3911
|
-
textFontSettings?:
|
|
4779
|
+
textFontSettings?: ListFontSettings;
|
|
3912
4780
|
textFontSize?: number;
|
|
3913
4781
|
textLineHeight?: number;
|
|
3914
4782
|
textLetterSpacing?: number;
|
|
@@ -3919,7 +4787,7 @@ type ListSettings = {
|
|
|
3919
4787
|
textHoverColor: string;
|
|
3920
4788
|
backgroundHoverColor: string;
|
|
3921
4789
|
dividerHoverColor: string;
|
|
3922
|
-
};
|
|
4790
|
+
} & ListColumnTextStyleOverrides;
|
|
3923
4791
|
|
|
3924
4792
|
type ListContentItem = {
|
|
3925
4793
|
AColumn?: string;
|
|
@@ -3963,7 +4831,7 @@ function sv(px: number): string {
|
|
|
3963
4831
|
return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
|
|
3964
4832
|
}
|
|
3965
4833
|
|
|
3966
|
-
function hasListColumnText(value:
|
|
4834
|
+
function hasListColumnText(value: React.ReactNode): boolean {
|
|
3967
4835
|
return String(value ?? '').trim().length > 0;
|
|
3968
4836
|
}
|
|
3969
4837
|
|
|
@@ -4052,6 +4920,29 @@ function getCSS(P: string): string {
|
|
|
4052
4920
|
box-sizing: border-box;
|
|
4053
4921
|
}
|
|
4054
4922
|
|
|
4923
|
+
.\${P}-list-cols-row-h {
|
|
4924
|
+
align-items: stretch;
|
|
4925
|
+
}
|
|
4926
|
+
|
|
4927
|
+
.\${P}-list-cols-row-h [data-list-col] {
|
|
4928
|
+
display: flex;
|
|
4929
|
+
flex-direction: column;
|
|
4930
|
+
align-self: stretch;
|
|
4931
|
+
min-height: 100%;
|
|
4932
|
+
}
|
|
4933
|
+
|
|
4934
|
+
.\${P}-list-cols-row-h .\${P}-list-col {
|
|
4935
|
+
flex: 1;
|
|
4936
|
+
display: flex;
|
|
4937
|
+
flex-direction: column;
|
|
4938
|
+
align-items: flex-start;
|
|
4939
|
+
}
|
|
4940
|
+
|
|
4941
|
+
.\${P}-list-cols-row-h .\${P}-list-col-title {
|
|
4942
|
+
flex: 0 1 auto;
|
|
4943
|
+
align-self: stretch;
|
|
4944
|
+
}
|
|
4945
|
+
|
|
4055
4946
|
.\${P}-wrapper.\${P}-type-b .\${P}-list-cols-row {
|
|
4056
4947
|
flex-direction: column;
|
|
4057
4948
|
align-items: stretch;
|
|
@@ -4098,7 +4989,7 @@ a.\${P}-list-item {
|
|
|
4098
4989
|
min-width: \${sv(50)};
|
|
4099
4990
|
position: relative;
|
|
4100
4991
|
display: flex;
|
|
4101
|
-
align-items:
|
|
4992
|
+
align-items: flex-start;
|
|
4102
4993
|
}
|
|
4103
4994
|
|
|
4104
4995
|
.\${P}-list-col-last {
|
|
@@ -4114,6 +5005,15 @@ a.\${P}-list-item {
|
|
|
4114
5005
|
flex: 1;
|
|
4115
5006
|
min-width: 0;
|
|
4116
5007
|
width: 100%;
|
|
5008
|
+
box-sizing: border-box;
|
|
5009
|
+
}
|
|
5010
|
+
|
|
5011
|
+
.\${P}-baseline-probe {
|
|
5012
|
+
display: inline-block;
|
|
5013
|
+
width: 0;
|
|
5014
|
+
height: 0;
|
|
5015
|
+
overflow: hidden;
|
|
5016
|
+
vertical-align: baseline;
|
|
4117
5017
|
}
|
|
4118
5018
|
|
|
4119
5019
|
.\${P}-col-resize-handle,
|
|
@@ -4334,6 +5234,171 @@ export const COLUMN_TEXT_PREFIXES = [
|
|
|
4334
5234
|
'EColumn',
|
|
4335
5235
|
] as const;
|
|
4336
5236
|
|
|
5237
|
+
export const LIST_COLUMN_LETTERS = ['A', 'B', 'C', 'D', 'E'] as const;
|
|
5238
|
+
|
|
5239
|
+
export function getListColumnVerticalAlignSettingKey(columnLetter: string): string {
|
|
5240
|
+
return \`\${columnLetter}ColumnVerticalAlign\`;
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5243
|
+
export const COLUMN_VALIGN_BASIC_OPTIONS = ['Top', 'Center', 'Bottom'] as const;
|
|
5244
|
+
|
|
5245
|
+
export function isTopColumnVerticalAlign(value: string | undefined): boolean {
|
|
5246
|
+
const raw = String(value ?? 'Top').trim();
|
|
5247
|
+
if (raw.toLowerCase().startsWith('baseline')) {
|
|
5248
|
+
return false;
|
|
5249
|
+
}
|
|
5250
|
+
return raw === 'Top';
|
|
5251
|
+
}
|
|
5252
|
+
|
|
5253
|
+
export function parseBaselineAnchorLetter(value: string | undefined): string | null {
|
|
5254
|
+
const raw = String(value ?? '').trim();
|
|
5255
|
+
if (!raw.toLowerCase().startsWith('baseline')) {
|
|
5256
|
+
return null;
|
|
5257
|
+
}
|
|
5258
|
+
const anchorLetter = raw.slice(-1).toUpperCase();
|
|
5259
|
+
return LIST_COLUMN_LETTERS.includes(anchorLetter as typeof LIST_COLUMN_LETTERS[number])
|
|
5260
|
+
? anchorLetter
|
|
5261
|
+
: null;
|
|
5262
|
+
}
|
|
5263
|
+
|
|
5264
|
+
export function isValidColumnBaselineVAlign(
|
|
5265
|
+
value: string | undefined,
|
|
5266
|
+
forColumnLetter: string,
|
|
5267
|
+
settings: ListSettings,
|
|
5268
|
+
): boolean {
|
|
5269
|
+
const anchorLetter = parseBaselineAnchorLetter(value);
|
|
5270
|
+
if (!anchorLetter) {
|
|
5271
|
+
return true;
|
|
5272
|
+
}
|
|
5273
|
+
if (anchorLetter === forColumnLetter) {
|
|
5274
|
+
return false;
|
|
5275
|
+
}
|
|
5276
|
+
return isTopColumnVerticalAlign(settings[getListColumnVerticalAlignSettingKey(anchorLetter) as ListColumnVerticalAlignKey]);
|
|
5277
|
+
}
|
|
5278
|
+
|
|
5279
|
+
export function getColumnVerticalAlignOptionsForLetter(
|
|
5280
|
+
columnLetter: string,
|
|
5281
|
+
settings: ListSettings,
|
|
5282
|
+
): string[] {
|
|
5283
|
+
const baselineOptions = LIST_COLUMN_LETTERS
|
|
5284
|
+
.filter((letter) => letter !== columnLetter)
|
|
5285
|
+
.filter((letter) => isTopColumnVerticalAlign(settings[getListColumnVerticalAlignSettingKey(letter) as ListColumnVerticalAlignKey]))
|
|
5286
|
+
.map((letter) => \`Baseline \${letter}\`);
|
|
5287
|
+
|
|
5288
|
+
return [...COLUMN_VALIGN_BASIC_OPTIONS, ...baselineOptions];
|
|
5289
|
+
}
|
|
5290
|
+
|
|
5291
|
+
type ColumnVerticalAlign =
|
|
5292
|
+
| { kind: 'top' | 'center' | 'bottom' }
|
|
5293
|
+
| { kind: 'baseline'; anchorLetter: string };
|
|
5294
|
+
|
|
5295
|
+
function parseColumnVerticalAlign(value: string | undefined): ColumnVerticalAlign {
|
|
5296
|
+
const raw = String(value ?? 'Top').trim();
|
|
5297
|
+
if (raw.toLowerCase().startsWith('baseline')) {
|
|
5298
|
+
const anchorLetter = raw.slice(-1).toUpperCase();
|
|
5299
|
+
if (LIST_COLUMN_LETTERS.includes(anchorLetter as typeof LIST_COLUMN_LETTERS[number])) {
|
|
5300
|
+
return { kind: 'baseline', anchorLetter };
|
|
5301
|
+
}
|
|
5302
|
+
return { kind: 'top' };
|
|
5303
|
+
}
|
|
5304
|
+
if (raw === 'Center') return { kind: 'center' };
|
|
5305
|
+
if (raw === 'Bottom') return { kind: 'bottom' };
|
|
5306
|
+
return { kind: 'top' };
|
|
5307
|
+
}
|
|
5308
|
+
|
|
5309
|
+
function resolveColumnVerticalAlign(
|
|
5310
|
+
value: string | undefined,
|
|
5311
|
+
settings: ListSettings,
|
|
5312
|
+
columnLetter: string,
|
|
5313
|
+
): ColumnVerticalAlign {
|
|
5314
|
+
if (isActiveBaselineVAlign(value, settings, columnLetter)) {
|
|
5315
|
+
return parseColumnVerticalAlign(value);
|
|
5316
|
+
}
|
|
5317
|
+
|
|
5318
|
+
const parsed = parseColumnVerticalAlign(value);
|
|
5319
|
+
if (parsed.kind === 'baseline') {
|
|
5320
|
+
return { kind: 'top' };
|
|
5321
|
+
}
|
|
5322
|
+
|
|
5323
|
+
return parsed;
|
|
5324
|
+
}
|
|
5325
|
+
|
|
5326
|
+
function isActiveBaselineVAlign(
|
|
5327
|
+
value: string | undefined,
|
|
5328
|
+
settings: ListSettings,
|
|
5329
|
+
forColumnLetter: string,
|
|
5330
|
+
): boolean {
|
|
5331
|
+
if (!isValidColumnBaselineVAlign(value, forColumnLetter, settings)) {
|
|
5332
|
+
return false;
|
|
5333
|
+
}
|
|
5334
|
+
return parseColumnVerticalAlign(value).kind === 'baseline';
|
|
5335
|
+
}
|
|
5336
|
+
|
|
5337
|
+
function getListColumnVerticalAlignSanitizeUpdates(
|
|
5338
|
+
settings: ListSettings,
|
|
5339
|
+
): ListColumnVerticalAlignUpdates | null {
|
|
5340
|
+
if (settings.type === 'B') {
|
|
5341
|
+
return null;
|
|
5342
|
+
}
|
|
5343
|
+
|
|
5344
|
+
const updates: ListColumnVerticalAlignUpdates = {};
|
|
5345
|
+
let hasUpdates = false;
|
|
5346
|
+
|
|
5347
|
+
for (const letter of LIST_COLUMN_LETTERS) {
|
|
5348
|
+
const key = getListColumnVerticalAlignSettingKey(letter) as ListColumnVerticalAlignKey;
|
|
5349
|
+
const value = settings[key];
|
|
5350
|
+
if (!isValidColumnBaselineVAlign(value, letter, settings)) {
|
|
5351
|
+
updates[key] = 'Top';
|
|
5352
|
+
hasUpdates = true;
|
|
5353
|
+
}
|
|
5354
|
+
}
|
|
5355
|
+
|
|
5356
|
+
return hasUpdates ? updates : null;
|
|
5357
|
+
}
|
|
5358
|
+
|
|
5359
|
+
function vAlignToJustifyContent(
|
|
5360
|
+
kind: ColumnVerticalAlign['kind'],
|
|
5361
|
+
): 'flex-start' | 'center' | 'flex-end' {
|
|
5362
|
+
if (kind === 'center') return 'center';
|
|
5363
|
+
if (kind === 'bottom') return 'flex-end';
|
|
5364
|
+
return 'flex-start';
|
|
5365
|
+
}
|
|
5366
|
+
|
|
5367
|
+
function getTitleBaselinePageY(titleEl: HTMLElement | null, probeClassName: string): number {
|
|
5368
|
+
if (!titleEl) return 0;
|
|
5369
|
+
|
|
5370
|
+
const probe = document.createElement('i');
|
|
5371
|
+
probe.className = probeClassName;
|
|
5372
|
+
probe.setAttribute('data-baseline-probe', '');
|
|
5373
|
+
probe.setAttribute('aria-hidden', 'true');
|
|
5374
|
+
|
|
5375
|
+
titleEl.insertBefore(probe, titleEl.firstChild);
|
|
5376
|
+
const baselineY = probe.getBoundingClientRect().bottom;
|
|
5377
|
+
probe.remove();
|
|
5378
|
+
|
|
5379
|
+
return baselineY;
|
|
5380
|
+
}
|
|
5381
|
+
|
|
5382
|
+
function applyBaselineTitleShift(titleEl: HTMLElement | null, shift: number): number {
|
|
5383
|
+
if (!titleEl || !shift) {
|
|
5384
|
+
if (titleEl) {
|
|
5385
|
+
titleEl.style.paddingTop = '';
|
|
5386
|
+
titleEl.style.marginTop = '';
|
|
5387
|
+
}
|
|
5388
|
+
return 0;
|
|
5389
|
+
}
|
|
5390
|
+
|
|
5391
|
+
if (shift > 0) {
|
|
5392
|
+
titleEl.style.paddingTop = \`\${shift}px\`;
|
|
5393
|
+
titleEl.style.marginTop = '';
|
|
5394
|
+
} else {
|
|
5395
|
+
titleEl.style.paddingTop = '';
|
|
5396
|
+
titleEl.style.marginTop = \`\${shift}px\`;
|
|
5397
|
+
}
|
|
5398
|
+
|
|
5399
|
+
return shift;
|
|
5400
|
+
}
|
|
5401
|
+
|
|
4337
5402
|
const COLUMN_CONTENT_KEY_TO_TEXT_PREFIX: Record<
|
|
4338
5403
|
typeof COLUMN_CONTENT_KEYS[number],
|
|
4339
5404
|
typeof COLUMN_TEXT_PREFIXES[number]
|
|
@@ -4405,12 +5470,12 @@ function resolveListGlobalTextFields(
|
|
|
4405
5470
|
}
|
|
4406
5471
|
|
|
4407
5472
|
function resolveListColumnTextFields(
|
|
4408
|
-
settings:
|
|
5473
|
+
settings: ListSettings,
|
|
4409
5474
|
textPrefix: typeof COLUMN_TEXT_PREFIXES[number],
|
|
4410
5475
|
): ResolvedListTextFields {
|
|
4411
5476
|
const read = <K extends ListGlobalTextStyleKey>(globalKey: K) => {
|
|
4412
5477
|
const columnKey = getListColumnTextSettingKey(textPrefix, globalKey);
|
|
4413
|
-
const columnValue = settings[columnKey];
|
|
5478
|
+
const columnValue = settings[columnKey as keyof ListSettings];
|
|
4414
5479
|
if (columnValue !== undefined) {
|
|
4415
5480
|
return columnValue as ListTextStyleFields[K];
|
|
4416
5481
|
}
|
|
@@ -4436,17 +5501,14 @@ function listColumnTextFieldsToCss(
|
|
|
4436
5501
|
fields: ResolvedListTextFields,
|
|
4437
5502
|
isEditor?: boolean,
|
|
4438
5503
|
): React.CSSProperties {
|
|
4439
|
-
const resolvedFontSize = fields.textFontSize ?? 0.01;
|
|
4440
|
-
const minLineHeight = resolvedFontSize * 1.2;
|
|
4441
|
-
const resolvedLineHeight = Math.max(fields.textLineHeight ?? resolvedFontSize, minLineHeight);
|
|
4442
5504
|
const resolvedTextStyle: TextStyles = {
|
|
4443
5505
|
fontSettings: {
|
|
4444
5506
|
fontFamily: fields.textFontFamily,
|
|
4445
5507
|
fontWeight: fields.textFontSettings?.fontWeight ?? 400,
|
|
4446
5508
|
fontStyle: fields.textFontSettings?.fontStyle ?? 'normal',
|
|
4447
5509
|
},
|
|
4448
|
-
fontSize:
|
|
4449
|
-
lineHeight:
|
|
5510
|
+
fontSize: fields.textFontSize ?? 0.01,
|
|
5511
|
+
lineHeight: fields.textLineHeight,
|
|
4450
5512
|
letterSpacing: fields.textLetterSpacing,
|
|
4451
5513
|
wordSpacing: fields.textWordSpacing,
|
|
4452
5514
|
textAppearance: fields.textTextAppearance,
|
|
@@ -4457,10 +5519,10 @@ function listColumnTextFieldsToCss(
|
|
|
4457
5519
|
}
|
|
4458
5520
|
|
|
4459
5521
|
function getListGlobalTextSyncUpdates(
|
|
4460
|
-
nextSettings:
|
|
4461
|
-
prevSettings:
|
|
4462
|
-
):
|
|
4463
|
-
const updates:
|
|
5522
|
+
nextSettings: ListSettings,
|
|
5523
|
+
prevSettings: ListSettings,
|
|
5524
|
+
): ListColumnTextStyleSyncUpdates | null {
|
|
5525
|
+
const updates: ListColumnTextStyleSyncUpdates = {};
|
|
4464
5526
|
let hasChanges = false;
|
|
4465
5527
|
|
|
4466
5528
|
for (const globalKey of LIST_GLOBAL_TEXT_STYLE_KEYS) {
|
|
@@ -4473,7 +5535,9 @@ function getListGlobalTextSyncUpdates(
|
|
|
4473
5535
|
|
|
4474
5536
|
hasChanges = true;
|
|
4475
5537
|
for (const prefix of COLUMN_TEXT_PREFIXES) {
|
|
4476
|
-
updates
|
|
5538
|
+
Object.assign(updates, {
|
|
5539
|
+
[getListColumnTextSettingKey(prefix, globalKey)]: nextSettings[globalKey],
|
|
5540
|
+
});
|
|
4477
5541
|
}
|
|
4478
5542
|
}
|
|
4479
5543
|
|
|
@@ -4517,6 +5581,27 @@ type ColumnPaddingLeftKey = typeof COLUMN_PADDING_LEFT_KEYS[number];
|
|
|
4517
5581
|
type ColumnPaddingRightKey = typeof COLUMN_PADDING_RIGHT_KEYS[number];
|
|
4518
5582
|
type ColumnPaddingBottomKey = typeof COLUMN_PADDING_BOTTOM_KEYS[number];
|
|
4519
5583
|
|
|
5584
|
+
type ListColumnPaddingUpdates = {
|
|
5585
|
+
AColumnPaddingLeft?: number;
|
|
5586
|
+
AColumnPaddingRight?: number;
|
|
5587
|
+
BColumnPaddingLeft?: number;
|
|
5588
|
+
BColumnPaddingRight?: number;
|
|
5589
|
+
CColumnPaddingLeft?: number;
|
|
5590
|
+
CColumnPaddingRight?: number;
|
|
5591
|
+
DColumnPaddingLeft?: number;
|
|
5592
|
+
DColumnPaddingRight?: number;
|
|
5593
|
+
EColumnPaddingLeft?: number;
|
|
5594
|
+
EColumnPaddingRight?: number;
|
|
5595
|
+
};
|
|
5596
|
+
|
|
5597
|
+
type ListColumnWidthUpdates = {
|
|
5598
|
+
AColumnWidth?: number;
|
|
5599
|
+
BColumnWidth?: number;
|
|
5600
|
+
CColumnWidth?: number;
|
|
5601
|
+
DColumnWidth?: number;
|
|
5602
|
+
EColumnWidth?: number;
|
|
5603
|
+
};
|
|
5604
|
+
|
|
4520
5605
|
type ListItemColumn = {
|
|
4521
5606
|
key: string;
|
|
4522
5607
|
textPrefix: typeof COLUMN_TEXT_PREFIXES[number];
|
|
@@ -4598,7 +5683,7 @@ const DEFAULT_COLUMN_WIDTHS: Record<ColumnWidthKey, number> = {
|
|
|
4598
5683
|
};
|
|
4599
5684
|
|
|
4600
5685
|
export function getListEffectiveContentWidth(
|
|
4601
|
-
settings:
|
|
5686
|
+
settings: ListSettings,
|
|
4602
5687
|
): number {
|
|
4603
5688
|
const wrapperWidth = typeof settings.wrapperWidth === 'number' ? settings.wrapperWidth : 1;
|
|
4604
5689
|
|
|
@@ -4632,7 +5717,7 @@ function getResetListColumnPaddingBottomUpdates(): Record<ColumnPaddingBottomKey
|
|
|
4632
5717
|
}
|
|
4633
5718
|
|
|
4634
5719
|
function getStoredColumnWidths(
|
|
4635
|
-
settings:
|
|
5720
|
+
settings: ListSettings,
|
|
4636
5721
|
): Record<ColumnWidthKey, number> {
|
|
4637
5722
|
return Object.fromEntries(
|
|
4638
5723
|
COLUMN_WIDTH_KEYS.map((key) => [
|
|
@@ -4690,9 +5775,9 @@ export function getEffectiveListColumnWidths(
|
|
|
4690
5775
|
function getListColumnPaddingUpdates(
|
|
4691
5776
|
columns: number,
|
|
4692
5777
|
effectiveWidths: number[],
|
|
4693
|
-
settings:
|
|
4694
|
-
):
|
|
4695
|
-
const updates:
|
|
5778
|
+
settings: ListSettings,
|
|
5779
|
+
): ListColumnPaddingUpdates {
|
|
5780
|
+
const updates: ListColumnPaddingUpdates = {};
|
|
4696
5781
|
|
|
4697
5782
|
for (let index = 0; index < columns; index += 1) {
|
|
4698
5783
|
const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
|
|
@@ -4767,13 +5852,13 @@ function getListColumnWidthUpdatesForWrapperWidth(
|
|
|
4767
5852
|
columns: number,
|
|
4768
5853
|
wrapperWidth: number,
|
|
4769
5854
|
storedWidths: Record<ColumnWidthKey, number>,
|
|
4770
|
-
):
|
|
5855
|
+
): ListColumnWidthUpdates {
|
|
4771
5856
|
if (columns <= 1) {
|
|
4772
5857
|
return {};
|
|
4773
5858
|
}
|
|
4774
5859
|
|
|
4775
5860
|
const resolvedWidths = resolveListColumnWidths(columns, wrapperWidth, storedWidths);
|
|
4776
|
-
const updates:
|
|
5861
|
+
const updates: ListColumnWidthUpdates = {};
|
|
4777
5862
|
|
|
4778
5863
|
for (let index = 0; index < columns - 1; index += 1) {
|
|
4779
5864
|
const key = COLUMN_WIDTH_KEYS[index];
|
|
@@ -4785,7 +5870,7 @@ function getListColumnWidthUpdatesForWrapperWidth(
|
|
|
4785
5870
|
return updates;
|
|
4786
5871
|
}
|
|
4787
5872
|
|
|
4788
|
-
function getColumnsOrder(settings:
|
|
5873
|
+
function getColumnsOrder(settings: ListSettings): string[] {
|
|
4789
5874
|
if (Array.isArray(settings.columnsOrder) && settings.columnsOrder.length > 0) {
|
|
4790
5875
|
return settings.columnsOrder as string[];
|
|
4791
5876
|
}
|
|
@@ -4804,7 +5889,7 @@ function areStringArraysEqual(left: string[], right: string[]): boolean {
|
|
|
4804
5889
|
function getColumnLayoutUpdatesForOrderChange(
|
|
4805
5890
|
nextOrder: string[],
|
|
4806
5891
|
prevOrder: string[],
|
|
4807
|
-
prevSettings:
|
|
5892
|
+
prevSettings: ListSettings,
|
|
4808
5893
|
columns: number,
|
|
4809
5894
|
): Record<string, number> {
|
|
4810
5895
|
const count = Math.min(columns, nextOrder.length, COLUMN_WIDTH_KEYS.length);
|
|
@@ -4853,15 +5938,20 @@ function getColumnLayoutUpdatesForOrderChange(
|
|
|
4853
5938
|
}
|
|
4854
5939
|
|
|
4855
5940
|
export function applyListSettingsChange(
|
|
4856
|
-
nextSettings:
|
|
4857
|
-
prevSettings:
|
|
5941
|
+
nextSettings: ListSettings,
|
|
5942
|
+
prevSettings: ListSettings,
|
|
4858
5943
|
options?: { designWidth?: number },
|
|
4859
|
-
):
|
|
5944
|
+
): ListSettings {
|
|
4860
5945
|
const textSyncUpdates = getListGlobalTextSyncUpdates(nextSettings, prevSettings);
|
|
4861
5946
|
if (textSyncUpdates) {
|
|
4862
5947
|
nextSettings = { ...nextSettings, ...textSyncUpdates };
|
|
4863
5948
|
}
|
|
4864
5949
|
|
|
5950
|
+
const valignSanitizeUpdates = getListColumnVerticalAlignSanitizeUpdates(nextSettings);
|
|
5951
|
+
if (valignSanitizeUpdates) {
|
|
5952
|
+
nextSettings = { ...nextSettings, ...valignSanitizeUpdates };
|
|
5953
|
+
}
|
|
5954
|
+
|
|
4865
5955
|
const minColumnWidth = getListMinColumnWidth(options?.designWidth);
|
|
4866
5956
|
const nextColumns = nextSettings.columns;
|
|
4867
5957
|
const prevColumns = prevSettings.columns;
|
|
@@ -4877,8 +5967,8 @@ export function applyListSettingsChange(
|
|
|
4877
5967
|
: COLUMN_CONTENT_KEYS.length;
|
|
4878
5968
|
|
|
4879
5969
|
const withColumnPaddingUpdates = (
|
|
4880
|
-
settings:
|
|
4881
|
-
):
|
|
5970
|
+
settings: ListSettings,
|
|
5971
|
+
): ListSettings => {
|
|
4882
5972
|
if (isVerticalLayout) {
|
|
4883
5973
|
return settings;
|
|
4884
5974
|
}
|
|
@@ -4902,7 +5992,7 @@ export function applyListSettingsChange(
|
|
|
4902
5992
|
};
|
|
4903
5993
|
|
|
4904
5994
|
if (typeof nextColumns === 'number' && nextColumns !== prevColumns) {
|
|
4905
|
-
const updates:
|
|
5995
|
+
const updates: ListSettings = {
|
|
4906
5996
|
...nextSettings,
|
|
4907
5997
|
...getEqualListColumnWidthUpdates(nextColumns, nextContentWidth),
|
|
4908
5998
|
...getResetListColumnPaddingUpdates(),
|
|
@@ -5009,7 +6099,7 @@ function randomBetween(min: number, max: number): number {
|
|
|
5009
6099
|
}
|
|
5010
6100
|
|
|
5011
6101
|
function getColumnWidthsFromSettings(
|
|
5012
|
-
settings:
|
|
6102
|
+
settings: ListSettings,
|
|
5013
6103
|
): Record<ColumnWidthKey, number> {
|
|
5014
6104
|
return Object.fromEntries(
|
|
5015
6105
|
COLUMN_WIDTH_KEYS.map((key) => [
|
|
@@ -5019,8 +6109,8 @@ function getColumnWidthsFromSettings(
|
|
|
5019
6109
|
) as Record<ColumnWidthKey, number>;
|
|
5020
6110
|
}
|
|
5021
6111
|
|
|
5022
|
-
function getNumericSettingValues<K extends
|
|
5023
|
-
settings:
|
|
6112
|
+
function getNumericSettingValues<K extends ColumnPaddingLeftKey | ColumnPaddingRightKey | ColumnPaddingBottomKey>(
|
|
6113
|
+
settings: ListSettings,
|
|
5024
6114
|
keys: readonly K[],
|
|
5025
6115
|
fallback = 0,
|
|
5026
6116
|
): Record<K, number> {
|
|
@@ -5208,10 +6298,10 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5208
6298
|
|
|
5209
6299
|
const prevSettings = prevSettingsRef.current;
|
|
5210
6300
|
const updatedSettings = applyListSettingsChange(
|
|
5211
|
-
settings
|
|
5212
|
-
prevSettings
|
|
6301
|
+
settings,
|
|
6302
|
+
prevSettings,
|
|
5213
6303
|
{ designWidth },
|
|
5214
|
-
)
|
|
6304
|
+
);
|
|
5215
6305
|
|
|
5216
6306
|
prevSettingsRef.current = settings;
|
|
5217
6307
|
|
|
@@ -5223,7 +6313,7 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5223
6313
|
}, [settings, onUpdateSettings, isEditor, layoutId, designWidth]);
|
|
5224
6314
|
|
|
5225
6315
|
const columnWidthByKey = useMemo(
|
|
5226
|
-
() => getColumnWidthsFromSettings(settings
|
|
6316
|
+
() => getColumnWidthsFromSettings(settings),
|
|
5227
6317
|
[
|
|
5228
6318
|
settings.AColumnWidth,
|
|
5229
6319
|
settings.BColumnWidth,
|
|
@@ -5234,7 +6324,7 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5234
6324
|
);
|
|
5235
6325
|
|
|
5236
6326
|
const columnPaddingLeftByKey = useMemo(
|
|
5237
|
-
() => getNumericSettingValues(settings
|
|
6327
|
+
() => getNumericSettingValues(settings, COLUMN_PADDING_LEFT_KEYS),
|
|
5238
6328
|
[
|
|
5239
6329
|
settings.AColumnPaddingLeft,
|
|
5240
6330
|
settings.BColumnPaddingLeft,
|
|
@@ -5245,7 +6335,7 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5245
6335
|
);
|
|
5246
6336
|
|
|
5247
6337
|
const columnPaddingRightByKey = useMemo(
|
|
5248
|
-
() => getNumericSettingValues(settings
|
|
6338
|
+
() => getNumericSettingValues(settings, COLUMN_PADDING_RIGHT_KEYS),
|
|
5249
6339
|
[
|
|
5250
6340
|
settings.AColumnPaddingRight,
|
|
5251
6341
|
settings.BColumnPaddingRight,
|
|
@@ -5256,7 +6346,7 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5256
6346
|
);
|
|
5257
6347
|
|
|
5258
6348
|
const columnPaddingBottomByKey = useMemo(
|
|
5259
|
-
() => getNumericSettingValues(settings
|
|
6349
|
+
() => getNumericSettingValues(settings, COLUMN_PADDING_BOTTOM_KEYS),
|
|
5260
6350
|
[
|
|
5261
6351
|
settings.AColumnPaddingBottom,
|
|
5262
6352
|
settings.BColumnPaddingBottom,
|
|
@@ -5285,7 +6375,7 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5285
6375
|
[columnContentOrder, columns, columnWidthByKey, columnPaddingLeftByKey, columnPaddingRightByKey, columnPaddingBottomByKey],
|
|
5286
6376
|
);
|
|
5287
6377
|
|
|
5288
|
-
const resolvedContentWidth = getListEffectiveContentWidth(settings
|
|
6378
|
+
const resolvedContentWidth = getListEffectiveContentWidth(settings);
|
|
5289
6379
|
|
|
5290
6380
|
const storedColumnWidths = useMemo(
|
|
5291
6381
|
() => COLUMN_WIDTH_KEYS.slice(0, columns).map((key) => columnWidthByKey[key]),
|
|
@@ -5401,6 +6491,137 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5401
6491
|
setHoverImage(null);
|
|
5402
6492
|
};
|
|
5403
6493
|
|
|
6494
|
+
const hasBaselineColumn = useMemo(
|
|
6495
|
+
() =>
|
|
6496
|
+
!isVerticalLayout &&
|
|
6497
|
+
COLUMN_TEXT_PREFIXES.some((prefix) => {
|
|
6498
|
+
const columnLetter = prefix.charAt(0);
|
|
6499
|
+
const valign = settings[\`\${prefix}VerticalAlign\` as ListColumnVerticalAlignKey];
|
|
6500
|
+
return isActiveBaselineVAlign(valign, settings, columnLetter);
|
|
6501
|
+
}),
|
|
6502
|
+
[
|
|
6503
|
+
isVerticalLayout,
|
|
6504
|
+
settings,
|
|
6505
|
+
settings.AColumnVerticalAlign,
|
|
6506
|
+
settings.BColumnVerticalAlign,
|
|
6507
|
+
settings.CColumnVerticalAlign,
|
|
6508
|
+
settings.DColumnVerticalAlign,
|
|
6509
|
+
settings.EColumnVerticalAlign,
|
|
6510
|
+
],
|
|
6511
|
+
);
|
|
6512
|
+
|
|
6513
|
+
useLayoutEffect(() => {
|
|
6514
|
+
const container = containerRef.current;
|
|
6515
|
+
if (!container) return;
|
|
6516
|
+
|
|
6517
|
+
const clearBaselineStyles = () => {
|
|
6518
|
+
container.querySelectorAll<HTMLElement>('[data-list-col]').forEach((el) => {
|
|
6519
|
+
el.style.transform = '';
|
|
6520
|
+
const title = el.querySelector<HTMLElement>(\`.\${P}-list-col-title\`);
|
|
6521
|
+
if (title) {
|
|
6522
|
+
title.style.paddingTop = '';
|
|
6523
|
+
title.style.marginTop = '';
|
|
6524
|
+
}
|
|
6525
|
+
});
|
|
6526
|
+
};
|
|
6527
|
+
|
|
6528
|
+
if (isVerticalLayout || !hasBaselineColumn) {
|
|
6529
|
+
clearBaselineStyles();
|
|
6530
|
+
return;
|
|
6531
|
+
}
|
|
6532
|
+
|
|
6533
|
+
const applyBaselines = () => {
|
|
6534
|
+
container.querySelectorAll<HTMLElement>('[data-list-row]').forEach((rowEl) => {
|
|
6535
|
+
const cols = Array.from(rowEl.querySelectorAll<HTMLElement>('[data-list-col]'));
|
|
6536
|
+
cols.forEach((el) => {
|
|
6537
|
+
el.style.transform = '';
|
|
6538
|
+
const title = el.querySelector<HTMLElement>(\`.\${P}-list-col-title\`);
|
|
6539
|
+
if (title) {
|
|
6540
|
+
title.style.paddingTop = '';
|
|
6541
|
+
title.style.marginTop = '';
|
|
6542
|
+
}
|
|
6543
|
+
});
|
|
6544
|
+
|
|
6545
|
+
type ColInfo = {
|
|
6546
|
+
el: HTMLElement;
|
|
6547
|
+
titleEl: HTMLElement | null;
|
|
6548
|
+
letter: string;
|
|
6549
|
+
kind: string;
|
|
6550
|
+
anchor: string | null;
|
|
6551
|
+
};
|
|
6552
|
+
|
|
6553
|
+
const probeClassName = \`\${P}-baseline-probe\`;
|
|
6554
|
+
const byLetter = new Map<string, ColInfo>();
|
|
6555
|
+
const infos: ColInfo[] = cols.map((el) => {
|
|
6556
|
+
const titleEl = el.querySelector<HTMLElement>(\`.\${P}-list-col-title\`);
|
|
6557
|
+
const info: ColInfo = {
|
|
6558
|
+
el,
|
|
6559
|
+
titleEl,
|
|
6560
|
+
letter: el.getAttribute('data-col-letter') ?? '',
|
|
6561
|
+
kind: el.getAttribute('data-valign') ?? 'top',
|
|
6562
|
+
anchor: el.getAttribute('data-valign-anchor'),
|
|
6563
|
+
};
|
|
6564
|
+
byLetter.set(info.letter, info);
|
|
6565
|
+
return info;
|
|
6566
|
+
});
|
|
6567
|
+
|
|
6568
|
+
const finalBaseline = new Map<string, number>();
|
|
6569
|
+
const resolve = (info: ColInfo, stack: Set<string>): number => {
|
|
6570
|
+
const cached = finalBaseline.get(info.letter);
|
|
6571
|
+
if (cached !== undefined) return cached;
|
|
6572
|
+
|
|
6573
|
+
const anchor = info.anchor ? byLetter.get(info.anchor) : undefined;
|
|
6574
|
+
if (info.kind !== 'baseline' || !anchor || stack.has(info.letter)) {
|
|
6575
|
+
const baseline = getTitleBaselinePageY(info.titleEl, probeClassName);
|
|
6576
|
+
finalBaseline.set(info.letter, baseline);
|
|
6577
|
+
return baseline;
|
|
6578
|
+
}
|
|
6579
|
+
|
|
6580
|
+
stack.add(info.letter);
|
|
6581
|
+
const anchorBaseline = resolve(anchor, stack);
|
|
6582
|
+
stack.delete(info.letter);
|
|
6583
|
+
|
|
6584
|
+
const followerNatural = getTitleBaselinePageY(info.titleEl, probeClassName);
|
|
6585
|
+
const shift = anchorBaseline - followerNatural;
|
|
6586
|
+
applyBaselineTitleShift(info.titleEl, shift);
|
|
6587
|
+
|
|
6588
|
+
const result = getTitleBaselinePageY(info.titleEl, probeClassName);
|
|
6589
|
+
finalBaseline.set(info.letter, result);
|
|
6590
|
+
return result;
|
|
6591
|
+
};
|
|
6592
|
+
|
|
6593
|
+
infos.forEach((info) => resolve(info, new Set<string>()));
|
|
6594
|
+
});
|
|
6595
|
+
};
|
|
6596
|
+
|
|
6597
|
+
applyBaselines();
|
|
6598
|
+
|
|
6599
|
+
const observer = new ResizeObserver(() => applyBaselines());
|
|
6600
|
+
observer.observe(container);
|
|
6601
|
+
|
|
6602
|
+
let cancelled = false;
|
|
6603
|
+
if (typeof document !== 'undefined' && document.fonts?.ready) {
|
|
6604
|
+
document.fonts.ready.then(() => {
|
|
6605
|
+
if (!cancelled) applyBaselines();
|
|
6606
|
+
});
|
|
6607
|
+
}
|
|
6608
|
+
|
|
6609
|
+
return () => {
|
|
6610
|
+
cancelled = true;
|
|
6611
|
+
observer.disconnect();
|
|
6612
|
+
clearBaselineStyles();
|
|
6613
|
+
};
|
|
6614
|
+
}, [
|
|
6615
|
+
hasBaselineColumn,
|
|
6616
|
+
isVerticalLayout,
|
|
6617
|
+
settings,
|
|
6618
|
+
content,
|
|
6619
|
+
designWidth,
|
|
6620
|
+
visibleRows,
|
|
6621
|
+
effectiveColumnWidths,
|
|
6622
|
+
columnTextCssByPrefix,
|
|
6623
|
+
]);
|
|
6624
|
+
|
|
5404
6625
|
return (
|
|
5405
6626
|
<>
|
|
5406
6627
|
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
@@ -5447,7 +6668,8 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5447
6668
|
/>
|
|
5448
6669
|
)}
|
|
5449
6670
|
<div
|
|
5450
|
-
className={\`\${P}-list-cols-row\`}
|
|
6671
|
+
className={\`\${P}-list-cols-row\${isVerticalLayout ? '' : \` \${P}-list-cols-row-h\`}\`}
|
|
6672
|
+
{...(isVerticalLayout ? {} : { 'data-list-row': '' })}
|
|
5451
6673
|
style={isVerticalLayout ? undefined : { minHeight: scaled(resolvedCellMinHeight) }}
|
|
5452
6674
|
>
|
|
5453
6675
|
{listColumns.map((col, colIndex) => {
|
|
@@ -5470,14 +6692,37 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5470
6692
|
paddingLeft: scaled(effectivePadding.paddingLeft),
|
|
5471
6693
|
paddingRight: scaled(effectivePadding.paddingRight),
|
|
5472
6694
|
};
|
|
6695
|
+
const columnLetter = col.textPrefix.charAt(0);
|
|
6696
|
+
const vAlign = isVerticalLayout
|
|
6697
|
+
? { kind: 'top' as const }
|
|
6698
|
+
: resolveColumnVerticalAlign(
|
|
6699
|
+
settings[\`\${col.textPrefix}VerticalAlign\` as ListColumnVerticalAlignKey],
|
|
6700
|
+
settings,
|
|
6701
|
+
columnLetter,
|
|
6702
|
+
);
|
|
5473
6703
|
|
|
5474
6704
|
return (
|
|
5475
|
-
<div
|
|
6705
|
+
<div
|
|
6706
|
+
key={col.key}
|
|
6707
|
+
{...(isVerticalLayout
|
|
6708
|
+
? {}
|
|
6709
|
+
: {
|
|
6710
|
+
'data-list-col': '',
|
|
6711
|
+
'data-col-letter': columnLetter,
|
|
6712
|
+
'data-valign': vAlign.kind,
|
|
6713
|
+
...(vAlign.kind === 'baseline'
|
|
6714
|
+
? { 'data-valign-anchor': vAlign.anchorLetter }
|
|
6715
|
+
: {}),
|
|
6716
|
+
})}
|
|
6717
|
+
>
|
|
5476
6718
|
<div
|
|
5477
6719
|
className={\`\${P}-list-col\${isLastColumn ? \` \${P}-list-col-last\` : ''}\`}
|
|
5478
6720
|
style={{
|
|
5479
6721
|
...columnPaddingStyle,
|
|
5480
6722
|
...columnSizeStyle,
|
|
6723
|
+
...(!isVerticalLayout
|
|
6724
|
+
? { justifyContent: vAlignToJustifyContent(vAlign.kind) }
|
|
6725
|
+
: {}),
|
|
5481
6726
|
}}
|
|
5482
6727
|
data-test={col.width}
|
|
5483
6728
|
>
|
|
@@ -5739,4 +6984,4 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
5739
6984
|
</>
|
|
5740
6985
|
);
|
|
5741
6986
|
}
|
|
5742
|
-
`,Fe=["A","B","C","D","E"],Hc={FontFamily:"textFontFamily",FontSettings:"textFontSettings",FontSize:"textFontSize",LineHeight:"textLineHeight",LetterSpacing:"textLetterSpacing",WordSpacing:"textWordSpacing",TextAppearance:"textTextAppearance"};function Et(t,e){return Go(t,Hc[e])}const Le={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Bc(t){return{type:"string",label:t,placeholder:"Add Title...",display:{type:"text-input"}}}function Rn(t){return{type:"number",scope:"layout",title:t,min:0,max:100,display:{type:"range-control"}}}function zc(){return Object.fromEntries(Fe.map((t,e)=>{const n=De[e],o=`${t} column`;return[n,Bc(o)]}))}function Dc(){const t={};for(const e of Fe)t[`${e}ColumnWidth`]=Rn(`${e} column width`),t[`${e}ColumnPaddingLeft`]=Rn(`${e} column padding left`),t[`${e}ColumnPaddingRight`]=Rn(`${e} column padding right`),t[`${e}ColumnPaddingBottom`]=Rn(`${e} column padding bottom`);return t}function Ti(t={}){const e={columns:5,wrapperWidth:1,columnsOrder:[...De]};for(const n of Fe)e[`${n}ColumnWidth`]=.2,e[`${n}ColumnPaddingLeft`]=0,e[`${n}ColumnPaddingRight`]=0,e[`${n}ColumnPaddingBottom`]=0;return{...e,...t}}function jc(t){return{[Et(t,"FontFamily")]:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},[Et(t,"FontSettings")]:{...Le.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},[Et(t,"FontSize")]:{...Le.fontSize,scope:"layout",title:"Font Size",display:{type:"font-size"}},[Et(t,"LineHeight")]:{...Le.lineHeight,scope:"layout",title:"Line Height",display:{type:"line-height-input"}},[Et(t,"LetterSpacing")]:{...Le.letterSpacing,scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},[Et(t,"WordSpacing")]:{...Le.wordSpacing,scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},[Et(t,"TextAppearance")]:{...Le.textAppearance,scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}}}}const Vc=qe.reduce((t,e)=>({...t,...jc(e)}),{}),Kc=qe.reduce((t,e)=>({...t,[Et(e,"FontFamily")]:"Arial",[Et(e,"FontSettings")]:{fontWeight:400,fontStyle:"normal"},[Et(e,"LetterSpacing")]:0,[Et(e,"WordSpacing")]:0,[Et(e,"TextAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Li(t){const{textFontSize:e,textLineHeight:n}=t;return qe.reduce((o,i)=>(e!==void 0&&(o[Et(i,"FontSize")]=e),n!==void 0&&(o[Et(i,"LineHeight")]=n),o),{})}const Uc=Fe.map(t=>`${t} column`),Gc=qe.map((t,e)=>({type:"group",title:Uc[e],items:[Et(t,"FontFamily"),Et(t,"FontSettings"),{type:"row",items:[Et(t,"FontSize"),Et(t,"LineHeight"),Et(t,"LetterSpacing"),Et(t,"WordSpacing")]},Et(t,"TextAppearance")]})),Yc=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],qc=["cutLabel","cutCellMinHeight","showCut"],Xc=[...Fe.flatMap(t=>[`${t}ColumnWidth`,`${t}ColumnPaddingLeft`,`${t}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"];function tn(t,e,n){return n.map(o=>({if:{name:t,value:e},then:{name:`properties.${o}.display.visible`,value:!1}}))}function ho(t,e){const n=t?` ${t}`:"";return{AColumn:`AColumn${n}`,BColumnWidth:`BColumnWidth${n}`,CColumnWidth:`CColumnWidth${n}`,DColumnWidth:`DColumnWidth${n}`,EColumnWidth:`EColumnWidth${n}`,image:e,link:""}}const Zc=[ho("",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"}),ho("2",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"}),ho("3",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"})],Jc=[...Fe.flatMap(t=>[`${t}ColumnWidth`,`${t}ColumnPaddingLeft`,`${t}ColumnPaddingRight`,`${t}ColumnPaddingBottom`]),"columnsOrder"],Qc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{...zc(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Zc}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["On","Off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["Top","Bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Cut",display:{type:"toggle-numeric-input",enum:["Off","On"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["All","Custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Dc(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},textFontSettings:{...Le.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},...Vc,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Kc,backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:Ti({type:"B",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.043,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043,...Li({textFontSize:.043,textLineHeight:.043})}),d:Ti({type:"A",textPaddingLR:.01,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01,...Li({textFontSize:.01,textLineHeight:.01})})},displayRules:[...tn("cut",0,qc),...tn("type","A",["textPaddingLR"]),...tn("type","B",Xc),...tn("type","A",["rowPaddingTopB"]),...tn("type","A",Fe.map(t=>`${t}ColumnPaddingBottom`))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Jc]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["entryHoverEffect"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]},{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"All text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]},...Gc]}],paletteBookmark:{items:[...Yc],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},td={element:Oc,id:"list",name:"Default List",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Qc,sourceCode:Nc},ed=[Ws,Os,Tl,Al,Vl,ql,ec,pc,td];exports.components=ed;exports.isSchemaV1=Cr;
|
|
6987
|
+
`,Et=["A","B","C","D","E"],Ni=[...zc,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],vd={FontFamily:"textFontFamily",FontSettings:"textFontSettings",FontSize:"textFontSize",LineHeight:"textLineHeight",LetterSpacing:"textLetterSpacing",WordSpacing:"textWordSpacing",TextAppearance:"textTextAppearance"};function Re(e,t){return ti(e,vd[t])}const Mt={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function bd(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Nn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function xd(){return Object.fromEntries(Et.map((e,t)=>{const n=Jt[t],o=`${e} column`;return[n,bd(o)]}))}function Cd(){const e={};for(const t of Et)e[`${t}ColumnWidth`]=Nn(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Nn(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Nn(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Nn(`${t} column padding bottom`);return e}function Oi(e={}){const t={columns:5,wrapperWidth:1,columnsOrder:[...Jt]};for(const n of Et)t[`${n}ColumnWidth`]=.2,t[`${n}ColumnPaddingLeft`]=0,t[`${n}ColumnPaddingRight`]=0,t[`${n}ColumnPaddingBottom`]=0;return{...t,...e}}function Sd(e){const t=e.charAt(0);return{[`${e}VerticalAlign`]:{type:"string",scope:"layout",title:"Vertical align",display:{type:"drop-down",enum:[...Ni],filterBaselineByTopAnchor:!0,columnLetter:t},enum:[...Ni]},[Re(e,"FontFamily")]:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},[Re(e,"FontSettings")]:{...Mt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},[Re(e,"FontSize")]:{...Mt.fontSize,scope:"layout",title:"Font Size",display:{type:"font-size"}},[Re(e,"LineHeight")]:{...Mt.lineHeight,scope:"layout",title:"Line Height",display:{type:"line-height-input"}},[Re(e,"LetterSpacing")]:{...Mt.letterSpacing,scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},[Re(e,"WordSpacing")]:{...Mt.wordSpacing,scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},[Re(e,"TextAppearance")]:{...Mt.textAppearance,scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}}}}const wd=Bt.reduce((e,t)=>({...e,...Sd(t)}),{}),$d=Bt.reduce((e,t)=>({...e,[`${t}VerticalAlign`]:"Top",[Re(t,"FontFamily")]:"Arial",[Re(t,"FontSettings")]:{fontWeight:400,fontStyle:"normal"},[Re(t,"LetterSpacing")]:0,[Re(t,"WordSpacing")]:0,[Re(t,"TextAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Hi(e){const{textFontSize:t,textLineHeight:n}=e;return Bt.reduce((o,i)=>(t!==void 0&&(o[`${i}TextFontSize`]=t),n!==void 0&&(o[`${i}TextLineHeight`]=n),o),{})}const Td=Et.map(e=>`${e} column`),Ld=Bt.map((e,t)=>({type:"group",title:Td[t],items:[Re(e,"FontFamily"),Re(e,"FontSettings"),{type:"row",items:[Re(e,"FontSize"),Re(e,"LineHeight"),Re(e,"LetterSpacing"),Re(e,"WordSpacing")]},Re(e,"TextAppearance"),`${e}VerticalAlign`]})),Ed=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],_d=["cutLabel","cutCellMinHeight","showCut"],Pd=[...Et.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"];function Co(e,t){const n=e?` ${e}`:"";return{AColumn:`AColumn${n}`,BColumnWidth:`BColumnWidth${n}`,CColumnWidth:`CColumnWidth${n}`,DColumnWidth:`DColumnWidth${n}`,EColumnWidth:`EColumnWidth${n}`,image:t,link:""}}const Ad=[Co("",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"}),Co("2",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"}),Co("3",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"})],Wd=[...Et.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Id={type:"object",version:1,properties:{content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{...xd(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Ad}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["On","Off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["Top","Bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Cut",display:{type:"toggle-numeric-input",enum:["Off","On"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["All","Custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Cd(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},textFontSettings:{...Mt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},...wd,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...$d,backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:Oi({type:"B",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.043,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043,...Hi({textFontSize:.043,textLineHeight:.043})}),d:Oi({type:"A",textPaddingLR:.01,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01,...Hi({textFontSize:.01,textLineHeight:.01})})},displayRules:[..._d.map(e=>({if:{name:"cut",value:0},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"A"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Pd.map(e=>({if:{name:"type",value:"B"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"A"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Et.map(e=>({if:{name:"type",value:"A"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),...Et.map(e=>({if:{name:"type",value:"B"},then:{name:`properties.${e}ColumnVerticalAlign.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Wd]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["entryHoverEffect"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]},{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"All text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]},...Ld]}],paletteBookmark:{items:[...Ed],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Fd={element:fd,id:"list",name:"Default List",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Id,sourceCode:yd},Rd=[Us,Qs,Vl,Xl,ac,fc,Cc,Ec,Oc,Fd];exports.components=Rd;exports.isSchemaV1=Nr;
|