@cntrl-site/components 1.0.11-alpha.7 → 1.0.11-alpha.9
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/List/List.d.ts +51 -34
- package/dist/index.js +1267 -651
- package/dist/index.mjs +4518 -3639
- 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"),g=require("react"),ve=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),po=require("react-dom");function ri(e){return e.type==="object"&&e.version===1}const oi="ControlSlider-module__wrapper___sHEkd",ii="ControlSlider-module__hoverArrow___A-dOH",ai="ControlSlider-module__sliderItem___QQSkR",li="ControlSlider-module__sliderImage___9hRl-",si="ControlSlider-module__arrow___05ghY",ci="ControlSlider-module__arrowVertical___tBfVN",di="ControlSlider-module__nextArrow___-30Yc",ui="ControlSlider-module__arrowInner___aEra3",pi="ControlSlider-module__arrowIcon___S4ztF",mi="ControlSlider-module__arrowImg___2dwJW",gi="ControlSlider-module__mirror___brd6U",hi="ControlSlider-module__pagination___bicLF",fi="ControlSlider-module__paginationInner___bT-P-",yi="ControlSlider-module__paginationVertical___zYqKw",vi="ControlSlider-module__paginationItem___nTRbk",bi="ControlSlider-module__dot___p1Qun",xi="ControlSlider-module__activeDot___LHFaj",Ci="ControlSlider-module__paginationInsideBottom___R3FWn",Si="ControlSlider-module__paginationInsideTop___V-qb-",$i="ControlSlider-module__paginationOutsideBottom___14w8D",wi="ControlSlider-module__paginationOutsideTop___SCLqB",Ti="ControlSlider-module__paginationInsideLeft___yOBRZ",Li="ControlSlider-module__paginationInsideRight___Rtt3o",_i="ControlSlider-module__paginationOutsideLeft___lahaw",Wi="ControlSlider-module__paginationOutsideRight___EtuQa",Ei="ControlSlider-module__imgWrapper___UjEgB",Pi="ControlSlider-module__captionBlock___dJ6-j",Ai="ControlSlider-module__captionTextWrapper___HFlpf",Ii="ControlSlider-module__captionText___uGBVc",Ri="ControlSlider-module__active___WZK4G",ki="ControlSlider-module__withPointerEvents___t-18M",Fi="ControlSlider-module__topLeftAlignment___zjnGM",Mi="ControlSlider-module__topCenterAlignment___gD1xW",Hi="ControlSlider-module__topRightAlignment___NMapS",Ni="ControlSlider-module__middleLeftAlignment___OnUrY",Oi="ControlSlider-module__middleCenterAlignment___Tdkl0",Bi="ControlSlider-module__middleRightAlignment___wEbfX",Di="ControlSlider-module__bottomLeftAlignment___cTP2-",ji="ControlSlider-module__bottomCenterAlignment___c54fB",zi="ControlSlider-module__bottomRightAlignment___kEwrz",Vi="ControlSlider-module__clickOverlay___DZA28",Ki="ControlSlider-module__contain___pLyq7",Gi="ControlSlider-module__cover___KdDat",te={wrapper:oi,hoverArrow:ii,sliderItem:ai,sliderImage:li,arrow:si,arrowVertical:ci,nextArrow:di,arrowInner:ui,arrowIcon:pi,arrowImg:mi,mirror:gi,pagination:hi,paginationInner:fi,paginationVertical:yi,paginationItem:vi,dot:bi,activeDot:xi,paginationInsideBottom:Ci,paginationInsideTop:Si,paginationOutsideBottom:$i,paginationOutsideTop:wi,paginationInsideLeft:Ti,paginationInsideRight:Li,paginationOutsideLeft:_i,paginationOutsideRight:Wi,imgWrapper:Ei,captionBlock:Pi,captionTextWrapper:Ai,captionText:Ii,active:Ri,withPointerEvents:ki,topLeftAlignment:Fi,topCenterAlignment:Mi,topRightAlignment:Hi,middleLeftAlignment:Ni,middleCenterAlignment:Oi,middleRightAlignment:Bi,bottomLeftAlignment:Di,bottomCenterAlignment:ji,bottomRightAlignment:zi,clickOverlay:Vi,contain:Ki,cover:Gi};function Ui(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qi(e,t,n){return t&&Ui(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Nr="(prefers-reduced-motion: reduce)",Ft=1,Yi=2,Nt=3,Dt=4,rn=5,wn=6,An=7,Xi={CREATED:Ft,MOUNTED:Yi,IDLE:Nt,MOVING:Dt,SCROLLING:rn,DRAGGING:wn,DESTROYED:An};function pt(e){e.length=0}function xt(e,t,n){return Array.prototype.slice.call(e,t,n)}function $e(e){return e.bind.apply(e,[null].concat(xt(arguments,1)))}var mo=setTimeout,ir=function(){};function Or(e){return requestAnimationFrame(e)}function On(e,t){return typeof t===e}function qt(e){return!hr(e)&&On("object",e)}var gr=Array.isArray,go=$e(On,"function"),vt=$e(On,"string"),on=$e(On,"undefined");function hr(e){return e===null}function ho(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function an(e){return gr(e)?e:[e]}function Ye(e,t){an(e).forEach(t)}function fr(e,t){return e.indexOf(t)>-1}function Tn(e,t){return e.push.apply(e,an(t)),e}function st(e,t,n){e&&Ye(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function rt(e,t){st(e,vt(t)?t.split(" "):t,!0)}function ln(e,t){Ye(t,e.appendChild.bind(e))}function yr(e,t){Ye(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function Yt(e,t){return ho(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function fo(e,t){var n=e?xt(e.children):[];return t?n.filter(function(r){return Yt(r,t)}):n}function sn(e,t){return t?fo(e,t)[0]:e.firstElementChild}var Xt=Object.keys;function Tt(e,t,n){return e&&(n?Xt(e).reverse():Xt(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function Zt(e){return xt(arguments,1).forEach(function(t){Tt(t,function(n,r){e[r]=t[r]})}),e}function ft(e){return xt(arguments,1).forEach(function(t){Tt(t,function(n,r){gr(n)?e[r]=n.slice():qt(n)?e[r]=ft({},qt(e[r])?e[r]:{},n):e[r]=n})}),e}function Br(e,t){Ye(t||Xt(e),function(n){delete e[n]})}function ot(e,t){Ye(e,function(n){Ye(t,function(r){n&&n.removeAttribute(r)})})}function de(e,t,n){qt(t)?Tt(t,function(r,o){de(e,o,r)}):Ye(e,function(r){hr(n)||n===""?ot(r,t):r.setAttribute(t,String(n))})}function Mt(e,t,n){var r=document.createElement(e);return t&&(vt(t)?rt(r,t):de(r,t)),n&&ln(n,r),r}function Je(e,t,n){if(on(n))return getComputedStyle(e)[t];hr(n)||(e.style[t]=""+n)}function Jt(e,t){Je(e,"display",t)}function yo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Qe(e,t){return e.getAttribute(t)}function Dr(e,t){return e&&e.classList.contains(t)}function Ue(e){return e.getBoundingClientRect()}function Lt(e){Ye(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function vo(e){return sn(new DOMParser().parseFromString(e,"text/html").body)}function lt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function bo(e,t){return e&&e.querySelector(t)}function vr(e,t){return t?xt(e.querySelectorAll(t)):[]}function ct(e,t){st(e,t,!1)}function ar(e){return e.timeStamp}function $t(e){return vt(e)?e:e?e+"px":""}var cn="splide",br="data-"+cn;function Gt(e,t){if(!e)throw new Error("["+cn+"] "+(t||""))}var bt=Math.min,In=Math.max,Rn=Math.floor,Qt=Math.ceil,Ne=Math.abs;function xo(e,t,n){return Ne(e-t)<n}function Ln(e,t,n,r){var o=bt(t,n),l=In(t,n);return r?o<e&&e<l:o<=e&&e<=l}function It(e,t,n){var r=bt(t,n),o=In(t,n);return bt(In(r,e),o)}function lr(e){return+(e>0)-+(e<0)}function sr(e,t){return Ye(t,function(n){e=e.replace("%s",""+n)}),e}function xr(e){return e<10?"0"+e:""+e}var jr={};function Zi(e){return""+e+xr(jr[e]=(jr[e]||0)+1)}function Co(){var e=[];function t(i,c,s,u){o(i,c,function(d,L,b){var f="addEventListener"in d,p=f?d.removeEventListener.bind(d,L,s,u):d.removeListener.bind(d,s);f?d.addEventListener(L,s,u):d.addListener(s),e.push([d,L,b,s,p])})}function n(i,c,s){o(i,c,function(u,d,L){e=e.filter(function(b){return b[0]===u&&b[1]===d&&b[2]===L&&(!s||b[3]===s)?(b[4](),!1):!0})})}function r(i,c,s){var u,d=!0;return typeof CustomEvent=="function"?u=new CustomEvent(c,{bubbles:d,detail:s}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(c,d,!1,s)),i.dispatchEvent(u),u}function o(i,c,s){Ye(i,function(u){u&&Ye(c,function(d){d.split(" ").forEach(function(L){var b=L.split(".");s(u,b[0],b[1])})})})}function l(){e.forEach(function(i){i[4]()}),pt(e)}return{bind:t,unbind:n,dispatch:r,destroy:l}}var Ct="mounted",cr="ready",mt="move",jt="moved",Cr="click",So="active",$o="inactive",wo="visible",To="hidden",_e="refresh",ke="updated",Ot="resize",Bn="resized",Lo="drag",_o="dragging",Wo="dragged",Dn="scroll",Wt="scrolled",Ji="overflow",Sr="destroy",Eo="arrows:mounted",Po="arrows:updated",Ao="pagination:mounted",Io="pagination:updated",$r="navigation:mounted",wr="autoplay:play",Ro="autoplay:playing",Tr="autoplay:pause",Lr="lazyload:loaded",ko="sk",Fo="sh",kn="ei";function Te(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Co();function r(l,i){n.bind(t,an(l).join(" "),function(c){i.apply(i,gr(c.detail)?c.detail:[])})}function o(l){n.dispatch(t,l,xt(arguments,1))}return e&&e.event.on(Sr,n.destroy),Zt(n,{bus:t,on:r,off:$e(n.unbind,t),emit:o})}function jn(e,t,n,r){var o=Date.now,l,i=0,c,s=!0,u=0;function d(){if(!s){if(i=e?bt((o()-l)/e,1):1,n&&n(i),i>=1&&(t(),l=o(),r&&++u>=r))return b();c=Or(d)}}function L(h){h||p(),l=o()-(h?i*e:0),s=!1,c=Or(d)}function b(){s=!0}function f(){l=o(),i=0,n&&n(i)}function p(){c&&cancelAnimationFrame(c),i=0,c=0,s=!0}function m(h){e=h}function v(){return s}return{start:L,rewind:f,pause:b,cancel:p,set:m,isPaused:v}}function Qi(e){var t=e;function n(o){t=o}function r(o){return fr(an(o),t)}return{set:n,is:r}}function ea(e,t){var n=jn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ta(e,t,n){var r=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},i=Co(),c=[];function s(){var p=n.mediaQuery==="min";Xt(o).sort(function(m,v){return p?+m-+v:+v-+m}).forEach(function(m){d(o[m],"("+(p?"min":"max")+"-width:"+m+"px)")}),d(l,Nr),L()}function u(p){p&&i.destroy()}function d(p,m){var v=matchMedia(m);i.bind(v,"change",L),c.push([p,v])}function L(){var p=r.is(An),m=n.direction,v=c.reduce(function(h,S){return ft(h,S[1].matches?S[0]:{})},{});Br(n),f(v),n.destroy?e.destroy(n.destroy==="completely"):p?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function b(p){matchMedia(Nr).matches&&(p?ft(n,l):Br(n,Xt(l)))}function f(p,m,v){ft(n,p),m&&ft(Object.getPrototypeOf(n),p),(v||!r.is(Ft))&&e.emit(ke,n)}return{setup:s,destroy:u,reduce:b,set:f}}var zn="Arrow",Vn=zn+"Left",Kn=zn+"Right",Mo=zn+"Up",Ho=zn+"Down",zr="rtl",Gn="ttb",Qn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Mo,Kn],ArrowRight:[Ho,Vn]};function na(e,t,n){function r(l,i,c){c=c||n.direction;var s=c===zr&&!i?1:c===Gn?0:-1;return Qn[l]&&Qn[l][s]||l.replace(/width|left|right/i,function(u,d){var L=Qn[u.toLowerCase()][s]||u;return d>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function o(l){return l*(n.direction===zr?1:-1)}return{resolve:r,orient:o}}var dt="role",Ht="tabindex",ra="disabled",tt="aria-",dn=tt+"controls",No=tt+"current",Vr=tt+"selected",qe=tt+"label",_r=tt+"labelledby",Oo=tt+"hidden",Wr=tt+"orientation",en=tt+"roledescription",Kr=tt+"live",Gr=tt+"busy",Ur=tt+"atomic",Er=[dt,Ht,ra,dn,No,qe,_r,Oo,Wr,en],it=cn+"__",St="is-",er=cn,qr=it+"track",oa=it+"list",Un=it+"slide",Bo=Un+"--clone",ia=Un+"__container",Pr=it+"arrows",qn=it+"arrow",Do=qn+"--prev",jo=qn+"--next",Yn=it+"pagination",zo=Yn+"__page",aa=it+"progress",la=aa+"__bar",sa=it+"toggle",ca=it+"spinner",da=it+"sr",ua=St+"initialized",_t=St+"active",Vo=St+"prev",Ko=St+"next",dr=St+"visible",ur=St+"loading",Go=St+"focus-in",Uo=St+"overflow",pa=[_t,dr,Vo,Ko,ur,Go,Uo],ma={slide:Un,clone:Bo,arrows:Pr,arrow:qn,prev:Do,next:jo,pagination:Yn,page:zo,spinner:ca};function ga(e,t){if(go(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Yt(n,t);)n=n.parentElement;return n}var ha=5,Yr=200,qo="touchstart mousedown",tr="touchmove mousemove",nr="touchend touchcancel mouseup click";function fa(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=e.root,c=n.i18n,s={},u=[],d=[],L=[],b,f,p;function m(){T(),z(),S()}function v(){o(_e,h),o(_e,m),o(ke,S),l(document,qo+" keydown",function(y){p=y.type==="keydown"},{capture:!0}),l(i,"focusin",function(){st(i,Go,!!p)})}function h(y){var x=Er.concat("style");pt(u),ct(i,d),ct(b,L),ot([b,f],x),ot(i,y?x:["style",en])}function S(){ct(i,d),ct(b,L),d=_(er),L=_(qr),rt(i,d),rt(b,L),de(i,qe,n.label),de(i,_r,n.labelledby)}function T(){b=F("."+qr),f=sn(b,"."+oa),Gt(b&&f,"A track/list element is missing."),Tn(u,fo(f,"."+Un+":not(."+Bo+")")),Tt({arrows:Pr,pagination:Yn,prev:Do,next:jo,bar:la,toggle:sa},function(y,x){s[x]=F("."+y)}),Zt(s,{root:i,track:b,list:f,slides:u})}function z(){var y=i.id||Zi(cn),x=n.role;i.id=y,b.id=b.id||y+"-track",f.id=f.id||y+"-list",!Qe(i,dt)&&i.tagName!=="SECTION"&&x&&de(i,dt,x),de(i,en,c.carousel),de(f,dt,"presentation")}function F(y){var x=bo(i,y);return x&&ga(x,"."+er)===i?x:void 0}function _(y){return[y+"--"+n.type,y+"--"+n.direction,n.drag&&y+"--draggable",n.isNavigation&&y+"--nav",y===er&&_t]}return Zt(s,{setup:m,mount:v,destroy:h})}var Bt="slide",zt="loop",un="fade";function ya(e,t,n,r){var o=Te(e),l=o.on,i=o.emit,c=o.bind,s=e.Components,u=e.root,d=e.options,L=d.isNavigation,b=d.updateOnMove,f=d.i18n,p=d.pagination,m=d.slideFocus,v=s.Direction.resolve,h=Qe(r,"style"),S=Qe(r,qe),T=n>-1,z=sn(r,"."+ia),F;function _(){T||(r.id=u.id+"-slide"+xr(t+1),de(r,dt,p?"tabpanel":"group"),de(r,en,f.slide),de(r,qe,S||sr(f.slideLabel,[t+1,e.length]))),y()}function y(){c(r,"click",$e(i,Cr,I)),c(r,"keydown",$e(i,ko,I)),l([jt,Fo,Wt],P),l($r,E),b&&l(mt,O)}function x(){F=!0,o.destroy(),ct(r,pa),ot(r,Er),de(r,"style",h),de(r,qe,S||"")}function E(){var k=e.splides.map(function(W){var M=W.splide.Components.Slides.getAt(t);return M?M.slide.id:""}).join(" ");de(r,qe,sr(f.slideX,(T?n:t)+1)),de(r,dn,k),de(r,dt,m?"button":""),m&&ot(r,en)}function O(){F||P()}function P(){if(!F){var k=e.index;H(),N(),st(r,Vo,t===k-1),st(r,Ko,t===k+1)}}function H(){var k=V();k!==Dr(r,_t)&&(st(r,_t,k),de(r,No,L&&k||""),i(k?So:$o,I))}function N(){var k=C(),W=!k&&(!V()||T);if(e.state.is([Dt,rn])||de(r,Oo,W||""),de(vr(r,d.focusableNodes||""),Ht,W?-1:""),m&&de(r,Ht,W?-1:0),k!==Dr(r,dr)&&(st(r,dr,k),i(k?wo:To,I)),!k&&document.activeElement===r){var M=s.Slides.getAt(e.index);M&&yo(M.slide)}}function D(k,W,M){Je(M&&z||r,k,W)}function V(){var k=e.index;return k===t||d.cloneStatus&&k===n}function C(){if(e.is(un))return V();var k=Ue(s.Elements.track),W=Ue(r),M=v("left",!0),Z=v("right",!0);return Rn(k[M])<=Qt(W[M])&&Rn(W[Z])<=Qt(k[Z])}function A(k,W){var M=Ne(k-t);return!T&&(d.rewind||e.is(zt))&&(M=bt(M,e.length-M)),M<=W}var I={index:t,slideIndex:n,slide:r,container:z,isClone:T,mount:_,destroy:x,update:P,style:D,isWithin:A};return I}function va(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=r.bind,c=t.Elements,s=c.slides,u=c.list,d=[];function L(){b(),o(_e,f),o(_e,b)}function b(){s.forEach(function(P,H){m(P,H,-1)})}function f(){F(function(P){P.destroy()}),pt(d)}function p(){F(function(P){P.update()})}function m(P,H,N){var D=ya(e,H,N,P);D.mount(),d.push(D),d.sort(function(V,C){return V.index-C.index})}function v(P){return P?_(function(H){return!H.isClone}):d}function h(P){var H=t.Controller,N=H.toIndex(P),D=H.hasFocus()?1:n.perPage;return _(function(V){return Ln(V.index,N,N+D-1)})}function S(P){return _(P)[0]}function T(P,H){Ye(P,function(N){if(vt(N)&&(N=vo(N)),ho(N)){var D=s[H];D?yr(N,D):ln(u,N),rt(N,n.classes.slide),x(N,$e(l,Ot))}}),l(_e)}function z(P){Lt(_(P).map(function(H){return H.slide})),l(_e)}function F(P,H){v(H).forEach(P)}function _(P){return d.filter(go(P)?P:function(H){return vt(P)?Yt(H.slide,P):fr(an(P),H.index)})}function y(P,H,N){F(function(D){D.style(P,H,N)})}function x(P,H){var N=vr(P,"img"),D=N.length;D?N.forEach(function(V){i(V,"load error",function(){--D||H()})}):H()}function E(P){return P?s.length:d.length}function O(){return d.length>n.perPage}return{mount:L,destroy:f,update:p,register:m,get:v,getIn:h,getAt:S,add:T,remove:z,forEach:F,filter:_,style:y,getLength:E,isEnough:O}}function ba(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=r.emit,c=t.Slides,s=t.Direction.resolve,u=t.Elements,d=u.root,L=u.track,b=u.list,f=c.getAt,p=c.style,m,v,h;function S(){T(),l(window,"resize load",ea($e(i,Ot))),o([ke,_e],T),o(Ot,z)}function T(){m=n.direction===Gn,Je(d,"maxWidth",$t(n.width)),Je(L,s("paddingLeft"),F(!1)),Je(L,s("paddingRight"),F(!0)),z(!0)}function z(I){var k=Ue(d);(I||v.width!==k.width||v.height!==k.height)&&(Je(L,"height",_()),p(s("marginRight"),$t(n.gap)),p("width",x()),p("height",E(),!0),v=k,i(Bn),h!==(h=A())&&(st(d,Uo,h),i(Ji,h)))}function F(I){var k=n.padding,W=s(I?"right":"left");return k&&$t(k[W]||(qt(k)?0:k))||"0px"}function _(){var I="";return m&&(I=y(),Gt(I,"height or heightRatio is missing."),I="calc("+I+" - "+F(!1)+" - "+F(!0)+")"),I}function y(){return $t(n.height||Ue(b).width*n.heightRatio)}function x(){return n.autoWidth?null:$t(n.fixedWidth)||(m?"":O())}function E(){return $t(n.fixedHeight)||(m?n.autoHeight?null:O():y())}function O(){var I=$t(n.gap);return"calc((100%"+(I&&" + "+I)+")/"+(n.perPage||1)+(I&&" - "+I)+")"}function P(){return Ue(b)[s("width")]}function H(I,k){var W=f(I||0);return W?Ue(W.slide)[s("width")]+(k?0:V()):0}function N(I,k){var W=f(I);if(W){var M=Ue(W.slide)[s("right")],Z=Ue(b)[s("left")];return Ne(M-Z)+(k?0:V())}return 0}function D(I){return N(e.length-1)-N(0)+H(0,I)}function V(){var I=f(0);return I&&parseFloat(Je(I.slide,s("marginRight")))||0}function C(I){return parseFloat(Je(L,s("padding"+(I?"Right":"Left"))))||0}function A(){return e.is(un)||D(!0)>P()}return{mount:S,resize:z,listSize:P,slideSize:H,sliderSize:D,totalSize:N,getPadding:C,isOverflow:A}}var xa=2;function Ca(e,t,n){var r=Te(e),o=r.on,l=t.Elements,i=t.Slides,c=t.Direction.resolve,s=[],u;function d(){o(_e,L),o([ke,Ot],f),(u=v())&&(p(u),t.Layout.resize(!0))}function L(){b(),d()}function b(){Lt(s),pt(s),r.destroy()}function f(){var h=v();u!==h&&(u<h||!h)&&r.emit(_e)}function p(h){var S=i.get().slice(),T=S.length;if(T){for(;S.length<h;)Tn(S,S);Tn(S.slice(-h),S.slice(0,h)).forEach(function(z,F){var _=F<h,y=m(z.slide,F);_?yr(y,S[0].slide):ln(l.list,y),Tn(s,y),i.register(y,F-h+(_?0:T),z.index)})}}function m(h,S){var T=h.cloneNode(!0);return rt(T,n.classes.clone),T.id=e.root.id+"-clone"+xr(S+1),T}function v(){var h=n.clones;if(!e.is(zt))h=0;else if(on(h)){var S=n[c("fixedWidth")]&&t.Layout.slideSize(0),T=S&&Qt(Ue(l.track)[c("width")]/S);h=T||n[c("autoWidth")]&&e.length||n.perPage*xa}return h}return{mount:d,destroy:b}}function Sa(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=e.state.set,c=t.Layout,s=c.slideSize,u=c.getPadding,d=c.totalSize,L=c.listSize,b=c.sliderSize,f=t.Direction,p=f.resolve,m=f.orient,v=t.Elements,h=v.list,S=v.track,T;function z(){T=t.Transition,o([Ct,Bn,ke,_e],F)}function F(){t.Controller.isBusy()||(t.Scroll.cancel(),y(e.index),t.Slides.update())}function _(W,M,Z,ae){W!==M&&I(W>Z)&&(P(),x(O(D(),W>Z),!0)),i(Dt),l(mt,M,Z,W),T.start(M,function(){i(Nt),l(jt,M,Z,W),ae&&ae()})}function y(W){x(N(W,!0))}function x(W,M){if(!e.is(un)){var Z=M?W:E(W);Je(h,"transform","translate"+p("X")+"("+Z+"px)"),W!==Z&&l(Fo)}}function E(W){if(e.is(zt)){var M=H(W),Z=M>t.Controller.getEnd(),ae=M<0;(ae||Z)&&(W=O(W,Z))}return W}function O(W,M){var Z=W-A(M),ae=b();return W-=m(ae*(Qt(Ne(Z)/ae)||1))*(M?1:-1),W}function P(){x(D(),!0),T.cancel()}function H(W){for(var M=t.Slides.get(),Z=0,ae=1/0,ne=0;ne<M.length;ne++){var ue=M[ne].index,R=Ne(N(ue,!0)-W);if(R<=ae)ae=R,Z=ue;else break}return Z}function N(W,M){var Z=m(d(W-1)-C(W));return M?V(Z):Z}function D(){var W=p("left");return Ue(h)[W]-Ue(S)[W]+m(u(!1))}function V(W){return n.trimSpace&&e.is(Bt)&&(W=It(W,0,m(b(!0)-L()))),W}function C(W){var M=n.focus;return M==="center"?(L()-s(W,!0))/2:+M*s(W)||0}function A(W){return N(W?t.Controller.getEnd():0,!!n.trimSpace)}function I(W){var M=m(O(D(),W));return W?M>=0:M<=h[p("scrollWidth")]-Ue(S)[p("width")]}function k(W,M){M=on(M)?D():M;var Z=W!==!0&&m(M)<m(A(!1)),ae=W!==!1&&m(M)>m(A(!0));return Z||ae}return{mount:z,move:_,jump:y,translate:x,shift:O,cancel:P,toIndex:H,toPosition:N,getPosition:D,getLimit:A,exceededLimit:k,reposition:F}}function $a(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=t.Move,c=i.getPosition,s=i.getLimit,u=i.toPosition,d=t.Slides,L=d.isEnough,b=d.getLength,f=n.omitEnd,p=e.is(zt),m=e.is(Bt),v=$e(D,!1),h=$e(D,!0),S=n.start||0,T,z=S,F,_,y;function x(){E(),o([ke,_e,kn],E),o(Bn,O)}function E(){F=b(!0),_=n.perMove,y=n.perPage,T=I();var R=It(S,0,f?T:F-1);R!==S&&(S=R,i.reposition())}function O(){T!==I()&&l(kn)}function P(R,re,he){if(!ue()){var me=N(R),ge=A(me);ge>-1&&(re||ge!==S)&&(Z(ge),i.move(me,ge,z,he))}}function H(R,re,he,me){t.Scroll.scroll(R,re,he,function(){var ge=A(i.toIndex(c()));Z(f?bt(ge,T):ge),me&&me()})}function N(R){var re=S;if(vt(R)){var he=R.match(/([+\-<>])(\d+)?/)||[],me=he[1],ge=he[2];me==="+"||me==="-"?re=V(S+ +(""+me+(+ge||1)),S):me===">"?re=ge?k(+ge):v(!0):me==="<"&&(re=h(!0))}else re=p?R:It(R,0,T);return re}function D(R,re){var he=_||(ne()?1:y),me=V(S+he*(R?-1:1),S,!(_||ne()));return me===-1&&m&&!xo(c(),s(!R),1)?R?0:T:re?me:A(me)}function V(R,re,he){if(L()||ne()){var me=C(R);me!==R&&(re=R,R=me,he=!1),R<0||R>T?!_&&(Ln(0,R,re,!0)||Ln(T,re,R,!0))?R=k(W(R)):p?R=he?R<0?-(F%y||y):F:R:n.rewind?R=R<0?T:0:R=-1:he&&R!==re&&(R=k(W(re)+(R<re?-1:1)))}else R=-1;return R}function C(R){if(m&&n.trimSpace==="move"&&R!==S)for(var re=c();re===u(R,!0)&&Ln(R,0,e.length-1,!n.rewind);)R<S?--R:++R;return R}function A(R){return p?(R+F)%F||0:R}function I(){for(var R=F-(ne()||p&&_?1:y);f&&R-- >0;)if(u(F-1,!0)!==u(R,!0)){R++;break}return It(R,0,F-1)}function k(R){return It(ne()?R:y*R,0,T)}function W(R){return ne()?bt(R,T):Rn((R>=T?F-1:R)/y)}function M(R){var re=i.toIndex(R);return m?It(re,0,T):re}function Z(R){R!==S&&(z=S,S=R)}function ae(R){return R?z:S}function ne(){return!on(n.focus)||n.isNavigation}function ue(){return e.state.is([Dt,rn])&&!!n.waitForTransition}return{mount:x,go:P,scroll:H,getNext:v,getPrev:h,getAdjacent:D,getEnd:I,setIndex:Z,getIndex:ae,toIndex:k,toPage:W,toDest:M,hasFocus:ne,isBusy:ue}}var wa="http://www.w3.org/2000/svg",Ta="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",yn=40;function La(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=r.emit,c=n.classes,s=n.i18n,u=t.Elements,d=t.Controller,L=u.arrows,b=u.track,f=L,p=u.prev,m=u.next,v,h,S={};function T(){F(),o(ke,z)}function z(){_(),T()}function F(){var H=n.arrows;H&&!(p&&m)&&E(),p&&m&&(Zt(S,{prev:p,next:m}),Jt(f,H?"":"none"),rt(f,h=Pr+"--"+n.direction),H&&(y(),P(),de([p,m],dn,b.id),i(Eo,p,m)))}function _(){r.destroy(),ct(f,h),v?(Lt(L?[p,m]:f),p=m=null):ot([p,m],Er)}function y(){o([Ct,jt,_e,Wt,kn],P),l(m,"click",$e(x,">")),l(p,"click",$e(x,"<"))}function x(H){d.go(H,!0)}function E(){f=L||Mt("div",c.arrows),p=O(!0),m=O(!1),v=!0,ln(f,[p,m]),!L&&yr(f,b)}function O(H){var N='<button class="'+c.arrow+" "+(H?c.prev:c.next)+'" type="button"><svg xmlns="'+wa+'" viewBox="0 0 '+yn+" "+yn+'" width="'+yn+'" height="'+yn+'" focusable="false"><path d="'+(n.arrowPath||Ta)+'" />';return vo(N)}function P(){if(p&&m){var H=e.index,N=d.getPrev(),D=d.getNext(),V=N>-1&&H<N?s.last:s.prev,C=D>-1&&H>D?s.first:s.next;p.disabled=N<0,m.disabled=D<0,de(p,qe,V),de(m,qe,C),i(Po,p,m,N,D)}}return{arrows:S,mount:T,destroy:_,update:P}}var _a=br+"-interval";function Wa(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=r.emit,c=jn(n.interval,e.go.bind(e,">"),y),s=c.isPaused,u=t.Elements,d=t.Elements,L=d.root,b=d.toggle,f=n.autoplay,p,m,v=f==="pause";function h(){f&&(S(),b&&de(b,dn,u.track.id),v||T(),_())}function S(){n.pauseOnHover&&l(L,"mouseenter mouseleave",function(E){p=E.type==="mouseenter",F()}),n.pauseOnFocus&&l(L,"focusin focusout",function(E){m=E.type==="focusin",F()}),b&&l(b,"click",function(){v?T():z(!0)}),o([mt,Dn,_e],c.rewind),o(mt,x)}function T(){s()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),m=p=v=!1,_(),i(wr))}function z(E){E===void 0&&(E=!0),v=!!E,_(),s()||(c.pause(),i(Tr))}function F(){v||(p||m?z(!1):T())}function _(){b&&(st(b,_t,!v),de(b,qe,n.i18n[v?"play":"pause"]))}function y(E){var O=u.bar;O&&Je(O,"width",E*100+"%"),i(Ro,E)}function x(E){var O=t.Slides.getAt(E);c.set(O&&+Qe(O.slide,_a)||n.interval)}return{mount:h,destroy:c.cancel,play:T,pause:z,isPaused:s}}function Ea(e,t,n){var r=Te(e),o=r.on;function l(){n.cover&&(o(Lr,$e(c,!0)),o([Ct,ke,_e],$e(i,!0)))}function i(s){t.Slides.forEach(function(u){var d=sn(u.container||u.slide,"img");d&&d.src&&c(s,d,u)})}function c(s,u,d){d.style("background",s?'center/cover no-repeat url("'+u.src+'")':"",!0),Jt(u,s?"none":"")}return{mount:l,destroy:$e(i,!1)}}var Pa=10,Aa=600,Ia=.6,Ra=1.5,ka=800;function Fa(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=e.state.set,c=t.Move,s=c.getPosition,u=c.getLimit,d=c.exceededLimit,L=c.translate,b=e.is(Bt),f,p,m=1;function v(){o(mt,z),o([ke,_e],F)}function h(y,x,E,O,P){var H=s();if(z(),E&&(!b||!d())){var N=t.Layout.sliderSize(),D=lr(y)*N*Rn(Ne(y)/N)||0;y=c.toPosition(t.Controller.toDest(y%N))+D}var V=xo(H,y,1);m=1,x=V?0:x||In(Ne(y-H)/Ra,ka),p=O,f=jn(x,S,$e(T,H,y,P),1),i(rn),l(Dn),f.start()}function S(){i(Nt),p&&p(),l(Wt)}function T(y,x,E,O){var P=s(),H=y+(x-y)*_(O),N=(H-P)*m;L(P+N),b&&!E&&d()&&(m*=Ia,Ne(N)<Pa&&h(u(d(!0)),Aa,!1,p,!0))}function z(){f&&f.cancel()}function F(){f&&!f.isPaused()&&(z(),S())}function _(y){var x=n.easingFunc;return x?x(y):1-Math.pow(1-y,4)}return{mount:v,destroy:z,scroll:h,cancel:F}}var Rt={passive:!1,capture:!0};function Ma(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=r.bind,c=r.unbind,s=e.state,u=t.Move,d=t.Scroll,L=t.Controller,b=t.Elements.track,f=t.Media.reduce,p=t.Direction,m=p.resolve,v=p.orient,h=u.getPosition,S=u.exceededLimit,T,z,F,_,y,x=!1,E,O,P;function H(){i(b,tr,ir,Rt),i(b,nr,ir,Rt),i(b,qo,D,Rt),i(b,"click",A,{capture:!0}),i(b,"dragstart",lt),o([Ct,ke],N)}function N(){var B=n.drag;le(!B),_=B==="free"}function D(B){if(E=!1,!O){var w=ge(B);me(B.target)&&(w||!B.button)&&(L.isBusy()?lt(B,!0):(P=w?b:window,y=s.is([Dt,rn]),F=null,i(P,tr,V,Rt),i(P,nr,C,Rt),u.cancel(),d.cancel(),I(B)))}}function V(B){if(s.is(wn)||(s.set(wn),l(Lo)),B.cancelable)if(y){u.translate(T+he(ne(B)));var w=ue(B)>Yr,K=x!==(x=S());(w||K)&&I(B),E=!0,l(_o),lt(B)}else M(B)&&(y=W(B),lt(B))}function C(B){s.is(wn)&&(s.set(Nt),l(Wo)),y&&(k(B),lt(B)),c(P,tr,V),c(P,nr,C),y=!1}function A(B){!O&&E&<(B,!0)}function I(B){F=z,z=B,T=h()}function k(B){var w=Z(B),K=ae(w),X=n.rewind&&n.rewindByDrag;f(!1),_?L.scroll(K,0,n.snap):e.is(un)?L.go(v(lr(w))<0?X?"<":"-":X?">":"+"):e.is(Bt)&&x&&X?L.go(S(!0)?">":"<"):L.go(L.toDest(K),!0),f(!0)}function W(B){var w=n.dragMinThreshold,K=qt(w),X=K&&w.mouse||0,J=(K?w.touch:+w)||10;return Ne(ne(B))>(ge(B)?J:X)}function M(B){return Ne(ne(B))>Ne(ne(B,!0))}function Z(B){if(e.is(zt)||!x){var w=ue(B);if(w&&w<Yr)return ne(B)/w}return 0}function ae(B){return h()+lr(B)*bt(Ne(B)*(n.flickPower||600),_?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function ne(B,w){return re(B,w)-re(R(B),w)}function ue(B){return ar(B)-ar(R(B))}function R(B){return z===B&&F||z}function re(B,w){return(ge(B)?B.changedTouches[0]:B)["page"+m(w?"Y":"X")]}function he(B){return B/(x&&e.is(Bt)?ha:1)}function me(B){var w=n.noDrag;return!Yt(B,"."+zo+", ."+qn)&&(!w||!Yt(B,w))}function ge(B){return typeof TouchEvent<"u"&&B instanceof TouchEvent}function U(){return y}function le(B){O=B}return{mount:H,disable:le,isDragging:U}}var Ha={Spacebar:" ",Right:Kn,Left:Vn,Up:Mo,Down:Ho};function Ar(e){return e=vt(e)?e:e.key,Ha[e]||e}var Xr="keydown";function Na(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=r.unbind,c=e.root,s=t.Direction.resolve,u,d;function L(){b(),o(ke,f),o(ke,b),o(mt,m)}function b(){var h=n.keyboard;h&&(u=h==="global"?window:c,l(u,Xr,v))}function f(){i(u,Xr)}function p(h){d=h}function m(){var h=d;d=!0,mo(function(){d=h})}function v(h){if(!d){var S=Ar(h);S===s(Vn)?e.go("<"):S===s(Kn)&&e.go(">")}}return{mount:L,destroy:f,disable:p}}var Ut=br+"-lazy",_n=Ut+"-srcset",Oa="["+Ut+"], ["+_n+"]";function Ba(e,t,n){var r=Te(e),o=r.on,l=r.off,i=r.bind,c=r.emit,s=n.lazyLoad==="sequential",u=[jt,Wt],d=[];function L(){n.lazyLoad&&(b(),o(_e,b))}function b(){pt(d),f(),s?h():(l(u),o(u,p),p())}function f(){t.Slides.forEach(function(S){vr(S.slide,Oa).forEach(function(T){var z=Qe(T,Ut),F=Qe(T,_n);if(z!==T.src||F!==T.srcset){var _=n.classes.spinner,y=T.parentElement,x=sn(y,"."+_)||Mt("span",_,y);d.push([T,S,x]),T.src||Jt(T,"none")}})})}function p(){d=d.filter(function(S){var T=n.perPage*((n.preloadPages||1)+1)-1;return S[1].isWithin(e.index,T)?m(S):!0}),d.length||l(u)}function m(S){var T=S[0];rt(S[1].slide,ur),i(T,"load error",$e(v,S)),de(T,"src",Qe(T,Ut)),de(T,"srcset",Qe(T,_n)),ot(T,Ut),ot(T,_n)}function v(S,T){var z=S[0],F=S[1];ct(F.slide,ur),T.type!=="error"&&(Lt(S[2]),Jt(z,""),c(Lr,z,F),c(Ot)),s&&h()}function h(){d.length&&m(d.shift())}return{mount:L,destroy:$e(pt,d),check:p}}function Da(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=r.bind,c=t.Slides,s=t.Elements,u=t.Controller,d=u.hasFocus,L=u.getIndex,b=u.go,f=t.Direction.resolve,p=s.pagination,m=[],v,h;function S(){T(),o([ke,_e,kn],S);var O=n.pagination;p&&Jt(p,O?"":"none"),O&&(o([mt,Dn,Wt],E),z(),E(),l(Ao,{list:v,items:m},x(e.index)))}function T(){v&&(Lt(p?xt(v.children):v),ct(v,h),pt(m),v=null),r.destroy()}function z(){var O=e.length,P=n.classes,H=n.i18n,N=n.perPage,D=d()?u.getEnd()+1:Qt(O/N);v=p||Mt("ul",P.pagination,s.track.parentElement),rt(v,h=Yn+"--"+y()),de(v,dt,"tablist"),de(v,qe,H.select),de(v,Wr,y()===Gn?"vertical":"");for(var V=0;V<D;V++){var C=Mt("li",null,v),A=Mt("button",{class:P.page,type:"button"},C),I=c.getIn(V).map(function(W){return W.slide.id}),k=!d()&&N>1?H.pageX:H.slideX;i(A,"click",$e(F,V)),n.paginationKeyboard&&i(A,"keydown",$e(_,V)),de(C,dt,"presentation"),de(A,dt,"tab"),de(A,dn,I.join(" ")),de(A,qe,sr(k,V+1)),de(A,Ht,-1),m.push({li:C,button:A,page:V})}}function F(O){b(">"+O,!0)}function _(O,P){var H=m.length,N=Ar(P),D=y(),V=-1;N===f(Kn,!1,D)?V=++O%H:N===f(Vn,!1,D)?V=(--O+H)%H:N==="Home"?V=0:N==="End"&&(V=H-1);var C=m[V];C&&(yo(C.button),b(">"+V),lt(P,!0))}function y(){return n.paginationDirection||n.direction}function x(O){return m[u.toPage(O)]}function E(){var O=x(L(!0)),P=x(L());if(O){var H=O.button;ct(H,_t),ot(H,Vr),de(H,Ht,-1)}if(P){var N=P.button;rt(N,_t),de(N,Vr,!0),de(N,Ht,"")}l(Io,{list:v,items:m},O,P)}return{items:m,mount:S,destroy:T,getAt:x,update:E}}var ja=[" ","Enter"];function za(e,t,n){var r=n.isNavigation,o=n.slideFocus,l=[];function i(){e.splides.forEach(function(p){p.isParent||(u(e,p.splide),u(p.splide,e))}),r&&d()}function c(){l.forEach(function(p){p.destroy()}),pt(l)}function s(){c(),i()}function u(p,m){var v=Te(p);v.on(mt,function(h,S,T){m.go(m.is(zt)?T:h)}),l.push(v)}function d(){var p=Te(e),m=p.on;m(Cr,b),m(ko,f),m([Ct,ke],L),l.push(p),p.emit($r,e.splides)}function L(){de(t.Elements.list,Wr,n.direction===Gn?"vertical":"")}function b(p){e.go(p.index)}function f(p,m){fr(ja,Ar(m))&&(b(p),lt(m))}return{setup:$e(t.Media.set,{slideFocus:on(o)?r:o},!0),mount:i,destroy:c,remount:s}}function Va(e,t,n){var r=Te(e),o=r.bind,l=0;function i(){n.wheel&&o(t.Elements.track,"wheel",c,Rt)}function c(u){if(u.cancelable){var d=u.deltaY,L=d<0,b=ar(u),f=n.wheelMinThreshold||0,p=n.wheelSleep||0;Ne(d)>f&&b-l>p&&(e.go(L?"<":">"),l=b),s(L)&<(u)}}function s(u){return!n.releaseWheel||e.state.is(Dt)||t.Controller.getAdjacent(u)!==-1}return{mount:i}}var Ka=90;function Ga(e,t,n){var r=Te(e),o=r.on,l=t.Elements.track,i=n.live&&!n.isNavigation,c=Mt("span",da),s=jn(Ka,$e(d,!1));function u(){i&&(b(!t.Autoplay.isPaused()),de(l,Ur,!0),c.textContent="…",o(wr,$e(b,!0)),o(Tr,$e(b,!1)),o([jt,Wt],$e(d,!0)))}function d(f){de(l,Gr,f),f?(ln(l,c),s.start()):(Lt(c),s.cancel())}function L(){ot(l,[Kr,Ur,Gr]),Lt(c)}function b(f){i&&de(l,Kr,f?"off":"polite")}return{mount:u,disable:b,destroy:L}}var Ua=Object.freeze({__proto__:null,Media:ta,Direction:na,Elements:fa,Slides:va,Layout:ba,Clones:Ca,Move:Sa,Controller:$a,Arrows:La,Autoplay:Wa,Cover:Ea,Scroll:Fa,Drag:Ma,Keyboard:Na,LazyLoad:Ba,Pagination:Da,Sync:za,Wheel:Va,Live:Ga}),qa={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"},Ya={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:ma,i18n:qa,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Xa(e,t,n){var r=t.Slides;function o(){Te(e).on([Ct,_e],l)}function l(){r.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function i(c,s){r.style("transition","opacity "+n.speed+"ms "+n.easing),mo(s)}return{mount:o,start:i,cancel:ir}}function Za(e,t,n){var r=t.Move,o=t.Controller,l=t.Scroll,i=t.Elements.list,c=$e(Je,i,"transition"),s;function u(){Te(e).bind(i,"transitionend",function(f){f.target===i&&s&&(L(),s())})}function d(f,p){var m=r.toPosition(f,!0),v=r.getPosition(),h=b(f);Ne(m-v)>=1&&h>=1?n.useScroll?l.scroll(m,h,!1,p):(c("transform "+h+"ms "+n.easing),r.translate(m,!0),s=p):(r.jump(f),p())}function L(){c(""),l.cancel()}function b(f){var p=n.rewindSpeed;if(e.is(Bt)&&p){var m=o.getIndex(!0),v=o.getEnd();if(m===0&&f>=v||m>=v&&f===0)return p}return n.speed}return{mount:u,start:d,cancel:L}}var Ja=(function(){function e(n,r){this.event=Te(),this.Components={},this.state=Qi(Ft),this.splides=[],this._o={},this._E={};var o=vt(n)?bo(document,n):n;Gt(o,o+" is invalid."),this.root=o,r=ft({label:Qe(o,qe)||"",labelledby:Qe(o,_r)||""},Ya,e.defaults,r||{});try{ft(r,JSON.parse(Qe(o,br)))}catch{Gt(!1,"Invalid JSON")}this._o=Object.create(ft({},r))}var t=e.prototype;return t.mount=function(r,o){var l=this,i=this.state,c=this.Components;Gt(i.is([Ft,An]),"Already mounted!"),i.set(Ft),this._C=c,this._T=o||this._T||(this.is(un)?Xa:Za),this._E=r||this._E;var s=Zt({},Ua,this._E,{Transition:this._T});return Tt(s,function(u,d){var L=u(l,c,l._o);c[d]=L,L.setup&&L.setup()}),Tt(c,function(u){u.mount&&u.mount()}),this.emit(Ct),rt(this.root,ua),i.set(Nt),this.emit(cr),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(Nt)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(xt(arguments,1))),this},t.add=function(r,o){return this._C.Slides.add(r,o),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(_e),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,l=this.state;return l.is(Ft)?Te(this).on(cr,this.destroy.bind(this,r)):(Tt(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(Sr),o.destroy(),r&&pt(this.splides),l.set(An)),this},qi(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Ir=Ja;Ir.defaults={};Ir.STATES=Xi;var Zr=[[Ct,"onMounted"],[cr,"onReady"],[mt,"onMove"],[jt,"onMoved"],[Cr,"onClick"],[So,"onActive"],[$o,"onInactive"],[wo,"onVisible"],[To,"onHidden"],[_e,"onRefresh"],[ke,"onUpdated"],[Ot,"onResize"],[Bn,"onResized"],[Lo,"onDrag"],[_o,"onDragging"],[Wo,"onDragged"],[Dn,"onScroll"],[Wt,"onScrolled"],[Sr,"onDestroy"],[Eo,"onArrowsMounted"],[Po,"onArrowsUpdated"],[Ao,"onPaginationMounted"],[Io,"onPaginationUpdated"],[$r,"onNavigationMounted"],[wr,"onAutoplayPlay"],[Ro,"onAutoplayPlaying"],[Tr,"onAutoplayPause"],[Lr,"onLazyLoadLoaded"]];function Rr(...e){return e.filter(Boolean).join(" ")}function Fn(e){return e!==null&&typeof e=="object"}function pr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!pr(n,t[r]));if(Fn(e)&&Fn(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!pr(e[o],t[o]))}return e===t}function Qa(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function el(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function mr(e,t){const n=e;return el(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Fn(r)?n[o]=mr(Fn(n[o])?n[o]:{},r):n[o]=r}),n}var tl=({children:e,className:t,...n})=>g.createElement("div",{className:Rr("splide__track",t),...n},g.createElement("ul",{className:"splide__list"},e)),kr=class extends g.Component{constructor(){super(...arguments),this.splideRef=g.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Ir(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=mr({},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&&!pr(this.options,e)&&(this.splide.options=e,this.options=mr({},e));const t=this.getSlides();Qa(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){Zr.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:r,...o}=this.props;return g.createElement(t,{className:Rr("splide",e),ref:this.splideRef,...this.omit(o,["options",...Zr.map(l=>l[1])])},n?g.createElement(tl,null,r):r)}},Fr=({children:e,className:t,...n})=>g.createElement("li",{className:Rr("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),xt=require("classnames"),S=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),_o=require("react-dom");function Ci(t){return t.type==="object"&&t.version===1}const Si="ControlSlider-module__wrapper___sHEkd",$i="ControlSlider-module__hoverArrow___A-dOH",wi="ControlSlider-module__sliderItem___QQSkR",Ti="ControlSlider-module__sliderImage___9hRl-",Li="ControlSlider-module__arrow___05ghY",_i="ControlSlider-module__arrowVertical___tBfVN",Ei="ControlSlider-module__nextArrow___-30Yc",Pi="ControlSlider-module__arrowInner___aEra3",Wi="ControlSlider-module__arrowIcon___S4ztF",Fi="ControlSlider-module__arrowImg___2dwJW",Ri="ControlSlider-module__mirror___brd6U",Ii="ControlSlider-module__pagination___bicLF",Ai="ControlSlider-module__paginationInner___bT-P-",ki="ControlSlider-module__paginationVertical___zYqKw",Mi="ControlSlider-module__paginationItem___nTRbk",Oi="ControlSlider-module__dot___p1Qun",Ni="ControlSlider-module__activeDot___LHFaj",Hi="ControlSlider-module__paginationInsideBottom___R3FWn",Bi="ControlSlider-module__paginationInsideTop___V-qb-",zi="ControlSlider-module__paginationOutsideBottom___14w8D",Di="ControlSlider-module__paginationOutsideTop___SCLqB",ji="ControlSlider-module__paginationInsideLeft___yOBRZ",Vi="ControlSlider-module__paginationInsideRight___Rtt3o",Ki="ControlSlider-module__paginationOutsideLeft___lahaw",Ui="ControlSlider-module__paginationOutsideRight___EtuQa",Gi="ControlSlider-module__imgWrapper___UjEgB",Yi="ControlSlider-module__captionBlock___dJ6-j",qi="ControlSlider-module__captionTextWrapper___HFlpf",Xi="ControlSlider-module__captionText___uGBVc",Zi="ControlSlider-module__active___WZK4G",Ji="ControlSlider-module__withPointerEvents___t-18M",Qi="ControlSlider-module__topLeftAlignment___zjnGM",ta="ControlSlider-module__topCenterAlignment___gD1xW",ea="ControlSlider-module__topRightAlignment___NMapS",na="ControlSlider-module__middleLeftAlignment___OnUrY",ra="ControlSlider-module__middleCenterAlignment___Tdkl0",oa="ControlSlider-module__middleRightAlignment___wEbfX",ia="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:Si,hoverArrow:$i,sliderItem:wi,sliderImage:Ti,arrow:Li,arrowVertical:_i,nextArrow:Ei,arrowInner:Pi,arrowIcon:Wi,arrowImg:Fi,mirror:Ri,pagination:Ii,paginationInner:Ai,paginationVertical:ki,paginationItem:Mi,dot:Oi,activeDot:Ni,paginationInsideBottom:Hi,paginationInsideTop:Bi,paginationOutsideBottom:zi,paginationOutsideTop:Di,paginationInsideLeft:ji,paginationInsideRight:Vi,paginationOutsideLeft:Ki,paginationOutsideRight:Ui,imgWrapper:Gi,captionBlock:Yi,captionTextWrapper:qi,captionText:Xi,active:Zi,withPointerEvents:Ji,topLeftAlignment:Qi,topCenterAlignment:ta,topRightAlignment:ea,middleLeftAlignment:na,middleCenterAlignment:ra,middleRightAlignment:oa,bottomLeftAlignment:ia,bottomCenterAlignment:aa,bottomRightAlignment:sa,clickOverlay:la,contain:ca,cover:da};function ua(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pa(t,e,n){return e&&ua(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Xr="(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 Eo=setTimeout,hr=function(){};function Zr(t){return requestAnimationFrame(t)}function Kn(t,e){return typeof e===t}function rn(t){return!Tr(t)&&Kn("object",t)}var wr=Array.isArray,Po=wt(Kn,"function"),be=wt(Kn,"string"),hn=wt(Kn,"undefined");function Tr(t){return t===null}function Wo(t){try{return t instanceof(t.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function fn(t){return wr(t)?t:[t]}function Zt(t,e){fn(t).forEach(e)}function Lr(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(r){r&&t.classList[n?"add":"remove"](r)})}function ie(t,e){ce(t,be(e)?e.split(" "):e,!0)}function yn(t,e){Zt(e,t.appendChild.bind(t))}function _r(t,e){Zt(t,function(n){var r=(e||n).parentNode;r&&r.insertBefore(n,e)})}function on(t,e){return Wo(t)&&(t.msMatchesSelector||t.matches).call(t,e)}function Fo(t,e){var n=t?Ce(t.children):[];return e?n.filter(function(r){return on(r,e)}):n}function vn(t,e){return e?Fo(t,e)[0]:t.firstElementChild}var an=Object.keys;function _e(t,e,n){return t&&(n?an(t).reverse():an(t)).forEach(function(r){r!=="__proto__"&&e(t[r],r)}),t}function sn(t){return Ce(arguments,1).forEach(function(e){_e(e,function(n,r){t[r]=e[r]})}),t}function ye(t){return Ce(arguments,1).forEach(function(e){_e(e,function(n,r){wr(n)?t[r]=n.slice():rn(n)?t[r]=ye({},rn(t[r])?t[r]:{},n):t[r]=n})}),t}function Jr(t,e){Zt(e||an(t),function(n){delete t[n]})}function ae(t,e){Zt(t,function(n){Zt(e,function(r){n&&n.removeAttribute(r)})})}function mt(t,e,n){rn(e)?_e(e,function(r,o){mt(t,o,r)}):Zt(t,function(r){Tr(n)||n===""?ae(r,e):r.setAttribute(e,String(n))})}function Oe(t,e,n){var r=document.createElement(t);return e&&(be(e)?ie(r,e):mt(r,e)),n&&yn(n,r),r}function te(t,e,n){if(hn(n))return getComputedStyle(t)[e];Tr(n)||(t.style[e]=""+n)}function ln(t,e){te(t,"display",e)}function Ro(t){t.setActive&&t.setActive()||t.focus({preventScroll:!0})}function ee(t,e){return t.getAttribute(e)}function Qr(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 Io(t){return vn(new DOMParser().parseFromString(t,"text/html").body)}function le(t,e){t.preventDefault(),e&&(t.stopPropagation(),t.stopImmediatePropagation())}function Ao(t,e){return t&&t.querySelector(e)}function Er(t,e){return e?Ce(t.querySelectorAll(e)):[]}function de(t,e){ce(t,e,!1)}function fr(t){return t.timeStamp}function we(t){return be(t)?t:t?t+"px":""}var bn="splide",Pr="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 ko(t,e,n){return zt(t-e)<n}function kn(t,e,n,r){var o=xe(e,n),l=zn(e,n);return r?o<t&&t<l:o<=t&&t<=l}function Ae(t,e,n){var r=xe(e,n),o=zn(e,n);return xe(zn(r,t),o)}function yr(t){return+(t>0)-+(t<0)}function vr(t,e){return Zt(e,function(n){t=t.replace("%s",""+n)}),t}function Wr(t){return t<10?"0"+t:""+t}var to={};function ha(t){return""+t+Wr(to[t]=(to[t]||0)+1)}function Mo(){var t=[];function e(i,s,d,u){o(i,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(i,s,d){o(i,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 r(i,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)),i.dispatchEvent(u),u}function o(i,s,d){Zt(i,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(i){i[4]()}),me(t)}return{bind:e,unbind:n,dispatch:r,destroy:l}}var Se="mounted",br="ready",ge="move",Ge="moved",Fr="click",Oo="active",No="inactive",Ho="visible",Bo="hidden",Ft="refresh",Nt="updated",Be="resize",Un="resized",zo="drag",Do="dragging",jo="dragged",Gn="scroll",We="scrolled",fa="overflow",Rr="destroy",Vo="arrows:mounted",Ko="arrows:updated",Uo="pagination:mounted",Go="pagination:updated",Ir="navigation:mounted",Ar="autoplay:play",Yo="autoplay:playing",kr="autoplay:pause",Mr="lazyload:loaded",qo="sk",Xo="sh",jn="ei";function _t(t){var e=t?t.event.bus:document.createDocumentFragment(),n=Mo();function r(l,i){n.bind(e,fn(l).join(" "),function(s){i.apply(i,wr(s.detail)?s.detail:[])})}function o(l){n.dispatch(e,l,Ce(arguments,1))}return t&&t.event.on(Rr,n.destroy),sn(n,{bus:e,on:r,off:wt(n.unbind,e),emit:o})}function Yn(t,e,n,r){var o=Date.now,l,i=0,s,d=!0,u=0;function c(){if(!d){if(i=t?xe((o()-l)/t,1):1,n&&n(i),i>=1&&(e(),l=o(),r&&++u>=r))return v();s=Zr(c)}}function L(f){f||p(),l=o()-(f?i*t:0),d=!1,s=Zr(c)}function v(){d=!0}function h(){l=o(),i=0,n&&n(i)}function p(){s&&cancelAnimationFrame(s),i=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(o){e=o}function r(o){return Lr(fn(o),e)}return{set:n,is:r}}function va(t,e){var n=Yn(0,t,null,1);return function(){n.isPaused()&&n.start()}}function ba(t,e,n){var r=t.state,o=n.breakpoints||{},l=n.reducedMotion||{},i=Mo(),s=[];function d(){var p=n.mediaQuery==="min";an(o).sort(function(g,$){return p?+g-+$:+$-+g}).forEach(function(g){c(o[g],"("+(p?"min":"max")+"-width:"+g+"px)")}),c(l,Xr),L()}function u(p){p&&i.destroy()}function c(p,g){var $=matchMedia(g);i.bind($,"change",L),s.push([p,$])}function L(){var p=r.is(Bn),g=n.direction,$=s.reduce(function(f,x){return ye(f,x[1].matches?x[0]:{})},{});Jr(n),h($),n.destroy?t.destroy(n.destroy==="completely"):p?(u(!0),t.mount()):g!==n.direction&&t.refresh()}function v(p){matchMedia(Xr).matches&&(p?ye(n,l):Jr(n,an(l)))}function h(p,g,$){ye(n,p),g&&ye(Object.getPrototypeOf(n),p),($||!r.is(Me))&&t.emit(Nt,n)}return{setup:d,destroy:u,reduce:v,set:h}}var qn="Arrow",Xn=qn+"Left",Zn=qn+"Right",Zo=qn+"Up",Jo=qn+"Down",eo="rtl",Jn="ttb",sr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Zo,Zn],ArrowRight:[Jo,Xn]};function xa(t,e,n){function r(l,i,s){s=s||n.direction;var d=s===eo&&!i?1:s===Jn?0:-1;return sr[l]&&sr[l][d]||l.replace(/width|left|right/i,function(u,c){var L=sr[u.toLowerCase()][d]||u;return c>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function o(l){return l*(n.direction===eo?1:-1)}return{resolve:r,orient:o}}var ue="role",Ne="tabindex",Ca="disabled",ne="aria-",xn=ne+"controls",Qo=ne+"current",no=ne+"selected",qt=ne+"label",Or=ne+"labelledby",ti=ne+"hidden",Nr=ne+"orientation",dn=ne+"roledescription",ro=ne+"live",oo=ne+"busy",io=ne+"atomic",Hr=[ue,Ne,Ca,xn,Qo,qt,Or,ti,Nr,dn],se=bn+"__",$e="is-",lr=bn,ao=se+"track",Sa=se+"list",Qn=se+"slide",ei=Qn+"--clone",$a=Qn+"__container",Br=se+"arrows",tr=se+"arrow",ni=tr+"--prev",ri=tr+"--next",er=se+"pagination",oi=er+"__page",wa=se+"progress",Ta=wa+"__bar",La=se+"toggle",_a=se+"spinner",Ea=se+"sr",Pa=$e+"initialized",Pe=$e+"active",ii=$e+"prev",ai=$e+"next",xr=$e+"visible",Cr=$e+"loading",si=$e+"focus-in",li=$e+"overflow",Wa=[Pe,xr,ii,ai,Cr,si,li],Fa={slide:Qn,clone:ei,arrows:Br,arrow:tr,prev:ni,next:ri,pagination:er,page:oi,spinner:_a};function Ra(t,e){if(Po(t.closest))return t.closest(e);for(var n=t;n&&n.nodeType===1&&!on(n,e);)n=n.parentElement;return n}var Ia=5,so=200,ci="touchstart mousedown",cr="touchmove mousemove",dr="touchend touchcancel mouseup click";function Aa(t,e,n){var r=_t(t),o=r.on,l=r.bind,i=t.root,s=n.i18n,d={},u=[],c=[],L=[],v,h,p;function g(){b(),R(),x()}function $(){o(Ft,f),o(Ft,g),o(Nt,x),l(document,ci+" keydown",function(y){p=y.type==="keydown"},{capture:!0}),l(i,"focusin",function(){ce(i,si,!!p)})}function f(y){var w=Hr.concat("style");me(u),de(i,c),de(v,L),ae([v,h],w),ae(i,y?w:["style",dn])}function x(){de(i,c),de(v,L),c=_(lr),L=_(ao),ie(i,c),ie(v,L),mt(i,qt,n.label),mt(i,Or,n.labelledby)}function b(){v=W("."+ao),h=vn(v,"."+Sa),en(v&&h,"A track/list element is missing."),An(u,Fo(h,"."+Qn+":not(."+ei+")")),_e({arrows:Br,pagination:er,prev:ni,next:ri,bar:Ta,toggle:La},function(y,w){d[w]=W("."+y)}),sn(d,{root:i,track:v,list:h,slides:u})}function R(){var y=i.id||ha(bn),w=n.role;i.id=y,v.id=v.id||y+"-track",h.id=h.id||y+"-list",!ee(i,ue)&&i.tagName!=="SECTION"&&w&&mt(i,ue,w),mt(i,dn,s.carousel),mt(h,ue,"presentation")}function W(y){var w=Ao(i,y);return w&&Ra(w,"."+lr)===i?w:void 0}function _(y){return[y+"--"+n.type,y+"--"+n.direction,n.drag&&y+"--draggable",n.isNavigation&&y+"--nav",y===lr&&Pe]}return sn(d,{setup:g,mount:$,destroy:f})}var ze="slide",Ye="loop",Cn="fade";function ka(t,e,n,r){var o=_t(t),l=o.on,i=o.emit,s=o.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(r,"style"),x=ee(r,qt),b=n>-1,R=vn(r,"."+$a),W;function _(){b||(r.id=u.id+"-slide"+Wr(e+1),mt(r,ue,p?"tabpanel":"group"),mt(r,dn,h.slide),mt(r,qt,x||vr(h.slideLabel,[e+1,t.length]))),y()}function y(){s(r,"click",wt(i,Fr,I)),s(r,"keydown",wt(i,qo,I)),l([Ge,Xo,We],F),l(Ir,E),v&&l(ge,H)}function w(){W=!0,o.destroy(),de(r,Wa),ae(r,Hr),mt(r,"style",f),mt(r,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(r,qt,vr(h.slideX,(b?n:e)+1)),mt(r,xn,A),mt(r,ue,g?"button":""),g&&ae(r,dn)}function H(){W||F()}function F(){if(!W){var A=t.index;O(),z(),ce(r,ii,e===A-1),ce(r,ai,e===A+1)}}function O(){var A=K();A!==Qr(r,Pe)&&(ce(r,Pe,A),mt(r,Qo,L&&A||""),i(A?Oo:No,I))}function z(){var A=C(),P=!A&&(!K()||b);if(t.state.is([Ue,gn])||mt(r,ti,P||""),mt(Er(r,c.focusableNodes||""),Ne,P?-1:""),g&&mt(r,Ne,P?-1:0),A!==Qr(r,xr)&&(ce(r,xr,A),i(A?Ho:Bo,I)),!A&&document.activeElement===r){var N=d.Slides.getAt(t.index);N&&Ro(N.slide)}}function V(A,P,N){te(N&&R||r,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(r),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:r,container:R,isClone:b,mount:_,destroy:w,update:F,style:V,isWithin:k};return I}function Ma(t,e,n){var r=_t(t),o=r.on,l=r.emit,i=r.bind,s=e.Elements,d=s.slides,u=s.list,c=[];function L(){v(),o(Ft,h),o(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=Io(z)),Wo(z)){var V=d[O];V?_r(z,V):yn(u,z),ie(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(Po(F)?F:function(O){return be(F)?on(O.slide,F):Lr(fn(F),O.index)})}function y(F,O,z){W(function(V){V.style(F,O,z)})}function w(F,O){var z=Er(F,"img"),V=z.length;V?z.forEach(function(K){i(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 r=_t(t),o=r.on,l=r.bind,i=r.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(i,Be))),o([Nt,Ft],b),o(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,i(Un),f!==(f=k())&&(ce(c,li,f),i(fa,f)))}function W(I){var A=n.padding,P=d(I?"right":"left");return A&&we(A[P]||(rn(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 r=_t(t),o=r.on,l=e.Elements,i=e.Slides,s=e.Direction.resolve,d=[],u;function c(){o(Ft,L),o([Nt,Be],h),(u=$())&&(p(u),e.Layout.resize(!0))}function L(){v(),c()}function v(){Ee(d),me(d),r.destroy()}function h(){var f=$();u!==f&&(u<f||!f)&&r.emit(Ft)}function p(f){var x=i.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);_?_r(y,x[0].slide):yn(l.list,y),An(d,y),i.register(y,W-f+(_?0:b),R.index)})}}function g(f,x){var b=f.cloneNode(!0);return ie(b,n.classes.clone),b.id=t.root.id+"-clone"+Wr(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 r=_t(t),o=r.on,l=r.emit,i=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,o([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)),i(Ue),l(ge,N,Q,P),b.start(N,function(){i(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(Xo)}}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,rt=0;rt<N.length;rt++){var ut=N[rt].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 r=_t(t),o=r.on,l=r.emit,i=e.Move,s=i.getPosition,d=i.getLimit,u=i.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(),o([Nt,Ft,jn],E),o(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,i.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),i.move(pt,gt,R,ht))}}function O(M,J,ht,pt){e.Scroll.scroll(M,J,ht,function(){var gt=k(i.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=_||(rt()?1:y),pt=K(x+ht*(M?-1:1),x,!(_||rt()));return pt===-1&&g&&!ko(s(),d(!M),1)?M?0:b:J?pt:k(pt)}function K(M,J,ht){if(L()||rt()){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-(rt()||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(rt()?M:y*M,0,b)}function P(M){return rt()?xe(M,b):Dn((M>=b?W-1:M)/y)}function N(M){var J=i.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 rt(){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:rt,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 r=_t(t),o=r.on,l=r.bind,i=r.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(),o(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"),ie(h,f=Br+"--"+n.direction),O&&(y(),F(),mt([p,g],xn,v.id),i(Vo,p,g)))}function _(){r.destroy(),de(h,f),$?(Ee(L?[p,g]:h),p=g=null):ae([p,g],Hr)}function y(){o([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&&_r(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 Io(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),i(Ko,p,g,z,V)}}return{arrows:x,mount:b,destroy:_,update:F}}var Ka=Pr+"-interval";function Ua(t,e,n){var r=_t(t),o=r.on,l=r.bind,i=r.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)}),o([ge,Gn,Ft],s.rewind),o(ge,w)}function b(){d()&&e.Slides.isEnough()&&(s.start(!n.resetProgress),g=p=$=!1,_(),i(Ar))}function R(E){E===void 0&&(E=!0),$=!!E,_(),d()||(s.pause(),i(kr))}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+"%"),i(Yo,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 r=_t(t),o=r.on;function l(){n.cover&&(o(Mr,wt(s,!0)),o([Se,Nt,Ft],wt(i,!0)))}function i(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(i,!1)}}var Ya=10,qa=600,Xa=.6,Za=1.5,Ja=800;function Qa(t,e,n){var r=_t(t),o=r.on,l=r.emit,i=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 $(){o(ge,R),o([Nt,Ft],W)}function f(y,w,E,H,F){var O=d();if(R(),E&&(!v||!c())){var z=e.Layout.sliderSize(),V=yr(y)*z*Dn(zt(y)/z)||0;y=s.toPosition(e.Controller.toDest(y%z))+V}var K=ko(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),i(gn),l(Gn),h.start()}function x(){i(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 r=_t(t),o=r.on,l=r.emit,i=r.bind,s=r.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(){i(v,cr,hr,ke),i(v,dr,hr,ke),i(v,ci,V,ke),i(v,"click",k,{capture:!0}),i(v,"dragstart",le),o([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,i(F,cr,K,ke),i(F,dr,C,ke),u.cancel(),c.cancel(),I(B)))}}function K(B){if(d.is(In)||(d.set(In),l(zo)),B.cancelable)if(y){u.translate(b+ht(rt(B)));var T=ut(B)>so,U=w!==(w=x());(T||U)&&I(B),E=!0,l(Do),le(B)}else N(B)&&(y=P(B),le(B))}function C(B){d.is(In)&&(d.set(He),l(jo)),y&&(A(B),le(B)),s(F,cr,K),s(F,dr,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($(yr(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=rn(T),q=U&&T.mouse||0,Z=(U?T.touch:+T)||10;return zt(rt(B))>(gt(B)?Z:q)}function N(B){return zt(rt(B))>zt(rt(B,!0))}function Q(B){if(t.is(Ye)||!w){var T=ut(B);if(T&&T<so)return rt(B)/T}return 0}function st(B){return f()+yr(B)*xe(zt(B)*(n.flickPower||600),_?1/0:e.Layout.listSize()*(n.flickMaxPages||1))}function rt(B,T){return J(B,T)-J(M(B),T)}function ut(B){return fr(B)-fr(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!on(B,"."+oi+", ."+tr)&&(!T||!on(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:Zo,Down:Jo};function zr(t){return t=be(t)?t:t.key,es[t]||t}var lo="keydown";function ns(t,e,n){var r=_t(t),o=r.on,l=r.bind,i=r.unbind,s=t.root,d=e.Direction.resolve,u,c;function L(){v(),o(Nt,h),o(Nt,v),o(ge,g)}function v(){var f=n.keyboard;f&&(u=f==="global"?window:s,l(u,lo,$))}function h(){i(u,lo)}function p(f){c=f}function g(){var f=c;c=!0,Eo(function(){c=f})}function $(f){if(!c){var x=zr(f);x===d(Xn)?t.go("<"):x===d(Zn)&&t.go(">")}}return{mount:L,destroy:h,disable:p}}var nn=Pr+"-lazy",Mn=nn+"-srcset",rs="["+nn+"], ["+Mn+"]";function os(t,e,n){var r=_t(t),o=r.on,l=r.off,i=r.bind,s=r.emit,d=n.lazyLoad==="sequential",u=[Ge,We],c=[];function L(){n.lazyLoad&&(v(),o(Ft,v))}function v(){me(c),h(),d?f():(l(u),o(u,p),p())}function h(){e.Slides.forEach(function(x){Er(x.slide,rs).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];ie(x[1].slide,Cr),i(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,Cr),b.type!=="error"&&(Ee(x[2]),ln(R,""),s(Mr,R,W),s(Be)),d&&f()}function f(){c.length&&g(c.shift())}return{mount:L,destroy:wt(me,c),check:p}}function is(t,e,n){var r=_t(t),o=r.on,l=r.emit,i=r.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(),o([Nt,Ft,jn],x);var H=n.pagination;p&&ln(p,H?"":"none"),H&&(o([ge,Gn,We],E),R(),E(),l(Uo,{list:$,items:g},w(t.index)))}function b(){$&&(Ee(p?Ce($.children):$),de($,f),me(g),$=null),r.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),ie($,f=er+"--"+y()),mt($,ue,"tablist"),mt($,qt,O.select),mt($,Nr,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;i(k,"click",wt(W,K)),n.paginationKeyboard&&i(k,"keydown",wt(_,K)),mt(C,ue,"presentation"),mt(k,ue,"tab"),mt(k,xn,I.join(" ")),mt(k,qt,vr(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=zr(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&&(Ro(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,no),mt(O,Ne,-1)}if(F){var z=F.button;ie(z,Pe),mt(z,no,!0),mt(z,Ne,"")}l(Go,{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 r=n.isNavigation,o=n.slideFocus,l=[];function i(){t.splides.forEach(function(p){p.isParent||(u(t,p.splide),u(p.splide,t))}),r&&c()}function s(){l.forEach(function(p){p.destroy()}),me(l)}function d(){s(),i()}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(Fr,v),g(qo,h),g([Se,Nt],L),l.push(p),p.emit(Ir,t.splides)}function L(){mt(e.Elements.list,Nr,n.direction===Jn?"vertical":"")}function v(p){t.go(p.index)}function h(p,g){Lr(as,zr(g))&&(v(p),le(g))}return{setup:wt(e.Media.set,{slideFocus:hn(o)?r:o},!0),mount:i,destroy:s,remount:d}}function ls(t,e,n){var r=_t(t),o=r.bind,l=0;function i(){n.wheel&&o(e.Elements.track,"wheel",s,ke)}function s(u){if(u.cancelable){var c=u.deltaY,L=c<0,v=fr(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:i}}var cs=90;function ds(t,e,n){var r=_t(t),o=r.on,l=e.Elements.track,i=n.live&&!n.isNavigation,s=Oe("span",Ea),d=Yn(cs,wt(c,!1));function u(){i&&(v(!e.Autoplay.isPaused()),mt(l,io,!0),s.textContent="…",o(Ar,wt(v,!0)),o(kr,wt(v,!1)),o([Ge,We],wt(c,!0)))}function c(h){mt(l,oo,h),h?(yn(l,s),d.start()):(Ee(s),d.cancel())}function L(){ae(l,[ro,io,oo]),Ee(s)}function v(h){i&&mt(l,ro,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:os,Pagination:is,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 r=e.Slides;function o(){_t(t).on([Se,Ft],l)}function l(){r.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function i(s,d){r.style("transition","opacity "+n.speed+"ms "+n.easing),Eo(d)}return{mount:o,start:i,cancel:hr}}function hs(t,e,n){var r=e.Move,o=e.Controller,l=e.Scroll,i=e.Elements.list,s=wt(te,i,"transition"),d;function u(){_t(t).bind(i,"transitionend",function(h){h.target===i&&d&&(L(),d())})}function c(h,p){var g=r.toPosition(h,!0),$=r.getPosition(),f=v(h);zt(g-$)>=1&&f>=1?n.useScroll?l.scroll(g,f,!1,p):(s("transform "+f+"ms "+n.easing),r.translate(g,!0),d=p):(r.jump(h),p())}function L(){s(""),l.cancel()}function v(h){var p=n.rewindSpeed;if(t.is(ze)&&p){var g=o.getIndex(!0),$=o.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,r){this.event=_t(),this.Components={},this.state=ya(Me),this.splides=[],this._o={},this._E={};var o=be(n)?Ao(document,n):n;en(o,o+" is invalid."),this.root=o,r=ye({label:ee(o,qt)||"",labelledby:ee(o,Or)||""},ms,t.defaults,r||{});try{ye(r,JSON.parse(ee(o,Pr)))}catch{en(!1,"Invalid JSON")}this._o=Object.create(ye({},r))}var e=t.prototype;return e.mount=function(r,o){var l=this,i=this.state,s=this.Components;en(i.is([Me,Bn]),"Already mounted!"),i.set(Me),this._C=s,this._T=o||this._T||(this.is(Cn)?gs:hs),this._E=r||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),ie(this.root,Pa),i.set(He),this.emit(br),this},e.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(He)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},e.go=function(r){return this._C.Controller.go(r),this},e.on=function(r,o){return this.event.on(r,o),this},e.off=function(r){return this.event.off(r),this},e.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(Ce(arguments,1))),this},e.add=function(r,o){return this._C.Slides.add(r,o),this},e.remove=function(r){return this._C.Slides.remove(r),this},e.is=function(r){return this._o.type===r},e.refresh=function(){return this.emit(Ft),this},e.destroy=function(r){r===void 0&&(r=!0);var o=this.event,l=this.state;return l.is(Me)?_t(this).on(br,this.destroy.bind(this,r)):(_e(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(Rr),o.destroy(),r&&me(this.splides),l.set(Bn)),this},pa(t,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),t})(),Dr=fs;Dr.defaults={};Dr.STATES=ga;var co=[[Se,"onMounted"],[br,"onReady"],[ge,"onMove"],[Ge,"onMoved"],[Fr,"onClick"],[Oo,"onActive"],[No,"onInactive"],[Ho,"onVisible"],[Bo,"onHidden"],[Ft,"onRefresh"],[Nt,"onUpdated"],[Be,"onResize"],[Un,"onResized"],[zo,"onDrag"],[Do,"onDragging"],[jo,"onDragged"],[Gn,"onScroll"],[We,"onScrolled"],[Rr,"onDestroy"],[Vo,"onArrowsMounted"],[Ko,"onArrowsUpdated"],[Uo,"onPaginationMounted"],[Go,"onPaginationUpdated"],[Ir,"onNavigationMounted"],[Ar,"onAutoplayPlay"],[Yo,"onAutoplayPlaying"],[kr,"onAutoplayPause"],[Mr,"onLazyLoadLoaded"]];function jr(...t){return t.filter(Boolean).join(" ")}function Vn(t){return t!==null&&typeof t=="object"}function Sr(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&!t.some((n,r)=>!Sr(n,e[r]));if(Vn(t)&&Vn(e)){const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(e,o)||!Sr(t[o],e[o]))}return t===e}function ys(t,e){return t.length===e.length&&!t.some((n,r)=>n!==e[r])}function vs(t,e){if(t){const n=Object.keys(t);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&e(t[o],o)===!1)break}}return t}function $r(t,e){const n=t;return vs(e,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Vn(r)?n[o]=$r(Vn(n[o])?n[o]:{},r):n[o]=r}),n}var bs=({children:t,className:e,...n})=>m.createElement("div",{className:jr("splide__track",e),...n},m.createElement("ul",{className:"splide__list"},t)),Vr=class extends m.Component{constructor(){super(...arguments),this.splideRef=m.createRef(),this.slides=[]}componentDidMount(){const{options:t,extensions:e,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Dr(r,t),this.bind(this.splide),this.splide.mount(e,n),this.options=$r({},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&&!Sr(this.options,t)&&(this.splide.options=t,this.options=$r({},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){co.forEach(([e,n])=>{const r=this.props[n];typeof r=="function"&&t.on(e,(...o)=>{r(t,...o)})})}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:r,...o}=this.props;return m.createElement(e,{className:jr("splide",t),ref:this.splideRef,...this.omit(o,["options",...co.map(l=>l[1])])},n?m.createElement(bs,null,r):r)}},Kr=({children:t,className:e,...n})=>m.createElement("li",{className:jr("splide__slide",e),...n},t);/*!
|
|
2
2
|
* Splide.js
|
|
3
3
|
* Version : 4.1.3
|
|
4
4
|
* License : MIT
|
|
5
5
|
* Copyright: 2022 Naotoshi Fujita
|
|
6
|
-
*/const nl="RichTextRenderer-module__link___BWeZ2",rl={link:nl},ol=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(r=>/^\d/.test(r))},Xn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>ol(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function ut(e){const{color:t,...n}=e;return n}function ze(e,t){var n,r,o;return{fontFamily:Xn(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:$.scalingValue(e.letterSpacing,t),wordSpacing:$.scalingValue(e.wordSpacing,t),fontSize:$.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?$.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(o=e.textAppearance)==null?void 0:o.fontVariant,color:e.color}}const tn=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?a.jsx("a",{className:rl.link,href:r.value,target:r.target,children:t(r.children)},o):a.jsx("span",{style:il(r),children:r.text},o));return a.jsx(a.Fragment,{children:e.map((n,r)=>{const o=n.children;return a.jsx("div",{children:t(o)},r)})})};function il(e){return{...e.fontFamily&&{fontFamily:Xn(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const al="SvgImage-module__svg___q3xE-",ll="SvgImage-module__img___VsTm-",Jr={svg:al,img:ll},sl=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},cl=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,yt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r="",style:o})=>{const[l,i]=g.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return g.useEffect(()=>{if(typeof window<"u"&&window.CSS){const c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(c)}},[]),!sl(e)||!l?a.jsx("img",{src:e,alt:"",className:ve(Jr.img,r),style:o}):a.jsx("span",{"data-supports-mask":l,className:ve(Jr.svg,r),style:{"--svg":cl(e),"--fill":t,"--hover-fill":n,...o??{}}})},dl={"top-left":te.topLeftAlignment,"top-center":te.topCenterAlignment,"top-right":te.topRightAlignment,"middle-left":te.middleLeftAlignment,"middle-center":te.middleCenterAlignment,"middle-right":te.middleRightAlignment,"bottom-left":te.bottomLeftAlignment,"bottom-center":te.bottomCenterAlignment,"bottom-right":te.bottomRightAlignment};function ul({settings:e,content:t,styles:n,isEditor:r}){const[o,l]=g.useState(null),{widthSettings:i,fontSettings:c,letterSpacing:s,textAlign:u,wordSpacing:d,fontSizeLineHeight:L,textAppearance:b,color:f}=n.imageCaption,[p,m]=g.useState(void 0),[v,h]=g.useState(null),[S,T]=g.useState(0),[z,F]=g.useState(0),{direction:_,transition:y,controls:x,pagination:E,imageCaption:O,triggers:P}=e,H=g.useRef(y.type),{x:N,y:D}=e.controls.offset,V=C=>{o&&o.go(C)};return g.useEffect(()=>{if(!v)return;const C=new ResizeObserver(A=>{if(!o)return;const[I]=A;m({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return C.observe(v),()=>C.unobserve(v)},[v]),g.useEffect(()=>{!o||H.current===y.type||(F(C=>C+1),H.current=y.type)},[y.type]),a.jsx("div",{className:ve(te.wrapper,{[te.editor]:r}),ref:h,children:a.jsxs("div",{className:te.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:y.backgroundColor&&y.type==="fade in"?y.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ve(te.captionBlock),children:a.jsx("div",{className:te.captionTextWrapper,children:t.map((C,A)=>a.jsx("div",{className:ve(te.captionText,dl[O.alignment],{[te.withPointerEvents]:A===S&&r,[te.active]:A===S}),style:{fontFamily:Xn(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:i.sizing==="auto"?"max-content":$.scalingValue(i.width,r),letterSpacing:$.scalingValue(s,r),wordSpacing:$.scalingValue(d,r),textAlign:u,fontSize:$.scalingValue(L.fontSize,r),lineHeight:$.scalingValue(L.lineHeight,r),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:f,transitionDuration:y.duration?`${Math.round(parseInt(y.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:te.captionTextInner,style:{"--link-hover-color":O.linkHoverColor,"--link-color":O.linkColor,position:"relative",top:$.scalingValue(O.offset.y,r),left:$.scalingValue(O.offset.x,r)},children:a.jsx(tn,{content:C.imageCaption})})},A))})}),a.jsx(kr,{onMove:C=>{T(C.index)},ref:l,options:{arrows:!1,speed:y.duration?parseInt(y.duration):500,autoplay:P.autoPlay!==null,...P.autoPlay!==null&&{interval:parseInt(P.autoPlay)*1e3},direction:_==="horiz"||y.type==="fade in"?"ltr":"ttb",pagination:!1,drag:P.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:y.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((C,A)=>a.jsx(Fr,{children:a.jsx("div",{className:te.sliderItem,children:a.jsx("div",{className:te.imgWrapper,children:a.jsx("img",{className:ve(te.sliderImage,{[te.contain]:C.image.objectFit==="contain",[te.cover]:C.image.objectFit==="cover"}),src:C.image.url,alt:C.image.name??""})})})},A))},z),x.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(te.arrow,{[te.arrowVertical]:_==="vert",[te.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{onClick:()=>{V("-1")},className:te.arrowInner,style:{transform:`translate(${$.scalingValue(N,r)}, ${$.scalingValue(D*(_==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(yt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:ve(te.arrowImg,te.mirror)}),!x.arrowsImgUrl&&a.jsx(Qr,{color:x.color,className:ve(te.arrowIcon,te.arrowImg,te.mirror)})]})}),a.jsx("div",{className:ve(te.arrow,te.nextArrow,{[te.arrowVertical]:_==="vert",[te.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{className:te.arrowInner,onClick:()=>V("+1"),style:{transform:`translate(${$.scalingValue(N*(_==="horiz"?-1:1),r)}, ${$.scalingValue(D,r)}) scale(${e.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(yt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:te.arrowImg}),!x.arrowsImgUrl&&a.jsx(Qr,{color:x.color,className:ve(te.arrowIcon,te.arrowImg)})]})})]}),P.triggersList.click&&a.jsx("div",{className:te.clickOverlay,onClick:()=>{o&&o.go("+1")}}),E.isActive&&a.jsx("div",{className:ve(te.pagination,{[te.paginationInsideBottom]:E.position==="inside-1"&&_==="horiz",[te.paginationInsideTop]:E.position==="inside-2"&&_==="horiz",[te.paginationOutsideBottom]:E.position==="outside-1"&&_==="horiz",[te.paginationOutsideTop]:E.position==="outside-2"&&_==="horiz",[te.paginationInsideLeft]:E.position==="inside-1"&&_==="vert",[te.paginationInsideRight]:E.position==="inside-2"&&_==="vert",[te.paginationOutsideLeft]:E.position==="outside-1"&&_==="vert",[te.paginationOutsideRight]:E.position==="outside-2"&&_==="vert",[te.paginationVertical]:_==="vert"}),children:a.jsx("div",{className:te.paginationInner,style:{backgroundColor:E.colors[2],transform:`scale(${E.scale/100}) translate(${$.scalingValue(E.offset.x,r)}, ${$.scalingValue(E.offset.y,r)}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:t.map((C,A)=>a.jsx("button",{onClick:()=>{o&&o.go(A)},className:ve(te.paginationItem),children:a.jsx("div",{className:ve(te.dot,{[te.activeDot]:A===S}),style:{backgroundColor:A===S?E.colors[0]:E.colors[1],"--pagination-hover-color":E.hover}})},A))})})]})})}function Qr({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 pl={element:ul,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"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"]}},ml="ImageRevealSlider-module__imageRevealSlider___UE5Ob",gl="ImageRevealSlider-module__image___Qjt-e",hl="ImageRevealSlider-module__link___N-iLG",fl="ImageRevealSlider-module__cursor___2U03d",At={imageRevealSlider:ml,image:gl,link:hl,cursor:fl};function eo(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const l=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*l,c=l/2,s=i/2;if(e>=r.x-c&&e<=r.x+c&&t>=r.y-s&&t<=r.y+s)return!0}return!1}function rr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function yl(e,t,n,r){let o,l;if(t==="custom"){o=n;const i=await rr(e);l=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await rr(e);l=i.height/i.width*o}else{const i=await rr(e);o=i.width,l=i.height}return{width:o,height:l,finalWidth:`${o}px`}}function vl({settings:e,content:t,isEditor:n}){const[r,o]=g.useState(null),[l,i]=g.useState([]),[c,s]=g.useState(0),u=g.useRef(0),[d,L]=g.useState({x:0,y:0}),[b,f]=g.useState(1),[p,m]=g.useState("none"),v=g.useRef({x:0,y:0}),[h,S]=g.useState(!1),{sizeType:T,imageWidth:z,randomRangeImageWidth:F}=e.imageSize,{revealPosition:_,visible:y}=e.position,{cursorType:x,target:E,defaultCursorScale:O,defaultCursor:P,hoverCursorScale:H,hoverCursor:N}=e.cursor;g.useEffect(()=>{if(!r)return;const C=(k,W)=>{const M=r.getBoundingClientRect(),Z=k-M.left,ae=W-M.top;if(L({x:Z,y:ae}),x==="system"){m("none"),f(1);return}const ne=Z,ue=ae,R=document.elementFromPoint(M.left+ne,M.top+ue);if(R&&R.closest("a")){m("none"),f(1);return}const re=eo(ne,ue,l)||E==="area"?{img:N??"none",scale:H}:{img:P??"none",scale:O};m(re.img),f(re.scale)},A=k=>{k.stopPropagation(),v.current={x:k.clientX,y:k.clientY},C(k.clientX,k.clientY)},I=()=>{h&&C(v.current.x,v.current.y)};return r.addEventListener("mousemove",A),window.addEventListener("scroll",I,!0),()=>{r.removeEventListener("mousemove",A),window.removeEventListener("scroll",I,!0)}},[r,h,d,x,E,N,P,H,O,l]),g.useEffect(()=>{h||(m("none"),f(0))},[h]);const D=async(C,A,I,k={})=>{const{width:W,height:M,finalWidth:Z}=await yl(C.image.url,T,z,F);let ae=0,ne=0;_==="same"?(ae=A/2,ne=I/2):(ae=k.x??Math.random()*A,ne=k.y??Math.random()*I);const ue=Math.min(Math.max(ae,W/2),A-W/2),R=Math.min(Math.max(ne,M/2),I-M/2);return{id:u.current++,url:C.image.url,link:C.link,name:C.image.name,x:ue,y:R,width:Z}};g.useEffect(()=>{if(!r||t.length===0)return;const C=r.getBoundingClientRect(),A=C.width,I=C.height,k=[];(async()=>{const M=t[0],Z=await D(M,A,I);k.push(Z),i(k),s(1)})()},[T,z,F,_,r]),g.useEffect(()=>{y==="last One"&&i(C=>C.length>0?[C[C.length-1]]:[])},[y]);const V=async C=>{if(!r)return;const A=r.getBoundingClientRect(),I=C.clientX-A.left,k=C.clientY-A.top;if(E==="image"&&!eo(I,k,l))return;let W=0,M=0;_==="on Click"?(W=I,M=k):_==="same"?(W=A.width/2,M=A.height/2):(W=Math.random()*A.width,M=Math.random()*A.height);const Z=t[c],ae=await D(Z,A.width,A.height,{x:W,y:M});i(ne=>y==="all"?[...ne,ae]:[ae]),s(ne=>ne>=t.length-1?0:ne+1)};return a.jsxs("div",{ref:o,onClick:V,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:At.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[l.map(C=>a.jsx("div",{className:At.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:At.link,children:a.jsx("img",{src:C.url,alt:C.name,className:At.image},C.id)}):a.jsx("img",{src:C.url,alt:C.name,className:At.image},C.id)},C.id)),h&&a.jsx("div",{className:At.cursor,style:{left:`${d.x}px`,top:`${d.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const bl={element:vl,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{width:"100%",height:"100%"},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},xl="LightBox-module__hidden___9s-9x",Cl="LightBox-module__heroImage___sTxNF",Sl="LightBox-module__background___rm9ml",$l="LightBox-module__editor___4ACaY",wl="LightBox-module__contentStyle___Bgnsq",Tl="LightBox-module__imageStyle___tLIlB",Ll="LightBox-module__imgWrapper___LuFUp",_l="LightBox-module__contain___8-yaS",Wl="LightBox-module__cover___hNvOG",El="LightBox-module__caption___b6L2I",Pl="LightBox-module__captionTextInner___rCGNH",Al="LightBox-module__lightboxSplide___XFuWC",Il="LightBox-module__arrow___iz38X",Rl="LightBox-module__arrowVertical___Zfz81",kl="LightBox-module__nextArrow___zkAQN",Fl="LightBox-module__arrowInner___p48sW",Ml="LightBox-module__arrowIcon___3VaFf",Hl="LightBox-module__arrowImg___pNV88",Nl="LightBox-module__mirror___pjeXc",Ol="LightBox-module__thumbsWrapper___GB-nU",Bl="LightBox-module__thumbsContainerVertical___wttk5",Dl="LightBox-module__thumbsContainer___osSma",jl="LightBox-module__thumbsAlignStart___MO6tY",zl="LightBox-module__thumbsAlignCenter___Q4sUx",Vl="LightBox-module__thumbsAlignEnd___p4y9R",Kl="LightBox-module__thumbItem___HvnF3",Gl="LightBox-module__closeButton___g2khP",Ul="LightBox-module__fadeIn___0m5GW",ql="LightBox-module__slideInLeft___gPYwC",Yl="LightBox-module__slideInRight___S-pPp",Xl="LightBox-module__slideInTop___DFdAj",Zl="LightBox-module__slideInBottom___m27kZ",Jl="LightBox-module__fadeOut___55qBR",Ql="LightBox-module__slideOutLeft___NvU7P",es="LightBox-module__slideOutRight___SK7eC",ts="LightBox-module__slideOutTop___Vgg0z",ns="LightBox-module__slideOutBottom___nJ0Ef",rs="LightBox-module__scaleSlide___vZriG",G={hidden:xl,heroImage:Cl,background:Sl,editor:$l,contentStyle:wl,imageStyle:Tl,imgWrapper:Ll,contain:_l,cover:Wl,caption:El,captionTextInner:Pl,lightboxSplide:Al,arrow:Il,arrowVertical:Rl,nextArrow:kl,arrowInner:Fl,arrowIcon:Ml,arrowImg:Hl,mirror:Nl,thumbsWrapper:Ol,thumbsContainerVertical:Bl,thumbsContainer:Dl,thumbsAlignStart:jl,thumbsAlignCenter:zl,thumbsAlignEnd:Vl,thumbItem:Kl,closeButton:Gl,fadeIn:Ul,slideInLeft:ql,slideInRight:Yl,slideInTop:Xl,slideInBottom:Zl,fadeOut:Jl,slideOutLeft:Ql,slideOutRight:es,slideOutTop:ts,slideOutBottom:ns,scaleSlide:rs},vn=(e,t,n)=>{const r={},[o,l]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),l==="left"?(r.left="0",r.right="auto"):l==="center"?(r.left="50%",r.right="auto"):l==="right"&&(r.left="auto",r.right="0"),o==="middle"&&l==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:l==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:r.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,r};function Yo(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function to(e){const t=e.getBoundingClientRect(),n=Yo(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,i=e.naturalHeight,c=r/o,s=l/i;let u,d;s>c?(u=r,d=r/s):(d=o,u=o*s);const L=t.left+n.left,b=t.top+n.top,f=(r-u)/2+L,p=(o-d)/2+b;return{x:f,y:p,width:u,height:d}}function no(e){const t=e.getBoundingClientRect(),n=Yo(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function ro(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function os(e,t){const n=(()=>{if(e==="fade in")return G.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return G.fadeIn;if(e==="slide in")switch(t){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return G.fadeOut;if(e==="slide in")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})(),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:r,backdropDisappearClass:o,disappearClass:l}}const is=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:l})=>{const[i,c]=g.useState(!1),{url:s}=e.thumbnailBlock.cover;return g.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:s,alt:"Cover",className:G.heroImage,onClick:()=>c(!0)}),a.jsx(as,{isOpen:i,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:l})]})},as=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:l,isEditor:i,metadata:c})=>{var B;const[s,u]=g.useState(0),[d,L]=g.useState(0),[b,f]=g.useState(!1),[p,m]=g.useState(!1),[v,h]=g.useState({}),S=g.useRef(null),T=g.useRef(null),z=g.useRef(null),F=g.useRef(!1),_=g.useRef(null),y=g.useRef(null),x=g.useRef(null),E=g.useRef(null),O=g.useRef(!1),P=g.useRef(null),[H,N]=g.useState(!1),{appear:D,triggers:V,slider:C,thumbnail:A,controls:I,area:k,caption:W,layout:M}=o.lightboxBlock,{appearClass:Z,backdropAppearClass:ae,backdropDisappearClass:ne,disappearClass:ue}=os(D.type,D.direction),R=(c==null?void 0:c.itemId)??null;g.useEffect(()=>{const w=()=>{setTimeout(()=>{var X,J;(J=(X=S.current)==null?void 0:X.splide)==null||J.refresh()},16)},K=()=>{L(X=>X+1)};return window.addEventListener("ArticleEditor.Layout:change",w),window.addEventListener("ArticleEditor.ComponentContent:change",K),()=>{window.removeEventListener("ArticleEditor.Layout:change",w),window.removeEventListener("ArticleEditor.ComponentContent:change",K)}},[]),g.useEffect(()=>{if(!e||!A.isActive){N(!1);return}const w=P.current;if(!w)return;const K=()=>{C.direction==="horiz"?N(w.scrollWidth>w.clientWidth):N(w.scrollHeight>w.clientHeight)};K();const X=new ResizeObserver(K);return X.observe(w),()=>X.disconnect()},[e,A.isActive,n.length,v,C.direction]);const re=g.useCallback(()=>{const w=window.matchMedia("(max-width: 768px)").matches,K=ro(k.color);w&&!i&&K>.9&&(document.body.style.backgroundColor=""),f(!0),F.current=!0;const X=J=>{J.target===_.current&&J.animationName&&(_.current&&y.current&&_.current.removeEventListener("animationend",y.current),y.current=null,F.current&&(F.current=!1,t()),f(!1))};_.current&&(y.current=X,_.current.addEventListener("animationend",X))},[t,k.color,i]),he=(w,K,X)=>{var J,ie;if(w){if(V.type==="click"&&V.switch==="image")V.repeat==="close"&&s===n.length-1?re():(J=S.current)==null||J.go("+1");else if(V.type==="click"&&V.switch==="50/50"){const Q=w.getBoundingClientRect(),ee=K-Q.left,se=X-Q.top,j=Q.width,q=Q.height;let Y;C.direction==="horiz"?Y=ee<j/2?"-1":"+1":Y=se<q/2?"-1":"+1",(ie=S.current)==null||ie.go(Y)}}},me=w=>{if(O.current){O.current=!1;return}const K=n[s],X=(K==null?void 0:K.image.objectFit)==="cover";let J,ie;if("changedTouches"in w&&w.changedTouches.length>0)J=w.changedTouches[0].clientX,ie=w.changedTouches[0].clientY;else if("clientX"in w)J=w.clientX,ie=w.clientY;else return;let Q;if(X&&z.current){const ee=no(z.current);Q=J>=ee.left&&J<=ee.right&&ie>=ee.top&&ie<=ee.bottom}else{const ee=z.current?to(z.current):null;if(!ee){w.target===w.currentTarget&&re();return}Q=J>=ee.x&&J<=ee.x+ee.width&&ie>=ee.y&&ie<=ee.y+ee.height}Q?he(z.current,J,ie):re()},ge=w=>{const K=w.target;(K.classList.contains(G.thumbsWrapper)||K.classList.contains(G.thumbsContainer))&&me(w)};g.useEffect(()=>{if(!e)return;const w=K=>{var X,J;if(K.key==="Escape"){re();return}if(K.key==="ArrowRight"){u(ie=>(ie+1)%Math.max(n.length,1)),(X=S.current)==null||X.go("+1");return}K.key==="ArrowLeft"&&(u(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=S.current)==null||J.go("-1"))};return window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}},[e,re,n.length]),g.useEffect(()=>{if(e){if(u(0),L(K=>K+1),F.current=!1,f(!1),m(!1),h({}),!R)return;const w=new CustomEvent("page-overlay",{detail:{itemId:R}});window.dispatchEvent(w)}return()=>{_.current&&y.current&&(_.current.removeEventListener("animationend",y.current),y.current=null),m(!1)}},[e,R]),g.useEffect(()=>{T.current!==null&&T.current!==C.type&&L(w=>w+1),T.current=C.type},[C.type]),g.useEffect(()=>{if(!e)return;const w=document.body.style.overflow,K=window.matchMedia("(max-width: 768px)").matches,X=ro(k.color);document.body.style.overflow="hidden",m(!1);const J=Q=>{Q.target===_.current&&!F.current&&Q.animationName&&(K&&!i&&X>.9&&(document.body.style.backgroundColor=k.color),m(!0),_.current&&x.current&&_.current.removeEventListener("animationend",x.current),x.current=null)};_.current&&(x.current=J,_.current.addEventListener("animationend",J));const ie=Q=>{const ee=Q.target;ee&&(ee.closest(`.${G.thumbsWrapper}`)||ee.closest(`.${G.thumbsContainer}`))||C.type!=="slide"&&Q.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=w,document.removeEventListener("touchmove",ie),_.current&&x.current&&(_.current.removeEventListener("animationend",x.current),x.current=null),m(!1)}},[e,i,k.color,C.type]),g.useEffect(()=>{if(!e)return;const w=K=>{var J,ie;if(F.current){K.stopPropagation();return}if(O.current){O.current=!1;return}const X=K.target;if(!(X&&(X.closest(`.${G.thumbsContainer}`)||X.closest(`.${G.thumbItem}`)||X.closest(`.${G.arrow}`)||X.closest(`.${G.closeButton}`)||X.closest(`.${G.caption}`)))){if(C.type==="slide"&&V.type==="drag"&&((ie=(J=S.current)==null?void 0:J.splide)!=null&&ie.root)){const Q=S.current.splide.root;if(X&&(Q.contains(X)||Q===X))return}if(K.touches.length===0&&K.changedTouches.length>0){const Q=n[s],ee=(Q==null?void 0:Q.image.objectFit)==="cover",se=K.changedTouches[0];let j;if(ee&&z.current){const q=no(z.current);j=se.clientX>=q.left&&se.clientX<=q.right&&se.clientY>=q.top&&se.clientY<=q.bottom}else{const q=z.current?to(z.current):null;if(!q)return;j=se.clientX>=q.x&&se.clientX<=q.x+q.width&&se.clientY>=q.y&&se.clientY<=q.y+q.height}if(!j){K.stopPropagation(),F.current=!0;const q=Y=>{Y.stopPropagation(),Y.preventDefault(),document.removeEventListener("click",q,!0)};document.addEventListener("click",q,!0),re()}}}};return document.addEventListener("touchend",w,{passive:!0}),()=>{document.removeEventListener("touchend",w)}},[e,re,s,n]);const U=(C.type==="scale"||C.type==="fade")&&C.direction==="vert"&&V.type==="drag";g.useEffect(()=>{var Y,ce;if(!e||!U||!((ce=(Y=S.current)==null?void 0:Y.splide)!=null&&ce.root))return;const w=S.current.splide.root,K=30,X=(oe,pe)=>{if(E.current){const we=Math.abs(oe-E.current.x),Le=Math.abs(pe-E.current.y);(we>0||Le>0)&&(O.current=!0)}},J=oe=>{E.current&&(oe.preventDefault(),X(oe.clientX,oe.clientY))},ie=oe=>{E.current&&oe.touches.length>0&&(oe.preventDefault(),X(oe.touches[0].clientX,oe.touches[0].clientY))},Q=(oe,pe)=>{if(!E.current||!S.current){E.current=null;return}const we=Math.abs(oe-E.current.x),Le=Math.abs(pe-E.current.y);Le>K&&Le>we&&S.current.go(pe<E.current.y?"+1":"-1"),E.current=null},ee=oe=>{E.current&&Q(oe.clientX,oe.clientY),document.removeEventListener("pointerup",ee),document.removeEventListener("pointercancel",ee),document.removeEventListener("pointermove",J)},se=oe=>{if(E.current){if(oe.changedTouches.length>0){const pe=oe.changedTouches[0];Q(pe.clientX,pe.clientY)}document.removeEventListener("touchend",se),document.removeEventListener("touchcancel",se),document.removeEventListener("touchmove",ie)}},j=oe=>{E.current={x:oe.clientX,y:oe.clientY},O.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",ee),document.addEventListener("pointercancel",ee)},q=oe=>{oe.touches.length>0&&(E.current={x:oe.touches[0].clientX,y:oe.touches[0].clientY},O.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",se),document.addEventListener("touchcancel",se))};return w.addEventListener("pointerdown",j),w.addEventListener("touchstart",q),()=>{w.removeEventListener("pointerdown",j),w.removeEventListener("touchstart",q),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ee),document.removeEventListener("pointercancel",ee),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",se),document.removeEventListener("touchcancel",se),E.current=null,O.current=!1}},[e,U,d]);const le={backgroundColor:k.color,backdropFilter:`blur(${k.blur}px)`,animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:po.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:_,className:ve(G.background,b?ne:ae,{[G.editor]:i},{[G.hidden]:!e}),style:{...le,...p&&!i&&!b?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?_:null,className:ve(G.contentStyle,b?ue:Z,{[G.editor]:i},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(kr,{onMove:w=>u(w.index),ref:S,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:V.type==="drag"&&!U,perPage:1,width:"100%",height:"100%",type:C.type==="fade"||C.type==="scale"?"fade":"loop",padding:0,rewind:V.repeat!=="close",start:0},style:{"--splide-speed":C.duration},children:n.map((w,K)=>{const X=vn(M.position,M.offset,i),J=`${$.scalingValue(M.padding.top,i)} ${$.scalingValue(M.padding.right,i)} ${$.scalingValue(M.padding.bottom,i)} ${$.scalingValue(M.padding.left,i)}`,ie=C.type==="scale"?(()=>{const{transform:Q,...ee}=X;return{...ee,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":Q||"none"}})():{...X,position:"absolute",padding:J,boxSizing:"border-box"};return a.jsx(Fr,{children:a.jsx("div",{className:G.imgWrapper,onClick:me,children:a.jsx("img",{ref:K===s?z:null,className:ve(G.imageStyle,{[G.contain]:w.image.objectFit==="contain",[G.cover]:w.image.objectFit==="cover",[G.scaleSlide]:C.type==="scale"}),src:w.image.url,alt:w.image.name??"",style:{...ie,pointerEvents:w.image.objectFit==="contain"?"none":"auto"}})})},K)})},d),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(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(${$.scalingValue(I.offset.x,i)}, ${$.scalingValue(I.offset.y*(C.direction==="horiz"?1:-1),i)}) scale(${I.scale}) rotate(${C.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=S.current)==null?void 0:w.go("-1")},"aria-label":"Previous",children:[I.arrowsImgUrl&&a.jsx(yt,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ve(G.arrowImg,G.mirror)}),!I.arrowsImgUrl&&a.jsx(oo,{color:I.color,className:ve(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:ve(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(${$.scalingValue(I.offset.x*(C.direction==="horiz"?-1:1),i)}, ${$.scalingValue(I.offset.y,i)}) scale(${I.scale}) rotate(${C.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=S.current)==null?void 0:w.go("+1")},"aria-label":"Next",children:[I.arrowsImgUrl&&a.jsx(yt,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:G.arrowImg}),!I.arrowsImgUrl&&a.jsx(oo,{color:I.color,className:ve(G.arrowIcon,G.arrowImg)})]})})]}),k.closeIconUrl&&(()=>{const w=vn(k.closeIconAlign,k.closeIconOffset,i),K=`scale(${k.closeIconScale})`,X=w.transform?`${w.transform} ${K}`:K;return a.jsx("button",{className:G.closeButton,style:{...w,transform:X},onClick:re,"aria-label":"Close lightbox",children:a.jsx(yt,{url:k.closeIconUrl,fill:k.closeIconColor??"#000000",hoverFill:k.closeIconHover??"#cccccc"})})})(),W&&W.isActive&&r.imageCaption&&((B=n[s])==null?void 0:B.imageCaption)&&(()=>{const{widthSettings:w,fontSettings:K,letterSpacing:X,textAlign:J,wordSpacing:ie,fontSizeLineHeight:Q,textAppearance:ee,color:se}=r.imageCaption;return a.jsx("div",{className:G.caption,style:{...vn(W.alignment,W.offset,i),fontFamily:Xn(K.fontFamily),fontWeight:K.fontWeight,fontStyle:K.fontStyle,width:w.sizing==="auto"?"max-content":$.scalingValue(w.width,i),letterSpacing:$.scalingValue(X,i),wordSpacing:$.scalingValue(ie,i),textAlign:J,fontSize:$.scalingValue(Q.fontSize,i),lineHeight:$.scalingValue(Q.lineHeight,i),textTransform:ee.textTransform??"none",textDecoration:ee.textDecoration??"none",fontVariant:ee.fontVariant??"normal",color:se},onClick:j=>j.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":W.linkColor,"--link-hover-color":W.linkHoverColor},children:a.jsx(tn,{content:n[s].imageCaption})})})})(),A.isActive&&(()=>{const[w,K]=A.position.split("-"),X=C.direction==="horiz"?`${w}-left`:A.position,J=vn(X,A.offset,i),ie=()=>{if(C.direction==="horiz"){if(K==="left")return"flex-start";if(K==="center")return"center";if(K==="right")return"flex-end"}else{if(w==="top")return"flex-start";if(w==="middle")return"center";if(w==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:P,className:G.thumbsWrapper,onClick:Q=>ge(Q),style:{position:i?"absolute":"fixed",...J,...C.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]:C.direction==="vert",[G.thumbsAlignStart]:A.align==="start",[G.thumbsAlignCenter]:A.align==="center",[G.thumbsAlignEnd]:A.align==="end"}),style:{gap:$.scalingValue(A.grid.gap,i),justifyContent:H?"flex-start":ie()},children:n.map((Q,ee)=>{const se=ee===s,j=v[ee],Y=A.grid.size*(se?A.activeState.scale:1),ce=()=>{if(A.fit!=="fit")return{};if(!j)return C.direction==="horiz"?{height:$.scalingValue(Y,i)}:{width:$.scalingValue(Y,i)};const oe=j.width/j.height;if(C.direction==="horiz"){const pe=Y,we=pe*oe;return{width:$.scalingValue(we,i),height:$.scalingValue(pe,i)}}else{const pe=Y,we=pe/oe;return{width:$.scalingValue(pe,i),height:$.scalingValue(we,i)}}};return a.jsx("button",{className:G.thumbItem,style:{...C.direction==="horiz"&&A.fit!=="fit"?{height:$.scalingValue(Y,i)}:{},...C.direction==="vert"&&A.fit!=="fit"?{width:$.scalingValue(Y,i)}:{},...A.fit==="cover"?{width:$.scalingValue(Y,i),height:$.scalingValue(Y,i)}:{},...ce(),transition:se?"all 0.25s ease-out":"none",opacity:se?A.activeState.opacity/100:A.opacity/100,"--thumb-hover":A.activeState.opacity/100},onClick:oe=>{var pe;oe.stopPropagation(),u(ee),(pe=S.current)==null||pe.go(ee)},onMouseEnter:()=>{var oe;A.triggers==="hov"&&((oe=S.current)==null||oe.go(ee))},children:a.jsx("img",{src:Q.image.url,alt:Q.image.name??"",onLoad:oe=>{const pe=oe.currentTarget;pe.naturalWidth&&pe.naturalHeight&&h(we=>({...we,[ee]:{width:pe.naturalWidth,height:pe.naturalHeight}}))},style:{objectFit:A.fit==="cover"?"cover":"contain",...A.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...A.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Q.image.name}-${ee}`)})})})})()]})]}),document.getElementById(l))};function oo({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 ls={element:is,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function bn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ss(e){return`
|
|
7
|
-
.${
|
|
6
|
+
*/const xs="RichTextRenderer-module__link___BWeZ2",Cs={link:xs},Ss=t=>{const e=t.trim();return!e||e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?!1:e.split(/\s+/g).filter(Boolean).some(r=>/^\d/.test(r))},nr=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,r,o;return{fontFamily:nr(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:(r=t.textAppearance)==null?void 0:r.textDecoration,fontVariant:(o=t.textAppearance)==null?void 0:o.fontVariant,color:t.color}}const un=({content:t})=>{const e=n=>n.map((r,o)=>r.type==="link"?a.jsx("a",{className:Cs.link,href:r.value,target:r.target,children:e(r.children)},o):a.jsx("span",{style:$s(r),children:r.text},o));return a.jsx(a.Fragment,{children:t.map((n,r)=>{const o=n.children;return a.jsx("div",{children:e(o)},r)})})};function $s(t){return{...t.fontFamily&&{fontFamily:nr(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-",uo={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:r="",style:o})=>{const[l,i]=m.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return m.useEffect(()=>{if(typeof window<"u"&&window.CSS){const s=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(s)}},[]),!Ls(t)||!l?a.jsx("img",{src:t,alt:"",className:xt(uo.img,r),style:o}):a.jsx("span",{"data-supports-mask":l,className:xt(uo.svg,r),style:{"--svg":_s(t),"--fill":e,"--hover-fill":n,...o??{}}})},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:r}){const[o,l]=m.useState(null),{widthSettings:i,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=>{o&&o.go(C)};return m.useEffect(()=>{if(!$)return;const C=new ResizeObserver(k=>{if(!o)return;const[I]=k;g({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return C.observe($),()=>C.unobserve($)},[$]),m.useEffect(()=>{!o||O.current===y.type||(W(C=>C+1),O.current=y.type)},[y.type]),a.jsx("div",{className:xt(tt.wrapper,{[tt.editor]:r}),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&&r,[tt.active]:k===x}),style:{fontFamily:nr(s.fontFamily),fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":S.scalingValue(i.width,r),letterSpacing:S.scalingValue(d,r),wordSpacing:S.scalingValue(c,r),textAlign:u,fontSize:S.scalingValue(L.fontSize,r),lineHeight:S.scalingValue(L.lineHeight,r),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,r),left:S.scalingValue(H.offset.x,r)},children:a.jsx(un,{content:C.imageCaption})})},k))})}),a.jsx(Vr,{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(Kr,{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,r)}, ${S.scalingValue(V*(_==="horiz"?1:-1),r)}) 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(po,{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),r)}, ${S.scalingValue(V,r)}) 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(po,{color:w.color,className:xt(tt.arrowIcon,tt.arrowImg)})]})})]}),F.triggersList.click&&a.jsx("div",{className:tt.clickOverlay,onClick:()=>{o&&o.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,r)}, ${S.scalingValue(E.offset.y,r)}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:e.map((C,k)=>a.jsx("button",{onClick:()=>{o&&o.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 po({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:{width:400,height:400},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"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 mo(t,e,n){for(const r of n){const o=new Image;o.src=r.url;const l=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*l,s=l/2,d=i/2;if(t>=r.x-s&&t<=r.x+s&&e>=r.y-d&&e<=r.y+d)return!0}return!1}function ur(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,r){let o,l;if(e==="custom"){o=n;const i=await ur(t);l=i.height/i.width*o}else if(e==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await ur(t);l=i.height/i.width*o}else{const i=await ur(t);o=i.width,l=i.height}return{width:o,height:l,finalWidth:`${o}px`}}function Ms({settings:t,content:e,isEditor:n}){const[r,o]=m.useState(null),[l,i]=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(!r)return;const C=(A,P)=>{const N=r.getBoundingClientRect(),Q=A-N.left,st=P-N.top;if(L({x:Q,y:st}),w==="system"){g("none"),h(1);return}const rt=Q,ut=st,M=document.elementFromPoint(N.left+rt,N.top+ut);if(M&&M.closest("a")){g("none"),h(1);return}const J=mo(rt,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 r.addEventListener("mousemove",k),window.addEventListener("scroll",I,!0),()=>{r.removeEventListener("mousemove",k),window.removeEventListener("scroll",I,!0)}},[r,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,rt=0;_==="same"?(st=k/2,rt=I/2):(st=A.x??Math.random()*k,rt=A.y??Math.random()*I);const ut=Math.min(Math.max(st,P/2),k-P/2),M=Math.min(Math.max(rt,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(!r||e.length===0)return;const C=r.getBoundingClientRect(),k=C.width,I=C.height,A=[];(async()=>{const N=e[0],Q=await V(N,k,I);A.push(Q),i(A),d(1)})()},[b,R,W,_,r]),m.useEffect(()=>{y==="last One"&&i(C=>C.length>0?[C[C.length-1]]:[])},[y]);const K=async C=>{if(!r)return;const k=r.getBoundingClientRect(),I=C.clientX-k.left,A=C.clientY-k.top;if(E==="image"&&!mo(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});i(rt=>y==="all"?[...rt,st]:[st]),d(rt=>rt>=e.length-1?0:rt+1)};return a.jsxs("div",{ref:o,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:{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",rl="LightBox-module__thumbsWrapper___GB-nU",ol="LightBox-module__thumbsContainerVertical___wttk5",il="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:rl,thumbsContainerVertical:ol,thumbsContainer:il,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 r={},[o,l]=t.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),l==="left"?(r.left="0",r.right="auto"):l==="center"?(r.left="50%",r.right="auto"):l==="right"&&(r.left="auto",r.right="0"),o==="middle"&&l==="center"?r.transform=`translate(calc(-50% + ${S.scalingValue(e.x,n)}), calc(-50% + ${S.scalingValue(e.y,n)}))`:o==="middle"?r.transform=`translate(${S.scalingValue(e.x,n)}, calc(-50% + ${S.scalingValue(e.y,n)}))`:l==="center"?r.transform=`translate(calc(-50% + ${S.scalingValue(e.x,n)}), ${S.scalingValue(e.y,n)})`:r.transform=`translate(${S.scalingValue(e.x,n)}, ${S.scalingValue(e.y,n)})`,r};function di(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 go(t){const e=t.getBoundingClientRect(),n=di(t),r=Math.max(0,e.width-n.left-n.right),o=Math.max(0,e.height-n.top-n.bottom),l=t.naturalWidth,i=t.naturalHeight,s=r/o,d=l/i;let u,c;d>s?(u=r,c=r/d):(c=o,u=o*d);const L=e.left+n.left,v=e.top+n.top,h=(r-u)/2+L,p=(o-c)/2+v;return{x:h,y:p,width:u,height:c}}function ho(t){const e=t.getBoundingClientRect(),n=di(t);return{left:e.left+n.left,right:e.right-n.right,top:e.top+n.top,bottom:e.bottom-n.bottom}}function fo(t){const e=t.match(/rgba?\(([^)]+)\)/);if(e){const r=e[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=t.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,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})(),r=(()=>{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})(),o=(()=>{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:r,backdropDisappearClass:o,disappearClass:l}}const $l=({settings:t,content:e,styles:n,portalId:r,activeEvent:o,isEditor:l})=>{const[i,s]=m.useState(!1),{url:d}=t.thumbnailBlock.cover;return m.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:d,alt:"Cover",className:G.heroImage,onClick:()=>s(!0)}),a.jsx(wl,{isOpen:i,onClose:()=>s(!1),content:e,settings:t,lightboxStyles:n,portalId:r,isEditor:l})]})},wl=({isOpen:t,onClose:e,content:n,lightboxStyles:r,settings:o,portalId:l,isEditor:i,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}=o.lightboxBlock,{appearClass:Q,backdropAppearClass:st,backdropDisappearClass:rt,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=fo(A.color);T&&!i&&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,i]),ht=(T,U,q)=>{var Z,ot;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 it=T.getBoundingClientRect(),et=U-it.left,dt=q-it.top,j=it.width,X=it.height;let Y;C.direction==="horiz"?Y=et<j/2?"-1":"+1":Y=dt<X/2?"-1":"+1",(ot=x.current)==null||ot.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,ot;if("changedTouches"in T&&T.changedTouches.length>0)Z=T.changedTouches[0].clientX,ot=T.changedTouches[0].clientY;else if("clientX"in T)Z=T.clientX,ot=T.clientY;else return;let it;if(q&&R.current){const et=ho(R.current);it=Z>=et.left&&Z<=et.right&&ot>=et.top&&ot<=et.bottom}else{const et=R.current?go(R.current):null;if(!et){T.target===T.currentTarget&&J();return}it=Z>=et.x&&Z<=et.x+et.width&&ot>=et.y&&ot<=et.y+et.height}it?ht(R.current,Z,ot):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(ot=>(ot+1)%Math.max(n.length,1)),(q=x.current)==null||q.go("+1");return}U.key==="ArrowLeft"&&(u(ot=>(ot-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=fo(A.color);document.body.style.overflow="hidden",g(!1);const Z=it=>{it.target===_.current&&!W.current&&it.animationName&&(U&&!i&&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 ot=it=>{const et=it.target;et&&(et.closest(`.${G.thumbsWrapper}`)||et.closest(`.${G.thumbsContainer}`))||C.type!=="slide"&&it.preventDefault()};return document.addEventListener("touchmove",ot,{passive:!1}),()=>{document.body.style.overflow=T,document.removeEventListener("touchmove",ot),_.current&&w.current&&(_.current.removeEventListener("animationend",w.current),w.current=null),g(!1)}},[t,i,A.color,C.type]),m.useEffect(()=>{if(!t)return;const T=U=>{var Z,ot;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"&&((ot=(Z=x.current)==null?void 0:Z.splide)!=null&&ot.root)){const it=x.current.splide.root;if(q&&(it.contains(q)||it===q))return}if(U.touches.length===0&&U.changedTouches.length>0){const it=n[d],et=(it==null?void 0:it.image.objectFit)==="cover",dt=U.changedTouches[0];let j;if(et&&R.current){const X=ho(R.current);j=dt.clientX>=X.left&&dt.clientX<=X.right&&dt.clientY>=X.top&&dt.clientY<=X.bottom}else{const X=R.current?go(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))},ot=nt=>{E.current&&nt.touches.length>0&&(nt.preventDefault(),q(nt.touches[0].clientX,nt.touches[0].clientY))},it=(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&&it(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];it(ct.clientX,ct.clientY)}document.removeEventListener("touchend",dt),document.removeEventListener("touchcancel",dt),document.removeEventListener("touchmove",ot)}},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",ot,{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",ot),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:_o.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:_,className:xt(G.background,v?rt:st,{[G.editor]:i},{[G.hidden]:!t}),style:{...at,...p&&!i&&!v?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?_:null,className:xt(G.contentStyle,v?ut:Q,{[G.editor]:i},{[G.hidden]:!t}),style:{animationDuration:`${parseInt(V.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Vr,{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,i),Z=`${S.scalingValue(N.padding.top,i)} ${S.scalingValue(N.padding.right,i)} ${S.scalingValue(N.padding.bottom,i)} ${S.scalingValue(N.padding.left,i)}`,ot=C.type==="scale"?(()=>{const{transform:it,...et}=q;return{...et,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":it||"none"}})():{...q,position:"absolute",padding:Z,boxSizing:"border-box"};return a.jsx(Kr,{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:{...ot,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,i)}, ${S.scalingValue(I.offset.y*(C.direction==="horiz"?1:-1),i)}) 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(yo,{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),i)}, ${S.scalingValue(I.offset.y,i)}) 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(yo,{color:I.color,className:xt(G.arrowIcon,G.arrowImg)})]})})]}),A.closeIconUrl&&(()=>{const T=_n(A.closeIconAlign,A.closeIconOffset,i),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&&r.imageCaption&&((B=n[d])==null?void 0:B.imageCaption)&&(()=>{const{widthSettings:T,fontSettings:U,letterSpacing:q,textAlign:Z,wordSpacing:ot,fontSizeLineHeight:it,textAppearance:et,color:dt}=r.imageCaption;return a.jsx("div",{className:G.caption,style:{..._n(P.alignment,P.offset,i),fontFamily:nr(U.fontFamily),fontWeight:U.fontWeight,fontStyle:U.fontStyle,width:T.sizing==="auto"?"max-content":S.scalingValue(T.width,i),letterSpacing:S.scalingValue(q,i),wordSpacing:S.scalingValue(ot,i),textAlign:Z,fontSize:S.scalingValue(it.fontSize,i),lineHeight:S.scalingValue(it.lineHeight,i),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,i),ot=()=>{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:it=>gt(it),style:{position:i?"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,i),justifyContent:O?"flex-start":ot()},children:n.map((it,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,i)}:{width:S.scalingValue(Y,i)};const nt=j.width/j.height;if(C.direction==="horiz"){const ct=Y,Ct=ct*nt;return{width:S.scalingValue(Ct,i),height:S.scalingValue(ct,i)}}else{const ct=Y,Ct=ct/nt;return{width:S.scalingValue(ct,i),height:S.scalingValue(Ct,i)}}};return a.jsx("button",{className:G.thumbItem,style:{...C.direction==="horiz"&&k.fit!=="fit"?{height:S.scalingValue(Y,i)}:{},...C.direction==="vert"&&k.fit!=="fit"?{width:S.scalingValue(Y,i)}:{},...k.fit==="cover"?{width:S.scalingValue(Y,i),height:S.scalingValue(Y,i)}:{},...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:it.image.url,alt:it.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%"}:{}}})},`${it.image.name}-${et}`)})})})})()]})]}),document.getElementById(l))};function yo({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:{width:440,height:550},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function En(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Ll(t){return`
|
|
7
|
+
.${t}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${En(48)};
|
|
12
12
|
}
|
|
13
|
-
.${
|
|
14
|
-
.${
|
|
13
|
+
.${t}-wrapper.${t}-type-C .${t}-input:focus-visible,
|
|
14
|
+
.${t}-wrapper.${t}-type-C .${t}-button:focus-visible {
|
|
15
15
|
outline: none;
|
|
16
16
|
}
|
|
17
|
-
.${
|
|
17
|
+
.${t}-form {
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
width: 100%;
|
|
21
21
|
}
|
|
22
|
-
.${
|
|
22
|
+
.${t}-fields {
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
flex: 1;
|
|
26
26
|
min-width: 0;
|
|
27
27
|
}
|
|
28
|
-
.${
|
|
28
|
+
.${t}-field-group {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
flex: 1;
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
|
-
.${
|
|
35
|
-
gap: ${
|
|
34
|
+
.${t}-field-group.${t}-labeled {
|
|
35
|
+
gap: ${En(4)};
|
|
36
36
|
}
|
|
37
|
-
.${
|
|
37
|
+
.${t}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
39
|
-
color: var(--${
|
|
39
|
+
color: var(--${t}-label-text-color);
|
|
40
40
|
}
|
|
41
|
-
.${
|
|
41
|
+
.${t}-input {
|
|
42
42
|
width: 100%;
|
|
43
43
|
box-sizing: border-box;
|
|
44
44
|
outline: none;
|
|
45
45
|
-webkit-tap-highlight-color: transparent;
|
|
46
|
-
background-color: var(--${
|
|
47
|
-
color: var(--${
|
|
48
|
-
border-color: var(--${
|
|
46
|
+
background-color: var(--${t}-input-color);
|
|
47
|
+
color: var(--${t}-input-text-color);
|
|
48
|
+
border-color: var(--${t}-input-border-color);
|
|
49
49
|
transition: color 250ms, border-color 250ms, background-color 250ms;
|
|
50
50
|
}
|
|
51
|
-
.${
|
|
52
|
-
color: var(--${
|
|
51
|
+
.${t}-input::placeholder {
|
|
52
|
+
color: var(--${t}-placeholder-color);
|
|
53
53
|
opacity: 1;
|
|
54
54
|
transition: color 250ms, opacity 250ms;
|
|
55
55
|
}
|
|
56
|
-
.${
|
|
57
|
-
background-color: var(--${
|
|
58
|
-
color: var(--${
|
|
59
|
-
border-color: var(--${
|
|
60
|
-
}
|
|
61
|
-
.${
|
|
62
|
-
background-color: var(--${
|
|
63
|
-
color: var(--${
|
|
64
|
-
border-color: var(--${
|
|
65
|
-
}
|
|
66
|
-
.${
|
|
67
|
-
.${
|
|
68
|
-
.${
|
|
69
|
-
background-color: var(--${
|
|
70
|
-
color: var(--${
|
|
71
|
-
border-color: var(--${
|
|
72
|
-
}
|
|
73
|
-
.${
|
|
74
|
-
background-color: var(--${
|
|
75
|
-
color: var(--${
|
|
76
|
-
border-color: var(--${
|
|
77
|
-
}
|
|
78
|
-
.${
|
|
79
|
-
background-color: var(--${
|
|
80
|
-
color: var(--${
|
|
81
|
-
border-color: var(--${
|
|
82
|
-
}
|
|
83
|
-
.${
|
|
84
|
-
.${
|
|
56
|
+
.${t}-input:hover {
|
|
57
|
+
background-color: var(--${t}-hover-input-color, var(--${t}-input-color));
|
|
58
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
59
|
+
border-color: var(--${t}-hover-input-border-color, var(--${t}-input-border-color));
|
|
60
|
+
}
|
|
61
|
+
.${t}-wrapper.${t}-state-hover .${t}-input {
|
|
62
|
+
background-color: var(--${t}-hover-input-color, var(--${t}-input-color));
|
|
63
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
64
|
+
border-color: var(--${t}-hover-input-border-color, var(--${t}-input-border-color));
|
|
65
|
+
}
|
|
66
|
+
.${t}-input:focus,
|
|
67
|
+
.${t}-input:focus-visible,
|
|
68
|
+
.${t}-wrapper.${t}-state-focus .${t}-input {
|
|
69
|
+
background-color: var(--${t}-focus-input-color, var(--${t}-input-color));
|
|
70
|
+
color: var(--${t}-focus-input-text-color, var(--${t}-input-text-color));
|
|
71
|
+
border-color: var(--${t}-focus-input-border-color, var(--${t}-input-border-color));
|
|
72
|
+
}
|
|
73
|
+
.${t}-input[data-filled="true"] {
|
|
74
|
+
background-color: var(--${t}-filled-input-color, var(--${t}-input-color));
|
|
75
|
+
color: var(--${t}-filled-input-text-color, var(--${t}-input-text-color));
|
|
76
|
+
border-color: var(--${t}-filled-input-border-color, var(--${t}-input-border-color));
|
|
77
|
+
}
|
|
78
|
+
.${t}-wrapper.${t}-state-filled .${t}-button {
|
|
79
|
+
background-color: var(--${t}-filled-button-color, var(--${t}-button-color));
|
|
80
|
+
color: var(--${t}-filled-button-text-color, var(--${t}-button-text-color));
|
|
81
|
+
border-color: var(--${t}-filled-button-border-color, var(--${t}-button-border-color));
|
|
82
|
+
}
|
|
83
|
+
.${t}-wrapper.${t}-state-success .${t}-input,
|
|
84
|
+
.${t}-wrapper.${t}-state-success .${t}-button {
|
|
85
85
|
pointer-events: none;
|
|
86
86
|
}
|
|
87
|
-
.${
|
|
87
|
+
.${t}-wrapper.${t}-state-error .${t}-input {
|
|
88
88
|
}
|
|
89
|
-
.${
|
|
89
|
+
.${t}-input[data-field-type="textarea"] {
|
|
90
90
|
resize: vertical;
|
|
91
91
|
}
|
|
92
|
-
.${
|
|
92
|
+
.${t}-input:disabled {
|
|
93
93
|
cursor: not-allowed;
|
|
94
94
|
}
|
|
95
|
-
.${
|
|
95
|
+
.${t}-button {
|
|
96
96
|
cursor: pointer;
|
|
97
97
|
white-space: nowrap;
|
|
98
98
|
box-sizing: border-box;
|
|
99
99
|
outline: none;
|
|
100
|
-
background-color: var(--${
|
|
101
|
-
color: var(--${
|
|
102
|
-
border-color: var(--${
|
|
100
|
+
background-color: var(--${t}-button-color);
|
|
101
|
+
color: var(--${t}-button-text-color);
|
|
102
|
+
border-color: var(--${t}-button-border-color);
|
|
103
103
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
104
104
|
}
|
|
105
|
-
.${
|
|
106
|
-
background-color: var(--${
|
|
107
|
-
color: var(--${
|
|
108
|
-
border-color: var(--${
|
|
109
|
-
}
|
|
110
|
-
.${
|
|
111
|
-
background-color: var(--${
|
|
112
|
-
color: var(--${
|
|
113
|
-
border-color: var(--${
|
|
114
|
-
}
|
|
115
|
-
.${
|
|
116
|
-
.${
|
|
117
|
-
.${
|
|
118
|
-
background-color: var(--${
|
|
119
|
-
color: var(--${
|
|
120
|
-
border-color: var(--${
|
|
121
|
-
}
|
|
122
|
-
.${
|
|
123
|
-
.${
|
|
105
|
+
.${t}-button:hover {
|
|
106
|
+
background-color: var(--${t}-hover-button-color, var(--${t}-button-color));
|
|
107
|
+
color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
108
|
+
border-color: var(--${t}-hover-button-border-color, var(--${t}-button-border-color));
|
|
109
|
+
}
|
|
110
|
+
.${t}-wrapper.${t}-state-hover .${t}-button {
|
|
111
|
+
background-color: var(--${t}-hover-button-color, var(--${t}-button-color));
|
|
112
|
+
color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
113
|
+
border-color: var(--${t}-hover-button-border-color, var(--${t}-button-border-color));
|
|
114
|
+
}
|
|
115
|
+
.${t}-button:focus,
|
|
116
|
+
.${t}-button:focus-visible,
|
|
117
|
+
.${t}-wrapper.${t}-state-focus .${t}-button {
|
|
118
|
+
background-color: var(--${t}-focus-button-color, var(--${t}-button-color));
|
|
119
|
+
color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
120
|
+
border-color: var(--${t}-focus-button-border-color, var(--${t}-button-border-color));
|
|
121
|
+
}
|
|
122
|
+
.${t}-input:focus-visible,
|
|
123
|
+
.${t}-wrapper.${t}-state-focus .${t}-input {
|
|
124
124
|
outline: none;
|
|
125
125
|
}
|
|
126
|
-
.${
|
|
127
|
-
.${
|
|
126
|
+
.${t}-button:focus-visible,
|
|
127
|
+
.${t}-wrapper.${t}-state-focus .${t}-button {
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
|
-
.${
|
|
131
|
-
margin-top: ${
|
|
132
|
-
color: var(--${
|
|
130
|
+
.${t}-success {
|
|
131
|
+
margin-top: ${En(8)};
|
|
132
|
+
color: var(--${t}-success-success-color, var(--${t}-success-color));
|
|
133
133
|
}
|
|
134
|
-
.${
|
|
135
|
-
margin-top: ${
|
|
136
|
-
color: var(--${
|
|
134
|
+
.${t}-error {
|
|
135
|
+
margin-top: ${En(8)};
|
|
136
|
+
color: var(--${t}-error-error-color, var(--${t}-error-color));
|
|
137
137
|
}
|
|
138
|
-
.${
|
|
138
|
+
.${t}-overlay-anchor {
|
|
139
139
|
position: relative;
|
|
140
140
|
height: auto;
|
|
141
141
|
}
|
|
142
|
-
`}function
|
|
142
|
+
`}function _l({settings:t,isEditor:e,metadata:n,activeEvent:r}){const{prefix:o}=S.useScopedStyles(),{type:l="A",fieldsToShow:i=2,fields:s=[],buttonLabel:d,gap:u,fieldsGap:c,buttonCorners:L,buttonStroke:v,buttonPadding:h,isButtonFullWidth:p,inputCorners:g,inputStroke:$,inputPadding:f,inputColor:x,inputTextColor:b,inputBorderColor:R,placeholderColor:W,buttonColor:_,buttonTextColor:y,buttonBorderColor:w,labelTextColor:E,successColor:H,errorColor:F,fontFamily:O,inputFontSettings:z,inputFontSize:V,inputLineHeight:K,inputLetterSpacing:C,inputWordSpacing:k,inputTextAppearance:I,buttonFontSettings:A,buttonFontSize:P,buttonLineHeight:N,buttonLetterSpacing:Q,buttonWordSpacing:st,buttonTextAppearance:rt,labelFontSettings:ut,labelFontSize:M,labelLineHeight:J,labelLetterSpacing:ht,labelWordSpacing:pt,labelTextAppearance:gt,statusFontSettings:D,statusFontSize:at,statusLineHeight:B,statusLetterSpacing:T,statusWordSpacing:U,statusTextAppearance:q,successMessage:Z,errorMessage:ot,stateOverrides:it}=t,et=l==="B",dt=s.slice(0,Math.min(i,s.length)),j={fontSettings:{fontFamily:O,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:V??.01,lineHeight:K,letterSpacing:C??0,wordSpacing:k??0,textAppearance:I,color:b},X=pe(Vt(j,e)),Y=S.scalingValue($??0,e),lt=S.scalingValue((K??V??.01)+((f==null?void 0:f.top)??0)+((f==null?void 0:f.bottom)??0)+(l==="C"?$??0:($??0)*2),e),nt={...X,borderStyle:"solid",borderRadius:l==="C"?0:S.scalingValue(g??0,e),...l==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Y,borderLeftWidth:0}:{borderWidth:Y},paddingTop:S.scalingValue((f==null?void 0:f.top)??0,e),paddingRight:S.scalingValue((f==null?void 0:f.right)??0,e),paddingBottom:S.scalingValue((f==null?void 0:f.bottom)??0,e),paddingLeft:S.scalingValue((f==null?void 0:f.left)??0,e),height:lt,minHeight:lt},ct={fontSettings:{fontFamily:O,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:P??.01,lineHeight:N,letterSpacing:Q??0,wordSpacing:st??0,textAppearance:rt,color:y},Ct=pe(Vt(ct,e)),Lt=S.scalingValue(v??0,e),Pt={fontSettings:{fontFamily:O,fontWeight:(ut==null?void 0:ut.fontWeight)??400,fontStyle:(ut==null?void 0:ut.fontStyle)??"normal"},fontSize:M??.01,lineHeight:J,letterSpacing:ht??0,wordSpacing:pt??0,textAppearance:gt,color:E},Dt=Vt(Pt,e),St={fontSettings:{fontFamily:O,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:at??.01,lineHeight:B,letterSpacing:T??0,wordSpacing:U??0,textAppearance:q,color:H},At=pe(Vt(St,e)),Kt=S.buildColorVars(o,{inputColor:x,inputTextColor:b,inputBorderColor:R,placeholderColor:W!=null&&W.trim()?W:"#cccccc",buttonColor:_,buttonTextColor:y,buttonBorderColor:w,labelTextColor:E,successColor:H,errorColor:F},El,Pl,it),[yt,Wt]=m.useState(()=>Object.fromEntries(dt.map(vt=>[vt.name,""]))),[$t,Mt]=m.useState("idle"),[kt,Rt]=m.useState(null),It=r==="success"?"success":r==="error"?"error":$t,Ut=r==="error"?ot:kt,re=r==="filled",Jt=m.useMemo(()=>{if(!re)return yt;let vt=null;for(const Qt of dt)(yt[Qt.name]??"").trim().length>0||(vt=vt??{...yt},vt[Qt.name]="Filled");return vt??yt},[yt,re,dt]),rr=It==="error"?S.getFormFieldValidationError(dt,Jt):null,ir=`${r&&r!=="default"?`${o}-state-${r}`:""}`.trim(),bt=n==null?void 0:n.submitUrl,Xe=(vt,Qt)=>{Wt(jt=>({...jt,[vt]:Qt}))},Sn=async vt=>{vt.preventDefault();const Qt=Object.fromEntries(dt.map(Ot=>{var Gt;return[Ot.name,((Gt=yt[Ot.name])==null?void 0:Gt.trim())??""]}).filter(([,Ot])=>Ot));if(!bt){Mt("error"),Rt("No integrations were found for this form.");return}if(Object.keys(Qt).length===0)return;const jt=S.getFormFieldValidationError(dt,yt);if(jt){Mt("error"),Rt(jt);return}Mt("submitting"),Rt(null);try{const Ot=await fetch(bt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Qt)});if(!Ot.ok){const Gt=await Ot.text();throw new Error(Gt||`Request failed: ${Ot.status}`)}Mt("success"),Wt(Object.fromEntries(dt.map(Gt=>[Gt.name,""])))}catch(Ot){Mt("error"),Rt(Ot instanceof Error?Ot.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${o}-type-${l} ${ir}`.trim(),style:Kt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ll(o)}}),a.jsxs("form",{onSubmit:Sn,className:`${o}-form`,style:{gap:S.scalingValue(u??0,e)},children:[a.jsx("div",{className:`${o}-fields`,style:{gap:S.scalingValue(c??0,e)},children:dt.map((vt,Qt)=>a.jsxs("div",{className:`${o}-field-group${et?` ${o}-labeled`:""}`,children:[et&&a.jsx("span",{className:`${o}-field-label`,style:Dt?{...Dt,lineHeight:Dt.fontSize}:void 0,children:vt.label||vt.name}),vt.type==="textarea"?a.jsx("textarea",{name:vt.name,autoComplete:"off",value:Jt[vt.name]??"",onChange:jt=>Xe(vt.name,jt.target.value),placeholder:vt.placeholder,className:`${o}-input`,style:nt,rows:1,"data-filled":re||(Jt[vt.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:vt.type==="phone"?"tel":vt.type==="email"?"email":"text",name:vt.name,autoComplete:"off",value:Jt[vt.name]??"",onChange:jt=>Xe(vt.name,jt.target.value),placeholder:vt.placeholder,required:vt.isRequired??vt.type==="email",className:`${o}-input`,style:nt,"data-filled":re||(Jt[vt.name]??"").trim().length>0})]},Qt))}),a.jsx("div",{className:`${o}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:S.scalingValue(L??0,e),borderWidth:Lt,paddingTop:S.scalingValue((h==null?void 0:h.top)??0,e),paddingRight:S.scalingValue((h==null?void 0:h.right)??0,e),paddingBottom:S.scalingValue((h==null?void 0:h.bottom)??0,e),paddingLeft:S.scalingValue((h==null?void 0:h.left)??0,e),...Ct,...p?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${o}-overlay-anchor`,style:p?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:$t==="submitting"?"...":d})})})]}),It==="success"&&a.jsx("p",{className:`${o}-success`,style:{...At},children:Z}),It==="error"&&a.jsx("p",{className:`${o}-error`,style:{...At},role:"alert",children:rr??Ut??ot})]})}const El={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},Pl=["hover","focus","filled","success","error"],Wl=`import React, { useMemo, useState } from 'react';\r
|
|
143
143
|
import { CommonComponentProps } from '../props';\r
|
|
144
144
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
|
|
145
145
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';\r
|
|
@@ -740,8 +740,8 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {\r
|
|
|
740
740
|
};\r
|
|
741
741
|
\r
|
|
742
742
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
743
|
-
`,ms=[{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"}],xn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},gs=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],hs={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:{...xn.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:{...xn.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:{...xn.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:{...xn.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:ms,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:[...gs],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},fs={element:cs,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{width:300,height:42},schema:hs,sourceCode:ps};function Cn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ys(e){return`
|
|
744
|
-
.${
|
|
743
|
+
`,Fl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],Pn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Rl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Il={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Input Stroke",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Button Stroke",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Color",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Pn.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...Pn.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...Pn.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...Pn.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:Fl,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["isButtonFullWidth"]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Rl],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Al={element:_l,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{width:300,height:42},schema:Il,sourceCode:Wl};function Wn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function kl(t){return`
|
|
744
|
+
.${t}-wrapper {
|
|
745
745
|
display: flex;
|
|
746
746
|
flex-direction: column;
|
|
747
747
|
width: 100%;
|
|
@@ -749,90 +749,90 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
749
749
|
align-items: stretch;
|
|
750
750
|
justify-content: center;
|
|
751
751
|
}
|
|
752
|
-
.${
|
|
752
|
+
.${t}-form {
|
|
753
753
|
display: flex;
|
|
754
754
|
width: 100%;
|
|
755
755
|
align-items: stretch;
|
|
756
756
|
overflow: hidden;
|
|
757
|
-
border-color: var(--${
|
|
757
|
+
border-color: var(--${t}-stroke-color);
|
|
758
758
|
transition: border-color 250ms;
|
|
759
759
|
}
|
|
760
|
-
.${
|
|
761
|
-
border-color: var(--${
|
|
760
|
+
.${t}-form:hover {
|
|
761
|
+
border-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
762
762
|
}
|
|
763
|
-
.${
|
|
764
|
-
border-color: var(--${
|
|
763
|
+
.${t}-form:focus-within {
|
|
764
|
+
border-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
765
765
|
}
|
|
766
|
-
.${
|
|
767
|
-
border-color: var(--${
|
|
766
|
+
.${t}-wrapper.${t}-state-hover .${t}-form {
|
|
767
|
+
border-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
768
768
|
}
|
|
769
|
-
.${
|
|
770
|
-
border-color: var(--${
|
|
769
|
+
.${t}-wrapper.${t}-state-focus .${t}-form {
|
|
770
|
+
border-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
771
771
|
}
|
|
772
|
-
.${
|
|
773
|
-
border-color: var(--${
|
|
772
|
+
.${t}-wrapper.${t}-state-filled .${t}-form {
|
|
773
|
+
border-color: var(--${t}-filled-stroke-color, var(--${t}-stroke-color));
|
|
774
774
|
}
|
|
775
|
-
.${
|
|
775
|
+
.${t}-inputWrap {
|
|
776
776
|
position: relative;
|
|
777
777
|
display: flex;
|
|
778
778
|
align-items: center;
|
|
779
779
|
flex: 1;
|
|
780
780
|
min-width: 0;
|
|
781
|
-
background-color: var(--${
|
|
781
|
+
background-color: var(--${t}-input-color);
|
|
782
782
|
transition: background-color 250ms;
|
|
783
783
|
}
|
|
784
|
-
.${
|
|
785
|
-
.${
|
|
786
|
-
background-color: var(--${
|
|
784
|
+
.${t}-inputWrap:hover,
|
|
785
|
+
.${t}-wrapper.${t}-state-hover .${t}-inputWrap {
|
|
786
|
+
background-color: var(--${t}-hover-input-color, var(--${t}-input-color));
|
|
787
787
|
}
|
|
788
|
-
.${
|
|
789
|
-
.${
|
|
790
|
-
background-color: var(--${
|
|
788
|
+
.${t}-inputWrap:focus-within,
|
|
789
|
+
.${t}-wrapper.${t}-state-focus .${t}-inputWrap {
|
|
790
|
+
background-color: var(--${t}-focus-input-color, var(--${t}-input-color));
|
|
791
791
|
}
|
|
792
|
-
.${
|
|
793
|
-
background-color: var(--${
|
|
792
|
+
.${t}-wrapper.${t}-state-filled .${t}-inputWrap {
|
|
793
|
+
background-color: var(--${t}-filled-input-color, var(--${t}-input-color));
|
|
794
794
|
}
|
|
795
|
-
.${
|
|
795
|
+
.${t}-input {
|
|
796
796
|
flex: 1;
|
|
797
797
|
min-width: 0;
|
|
798
798
|
background: transparent;
|
|
799
799
|
border: none;
|
|
800
800
|
outline: none;
|
|
801
801
|
-webkit-tap-highlight-color: transparent;
|
|
802
|
-
color: var(--${
|
|
802
|
+
color: var(--${t}-input-text-color);
|
|
803
803
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
804
804
|
}
|
|
805
|
-
.${
|
|
806
|
-
color: var(--${
|
|
805
|
+
.${t}-input:hover {
|
|
806
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
807
807
|
}
|
|
808
|
-
.${
|
|
809
|
-
.${
|
|
810
|
-
color: var(--${
|
|
808
|
+
.${t}-inputWrap:hover .${t}-input,
|
|
809
|
+
.${t}-wrapper.${t}-state-hover .${t}-input {
|
|
810
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
811
811
|
}
|
|
812
|
-
.${
|
|
813
|
-
.${
|
|
814
|
-
color: var(--${
|
|
812
|
+
.${t}-input:focus,
|
|
813
|
+
.${t}-wrapper.${t}-state-focus .${t}-input {
|
|
814
|
+
color: var(--${t}-focus-input-text-color, var(--${t}-input-text-color));
|
|
815
815
|
}
|
|
816
|
-
.${
|
|
817
|
-
color: var(--${
|
|
816
|
+
.${t}-wrapper.${t}-state-filled .${t}-input {
|
|
817
|
+
color: var(--${t}-filled-input-text-color, var(--${t}-input-text-color));
|
|
818
818
|
}
|
|
819
|
-
.${
|
|
820
|
-
color: var(--${
|
|
819
|
+
.${t}-input::placeholder {
|
|
820
|
+
color: var(--${t}-placeholder-color);
|
|
821
821
|
opacity: 1;
|
|
822
822
|
transition: color 250ms, opacity 250ms;
|
|
823
823
|
}
|
|
824
|
-
.${
|
|
825
|
-
.${
|
|
826
|
-
color: var(--${
|
|
824
|
+
.${t}-inputWrap:hover .${t}-input::placeholder,
|
|
825
|
+
.${t}-wrapper.${t}-state-hover .${t}-input::placeholder {
|
|
826
|
+
color: var(--${t}-hover-placeholder-color, var(--${t}-placeholder-color));
|
|
827
827
|
}
|
|
828
|
-
.${
|
|
829
|
-
.${
|
|
830
|
-
color: var(--${
|
|
828
|
+
.${t}-inputWrap:focus-within .${t}-input::placeholder,
|
|
829
|
+
.${t}-wrapper.${t}-state-focus .${t}-input::placeholder {
|
|
830
|
+
color: var(--${t}-focus-placeholder-color, var(--${t}-placeholder-color));
|
|
831
831
|
}
|
|
832
|
-
.${
|
|
833
|
-
color: var(--${
|
|
832
|
+
.${t}-wrapper.${t}-state-filled .${t}-input::placeholder {
|
|
833
|
+
color: var(--${t}-filled-placeholder-color, var(--${t}-placeholder-color));
|
|
834
834
|
}
|
|
835
|
-
.${
|
|
835
|
+
.${t}-submitBtn {
|
|
836
836
|
box-sizing: border-box;
|
|
837
837
|
height: 100%;
|
|
838
838
|
display: flex;
|
|
@@ -841,13 +841,13 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
841
841
|
border: none;
|
|
842
842
|
cursor: pointer;
|
|
843
843
|
white-space: nowrap;
|
|
844
|
-
background-color: var(--${
|
|
845
|
-
color: var(--${
|
|
844
|
+
background-color: var(--${t}-button-color);
|
|
845
|
+
color: var(--${t}-button-text-color);
|
|
846
846
|
border-left-style: solid;
|
|
847
|
-
border-left-color: var(--${
|
|
847
|
+
border-left-color: var(--${t}-stroke-color);
|
|
848
848
|
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
849
849
|
}
|
|
850
|
-
.${
|
|
850
|
+
.${t}-submitBtn img {
|
|
851
851
|
display: block;
|
|
852
852
|
box-sizing: border-box;
|
|
853
853
|
flex: 0 1 auto;
|
|
@@ -858,7 +858,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
858
858
|
max-height: 100%;
|
|
859
859
|
object-fit: contain;
|
|
860
860
|
}
|
|
861
|
-
.${
|
|
861
|
+
.${t}-submitBtn svg {
|
|
862
862
|
display: block;
|
|
863
863
|
box-sizing: border-box;
|
|
864
864
|
flex: 0 1 auto;
|
|
@@ -868,7 +868,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
868
868
|
max-width: 100%;
|
|
869
869
|
max-height: 100%;
|
|
870
870
|
}
|
|
871
|
-
.${
|
|
871
|
+
.${t}-submitBtn .${t}-submitBtnIcon {
|
|
872
872
|
position: relative;
|
|
873
873
|
top: auto;
|
|
874
874
|
left: auto;
|
|
@@ -884,54 +884,54 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
884
884
|
max-width: 100%;
|
|
885
885
|
max-height: 100%;
|
|
886
886
|
}
|
|
887
|
-
.${
|
|
888
|
-
.${
|
|
889
|
-
background-color: var(--${
|
|
890
|
-
color: var(--${
|
|
891
|
-
border-left-color: var(--${
|
|
887
|
+
.${t}-submitBtn:hover,
|
|
888
|
+
.${t}-wrapper.${t}-state-hover .${t}-submitBtn {
|
|
889
|
+
background-color: var(--${t}-hover-button-color, var(--${t}-button-color));
|
|
890
|
+
color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
891
|
+
border-left-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
892
892
|
}
|
|
893
|
-
.${
|
|
894
|
-
.${
|
|
895
|
-
background-color: var(--${
|
|
896
|
-
color: var(--${
|
|
897
|
-
border-left-color: var(--${
|
|
893
|
+
.${t}-submitBtn:focus,
|
|
894
|
+
.${t}-wrapper.${t}-state-focus .${t}-submitBtn {
|
|
895
|
+
background-color: var(--${t}-focus-button-color, var(--${t}-button-color));
|
|
896
|
+
color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
897
|
+
border-left-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
898
898
|
}
|
|
899
|
-
.${
|
|
900
|
-
background-color: var(--${
|
|
901
|
-
color: var(--${
|
|
902
|
-
border-left-color: var(--${
|
|
899
|
+
.${t}-wrapper.${t}-state-filled .${t}-submitBtn {
|
|
900
|
+
background-color: var(--${t}-filled-button-color, var(--${t}-button-color));
|
|
901
|
+
color: var(--${t}-filled-button-text-color, var(--${t}-button-text-color));
|
|
902
|
+
border-left-color: var(--${t}-filled-stroke-color, var(--${t}-stroke-color));
|
|
903
903
|
}
|
|
904
|
-
.${
|
|
905
|
-
.${
|
|
906
|
-
background-color: var(--${
|
|
904
|
+
.${t}-submitBtn:hover .${t}-submitBtnIcon,
|
|
905
|
+
.${t}-wrapper.${t}-state-hover .${t}-submitBtn .${t}-submitBtnIcon {
|
|
906
|
+
background-color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
907
907
|
}
|
|
908
|
-
.${
|
|
909
|
-
.${
|
|
910
|
-
background-color: var(--${
|
|
908
|
+
.${t}-submitBtn:focus .${t}-submitBtnIcon,
|
|
909
|
+
.${t}-wrapper.${t}-state-focus .${t}-submitBtn .${t}-submitBtnIcon {
|
|
910
|
+
background-color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
911
911
|
}
|
|
912
|
-
.${
|
|
913
|
-
background-color: var(--${
|
|
912
|
+
.${t}-wrapper.${t}-state-filled .${t}-submitBtn .${t}-submitBtnIcon {
|
|
913
|
+
background-color: var(--${t}-filled-button-text-color, var(--${t}-button-text-color));
|
|
914
914
|
}
|
|
915
|
-
.${
|
|
916
|
-
.${
|
|
915
|
+
.${t}-wrapper.${t}-state-success .${t}-input,
|
|
916
|
+
.${t}-wrapper.${t}-state-success .${t}-submitBtn {
|
|
917
917
|
pointer-events: none;
|
|
918
918
|
}
|
|
919
|
-
.${
|
|
919
|
+
.${t}-overlayAnchor {
|
|
920
920
|
position: relative;
|
|
921
921
|
display: flex;
|
|
922
922
|
align-items: center;
|
|
923
923
|
}
|
|
924
|
-
.${
|
|
925
|
-
margin-top: ${
|
|
926
|
-
font-size: ${
|
|
927
|
-
color: var(--${
|
|
924
|
+
.${t}-success {
|
|
925
|
+
margin-top: ${Wn(8)};
|
|
926
|
+
font-size: ${Wn(14)};
|
|
927
|
+
color: var(--${t}-success-success-color, var(--${t}-success-color));
|
|
928
928
|
}
|
|
929
|
-
.${
|
|
930
|
-
margin-top: ${
|
|
931
|
-
font-size: ${
|
|
932
|
-
color: var(--${
|
|
929
|
+
.${t}-error {
|
|
930
|
+
margin-top: ${Wn(8)};
|
|
931
|
+
font-size: ${Wn(14)};
|
|
932
|
+
color: var(--${t}-error-error-color, var(--${t}-error-color));
|
|
933
933
|
}
|
|
934
|
-
`}const
|
|
934
|
+
`}const Ml=({settings:t,isEditor:e,metadata:n,activeEvent:r})=>{const{prefix:o}=S.useScopedStyles(),{fields:l=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:i,buttonLabel:s,fieldsToShow:d=1,fontFamily:u,inputFontSettings:c,inputFontSize:L,inputLineHeight:v,inputLetterSpacing:h,inputWordSpacing:p,inputTextAppearance:g,buttonFontSettings:$,buttonFontSize:f,buttonLineHeight:x,buttonLetterSpacing:b,buttonWordSpacing:R,buttonTextAppearance:W,statusFontSettings:_,statusFontSize:y,statusLineHeight:w,statusLetterSpacing:E,statusWordSpacing:H,statusTextAppearance:F,iconMaxWidth:O,minHeight:z,corners:V,stroke:K,stateOverrides:C,inputPadding:k,buttonPadding:I,successMessage:A="Thanks for subscribing!",errorMessage:P="Please, fill all required fields."}=t,N=l.slice(0,Math.min(d,l.length)),[Q,st]=m.useState(()=>Object.fromEntries(N.map(St=>[St.name,""]))),[rt,ut]=m.useState("idle"),[M,J]=m.useState(null),ht=r==="success"?"success":r==="error"?"error":rt,pt=r==="error"?P:M,gt=r==="filled",D=m.useMemo(()=>{if(!gt)return Q;let St=null;for(const At of N)(Q[At.name]??"").trim().length>0||(St=St??{...Q},St[At.name]="Filled");return St??Q},[gt,Q,N]),at=ht==="error"?S.getFormFieldValidationError(N,D):null,B=r&&r!=="default"?`${o}-state-${r}`:"",T=N.some(St=>(D[St.name]??"").trim().length>0),U=B!==`${o}-state-filled`&&T?`${o}-state-filled`:"",q=`${B} ${U}`.trim(),Z=n==null?void 0:n.submitUrl,ot=s??"",it=(i==null?void 0:i.icon)??"",et=(i==null?void 0:i.mode)==="On",dt=ot||"Submit",j={fontSettings:{fontFamily:u,fontWeight:(c==null?void 0:c.fontWeight)??400,fontStyle:(c==null?void 0:c.fontStyle)??"normal"},fontSize:L??.01,lineHeight:v,letterSpacing:h??0,wordSpacing:p??0,textAppearance:g,color:t.inputTextColor??"#111111"},X={fontSettings:{fontFamily:u,fontWeight:($==null?void 0:$.fontWeight)??400,fontStyle:($==null?void 0:$.fontStyle)??"normal"},fontSize:f??.01,lineHeight:x,letterSpacing:b??0,wordSpacing:R??0,textAppearance:W,color:t.buttonTextColor??"#ffffff"},Y={fontSettings:{fontFamily:u,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:y??.01,lineHeight:w,letterSpacing:E??0,wordSpacing:H??0,textAppearance:F,color:t.successColor??"#22c55e"},lt=pe(Vt(j,e)),nt=pe(Vt(X,e)),ct=pe(Vt(Y,e)),Ct=S.buildColorVars(o,{strokeColor:t.strokeColor,inputColor:t.inputColor,placeholderColor:t.placeholderColor,buttonColor:t.buttonColor,successColor:t.successColor,errorColor:t.errorColor,inputTextColor:t.inputTextColor??(j==null?void 0:j.color)??"#111111",buttonTextColor:t.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},Ol,Nl,C),Lt={borderRadius:S.scalingValue(V,e),borderWidth:S.scalingValue(K,e),borderStyle:"solid"},Pt={borderLeftWidth:S.scalingValue(K,e)},Dt=async St=>{St.preventDefault();const At=Object.fromEntries(N.map(yt=>{var Wt;return[yt.name,((Wt=Q[yt.name])==null?void 0:Wt.trim())??""]}).filter(([,yt])=>yt));if(!Z){ut("error"),J("No integrations were found for this form.");return}if(Object.keys(At).length===0)return;const Kt=S.getFormFieldValidationError(N,Q);if(Kt){ut("error"),J(Kt);return}ut("submitting"),J(null);try{const yt=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(At)});if(!yt.ok){const Wt=await yt.text();throw new Error(Wt||`Request failed: ${yt.status}`)}ut("success"),st(Object.fromEntries(N.map(Wt=>[Wt.name,""])))}catch(yt){ut("error"),J(yt instanceof Error?yt.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${q}`.trim(),style:Ct,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:kl(o)}}),a.jsxs("form",{onSubmit:Dt,className:`${o}-form`,style:{...Lt,height:S.scalingValue(z,e),minHeight:S.scalingValue(z,e)},children:[a.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:N.map(St=>a.jsx("input",{type:St.type==="email"?"email":St.type==="phone"?"tel":"text",name:St.name,autoComplete:"off",value:D[St.name]??"",onChange:At=>st(Kt=>({...Kt,[St.name]:At.target.value})),placeholder:St.placeholder,required:St.isRequired??St.type==="email",className:`${o}-input`,style:{...lt,paddingRight:S.scalingValue(k.right,e),paddingLeft:S.scalingValue(k.left,e),paddingTop:S.scalingValue(k.top,e),paddingBottom:S.scalingValue(k.bottom,e)}},St.name))}),a.jsx("div",{className:`${o}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":dt,style:{...nt,...Pt,paddingRight:S.scalingValue(I.right,e),paddingLeft:S.scalingValue(I.left,e),paddingTop:S.scalingValue(I.top,e),paddingBottom:S.scalingValue(I.bottom,e)},children:rt==="submitting"?"...":et?it&&a.jsx(ve,{url:it,className:`${o}-submitBtnIcon`,style:{maxWidth:S.scalingValue(O??0,e)},fill:`var(--${o}-button-text-color)`,hoverFill:`var(--${o}-button-text-color)`}):ot})})]}),ht==="success"&&a.jsx("p",{className:`${o}-success`,style:{...ct},children:A}),ht==="error"&&a.jsx("p",{className:`${o}-error`,style:{...ct},role:"alert",children:at??pt??P})]})},Ol={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},Nl=["hover","focus","filled","success","error"],Hl=`import React, { useMemo, useState } from 'react';\r
|
|
935
935
|
import { CommonComponentProps } from '../props';\r
|
|
936
936
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
|
|
937
937
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';\r
|
|
@@ -1503,24 +1503,24 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {\r
|
|
|
1503
1503
|
};\r
|
|
1504
1504
|
\r
|
|
1505
1505
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
1506
|
-
`,Ss="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>'),$s=[{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."}],or={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ws=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Ts={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:{...or.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:{...or.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:{...or.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:$s,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Ss},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:[...ws],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"]},Ls={element:vs,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{width:400,height:60},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:Ts,sourceCode:Cs};function io(e){return`
|
|
1507
|
-
.${
|
|
1506
|
+
`,Bl="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),zl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],pr={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:{...pr.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:{...pr.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:{...pr.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:{width:400,height:60},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:jl,sourceCode:Hl};function vo(t){return`
|
|
1507
|
+
.${t}-marquee-wrapper {
|
|
1508
1508
|
overflow: hidden;
|
|
1509
1509
|
width: 100%;
|
|
1510
1510
|
height: auto;
|
|
1511
1511
|
}
|
|
1512
1512
|
|
|
1513
|
-
@keyframes ${
|
|
1513
|
+
@keyframes ${t}-marquee-left {
|
|
1514
1514
|
from { transform: translate3d(0, 0, 0); }
|
|
1515
1515
|
to { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1516
1516
|
}
|
|
1517
1517
|
|
|
1518
|
-
@keyframes ${
|
|
1518
|
+
@keyframes ${t}-marquee-right {
|
|
1519
1519
|
from { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1520
1520
|
to { transform: translate3d(0, 0, 0); }
|
|
1521
1521
|
}
|
|
1522
1522
|
|
|
1523
|
-
.${
|
|
1523
|
+
.${t}-marquee-track {
|
|
1524
1524
|
display: flex;
|
|
1525
1525
|
flex-direction: row;
|
|
1526
1526
|
width: max-content;
|
|
@@ -1536,28 +1536,28 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
1536
1536
|
animation-play-state: var(--marquee-play-state, running);
|
|
1537
1537
|
}
|
|
1538
1538
|
|
|
1539
|
-
.${
|
|
1540
|
-
animation-name: ${
|
|
1539
|
+
.${t}-marquee-track[data-direction="left"] {
|
|
1540
|
+
animation-name: ${t}-marquee-left;
|
|
1541
1541
|
}
|
|
1542
1542
|
|
|
1543
|
-
.${
|
|
1544
|
-
animation-name: ${
|
|
1543
|
+
.${t}-marquee-track[data-direction="right"] {
|
|
1544
|
+
animation-name: ${t}-marquee-right;
|
|
1545
1545
|
}
|
|
1546
1546
|
|
|
1547
|
-
.${
|
|
1547
|
+
.${t}-marquee-set {
|
|
1548
1548
|
display: flex;
|
|
1549
1549
|
flex-direction: row;
|
|
1550
1550
|
flex: 0 0 auto;
|
|
1551
1551
|
}
|
|
1552
1552
|
|
|
1553
|
-
.${
|
|
1553
|
+
.${t}-wrapper {
|
|
1554
1554
|
position: relative;
|
|
1555
1555
|
width: 100%;
|
|
1556
1556
|
height: 100%;
|
|
1557
1557
|
order: 1;
|
|
1558
1558
|
}
|
|
1559
1559
|
|
|
1560
|
-
.${
|
|
1560
|
+
.${t}-cover {
|
|
1561
1561
|
position: absolute;
|
|
1562
1562
|
width: 100%;
|
|
1563
1563
|
height: 100%;
|
|
@@ -1565,7 +1565,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
1565
1565
|
left: 0;
|
|
1566
1566
|
}
|
|
1567
1567
|
|
|
1568
|
-
.${
|
|
1568
|
+
.${t}-elements-overlay {
|
|
1569
1569
|
position: relative;
|
|
1570
1570
|
inset: 0;
|
|
1571
1571
|
display: flex;
|
|
@@ -1573,13 +1573,13 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
1573
1573
|
pointer-events: none;
|
|
1574
1574
|
}
|
|
1575
1575
|
|
|
1576
|
-
.${
|
|
1576
|
+
.${t}-control {
|
|
1577
1577
|
position: relative;
|
|
1578
1578
|
z-index: 2;
|
|
1579
1579
|
width: 100%;
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
-
.${
|
|
1582
|
+
.${t}-control::before {
|
|
1583
1583
|
content: "";
|
|
1584
1584
|
position: absolute;
|
|
1585
1585
|
top: 0;
|
|
@@ -1590,7 +1590,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
1590
1590
|
pointer-events: auto;
|
|
1591
1591
|
z-index: 10;
|
|
1592
1592
|
}
|
|
1593
|
-
`}const
|
|
1593
|
+
`}const Kl=30,Ul=({settings:t,content:e,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=S.useScopedStyles(),{autoplay:l,align:i,speed:s,direction:d,pauseOnHover:u,gap:c,cardWidth:L,corners:v,stroke:h,strokeColor:p,bgColor:g,padding:$,logoMarginTop:f,logoWidth:x,logoHeight:b,captionMarginTop:R}=t,W=l==="on"&&!r,_=W,y=Math.max(0,s)*Kl,w=j=>S.scalingValue(j,n??!1),E=m.useRef(null),H=m.useRef(null),F=m.useRef(null),[O,z]=m.useState(0),[V,K]=m.useState(0),[C,k]=m.useState(0),I=_&&u==="on",[A,P]=m.useState(!1),N=m.useRef(null),[Q,st]=m.useState(0),[rt,ut]=m.useState(0),M=m.useRef(null),J=j=>{var Y,lt,nt,ct,Ct;return{fontSettings:{fontFamily:(t==null?void 0:t[`${j}FontFamily`])??"Arial",fontWeight:((Y=t==null?void 0:t[`${j}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((lt=t==null?void 0:t[`${j}FontSettings`])==null?void 0:lt.fontStyle)??"normal"},textAppearance:{textTransform:((nt=t==null?void 0:t[`${j}TextAppearance`])==null?void 0:nt.textTransform)??"none",textDecoration:((ct=t==null?void 0:t[`${j}TextAppearance`])==null?void 0:ct.textDecoration)??"none",fontVariant:((Ct=t==null?void 0:t[`${j}TextAppearance`])==null?void 0:Ct.fontVariant)??"normal"},letterSpacing:(t==null?void 0:t[`${j}LetterSpacing`])??0,wordSpacing:(t==null?void 0:t[`${j}WordSpacing`])??0,fontSize:(t==null?void 0:t[`${j}FontSize`])??.01,lineHeight:(t==null?void 0:t[`${j}LineHeight`])??.01,color:(t==null?void 0:t[`${j}Color`])??"#000000"}},ht=J("text"),pt=J("caption"),gt=m.useMemo(()=>((e==null?void 0:e.length)??0)>1&&(e??[]).some(j=>{var X,Y;return(((X=j.text)==null?void 0:X.length)??0)>0||(((Y=j.caption)==null?void 0:Y.length)??0)>0}),[e]),D=m.useMemo(()=>!W||(e==null?void 0:e.length)===0?1:V<=0||O<=0?2:Math.max(2,Math.ceil(O/V)+1),[W,e==null?void 0:e.length,V,O]);m.useLayoutEffect(()=>{if(!W)return;const j=E.current,X=F.current;if(!j||!X)return;let Y=0;const lt=()=>{const Ct=j.getBoundingClientRect().width,Lt=X.getBoundingClientRect().width,Pt=M.current,Dt=typeof Pt=="number"&&Math.abs(Pt-Lt)<=.25;if(M.current=Lt,z(Ct),typeof Lt=="number"&&Lt>0&&V<=0){K(Lt);return}Dt&&Lt!==V?K(Lt):!Dt&&V<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(lt))},nt=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(lt)};nt();const ct=new ResizeObserver(nt);return ct.observe(j),ct.observe(X),()=>{cancelAnimationFrame(Y),ct.disconnect()}},[W,V]),m.useLayoutEffect(()=>{const j=H.current;if(!W||!j||!_)return;const X=V>0?V:0,Y=X>0&&y>0?X/y*1e3:0,lt=`${Math.max(0,Y)/1e3}s`;j.style.setProperty("--marquee-distance",`${X}px`),j.style.setProperty("--marquee-duration",lt)},[W,_,y,V]),m.useLayoutEffect(()=>{if(!W){k(0);return}const j=H.current;if(!j)return;const X=()=>{const lt=j.getBoundingClientRect().height;k(lt>0?lt:0)};X();const Y=new ResizeObserver(X);return Y.observe(j),()=>{Y.disconnect()}},[W,D,e,n,c,L,$,h,v,x,b]);const at=()=>{I&&P(!0)},B=()=>{I&&P(!1)},T=m.useMemo(()=>{switch(i){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[i]),U=m.useMemo(()=>{switch(i){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[i]),q=m.useCallback((j,X,Y,lt)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":lt==null?void 0:lt.controlsName,"data-controls-axis":"y",className:`${o}-control`,style:{height:w((lt==null?void 0:lt.marginTop)??0)}}),a.jsx("div",{...lt!=null&<.dataMeasureKind?{"data-testimonial-measure":lt.dataMeasureKind}:{},style:{...Vt(j,n),textAlign:U,pointerEvents:"auto",...typeof(lt==null?void 0:lt.minHeightPx)=="number"&<.minHeightPx>0?{minHeight:lt.minHeightPx}:{}},children:a.jsx(un,{content:X})})]},Y),[T,U,n]),Z=m.useCallback((j,X,Y)=>{var lt,nt,ct;return a.jsxs("div",{style:{padding:`${w($.top)} ${w($.right)} ${w($.bottom)} ${w($.left)}`,width:w(L+h*2),height:"100%",borderRadius:w(v),border:`${w(h)} solid ${p}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${o}-cover`,style:{background:g}}),a.jsxs("div",{className:`${o}-elements-overlay`,style:{alignItems:T,textAlign:U},children:[j.text&&q(ht,j.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${o}-control`,style:{height:w(f)}}),a.jsx("div",{style:{width:w(x),height:w(b)},children:((lt=j.logo)==null?void 0:lt.url)&&a.jsx("img",{src:j.logo.url,alt:((nt=j.logo)==null?void 0:nt.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ct=j.logo)==null?void 0:ct.objectFit)||"contain"}})})]}),j.caption&&q(pt,j.caption,"caption",{controlsName:"captionMarginTop",marginTop:R,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},X)},[g,R,pt,L,v,b,f,x,T,U,$.bottom,$.left,$.right,$.top,q,h,p,ht,n]),ot=m.useCallback(j=>{st(j.maxTextPx),ut(j.maxCaptionPx)},[]);m.useLayoutEffect(()=>{if(!gt){ot({maxTextPx:0,maxCaptionPx:0});return}const j=N.current;if(!j)return;const X=()=>{S.readTestimonialTextMeasure(j,ot)};X();const Y=new ResizeObserver(X);return Y.observe(j),()=>{Y.disconnect()}},[gt,ot,e,Z]);const it=gt?{textMinHeightPx:Q,captionMinHeightPx:rt}:void 0,et=gt?a.jsx("div",{ref:N,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(e??[]).map((j,X)=>Z(j,`measure-${X}`,{dataMeasureAttrs:!0}))}):null,dt=(j,X)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Z(j,`card-${X}`,it),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${w(c)})`,width:w(c),height:"100%",pointerEvents:"auto",zIndex:2}})]},X);return W&&((e==null?void 0:e.length)??0)>0?a.jsxs("div",{ref:E,className:xt(`${o}-wrapper`,`${o}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...C>0?{height:C}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vo(o)}}),et,a.jsx("div",{ref:H,className:`${o}-marquee-track`,"data-direction":d,onMouseEnter:at,onMouseLeave:B,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...I?{"--marquee-play-state":A?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:D},(j,X)=>a.jsx("div",{ref:X===0?F:void 0,className:`${o}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:w(c),paddingRight:w(c)},"aria-hidden":X>0,children:e==null?void 0:e.map((Y,lt)=>dt(Y,`${X}-${lt}`))},`set-${X}`))})]}):a.jsxs("div",{className:`${o}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vo(o)}}),et,a.jsx("div",{style:{gap:w(c),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:e==null?void 0:e.map((j,X)=>dt(j,X))})]})},Gl=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
|
|
1594
1594
|
import cn from 'classnames';\r
|
|
1595
1595
|
import { CommonComponentProps } from '../props';\r
|
|
1596
1596
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';\r
|
|
@@ -2186,8 +2186,8 @@ type TestimonialsSettings = {\r
|
|
|
2186
2186
|
logoHeight: number;\r
|
|
2187
2187
|
captionMarginTop: number;\r
|
|
2188
2188
|
};\r
|
|
2189
|
-
`,
|
|
2190
|
-
.${
|
|
2189
|
+
`,bo={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Yl={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke color",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG color",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:100,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text color",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption color",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...bo.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:{...bo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{autoplay:"on",direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","autoplay","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},ql={element:Ul,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonials.png"},defaultSize:{width:"100%",height:320},schema:Yl,sourceCode:Gl,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Xl(t){return`
|
|
2190
|
+
.${t}-container {
|
|
2191
2191
|
position: relative;
|
|
2192
2192
|
overflow-x: clip;
|
|
2193
2193
|
display: flex;
|
|
@@ -2196,7 +2196,7 @@ type TestimonialsSettings = {\r
|
|
|
2196
2196
|
align-items: center;
|
|
2197
2197
|
}
|
|
2198
2198
|
|
|
2199
|
-
.${
|
|
2199
|
+
.${t}-wrapper {
|
|
2200
2200
|
position: relative;
|
|
2201
2201
|
width: 100%;
|
|
2202
2202
|
order: 1;
|
|
@@ -2208,42 +2208,42 @@ type TestimonialsSettings = {\r
|
|
|
2208
2208
|
height: auto;
|
|
2209
2209
|
}
|
|
2210
2210
|
|
|
2211
|
-
.${
|
|
2211
|
+
.${t}-fade-stack {
|
|
2212
2212
|
position: relative;
|
|
2213
2213
|
width: 100%;
|
|
2214
2214
|
}
|
|
2215
2215
|
|
|
2216
|
-
.${
|
|
2216
|
+
.${t}-fade-item-prev {
|
|
2217
2217
|
position: absolute;
|
|
2218
2218
|
inset: 0;
|
|
2219
2219
|
width: 100%;
|
|
2220
2220
|
height: 100%;
|
|
2221
2221
|
}
|
|
2222
2222
|
|
|
2223
|
-
.${
|
|
2223
|
+
.${t}-fade-item-current {
|
|
2224
2224
|
position: relative;
|
|
2225
2225
|
width: 100%;
|
|
2226
2226
|
}
|
|
2227
2227
|
|
|
2228
|
-
@keyframes ${
|
|
2228
|
+
@keyframes ${t}-testimonial-fade-in {
|
|
2229
2229
|
from { opacity: 0; }
|
|
2230
2230
|
to { opacity: 1; }
|
|
2231
2231
|
}
|
|
2232
2232
|
|
|
2233
|
-
@keyframes ${
|
|
2233
|
+
@keyframes ${t}-testimonial-fade-out {
|
|
2234
2234
|
from { opacity: 1; }
|
|
2235
2235
|
to { opacity: 0; }
|
|
2236
2236
|
}
|
|
2237
2237
|
|
|
2238
|
-
.${
|
|
2239
|
-
animation: ${
|
|
2238
|
+
.${t}-fade-in {
|
|
2239
|
+
animation: ${t}-testimonial-fade-in 300ms ease-in forwards;
|
|
2240
2240
|
}
|
|
2241
2241
|
|
|
2242
|
-
.${
|
|
2243
|
-
animation: ${
|
|
2242
|
+
.${t}-fade-out {
|
|
2243
|
+
animation: ${t}-testimonial-fade-out 300ms ease-in forwards;
|
|
2244
2244
|
}
|
|
2245
2245
|
|
|
2246
|
-
.${
|
|
2246
|
+
.${t}-controls {
|
|
2247
2247
|
position: absolute;
|
|
2248
2248
|
inset: 0;
|
|
2249
2249
|
pointer-events: none;
|
|
@@ -2253,7 +2253,7 @@ type TestimonialsSettings = {\r
|
|
|
2253
2253
|
justify-content: space-between;
|
|
2254
2254
|
}
|
|
2255
2255
|
|
|
2256
|
-
.${
|
|
2256
|
+
.${t}-arrow {
|
|
2257
2257
|
pointer-events: auto;
|
|
2258
2258
|
position: relative;
|
|
2259
2259
|
display: flex;
|
|
@@ -2265,11 +2265,11 @@ type TestimonialsSettings = {\r
|
|
|
2265
2265
|
padding: 0;
|
|
2266
2266
|
}
|
|
2267
2267
|
|
|
2268
|
-
.${
|
|
2268
|
+
.${t}-next-arrow {
|
|
2269
2269
|
left: unset;
|
|
2270
2270
|
}
|
|
2271
2271
|
|
|
2272
|
-
.${
|
|
2272
|
+
.${t}-arrow-inner {
|
|
2273
2273
|
all: unset;
|
|
2274
2274
|
cursor: pointer;
|
|
2275
2275
|
width: 100%;
|
|
@@ -2277,25 +2277,25 @@ type TestimonialsSettings = {\r
|
|
|
2277
2277
|
pointer-events: auto;
|
|
2278
2278
|
}
|
|
2279
2279
|
|
|
2280
|
-
.${
|
|
2280
|
+
.${t}-arrow-img {
|
|
2281
2281
|
position: absolute;
|
|
2282
2282
|
top: 50%;
|
|
2283
2283
|
left: 50%;
|
|
2284
2284
|
transform: translate(-50%, -50%);
|
|
2285
2285
|
}
|
|
2286
2286
|
|
|
2287
|
-
.${
|
|
2287
|
+
.${t}-mirror {
|
|
2288
2288
|
transform: translate(-50%, -50%) scaleX(-1) !important;
|
|
2289
2289
|
}
|
|
2290
2290
|
|
|
2291
|
-
.${
|
|
2291
|
+
.${t}-control {
|
|
2292
2292
|
position: relative;
|
|
2293
2293
|
z-index: 2;
|
|
2294
2294
|
pointer-events: auto;
|
|
2295
2295
|
width: 100%;
|
|
2296
2296
|
}
|
|
2297
2297
|
|
|
2298
|
-
.${
|
|
2298
|
+
.${t}-control::before {
|
|
2299
2299
|
content: "";
|
|
2300
2300
|
position: absolute;
|
|
2301
2301
|
top: 0;
|
|
@@ -2305,12 +2305,12 @@ type TestimonialsSettings = {\r
|
|
|
2305
2305
|
pointer-events: auto;
|
|
2306
2306
|
z-index: 10;
|
|
2307
2307
|
}
|
|
2308
|
-
.${
|
|
2308
|
+
.${t}-icon {
|
|
2309
2309
|
pointer-events: auto;
|
|
2310
2310
|
width: 100%;
|
|
2311
2311
|
height: 100%;
|
|
2312
2312
|
}
|
|
2313
|
-
`}const
|
|
2313
|
+
`}const Zl=({settings:t,content:e,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=S.useScopedStyles(),l=e||[],{autoplay:i,delay:s,align:d,width:u,imageMarginTop:c,textMarginTop:L,captionMarginTop:v,imageWidth:h,imageHeight:p,controlsWidth:g,controlsColor:$,controlsHoverColor:f}=t,x=i==="on"&&!r,[b,R]=m.useState(0),[W,_]=m.useState(null),[y,w]=m.useState(!1),E=m.useRef(null),H=m.useMemo(()=>{switch(d){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[d]),F=m.useMemo(()=>{switch(d){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[d]);m.useEffect(()=>{R(0),_(null),w(!1)},[l.length]);const O=l[b],z=W===null?null:l[W],V=D=>{var B,T,U,q,Z;return{fontSettings:{fontFamily:(t==null?void 0:t[`${D}FontFamily`])??"Arial",fontWeight:((B=t==null?void 0:t[`${D}FontSettings`])==null?void 0:B.fontWeight)??400,fontStyle:((T=t==null?void 0:t[`${D}FontSettings`])==null?void 0:T.fontStyle)??"normal"},textAppearance:{textTransform:((U=t==null?void 0:t[`${D}TextAppearance`])==null?void 0:U.textTransform)??"none",textDecoration:((q=t==null?void 0:t[`${D}TextAppearance`])==null?void 0:q.textDecoration)??"none",fontVariant:((Z=t==null?void 0:t[`${D}TextAppearance`])==null?void 0:Z.fontVariant)??"normal"},fontSize:(t==null?void 0:t[`${D}FontSize`])??.01,lineHeight:(t==null?void 0:t[`${D}LineHeight`])??.01,letterSpacing:(t==null?void 0:t[`${D}LetterSpacing`])??0,wordSpacing:(t==null?void 0:t[`${D}WordSpacing`])??0,color:(t==null?void 0:t[`${D}Color`])??"#000000"}},K=V("text"),C=V("caption"),k=l.length>1&&l.some(D=>{var at,B;return(((at=D.text)==null?void 0:at.length)??0)>0||(((B=D.caption)==null?void 0:B.length)??0)>0}),I=m.useRef(null),[A,P]=m.useState(0),[N,Q]=m.useState(0),st=t.controls??{mode:"Off",icon:null},rt=l.length>1,ut=m.useCallback((D,at)=>!rt||at===D?D:(E.current&&window.clearTimeout(E.current),_(D),w(!0),E.current=window.setTimeout(()=>{_(null),w(!1),E.current=null},300),at),[rt]),M=m.useCallback(()=>{rt&&R(D=>ut(D,(D-1+l.length)%l.length))},[rt,ut,l.length]),J=m.useCallback(()=>{rt&&R(D=>ut(D,(D+1)%l.length))},[rt,ut,l.length]);m.useEffect(()=>{if(!x||!rt)return;const D=Math.max(300,Number.isFinite(s*1e3)?s*1e3:0),at=window.setInterval(()=>{R(B=>ut(B,(B+1)%l.length))},D);return()=>{window.clearInterval(at)}},[x,rt,ut,l.length,s]),m.useEffect(()=>()=>{E.current&&window.clearTimeout(E.current)},[]);const ht=(D,at)=>{var q,Z,ot,it;const B=at==null?void 0:at.textMinHeightPx,T=at==null?void 0:at.captionMinHeightPx,U=at==null?void 0:at.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[D.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:H,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${o}-control`,style:{height:S.scalingValue(L??0,n??!1)}}),a.jsx("div",{...U&&{"data-testimonial-measure":"text"},style:{...Vt(K,n),...B&&B>0?{minHeight:B}:{},textAlign:F,pointerEvents:"auto"},children:a.jsx(un,{content:D.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:H,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${o}-control`,style:{height:S.scalingValue(c??0,n??!1)}}),a.jsx("div",{style:{width:S.scalingValue(h??0,n??!1),height:S.scalingValue(p??0,n??!1)},children:((q=D.image)==null?void 0:q.url)&&a.jsx("img",{src:(Z=D.image)==null?void 0:Z.url,alt:((ot=D.image)==null?void 0:ot.name)??"",className:`${o}-icon`,style:{objectFit:((it=D.image)==null?void 0:it.objectFit)||"contain"}})})]}),D.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:H,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${o}-control`,style:{height:S.scalingValue(v??0,n??!1)}}),a.jsx("div",{...U?{"data-testimonial-measure":"caption"}:{},style:{...Vt(C,n),...T&&T>0?{minHeight:T}:{},textAlign:F,pointerEvents:"auto"},children:a.jsx(un,{content:D.caption})})]})]})},pt=m.useCallback(D=>{P(D.maxTextPx),Q(D.maxCaptionPx)},[]);if(m.useLayoutEffect(()=>{if(!k){pt({maxTextPx:0,maxCaptionPx:0});return}const D=I.current;if(!D)return;const at=()=>{S.readTestimonialTextMeasure(D,pt)};at();const B=new ResizeObserver(at);return B.observe(D),()=>{B.disconnect()}},[k,pt,e]),!O)return a.jsx(a.Fragment,{});const gt=k?{textMinHeightPx:A,captionMinHeightPx:N}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${o}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Xl(o)}}),a.jsxs("div",{className:`${o}-wrapper`,style:{width:S.scalingValue(u??0,n??!1),alignItems:H},children:[k&&a.jsx("div",{ref:I,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((D,at)=>a.jsx("div",{style:{width:"100%"},children:ht(D,{dataMeasureAttrs:!0})},at))}),a.jsxs("div",{className:`${o}-fade-stack`,children:[z&&y&&a.jsx("div",{className:xt(`${o}-fade-item-prev`,`${o}-fade-out`),children:ht(z,gt)}),a.jsx("div",{className:xt(`${o}-fade-item-current`,y?`${o}-fade-in`:void 0),children:ht(O,gt)})]})]}),st.mode==="On"&&a.jsxs("div",{className:`${o}-controls`,children:[a.jsx("div",{className:`${o}-arrow`,style:{width:S.scalingValue(g??.02,n??!1),height:S.scalingValue(g??.02,n??!1),"--arrow-hover-color":f},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:M,disabled:!rt,"aria-label":"Previous testimonial",children:st.icon&&a.jsx(ve,{url:st.icon,fill:$,hoverFill:f,className:xt(`${o}-arrow-img`,`${o}-mirror`)})})}),a.jsx("div",{className:xt(`${o}-arrow`,`${o}-next-arrow`),style:{width:S.scalingValue(g??.02,n??!1),height:S.scalingValue(g??.02,n??!1),"--arrow-hover-color":f},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:J,disabled:!rt,"aria-label":"Next testimonial",children:st.icon&&a.jsx(ve,{url:st.icon,fill:$,hoverFill:f,className:`${o}-arrow-img`})})})]})]})})},Jl=`import cn from 'classnames';\r
|
|
2314
2314
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
|
|
2315
2315
|
import { CommonComponentProps } from '../props';\r
|
|
2316
2316
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';\r
|
|
@@ -2802,84 +2802,84 @@ type TestimonialsSettings = {\r
|
|
|
2802
2802
|
icon?: string | null;\r
|
|
2803
2803
|
};\r
|
|
2804
2804
|
};\r
|
|
2805
|
-
`,
|
|
2806
|
-
.${
|
|
2805
|
+
`,Ql="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),xo={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},tc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},delay:{type:"number",scope:"layout",title:"Delay(s)",display:{type:"percentage-input"},step:1,min:1,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:100,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:100,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Color",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...xo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Color"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...xo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"}},defaults:{autoplay:"on",controls:{mode:"On",icon:Ql},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Charter",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{delay:3,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{delay:3,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},displayRules:[{if:{name:"autoplay",value:"off"},then:{name:"properties.delay.display.enabled",value:!1}}],layout:["__componentName__","autoplay","delay","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","delay"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},ec={element:Zl,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonialsSingle.png"},defaultSize:{width:700,height:300},schema:tc,sourceCode:Jl,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function nc(){return window.navigator.platform==="Win32"||window.navigator.platform==="Win64"?'"InputMono-Regular", monospace':'"DepartureMono-Regular", monospace'}function rc(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function oc(t){return`
|
|
2806
|
+
.${t}-wrapper {
|
|
2807
2807
|
display: grid;
|
|
2808
2808
|
align-items: start;
|
|
2809
|
-
min-height: ${
|
|
2809
|
+
min-height: ${rc(48)};
|
|
2810
2810
|
}
|
|
2811
|
-
.${
|
|
2811
|
+
.${t}-item {
|
|
2812
2812
|
display: flex;
|
|
2813
2813
|
flex-direction: column;
|
|
2814
2814
|
justify-content: center;
|
|
2815
2815
|
align-items: center;
|
|
2816
2816
|
}
|
|
2817
|
-
.${
|
|
2817
|
+
.${t}-item-inner {
|
|
2818
2818
|
display: flex;
|
|
2819
2819
|
flex-direction: column;
|
|
2820
2820
|
align-items: center;
|
|
2821
2821
|
outline: 1px solid #ccc;
|
|
2822
2822
|
}
|
|
2823
|
-
.${
|
|
2823
|
+
.${t}-item-inner-hidden {
|
|
2824
2824
|
display: flex;
|
|
2825
2825
|
flex-direction: column;
|
|
2826
2826
|
align-items: center;
|
|
2827
2827
|
}
|
|
2828
|
-
.${
|
|
2828
|
+
.${t}-item-image-wrapper {
|
|
2829
2829
|
display: flex;
|
|
2830
2830
|
justify-content: center;
|
|
2831
2831
|
align-items: center;
|
|
2832
2832
|
}
|
|
2833
|
-
.${
|
|
2833
|
+
.${t}-item-image-link {
|
|
2834
2834
|
width: 100%;
|
|
2835
2835
|
height: 100%;
|
|
2836
2836
|
display: flex;
|
|
2837
2837
|
flex-direction: column;
|
|
2838
2838
|
align-items: center;
|
|
2839
2839
|
}
|
|
2840
|
-
.${
|
|
2840
|
+
.${t}-item-image {
|
|
2841
2841
|
width: 100%;
|
|
2842
2842
|
height: 100%;
|
|
2843
2843
|
display: block;
|
|
2844
2844
|
}
|
|
2845
|
-
.${
|
|
2846
|
-
.${
|
|
2847
|
-
.${
|
|
2848
|
-
.${
|
|
2845
|
+
.${t}-item-slider,
|
|
2846
|
+
.${t}-item-slider .splide__track,
|
|
2847
|
+
.${t}-item-slider .splide__list,
|
|
2848
|
+
.${t}-item-slider .splide__slide {
|
|
2849
2849
|
width: 100%;
|
|
2850
2850
|
height: 100%;
|
|
2851
2851
|
}
|
|
2852
|
-
.${
|
|
2852
|
+
.${t}-item-slider .splide__slide {
|
|
2853
2853
|
display: flex;
|
|
2854
2854
|
justify-content: center;
|
|
2855
2855
|
align-items: center;
|
|
2856
2856
|
}
|
|
2857
|
-
.${
|
|
2857
|
+
.${t}-item-title {
|
|
2858
2858
|
white-space: normal;
|
|
2859
2859
|
overflow-wrap: anywhere;
|
|
2860
2860
|
word-break: break-word;
|
|
2861
2861
|
text-align: center;
|
|
2862
2862
|
margin-bottom: 0px;
|
|
2863
2863
|
margin-top: 0px;
|
|
2864
|
-
color: var(--${
|
|
2864
|
+
color: var(--${t}-title-color);
|
|
2865
2865
|
}
|
|
2866
|
-
.${
|
|
2866
|
+
.${t}-item-subtitle {
|
|
2867
2867
|
white-space: normal;
|
|
2868
2868
|
overflow-wrap: anywhere;
|
|
2869
2869
|
word-break: break-word;
|
|
2870
2870
|
text-align: center;
|
|
2871
2871
|
margin-bottom: 0px;
|
|
2872
2872
|
margin-top: 0px;
|
|
2873
|
-
color: var(--${
|
|
2873
|
+
color: var(--${t}-subtitle-color);
|
|
2874
2874
|
}
|
|
2875
2875
|
|
|
2876
|
-
.${
|
|
2876
|
+
.${t}-control {
|
|
2877
2877
|
position: relative;
|
|
2878
2878
|
z-index: 2;
|
|
2879
2879
|
width: 100%;
|
|
2880
2880
|
}
|
|
2881
2881
|
|
|
2882
|
-
.${
|
|
2882
|
+
.${t}-control::before {
|
|
2883
2883
|
content: "";
|
|
2884
2884
|
position: absolute;
|
|
2885
2885
|
top: 0;
|
|
@@ -2890,7 +2890,7 @@ type TestimonialsSettings = {\r
|
|
|
2890
2890
|
pointer-events: auto;
|
|
2891
2891
|
z-index: 10;
|
|
2892
2892
|
}
|
|
2893
|
-
`}const
|
|
2893
|
+
`}const fe=500,Te="cubic-bezier(0.22, 1, 0.36, 1)";function ic({images:t,index:e,imageDisplay:n,originRect:r,reverseClose:o,onClose:l,onPrev:i,onNext:s}){const d=m.useRef(null),u=m.useRef(null),[c,L]=m.useState(null),[v,h]=m.useState(r?"opening":"open"),[p,g]=m.useState(!0),$=m.useRef(e),f=m.useCallback(()=>{const y=d.current,w=u.current;if(!y||!w)return;const E=y.getBoundingClientRect(),H=E.width,F=E.height,O=w.naturalWidth,z=w.naturalHeight;if(!H||!F||!O||!z)return;if(n==="Cover"){L({width:H,height:F,left:E.left,top:E.top});return}const V=O/z,K=H/F;if(V>K){const C=H/V;L({width:H,height:C,left:E.left,top:E.top+(F-C)/2})}else{const C=F*V;L({width:C,height:F,left:E.left+(H-C)/2,top:E.top})}},[n]);m.useEffect(()=>{f();const y=d.current;if(!y)return;const w=new ResizeObserver(()=>f());return w.observe(y),()=>w.disconnect()},[f,e]),m.useEffect(()=>{if(v!=="opening"||!c)return;const y={id:0};return y.id=requestAnimationFrame(()=>{y.id=requestAnimationFrame(()=>h("open"))}),()=>cancelAnimationFrame(y.id)},[v,c]),m.useEffect(()=>{if(v!=="closing")return;const y=setTimeout(()=>l(),fe);return()=>clearTimeout(y)},[v,l]),m.useEffect(()=>{$.current!==e&&g(!1),$.current=e},[e]);const x=()=>{v!=="closing"&&h("closing")},b=v==="open",R=v==="closing",W=R&&o&&!!r,_=v==="opening"?r??c:W?r:c;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:x,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:b?1:0,transition:`opacity ${fe}ms ${Te}`,pointerEvents:"none"}}),a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:d,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",color:"#E6E6E6",letterSpacing:"-0.6px",lineHeight:"16px",opacity:b?1:0,transition:`opacity ${fe}ms ${Te}`,fontFamily:nc()},children:t.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:e+1}),a.jsx("p",{children:"/"}),a.jsx("p",{children:t.length})]})})]}),_&&a.jsx("img",{ref:u,src:t[e],onLoad:f,style:{position:"fixed",top:_.top,left:_.left,width:_.width,height:_.height,objectFit:n==="Cover"?"cover":"contain",opacity:R&&!W?0:1,transition:R&&!W?`opacity ${fe}ms ${Te}`:W||p?`top ${fe}ms ${Te}, left ${fe}ms ${Te}, width ${fe}ms ${Te}, height ${fe}ms ${Te}`:"none",pointerEvents:"none",zIndex:9998}}),b&&c&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:c.top,left:c.left,width:c.width/2,height:c.height,cursor:"w-resize",zIndex:9999},onClick:y=>{y.stopPropagation(),i()}}),a.jsx("div",{style:{position:"fixed",top:c.top,left:c.left+c.width/2,width:c.width/2,height:c.height,cursor:"e-resize",zIndex:9999},onClick:y=>{y.stopPropagation(),s()}})]})]})}function ac({settings:t,content:e,isEditor:n,isPreviewMode:r,metadata:o,activeEvent:l,layoutId:i}){const{prefix:s}=S.useScopedStyles(),{type:d="A",gridLayout:u,textBoxWidth:c,verticalGap:L,entriesCount:v,lightbox:h,imageDisplay:p,slider:g,sliderTiming:$,direction:f,transition:x,titleMarginTop:b,subtitleMarginTop:R,titleColor:W,subtitleColor:_,titleFontFamily:y,titleFontSettings:w,titleFontSize:E,titleLineHeight:H,titleLetterSpacing:F,titleWordSpacing:O,titleTextAppearance:z,subtitleFontFamily:V,subtitleFontSettings:K,subtitleFontSize:C,subtitleLineHeight:k,subtitleLetterSpacing:I,subtitleWordSpacing:A,subtitleTextAppearance:P}=t,N={fontSettings:{fontFamily:y,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:E??.01,lineHeight:H,letterSpacing:F??0,wordSpacing:O??0,textAppearance:z,color:W},st={...pe(Vt(N,n))},rt={fontSettings:{fontFamily:V,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:C??.01,lineHeight:k,letterSpacing:I??0,wordSpacing:A??0,textAppearance:P,color:_},M={...pe(Vt(rt,n))},J=S.buildColorVars(s,{titleColor:W,subtitleColor:_},sc,lc),pt=`${l&&l!=="default"?`${s}-state-${l}`:""}`.trim(),gt=v===0?1/0:v,D=(e??[]).slice(0,gt),at=u.entryWidth??.2,B=(p==null?void 0:p.display)==="Cover",T=(p==null?void 0:p.ratioValue)??"1:1",U=(p==null?void 0:p.reversed)??!1,[q,Z]=T.split(":").map(Number),ot=U?Z:q,it=U?q:Z,et=`${ot} / ${it}`,dt=ot>=it,j={objectFit:B?"cover":"contain",...B&&{aspectRatio:et,width:dt?"100%":"auto",height:dt?"auto":"100%"}},[X,Y]=m.useState("ltr"),[lt,nt]=m.useState(0),ct=m.useRef(null);m.useEffect(()=>{const $t=ct.current;if(!$t)return;const Mt=new ResizeObserver(kt=>{nt(Math.round(kt[0].contentRect.width))});return Mt.observe($t),()=>Mt.disconnect()},[]);const[Ct,Lt]=m.useState(!1),[Pt,Dt]=m.useState([]),[St,At]=m.useState(0),[Kt,yt]=m.useState(null),Wt=($t,Mt,kt)=>{if(h==="Off")return;const Rt=$t.currentTarget.getBoundingClientRect();yt({top:Rt.top,left:Rt.left,width:Rt.width,height:Rt.height}),Dt(Mt),At(kt),Lt(!0)};return m.useEffect(()=>{if(!Ct||h!=="On"||typeof document>"u")return;const $t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=$t}},[Ct,h]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:oc(s)}}),a.jsx("div",{style:J,children:a.jsx("div",{ref:ct,className:`${s}-wrapper ${s}-type-${d} ${pt}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:S.scalingValue(L??0,n),columnGap:S.scalingValue(u.horizontalGap??0,n),width:S.scalingValue(u.wrapperWidth??0,n)},children:D.map(($t,Mt)=>{var kt,Rt;return a.jsx("div",{className:`${s}-item`.trim(),children:a.jsx("div",{className:r?`${s}-item-inner`:`${s}-item-inner-hidden`,style:{width:(c??0)>100?`calc(${S.scalingValue(at??0,n)} * (${c} / 100))`:S.scalingValue(at??0,n)},children:a.jsxs("a",{href:(((kt=$t.link)==null?void 0:kt.length)??0)>0&&h==="Off"?$t.link:void 0,target:"_blank",className:`${s}-item-image-link`,children:[a.jsx("div",{className:`${s}-item-image-wrapper`,style:{width:S.scalingValue(at??0,n),height:S.scalingValue(at??0,n)},children:(((Rt=$t.image)==null?void 0:Rt.length)??0)===0?null:g==="Off"?a.jsx("img",{src:$t.image[0].url,alt:$t.image[0].name,className:`${s}-item-image`.trim(),style:j,onClick:It=>Wt(It,$t.image.map(Ut=>Ut.url),0)}):a.jsx(Vr,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:$*1e3,width:"100%",height:"100%",speed:500,type:x==="Fade"?"fade":"loop",rewind:x==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:x==="Fade"?"ltr":f!=="Random"?f==="Horizontal"?"ltr":"ttb":X},onMoved:It=>{if(f!=="Random"||x==="Fade")return;const Ut=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";Y(Ut),setTimeout(()=>{It.refresh()},0)},children:$t.image.map((It,Ut)=>a.jsx(Kr,{children:a.jsx("img",{src:It.url,alt:It.name,className:`${s}-item-image`.trim(),style:j,onClick:re=>Wt(re,$t.image.map(Jt=>Jt.url),Ut)})},Ut))},`${x}-${at}-${f}-${$}-${lt}-${i}`)}),a.jsx("div",{"data-controls":"titleMarginTop",className:`${s}-control`,style:{height:S.scalingValue(b??0,n),width:S.scalingValue(at*c/100,n)}}),a.jsx("p",{className:`${s}-item-title`.trim(),style:{width:`calc(${S.scalingValue(at??0,n)} * (${c} / 100))`,...st},children:$t.title}),d==="B"&&a.jsx("div",{"data-controls":"subtitleMarginTop",className:`${s}-control`,style:{height:S.scalingValue(R??0,n),width:S.scalingValue(at*c/100,n)}}),d==="B"&&a.jsx("p",{className:`${s}-item-subtitle`.trim(),style:{width:`calc(${S.scalingValue(at??0,n)} * (${c} / 100))`,...M},children:$t.subtitle})]})})},Mt)})})}),Ct&&typeof document&&document.getElementById("grid-component-lightbox-portal")&&h==="On"&&_o.createPortal(a.jsx("div",{"data-selection":"none",children:a.jsx(ic,{images:Pt,index:St,imageDisplay:p.display,originRect:Kt,reverseClose:g==="Off",onClose:()=>Lt(!1),onPrev:()=>At($t=>($t-1+Pt.length)%Pt.length),onNext:()=>At($t=>($t+1)%Pt.length)})}),document.body)]})}const sc={titleColor:"title-color",subtitleColor:"subtitle-color"},lc=["hover","focus","filled","success","error"],cc=`import { Splide, SplideSlide } from '@splidejs/react-splide';\r
|
|
2894
2894
|
import '@splidejs/react-splide/css/core';\r
|
|
2895
2895
|
import { CommonComponentProps } from '../props';\r
|
|
2896
2896
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
|
|
@@ -3549,17 +3549,17 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {\r
|
|
|
3549
3549
|
};\r
|
|
3550
3550
|
\r
|
|
3551
3551
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
3552
|
-
`,
|
|
3553
|
-
.${
|
|
3552
|
+
`,Co={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},dc=["titleColor","subtitleColor"],uc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Title 1",subtitle:"Subtitle 1",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Grid-1.png",objectFit:"cover"}],link:""},{title:"Title 2",subtitle:"Subtitle 2",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Grid-2.png",objectFit:"cover"}],link:""},{title:"Title 3",subtitle:"Subtitle 3",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Grid-3.png",objectFit:"cover"}],link:""}]}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0,max:200},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["On","Off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["On","Off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["Horizontal","Vertical","Random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["Fade","Slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Color",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Color",display:{type:"palette-color-picker",visible:!1}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Co.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:{...Co.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"Off",imageDisplay:{display:"Fit",ratioValue:"16:9",reversed:!1},type:"A",slider:"Off",sliderTiming:5,direction:"Horizontal",transition:"Slide",titleColor:"#767676",subtitleColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Arial",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.043,titleLineHeight:.043,subtitleFontSize:.0373,subtitleLineHeight:.0373},d:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.01,titleLineHeight:.01,subtitleFontSize:.01,subtitleLineHeight:.01}},displayRules:[{if:{name:"transition",value:"Fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"type",value:"B"},then:{name:"properties.subtitleColor.display.visible",value:!0}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","entriesCount","lightbox","imageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","entriesCount"]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"Image",items:["imageDisplay","lightbox"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","sliderTiming"]},{type:"group",title:"",items:["direction","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]}]}],paletteBookmark:{items:[...dc],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},pc={element:ac,id:"grid",name:"Neptune",category:"grids",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:uc,sourceCode:cc};function On(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function mc(t){return String(t??"").trim().length>0}function gc(t,e,n,r,o,l,i){const s=S.scalingValue(l,i),d=S.scalingValue(0,i),u=t===0,c=t===e-1&&!o;return{borderTopWidth:u&&n?s:d,borderBottomWidth:!c||r?s:d}}function hc(t,e,n){const r=S.scalingValue(e,n),o=S.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:t?r:o}}function fc(t){return`
|
|
3553
|
+
.${t}-wrapper {
|
|
3554
3554
|
display: grid;
|
|
3555
3555
|
align-items: start;
|
|
3556
|
-
min-height: ${
|
|
3556
|
+
min-height: ${On(48)};
|
|
3557
3557
|
position: relative;
|
|
3558
3558
|
overflow: visible;
|
|
3559
3559
|
box-sizing: border-box;
|
|
3560
3560
|
}
|
|
3561
3561
|
|
|
3562
|
-
.${
|
|
3562
|
+
.${t}-hover-image {
|
|
3563
3563
|
position: absolute;
|
|
3564
3564
|
right: 0;
|
|
3565
3565
|
bottom: 0;
|
|
@@ -3569,7 +3569,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
3569
3569
|
height: auto;
|
|
3570
3570
|
}
|
|
3571
3571
|
|
|
3572
|
-
.${
|
|
3572
|
+
.${t}-list-item {
|
|
3573
3573
|
display: flex;
|
|
3574
3574
|
flex-direction: column;
|
|
3575
3575
|
align-items: stretch;
|
|
@@ -3577,47 +3577,83 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
3577
3577
|
overflow: visible;
|
|
3578
3578
|
position: relative;
|
|
3579
3579
|
box-sizing: content-box;
|
|
3580
|
-
border-bottom-style: solid;
|
|
3581
|
-
border-bottom-color: var(--${e}-divider-color);
|
|
3582
3580
|
user-select: none;
|
|
3583
|
-
background: var(--${
|
|
3581
|
+
background: var(--${t}-background-color);
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
.${t}-wrapper.${t}-divider-top .${t}-list-item {
|
|
3585
|
+
border-top-style: solid;
|
|
3586
|
+
border-top-color: var(--${t}-divider-color);
|
|
3587
|
+
}
|
|
3588
|
+
|
|
3589
|
+
.${t}-wrapper.${t}-divider-bottom .${t}-list-item {
|
|
3590
|
+
border-bottom-style: solid;
|
|
3591
|
+
border-bottom-color: var(--${t}-divider-color);
|
|
3584
3592
|
}
|
|
3585
3593
|
|
|
3586
|
-
.${
|
|
3594
|
+
.${t}-list-cols-row {
|
|
3587
3595
|
display: flex;
|
|
3588
3596
|
align-items: start;
|
|
3589
3597
|
width: 100%;
|
|
3590
3598
|
box-sizing: border-box;
|
|
3591
3599
|
}
|
|
3592
3600
|
|
|
3593
|
-
|
|
3601
|
+
.${t}-wrapper.${t}-type-b .${t}-list-cols-row {
|
|
3602
|
+
flex-direction: column;
|
|
3603
|
+
align-items: stretch;
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
.${t}-wrapper.${t}-type-b .${t}-list-col {
|
|
3607
|
+
width: 100%;
|
|
3608
|
+
min-width: 0;
|
|
3609
|
+
justify-content: center;
|
|
3610
|
+
align-items: flex-start;
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
.${t}-wrapper.${t}-type-b .${t}-list-col-title {
|
|
3614
|
+
text-align: center;
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
.${t}-wrapper.${t}-type-b .${t}-cut-item .${t}-list-cols-row {
|
|
3618
|
+
flex-direction: row;
|
|
3619
|
+
align-items: center;
|
|
3620
|
+
justify-content: center;
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
.${t}-wrapper.${t}-type-b .${t}-cut-label {
|
|
3624
|
+
text-align: center;
|
|
3625
|
+
width: 100%;
|
|
3626
|
+
box-sizing: border-box;
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
.${t}-wrapper.${t}-type-b .${t}-list-col-last {
|
|
3630
|
+
flex: 0 0 auto;
|
|
3631
|
+
min-width: 0;
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
a.${t}-list-item {
|
|
3594
3635
|
text-decoration: none;
|
|
3595
3636
|
color: inherit;
|
|
3596
3637
|
cursor: pointer;
|
|
3597
3638
|
}
|
|
3598
3639
|
|
|
3599
|
-
.${
|
|
3600
|
-
border-top-style: solid;
|
|
3601
|
-
border-top-color: var(--${e}-divider-color);
|
|
3602
|
-
}
|
|
3603
|
-
|
|
3604
|
-
.${e}-list-col {
|
|
3640
|
+
.${t}-list-col {
|
|
3605
3641
|
flex-shrink: 0;
|
|
3606
3642
|
overflow: visible;
|
|
3607
3643
|
box-sizing: border-box;
|
|
3608
|
-
min-width: ${
|
|
3644
|
+
min-width: ${On(50)};
|
|
3609
3645
|
position: relative;
|
|
3610
3646
|
display: flex;
|
|
3611
3647
|
align-items: center;
|
|
3612
3648
|
}
|
|
3613
3649
|
|
|
3614
|
-
.${
|
|
3650
|
+
.${t}-list-col-last {
|
|
3615
3651
|
flex: 1 1 auto;
|
|
3616
|
-
min-width: ${
|
|
3652
|
+
min-width: ${On(50)};
|
|
3617
3653
|
}
|
|
3618
3654
|
|
|
3619
|
-
.${
|
|
3620
|
-
color: var(--${
|
|
3655
|
+
.${t}-list-col-title {
|
|
3656
|
+
color: var(--${t}-text-color);
|
|
3621
3657
|
white-space: pre-wrap;
|
|
3622
3658
|
overflow-wrap: anywhere;
|
|
3623
3659
|
word-break: break-word;
|
|
@@ -3626,20 +3662,20 @@ a.${e}-list-item {
|
|
|
3626
3662
|
width: 100%;
|
|
3627
3663
|
}
|
|
3628
3664
|
|
|
3629
|
-
.${
|
|
3630
|
-
.${
|
|
3665
|
+
.${t}-col-resize-handle,
|
|
3666
|
+
.${t}-padding-control-handle {
|
|
3631
3667
|
background: transparent;
|
|
3632
3668
|
}
|
|
3633
3669
|
|
|
3634
|
-
.${
|
|
3670
|
+
.${t}-row-padding-handle {
|
|
3635
3671
|
position: relative;
|
|
3636
3672
|
z-index: 2;
|
|
3637
3673
|
width: 100%;
|
|
3638
3674
|
flex-shrink: 0;
|
|
3639
|
-
background:
|
|
3675
|
+
background: transparent;
|
|
3640
3676
|
}
|
|
3641
3677
|
|
|
3642
|
-
.${
|
|
3678
|
+
.${t}-row-padding-handle::before {
|
|
3643
3679
|
content: "";
|
|
3644
3680
|
position: absolute;
|
|
3645
3681
|
top: 0;
|
|
@@ -3651,7 +3687,7 @@ a.${e}-list-item {
|
|
|
3651
3687
|
z-index: 10;
|
|
3652
3688
|
}
|
|
3653
3689
|
|
|
3654
|
-
.${
|
|
3690
|
+
.${t}-col-resize-handle::after {
|
|
3655
3691
|
content: '';
|
|
3656
3692
|
position: absolute;
|
|
3657
3693
|
top: 0;
|
|
@@ -3663,7 +3699,39 @@ a.${e}-list-item {
|
|
|
3663
3699
|
pointer-events: none;
|
|
3664
3700
|
}
|
|
3665
3701
|
|
|
3666
|
-
.${
|
|
3702
|
+
.${t}-wrapper.${t}-type-b .${t}-col-resize-handle::after {
|
|
3703
|
+
top: 50%;
|
|
3704
|
+
left: 0;
|
|
3705
|
+
transform: translateY(-50%);
|
|
3706
|
+
width: 100%;
|
|
3707
|
+
height: 2px;
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3710
|
+
.${t}-padding-control-handle::after {
|
|
3711
|
+
content: '';
|
|
3712
|
+
position: absolute;
|
|
3713
|
+
top: 50%;
|
|
3714
|
+
left: 50%;
|
|
3715
|
+
transform: translate(-50%, -50%);
|
|
3716
|
+
width: 4px;
|
|
3717
|
+
height: 12px;
|
|
3718
|
+
background: #FF5C02;
|
|
3719
|
+
border: 1px solid #FFFFFF;
|
|
3720
|
+
border-radius: 5px;
|
|
3721
|
+
pointer-events: none;
|
|
3722
|
+
box-sizing: border-box;
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3725
|
+
.${t}-wrapper.${t}-type-b .${t}-padding-control-handle::after {
|
|
3726
|
+
width: 12px;
|
|
3727
|
+
height: 4px;
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
.${t}-text-padding-lr-handle {
|
|
3731
|
+
background: transparent;
|
|
3732
|
+
}
|
|
3733
|
+
|
|
3734
|
+
.${t}-text-padding-lr-handle::after {
|
|
3667
3735
|
content: '';
|
|
3668
3736
|
position: absolute;
|
|
3669
3737
|
top: 50%;
|
|
@@ -3678,75 +3746,73 @@ a.${e}-list-item {
|
|
|
3678
3746
|
box-sizing: border-box;
|
|
3679
3747
|
}
|
|
3680
3748
|
|
|
3681
|
-
.${
|
|
3682
|
-
.${
|
|
3683
|
-
.${
|
|
3684
|
-
.${
|
|
3749
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-list-item,
|
|
3750
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-item,
|
|
3751
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-cut-item,
|
|
3752
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-item {
|
|
3685
3753
|
transition: background-color 250ms, border-color 250ms;
|
|
3686
3754
|
}
|
|
3687
3755
|
|
|
3688
|
-
.${
|
|
3689
|
-
.${
|
|
3690
|
-
.${
|
|
3691
|
-
.${
|
|
3756
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-list-col-title,
|
|
3757
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-col-title,
|
|
3758
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-cut-label,
|
|
3759
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-label {
|
|
3692
3760
|
transition: color 250ms;
|
|
3693
3761
|
}
|
|
3694
3762
|
|
|
3695
|
-
.${
|
|
3696
|
-
.${
|
|
3697
|
-
.${
|
|
3698
|
-
.${
|
|
3699
|
-
background: var(--${
|
|
3700
|
-
}
|
|
3701
|
-
|
|
3702
|
-
.${
|
|
3703
|
-
.${
|
|
3704
|
-
.${
|
|
3705
|
-
.${
|
|
3706
|
-
.${
|
|
3707
|
-
.${
|
|
3708
|
-
|
|
3709
|
-
}
|
|
3710
|
-
|
|
3711
|
-
.${
|
|
3712
|
-
.${
|
|
3713
|
-
.${
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
.${
|
|
3718
|
-
.${
|
|
3719
|
-
.${
|
|
3720
|
-
.${
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
}
|
|
3725
|
-
|
|
3726
|
-
.${
|
|
3727
|
-
.${
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
}
|
|
3732
|
-
|
|
3733
|
-
.${
|
|
3734
|
-
.${
|
|
3735
|
-
.${
|
|
3736
|
-
.${
|
|
3737
|
-
.${
|
|
3738
|
-
.${
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
}
|
|
3743
|
-
|
|
3744
|
-
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item::before,
|
|
3745
|
-
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item::before {
|
|
3763
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-list-item:hover,
|
|
3764
|
+
.${t}-wrapper.${t}-entry-hover-default.${t}-state-hover .${t}-list-item,
|
|
3765
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-cut-item:hover,
|
|
3766
|
+
.${t}-wrapper.${t}-entry-hover-default.${t}-state-hover .${t}-cut-item {
|
|
3767
|
+
background: var(--${t}-background-hover-color);
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default .${t}-list-item:hover,
|
|
3771
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default .${t}-list-item:has(+ .${t}-list-item:hover),
|
|
3772
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default .${t}-list-item:has(+ .${t}-cut-item:hover),
|
|
3773
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default.${t}-state-hover .${t}-list-item,
|
|
3774
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default .${t}-cut-item:hover,
|
|
3775
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-default.${t}-state-hover .${t}-cut-item,
|
|
3776
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-list-item:hover,
|
|
3777
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-list-item:has(+ .${t}-list-item:hover),
|
|
3778
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-list-item:has(+ .${t}-cut-item:hover),
|
|
3779
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item,
|
|
3780
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-cut-item:hover,
|
|
3781
|
+
.${t}-wrapper.${t}-divider-bottom.${t}-entry-hover-blinds.${t}-state-hover .${t}-cut-item {
|
|
3782
|
+
border-bottom-color: var(--${t}-divider-hover-color);
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
.${t}-wrapper.${t}-divider-top:not(.${t}-divider-bottom).${t}-entry-hover-default .${t}-list-item:hover:first-child,
|
|
3786
|
+
.${t}-wrapper.${t}-divider-top:not(.${t}-divider-bottom).${t}-entry-hover-default.${t}-state-hover .${t}-list-item:first-child,
|
|
3787
|
+
.${t}-wrapper.${t}-divider-top:not(.${t}-divider-bottom).${t}-entry-hover-blinds .${t}-list-item:hover:first-child,
|
|
3788
|
+
.${t}-wrapper.${t}-divider-top:not(.${t}-divider-bottom).${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item:first-child {
|
|
3789
|
+
border-top-color: var(--${t}-divider-hover-color);
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
.${t}-wrapper.${t}-divider-top.${t}-divider-bottom.${t}-entry-hover-default .${t}-list-item:hover:first-child,
|
|
3793
|
+
.${t}-wrapper.${t}-divider-top.${t}-divider-bottom.${t}-entry-hover-default.${t}-state-hover .${t}-list-item:first-child,
|
|
3794
|
+
.${t}-wrapper.${t}-divider-top.${t}-divider-bottom.${t}-entry-hover-blinds .${t}-list-item:hover:first-child,
|
|
3795
|
+
.${t}-wrapper.${t}-divider-top.${t}-divider-bottom.${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item:first-child {
|
|
3796
|
+
border-top-color: var(--${t}-divider-hover-color);
|
|
3797
|
+
}
|
|
3798
|
+
|
|
3799
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-list-item:hover .${t}-list-col-title,
|
|
3800
|
+
.${t}-wrapper.${t}-entry-hover-default.${t}-state-hover .${t}-list-item .${t}-list-col-title,
|
|
3801
|
+
.${t}-wrapper.${t}-entry-hover-default .${t}-cut-item:hover .${t}-cut-label,
|
|
3802
|
+
.${t}-wrapper.${t}-entry-hover-default.${t}-state-hover .${t}-cut-item .${t}-cut-label,
|
|
3803
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-item:hover .${t}-list-col-title,
|
|
3804
|
+
.${t}-wrapper.${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item .${t}-list-col-title,
|
|
3805
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-item:hover .${t}-cut-label,
|
|
3806
|
+
.${t}-wrapper.${t}-entry-hover-blinds.${t}-state-hover .${t}-cut-item .${t}-cut-label {
|
|
3807
|
+
color: var(--${t}-text-hover-color);
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-item::before,
|
|
3811
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-item::before {
|
|
3746
3812
|
content: '';
|
|
3747
3813
|
position: absolute;
|
|
3748
3814
|
inset: 0;
|
|
3749
|
-
background: var(--${
|
|
3815
|
+
background: var(--${t}-background-hover-color);
|
|
3750
3816
|
transform: scaleY(0);
|
|
3751
3817
|
transform-origin: center center;
|
|
3752
3818
|
transition: transform 250ms;
|
|
@@ -3754,52 +3820,188 @@ a.${e}-list-item {
|
|
|
3754
3820
|
pointer-events: none;
|
|
3755
3821
|
}
|
|
3756
3822
|
|
|
3757
|
-
.${
|
|
3758
|
-
.${
|
|
3823
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-col,
|
|
3824
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-label {
|
|
3759
3825
|
position: relative;
|
|
3760
3826
|
z-index: 1;
|
|
3761
3827
|
}
|
|
3762
3828
|
|
|
3763
|
-
.${
|
|
3764
|
-
.${
|
|
3765
|
-
.${
|
|
3766
|
-
.${
|
|
3829
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-list-item:hover::before,
|
|
3830
|
+
.${t}-wrapper.${t}-entry-hover-blinds.${t}-state-hover .${t}-list-item::before,
|
|
3831
|
+
.${t}-wrapper.${t}-entry-hover-blinds .${t}-cut-item:hover::before,
|
|
3832
|
+
.${t}-wrapper.${t}-entry-hover-blinds.${t}-state-hover .${t}-cut-item::before {
|
|
3767
3833
|
transform: scaleY(1);
|
|
3768
3834
|
}
|
|
3769
3835
|
|
|
3770
|
-
.${
|
|
3836
|
+
.${t}-cut-item {
|
|
3771
3837
|
display: flex;
|
|
3772
3838
|
align-items: center;
|
|
3773
3839
|
justify-content: center;
|
|
3774
3840
|
width: 100%;
|
|
3775
3841
|
overflow: visible;
|
|
3776
3842
|
position: relative;
|
|
3843
|
+
z-index: 3;
|
|
3777
3844
|
box-sizing: border-box;
|
|
3778
|
-
border-bottom-style: solid;
|
|
3779
|
-
border-bottom-color: var(--${e}-divider-color);
|
|
3780
3845
|
user-select: none;
|
|
3781
|
-
background: var(--${
|
|
3846
|
+
background: var(--${t}-background-color);
|
|
3782
3847
|
}
|
|
3783
3848
|
|
|
3784
|
-
.${
|
|
3849
|
+
.${t}-wrapper.${t}-divider-bottom .${t}-cut-item {
|
|
3850
|
+
border-bottom-style: solid;
|
|
3851
|
+
border-bottom-color: var(--${t}-divider-color);
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
.${t}-cut-label {
|
|
3785
3855
|
all: unset;
|
|
3786
3856
|
cursor: pointer;
|
|
3787
|
-
|
|
3857
|
+
position: relative;
|
|
3858
|
+
z-index: 1;
|
|
3859
|
+
color: var(--${t}-text-color);
|
|
3788
3860
|
white-space: pre-wrap;
|
|
3789
3861
|
overflow-wrap: anywhere;
|
|
3790
3862
|
word-break: break-word;
|
|
3791
3863
|
}
|
|
3792
|
-
`}const Mn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],et=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Hn=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Nn=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],co=.004,Sn=.004,Xo=50,Xs=1440,nn=Xo/Xs,kt={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function En(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Zs(e,t=1){const n=t/e;return Object.fromEntries(et.map(r=>[r,n]))}function $n(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:kt[t]]))}function Zo(e,t,n){const r=e-nn,o=t+n;if(o<=0||o<=r)return{paddingLeft:t,paddingRight:n};if(r<=0)return{paddingLeft:0,paddingRight:0};const l=r/o;return{paddingLeft:t*l,paddingRight:n*l}}function Pn(e,t,n){const r=Mr(e,t,n);if(e<=0)return[];const o=r.slice(0,e-1).reduce((l,i)=>l+i,0);return[...r.slice(0,e-1),Math.max(0,t-o)]}function Js(e,t,n){const r={};for(let o=0;o<e;o+=1){const l=Hn[o],i=Nn[o],c=typeof n[l]=="number"?n[l]:0,s=typeof n[i]=="number"?n[i]:0,u=Zo(t[o]??0,c,s);u.paddingLeft!==c&&(r[l]=u.paddingLeft),u.paddingRight!==s&&(r[i]=u.paddingRight)}return r}function Mr(e,t,n){if(e<=0)return[];const r=et.slice(0,e).map(u=>n[u]);if(e===1)return r;const o=r.slice(0,e-1),i=o.reduce((u,d)=>u+d,0)+nn;if(t>=i)return r;const c=[...o];let s=i-t;for(let u=c.length-1;u>=0&&s>0;u-=1){const d=c[u]-nn;if(d<=0)continue;const L=Math.min(s,d);c[u]-=L,s-=L}return[...c,r[e-1]]}function Qs(e,t,n){if(e<=1)return{};const r=Mr(e,t,n),o={};for(let l=0;l<e-1;l+=1){const i=et[l];r[l]!==n[i]&&(o[i]=r[l])}return o}function uo(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Mn]}function ec(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function tc(e,t,n,r){const o=Math.min(r,e.length,et.length),l={};for(let i=0;i<o;i+=1){const c=e[i],s=t.indexOf(c);if(s===-1)continue;const u=et[s],d=Hn[s],L=Nn[s],b=et[i],f=Hn[i],p=Nn[i],m=n[u],v=n[d],h=n[L];typeof m=="number"&&(l[b]=m),typeof v=="number"&&(l[f]=v),typeof h=="number"&&(l[p]=h)}return l}function nc(e,t){const n=e.columns,r=t.columns,o=En(e),l=En(t),i=typeof n=="number"?n:typeof r=="number"?r:Mn.length,c=m=>{const v=$n({...t,...m}),h=En(m),S=Pn(i,h,v),T=Js(i,S,{...t,...m});return Object.keys(T).length===0?m:{...m,...T}};if(typeof n=="number"&&n!==r)return c({...e,...Zs(n,o)});const s=uo(e),u=uo(t);if(!ec(s,u))return c({...e,...tc(s,u,t,i)});if(o<l&&typeof i=="number"){const m=$n({...t,...e});return c({...e,...Qs(i,o,m)})}const d=$n({...t,...e}),L=Pn(i,l,$n(t)),f=Pn(i,o,d).some((m,v)=>m<(L[v]??m)),p=et.some(m=>{const v=e[m],h=t[m];return typeof v=="number"&&typeof h=="number"&&v!==h});return f||p?c(e):e}function rc(e,t,n,r){const o=t.slice(0,e).reduce((i,c)=>i+c,0),l=n.slice(e+1,t.length-1).reduce((i,c)=>i+c,0);return Math.max(nn,r-o-l-nn)}function oc(e,t){return Math.random()*(t-e)+e}function ic({settings:e,content:t,isEditor:n,isPreviewMode:r,metadata:o,activeEvent:l,layoutId:i,onUpdateSettings:c}){const{prefix:s}=$.useScopedStyles(),u=!!(n&&r),{columns:d,wrapperWidth:L,entriesCount:b,cellMinHeight:f,dividerWidth:p,cut:m,showCut:v,cutCellMinHeight:h,cutLabel:S,imageSize:T,imageOnHover:z,entryHoverEffect:F,rowPaddingTop:_,rowPaddingBottom:y,AColumnWidth:x,AColumnPaddingLeft:E,AColumnPaddingRight:O,BColumnWidth:P,BColumnPaddingLeft:H,BColumnPaddingRight:N,CColumnWidth:D,CColumnPaddingLeft:V,CColumnPaddingRight:C,DColumnWidth:A,DColumnPaddingLeft:I,DColumnPaddingRight:k,EColumnWidth:W,EColumnPaddingLeft:M,EColumnPaddingRight:Z,columnsOrder:ae,textColor:ne,textFontFamily:ue,textFontSettings:R,textFontSize:re,textLineHeight:he,textLetterSpacing:me,textWordSpacing:ge,textTextAppearance:U,backgroundColor:le,dividerColor:B,textHoverColor:w,backgroundHoverColor:K,dividerHoverColor:X}=e,[J,ie]=g.useState(void 0),[Q,ee]=g.useState(null),se=z==="On",j=(m??0)>0;g.useEffect(()=>{ie(void 0)},[m,v,t,b]);const q=re??.01,Y=q*1.2,ce=Math.max(he??q,Y),oe={fontSettings:{fontFamily:ue,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:q,lineHeight:ce,letterSpacing:me??0,wordSpacing:ge??0,textAppearance:U,color:ne},we={...ut(ze(oe,n))},Le=$.buildColorVars(s,{textColor:ne,backgroundColor:le,dividerColor:B,textHoverColor:w,backgroundHoverColor:K,dividerHoverColor:X},ac,lc),Oe=l&&l!=="default"?`${s}-state-${l}`:"",be=`${F==="Default"?`${s}-entry-hover-default`:F==="Blinds"?`${s}-entry-hover-blinds`:""} ${Oe}`.trim(),Ae=g.useRef(null),Be=g.useRef(e);g.useEffect(()=>{if(!c||!n){Be.current=e;return}const ye=Be.current,Se=nc(e,ye);Be.current=e,Se!==e&&c(Se)},[e,c,n]);const xe={AColumnWidth:x??kt.AColumnWidth,BColumnWidth:P??kt.BColumnWidth,CColumnWidth:D??kt.CColumnWidth,DColumnWidth:A??kt.DColumnWidth,EColumnWidth:W??kt.EColumnWidth},Fe={AColumnPaddingLeft:E??0,BColumnPaddingLeft:H??0,CColumnPaddingLeft:V??0,DColumnPaddingLeft:I??0,EColumnPaddingLeft:M??0},Ce={AColumnPaddingRight:O??0,BColumnPaddingRight:N??0,CColumnPaddingRight:C??0,DColumnPaddingRight:k??0,EColumnPaddingRight:Z??0},Ie=g.useMemo(()=>Array.isArray(ae)&&ae.length>0?ae:[...Mn],[ae]),We=g.useMemo(()=>Ie.slice(0,d).map((ye,Se)=>{const je=Hn[Se],nt=Nn[Se];return{key:ye,widthKey:et[Se],width:xe[et[Se]],paddingLeftKey:je,paddingRightKey:nt,paddingLeft:Fe[je],paddingRight:Ce[nt]}}),[d,Ie,x,P,D,A,W,E,O,H,N,V,C,I,k,M,Z]),Ee=En(e),Ve=g.useMemo(()=>et.slice(0,d).map(ye=>xe[ye]),[d,x,P,D,A,W]),Ze=g.useMemo(()=>Mr(d,Ee,xe),[d,Ee,x,P,D,A,W]),Me=g.useMemo(()=>Pn(d,Ee,xe),[d,Ee,x,P,D,A,W]),He=g.useMemo(()=>We.map((ye,Se)=>Zo(Me[Se]??0,ye.paddingLeft,ye.paddingRight)),[We,Me]),at=g.useMemo(()=>{const ye=b===0?1/0:b;return(t??[]).slice(0,ye).map((je,nt)=>({id:nt,cells:Object.fromEntries(Mn.map(gt=>[gt,je[gt]??""])),image:je.image,link:je.link}))},[t,b]),pn=j?J??m:at.length,Zn=g.useMemo(()=>j?at.slice(0,pn):at,[at,j,pn]),mn=j&&pn<at.length,gn=()=>{const ye=J??m;if(!v){ie(at.length);return}ie(Math.min(ye+v,at.length))},Pe=ye=>$.scalingValue(ye,n??!1),fe=_??0,Ke=y??0,De=We[0],Re=We[We.length-1],Ge=He[0],Vt=He[He.length-1],Jo=De&&Ge?Math.max(Ge.paddingLeft,Sn):0,Hr=Re&&Vt?Math.max(Vt.paddingRight,Sn):0,Qo=Ee,ei=ye=>{if(!se)return;const Se=ye.image;if(!(Se!=null&&Se.url)){ee(null);return}if((Q==null?void 0:Q.rowId)===ye.id)return;const je=(T==null?void 0:T.min)??80,nt=(T==null?void 0:T.max)??320;ee({rowId:ye.id,url:Se.url,objectFit:Se.objectFit??"cover",widthPx:oc(je,nt)})},ti=()=>{ee(null)};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ys(s)}}),a.jsx("div",{style:Le,children:a.jsxs("div",{ref:Ae,className:`${s}-wrapper ${be}`.trim(),style:{width:$.scalingValue(L??0,n)},onMouseLeave:se?ti:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[Zn.map((ye,Se)=>{var Kt;const je=(((Kt=ye.link)==null?void 0:Kt.length)??0)>0,nt=je?"a":"div",gt={borderBottomWidth:$.scalingValue(p??0,n),...Se===0?{borderTopWidth:$.scalingValue(p??0,n)}:{}};return a.jsxs(nt,{className:`${s}-list-item`,...je?{href:ye.link,target:"_blank"}:{},style:gt,onMouseEnter:se?()=>ei(ye):void 0,children:[(fe>0||u)&&a.jsx("div",{...u?{"data-controls":"rowPaddingTop","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Pe(fe)}}),a.jsx("div",{className:`${s}-list-cols-row`,style:{minHeight:Pe(f??0)},children:We.map((Et,Pt)=>{const hn=Pt===We.length-1,Jn=Me[Pt],fn=He[Pt];return a.jsx("div",{className:`${s}-list-col${hn?` ${s}-list-col-last`:""}`,style:{paddingLeft:Pe(fn.paddingLeft),paddingRight:Pe(fn.paddingRight),...hn?{}:{width:Pe(Jn)}},"data-test":Et.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:we,children:ye.cells[Et.key]??null})},Et.key)})}),(Ke>0||u)&&a.jsx("div",{...u?{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Pe(Ke)}})]},ye.id)}),mn&&a.jsx("div",{className:`${s}-cut-item`,style:{minHeight:Pe(h??0),borderBottomWidth:$.scalingValue(p??0,n)},children:a.jsx("div",{className:`${s}-list-cols-row`,style:{justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${s}-cut-label`,style:we,onClick:gn,children:S})})})]}),u&&De&&Re&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":De.paddingLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me[0]-((Ge==null?void 0:Ge.paddingRight)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:0,width:Pe(Jo),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Re.paddingRightKey,"data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Me[We.length-1]-((Vt==null?void 0:Vt.paddingLeft)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Pe(Qo-Hr),width:Pe(Hr),height:"100%",pointerEvents:"auto",zIndex:2}})]},"column-edge-padding-handles"),u&&We.slice(0,-1).map((ye,Se)=>{const je=We[Se+1],nt=rc(Se,Ze,Ve,Ee),gt=Ze.slice(0,Se+1).reduce((fn,ni)=>fn+ni,0),Kt=He[Se],Et=He[Se+1],Pt=Math.max(Kt.paddingRight,Sn),hn=Math.max(Et.paddingLeft,Sn),Jn=gt-co/2;return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":ye.paddingRightKey,"data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Me[Se]-Kt.paddingLeft),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Pe(gt-Pt),width:Pe(Pt),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-min":String(Xo),"data-controls-max-fraction":String(nt),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Pe(Jn),width:Pe(co),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":je.paddingLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me[Se+1]-Et.paddingRight),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Pe(gt),width:Pe(hn),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${ye.widthKey}-junction`)}),se&&Q&&a.jsx("img",{className:`${s}-hover-image`,src:Q.url,alt:"",style:{width:Wn(Q.widthPx),objectFit:Q.objectFit}})]})})]})}const ac={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},lc=["hover","focus","filled","success","error"],sc=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3793
|
-
import '@splidejs/react-splide/css/core';
|
|
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 Ur(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=r=>{const o=Ur(e,r),l=t[o];return l!==void 0?l:t[r]};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 So(t,e){var i,s;const n=t.textFontSize??.01,r=n*1.2,o=Math.max(t.textLineHeight??n,r),l={fontSettings:{fontFamily:t.textFontFamily,fontWeight:((i=t.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((s=t.textFontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:n,lineHeight:o,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 r=!1;for(const o of vc)if(t[o]!==e[o]&&t[o]!==void 0){r=!0;for(const l of qe)n[Ur(l,o)]=t[o]}return r?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"],$o=.004,Qe=.004,Gr=50,pn=1440,mn=Gr/pn;function ui(t){const e=typeof t=="number"&&t>0?t:pn;return Gr/e}function wc(t){let e=t??null;for(;e;){const n=e.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const r=getComputedStyle(e).getPropertyValue("--cntrl-article-width").trim();if(r){const o=parseFloat(r);if(Number.isFinite(o)&&o>0)return o}e=e.parentElement}return pn}const pi={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(r=>[r,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]:pi[e]]))}function mi(t,e,n){const r=t-mn,o=e+n;if(o<=0||o<=r)return{paddingLeft:e,paddingRight:n};if(r<=0)return{paddingLeft:0,paddingRight:0};const l=r/o;return{paddingLeft:e*l,paddingRight:n*l}}function Hn(t,e,n){const r=Yr(t,e,n);if(t<=0)return[];const o=r.slice(0,t-1).reduce((l,i)=>l+i,0);return[...r.slice(0,t-1),Math.max(0,e-o)]}function Ec(t,e,n){const r={};for(let o=0;o<t;o+=1){const l=je[o],i=Ve[o],s=typeof n[l]=="number"?n[l]:0,d=typeof n[i]=="number"?n[i]:0,u=mi(e[o]??0,s,d);u.paddingLeft!==s&&(r[l]=u.paddingLeft),u.paddingRight!==d&&(r[i]=u.paddingRight)}return r}function Yr(t,e,n){if(t<=0)return[];const r=Xt.slice(0,t).map(u=>n[u]);if(t===1)return r;const o=r.slice(0,t-1),i=o.reduce((u,c)=>u+c,0)+mn;if(e>=i)return r;const s=[...o];let d=i-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,r[t-1]]}function Pc(t,e,n){if(t<=1)return{};const r=Yr(t,e,n),o={};for(let l=0;l<t-1;l+=1){const i=Xt[l];r[l]!==n[i]&&(o[i]=r[l])}return o}function wo(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,r)=>n===e[r])}function Fc(t,e,n,r){const o=Math.min(r,t.length,Xt.length),l={};for(let i=0;i<o;i+=1){const s=t[i],d=e.indexOf(s);if(d===-1)continue;const u=Xt[d],c=je[d],L=Ve[d],v=Ke[d],h=Xt[i],p=je[i],g=Ve[i],$=Ke[i],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 r=Cc(t,e);r&&(t={...t,...r});const o=ui(n==null?void 0:n.designWidth),l=t.columns,i=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 i=="number"?i: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!==i){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=wo(t),h=wo(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-o)/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,r){const o=e.slice(0,t).reduce((i,s)=>i+s,0),l=n.slice(t+1,e.length-1).reduce((i,s)=>i+s,0);return Math.max(mn,r-o-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]:pi[e]]))}function mr(t,e,n=0){return Object.fromEntries(e.map(r=>[r,typeof t[r]=="number"?t[r]:n]))}function Mc(t,e,n,r,o,l){return t.slice(0,e).map((i,s)=>{const d=je[s],u=Ve[s],c=Ke[s];return{key:i,textPrefix:yc[i],widthKey:Xt[s],width:n[Xt[s]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:c,paddingLeft:r[d],paddingRight:o[u],paddingBottom:l[c]}})}function Oc({settings:t,content:e,isEditor:n,isPreviewMode:r,activeEvent:o,layoutId:l,onUpdateSettings:i}){const{prefix:s}=S.useScopedStyles(),d=!!(n&&r),{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:rt}=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=ui(B),q=Math.max(0,((L??0)-U)/2),Z=Math.min(F??0,q),ot=Math.max(Z,Qe),it=((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=So(bc(t),n),dt=m.useMemo(()=>Object.fromEntries(qe.map(ft=>[ft,So(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:rt},Sc,$c),X=o&&o!=="default"?`${s}-state-${o}`:"",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(!i||!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&&i(Tt)},[t,i,n,l,B]);const Pt=m.useMemo(()=>kc(t),[t.AColumnWidth,t.BColumnWidth,t.CColumnWidth,t.DColumnWidth,t.EColumnWidth]),Dt=m.useMemo(()=>mr(t,je),[t.AColumnPaddingLeft,t.BColumnPaddingLeft,t.CColumnPaddingLeft,t.DColumnPaddingLeft,t.EColumnPaddingLeft]),St=m.useMemo(()=>mr(t,Ve),[t.AColumnPaddingRight,t.BColumnPaddingRight,t.CColumnPaddingRight,t.DColumnPaddingRight,t.EColumnPaddingRight]),At=m.useMemo(()=>mr(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(()=>Yr(u,Wt,Pt),[u,Wt,Pt]),kt=m.useMemo(()=>Hn(u,Wt,Pt),[u,Wt,Pt]),Rt=m.useMemo(()=>yt.map((ft,Tt)=>mi(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,re=m.useMemo(()=>gt?It.slice(0,Ut):It,[It,gt,Ut]),Jt=gt&&Ut<It.length,rr=re.length>1||Jt,or=[nt?`${s}-divider-top`:"",ct||rr?`${s}-divider-bottom`:""].filter(Boolean).join(" "),ir=()=>{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],gi=jt&&Gt?Math.max(Gt.paddingLeft,Qe):0,qr=Ot&&Ze?Math.max(Ze.paddingRight,Qe):0,hi=Wt,fi=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)})},yi=()=>{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}${or?` ${or}`:""}${D?` ${s}-type-b`:""}`.trim(),style:{width:S.scalingValue(L??0,n)},onMouseLeave:pt?yi:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[re.map((ft,Tt)=>{var Je;const Ht=(((Je=ft.link)==null?void 0:Je.length)??0)>0,Bt=Ht?"a":"div",he=gc(Tt,re.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?()=>fi(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((oe,Re)=>{const $n=Re===yt.length-1,wn=Rt[Re],Tn=oe.paddingBottom,ar=mc(ft.cells[oe.key]),vi=D&&ar&&(Tn>0||d),bi=D?{minHeight:bt(vt)}:$n?{}:{width:bt(kt[Re])},xi=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:{...xi,...bi},"data-test":oe.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:dt[oe.textPrefix]??et,children:ft.cells[oe.key]??null})}),vi&&a.jsx("div",{...d?{"data-controls":oe.paddingBottomKey,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:bt(Tn)}})]},oe.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:ir,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-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(gi),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Ot.paddingRightKey,"data-controls-axis":"x","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(hi-qr),width:bt(qr),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,ar)=>Tn+ar,0),Je=Rt[Tt],oe=Rt[Tt+1],Re=Math.max(Je.paddingRight,Qe),$n=Math.max(oe.paddingLeft,Qe),wn=he-$o/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-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(Gr),"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($o),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":Ht.paddingLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(kt[Tt+1]-oe.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(it),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:0,width:bt(ot),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(it),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:bt(Math.max(ot,Wt-ot)),width:bt(ot),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';
|
|
3794
3865
|
import { CommonComponentProps } from '../props';
|
|
3795
3866
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
3796
|
-
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3797
3867
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
3798
3868
|
|
|
3869
|
+
type ListSettings = {
|
|
3870
|
+
columns: number;
|
|
3871
|
+
type: 'A' | 'B';
|
|
3872
|
+
wrapperWidth: number;
|
|
3873
|
+
entriesCount: number;
|
|
3874
|
+
cellMinHeight: number;
|
|
3875
|
+
imageOnHover: 'On' | 'Off';
|
|
3876
|
+
imageSize?: { min: number; max: number };
|
|
3877
|
+
dividerWidth: number;
|
|
3878
|
+
showVisibility: boolean[];
|
|
3879
|
+
cut: number;
|
|
3880
|
+
showCut: number;
|
|
3881
|
+
cutCellMinHeight: number;
|
|
3882
|
+
cutLabel: string;
|
|
3883
|
+
entryHoverEffect: 'None' | 'Default' | 'Blinds';
|
|
3884
|
+
rowPaddingTop: number;
|
|
3885
|
+
rowPaddingBottom: number;
|
|
3886
|
+
rowPaddingTopB: number;
|
|
3887
|
+
AColumnWidth: number;
|
|
3888
|
+
AColumnPaddingLeft: number;
|
|
3889
|
+
AColumnPaddingRight: number;
|
|
3890
|
+
AColumnPaddingBottom: number;
|
|
3891
|
+
BColumnWidth: number;
|
|
3892
|
+
BColumnPaddingLeft: number;
|
|
3893
|
+
BColumnPaddingRight: number;
|
|
3894
|
+
BColumnPaddingBottom: number;
|
|
3895
|
+
CColumnWidth: number;
|
|
3896
|
+
CColumnPaddingLeft: number;
|
|
3897
|
+
CColumnPaddingRight: number;
|
|
3898
|
+
CColumnPaddingBottom: number;
|
|
3899
|
+
DColumnWidth: number;
|
|
3900
|
+
DColumnPaddingLeft: number;
|
|
3901
|
+
DColumnPaddingRight: number;
|
|
3902
|
+
DColumnPaddingBottom: number;
|
|
3903
|
+
EColumnWidth: number;
|
|
3904
|
+
EColumnPaddingLeft: number;
|
|
3905
|
+
EColumnPaddingRight: number;
|
|
3906
|
+
EColumnPaddingBottom: number;
|
|
3907
|
+
columnsOrder?: string[];
|
|
3908
|
+
textPaddingLR?: number;
|
|
3909
|
+
textColor: string;
|
|
3910
|
+
textFontFamily: string;
|
|
3911
|
+
textFontSettings?: { fontWeight: number; fontStyle: string };
|
|
3912
|
+
textFontSize?: number;
|
|
3913
|
+
textLineHeight?: number;
|
|
3914
|
+
textLetterSpacing?: number;
|
|
3915
|
+
textWordSpacing?: number;
|
|
3916
|
+
textTextAppearance?: TextStyles['textAppearance'];
|
|
3917
|
+
backgroundColor: string;
|
|
3918
|
+
dividerColor: string;
|
|
3919
|
+
textHoverColor: string;
|
|
3920
|
+
backgroundHoverColor: string;
|
|
3921
|
+
dividerHoverColor: string;
|
|
3922
|
+
};
|
|
3923
|
+
|
|
3924
|
+
type ListContentItem = {
|
|
3925
|
+
AColumn?: string;
|
|
3926
|
+
BColumnWidth?: string;
|
|
3927
|
+
CColumnWidth?: string;
|
|
3928
|
+
DColumnWidth?: string;
|
|
3929
|
+
EColumnWidth?: string;
|
|
3930
|
+
image?: {
|
|
3931
|
+
objectFit?: 'cover' | 'contain';
|
|
3932
|
+
url: string;
|
|
3933
|
+
name: string;
|
|
3934
|
+
};
|
|
3935
|
+
link?: string;
|
|
3936
|
+
};
|
|
3937
|
+
|
|
3938
|
+
type ListItemRow = {
|
|
3939
|
+
id: string | number;
|
|
3940
|
+
cells: Record<string, React.ReactNode>;
|
|
3941
|
+
image?: ListContentItem['image'];
|
|
3942
|
+
link?: string;
|
|
3943
|
+
};
|
|
3944
|
+
|
|
3945
|
+
type HoverImageState = {
|
|
3946
|
+
rowId: string | number;
|
|
3947
|
+
url: string;
|
|
3948
|
+
objectFit: 'cover' | 'contain';
|
|
3949
|
+
widthPx: number;
|
|
3950
|
+
};
|
|
3951
|
+
|
|
3952
|
+
type ListProps = {
|
|
3953
|
+
layoutId?: string;
|
|
3954
|
+
settings: ListSettings;
|
|
3955
|
+
content?: ListContentItem[];
|
|
3956
|
+
isEditor?: boolean;
|
|
3957
|
+
isPreviewMode?: boolean;
|
|
3958
|
+
activeEvent: string | undefined;
|
|
3959
|
+
onUpdateSettings?: (settings: ListSettings) => void;
|
|
3960
|
+
} & CommonComponentProps;
|
|
3961
|
+
|
|
3799
3962
|
function sv(px: number): string {
|
|
3800
3963
|
return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
|
|
3801
3964
|
}
|
|
3802
3965
|
|
|
3966
|
+
function hasListColumnText(value: unknown): boolean {
|
|
3967
|
+
return String(value ?? '').trim().length > 0;
|
|
3968
|
+
}
|
|
3969
|
+
|
|
3970
|
+
function getEntryDividerWidths(
|
|
3971
|
+
rowIdx: number,
|
|
3972
|
+
rowCount: number,
|
|
3973
|
+
showDividerTop: boolean,
|
|
3974
|
+
showDividerBottom: boolean,
|
|
3975
|
+
hasCutItem: boolean,
|
|
3976
|
+
dividerWidth: number,
|
|
3977
|
+
isEditor: boolean,
|
|
3978
|
+
): { borderTopWidth: string; borderBottomWidth: string } {
|
|
3979
|
+
const scaledDividerWidth = scalingValue(dividerWidth, isEditor);
|
|
3980
|
+
const none = scalingValue(0, isEditor);
|
|
3981
|
+
|
|
3982
|
+
const isFirst = rowIdx === 0;
|
|
3983
|
+
const isLastEntry = rowIdx === rowCount - 1 && !hasCutItem;
|
|
3984
|
+
|
|
3985
|
+
const borderTopWidth = isFirst && showDividerTop ? scaledDividerWidth : none;
|
|
3986
|
+
const borderBottomWidth = !isLastEntry || showDividerBottom ? scaledDividerWidth : none;
|
|
3987
|
+
|
|
3988
|
+
return { borderTopWidth, borderBottomWidth };
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
function getCutItemDividerWidths(
|
|
3992
|
+
showDividerBottom: boolean,
|
|
3993
|
+
dividerWidth: number,
|
|
3994
|
+
isEditor: boolean,
|
|
3995
|
+
): { borderTopWidth: string; borderBottomWidth: string } {
|
|
3996
|
+
const scaledDividerWidth = scalingValue(dividerWidth, isEditor);
|
|
3997
|
+
const none = scalingValue(0, isEditor);
|
|
3998
|
+
|
|
3999
|
+
return {
|
|
4000
|
+
borderTopWidth: none,
|
|
4001
|
+
borderBottomWidth: showDividerBottom ? scaledDividerWidth : none,
|
|
4002
|
+
};
|
|
4003
|
+
}
|
|
4004
|
+
|
|
3803
4005
|
function getCSS(P: string): string {
|
|
3804
4006
|
return \`
|
|
3805
4007
|
.\${P}-wrapper {
|
|
@@ -3829,12 +4031,20 @@ function getCSS(P: string): string {
|
|
|
3829
4031
|
overflow: visible;
|
|
3830
4032
|
position: relative;
|
|
3831
4033
|
box-sizing: content-box;
|
|
3832
|
-
border-bottom-style: solid;
|
|
3833
|
-
border-bottom-color: var(--\${P}-divider-color);
|
|
3834
4034
|
user-select: none;
|
|
3835
4035
|
background: var(--\${P}-background-color);
|
|
3836
4036
|
}
|
|
3837
4037
|
|
|
4038
|
+
.\${P}-wrapper.\${P}-divider-top .\${P}-list-item {
|
|
4039
|
+
border-top-style: solid;
|
|
4040
|
+
border-top-color: var(--\${P}-divider-color);
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
.\${P}-wrapper.\${P}-divider-bottom .\${P}-list-item {
|
|
4044
|
+
border-bottom-style: solid;
|
|
4045
|
+
border-bottom-color: var(--\${P}-divider-color);
|
|
4046
|
+
}
|
|
4047
|
+
|
|
3838
4048
|
.\${P}-list-cols-row {
|
|
3839
4049
|
display: flex;
|
|
3840
4050
|
align-items: start;
|
|
@@ -3842,17 +4052,45 @@ function getCSS(P: string): string {
|
|
|
3842
4052
|
box-sizing: border-box;
|
|
3843
4053
|
}
|
|
3844
4054
|
|
|
4055
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-list-cols-row {
|
|
4056
|
+
flex-direction: column;
|
|
4057
|
+
align-items: stretch;
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-list-col {
|
|
4061
|
+
width: 100%;
|
|
4062
|
+
min-width: 0;
|
|
4063
|
+
justify-content: center;
|
|
4064
|
+
align-items: flex-start;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-list-col-title {
|
|
4068
|
+
text-align: center;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-cut-item .\${P}-list-cols-row {
|
|
4072
|
+
flex-direction: row;
|
|
4073
|
+
align-items: center;
|
|
4074
|
+
justify-content: center;
|
|
4075
|
+
}
|
|
4076
|
+
|
|
4077
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-cut-label {
|
|
4078
|
+
text-align: center;
|
|
4079
|
+
width: 100%;
|
|
4080
|
+
box-sizing: border-box;
|
|
4081
|
+
}
|
|
4082
|
+
|
|
4083
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-list-col-last {
|
|
4084
|
+
flex: 0 0 auto;
|
|
4085
|
+
min-width: 0;
|
|
4086
|
+
}
|
|
4087
|
+
|
|
3845
4088
|
a.\${P}-list-item {
|
|
3846
4089
|
text-decoration: none;
|
|
3847
4090
|
color: inherit;
|
|
3848
4091
|
cursor: pointer;
|
|
3849
4092
|
}
|
|
3850
4093
|
|
|
3851
|
-
.\${P}-list-item:first-child {
|
|
3852
|
-
border-top-style: solid;
|
|
3853
|
-
border-top-color: var(--\${P}-divider-color);
|
|
3854
|
-
}
|
|
3855
|
-
|
|
3856
4094
|
.\${P}-list-col {
|
|
3857
4095
|
flex-shrink: 0;
|
|
3858
4096
|
overflow: visible;
|
|
@@ -3888,7 +4126,7 @@ a.\${P}-list-item {
|
|
|
3888
4126
|
z-index: 2;
|
|
3889
4127
|
width: 100%;
|
|
3890
4128
|
flex-shrink: 0;
|
|
3891
|
-
background:
|
|
4129
|
+
background: transparent;
|
|
3892
4130
|
}
|
|
3893
4131
|
|
|
3894
4132
|
.\${P}-row-padding-handle::before {
|
|
@@ -3915,6 +4153,14 @@ a.\${P}-list-item {
|
|
|
3915
4153
|
pointer-events: none;
|
|
3916
4154
|
}
|
|
3917
4155
|
|
|
4156
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-col-resize-handle::after {
|
|
4157
|
+
top: 50%;
|
|
4158
|
+
left: 0;
|
|
4159
|
+
transform: translateY(-50%);
|
|
4160
|
+
width: 100%;
|
|
4161
|
+
height: 2px;
|
|
4162
|
+
}
|
|
4163
|
+
|
|
3918
4164
|
.\${P}-padding-control-handle::after {
|
|
3919
4165
|
content: '';
|
|
3920
4166
|
position: absolute;
|
|
@@ -3930,6 +4176,30 @@ a.\${P}-list-item {
|
|
|
3930
4176
|
box-sizing: border-box;
|
|
3931
4177
|
}
|
|
3932
4178
|
|
|
4179
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-padding-control-handle::after {
|
|
4180
|
+
width: 12px;
|
|
4181
|
+
height: 4px;
|
|
4182
|
+
}
|
|
4183
|
+
|
|
4184
|
+
.\${P}-text-padding-lr-handle {
|
|
4185
|
+
background: transparent;
|
|
4186
|
+
}
|
|
4187
|
+
|
|
4188
|
+
.\${P}-text-padding-lr-handle::after {
|
|
4189
|
+
content: '';
|
|
4190
|
+
position: absolute;
|
|
4191
|
+
top: 50%;
|
|
4192
|
+
left: 50%;
|
|
4193
|
+
transform: translate(-50%, -50%);
|
|
4194
|
+
width: 4px;
|
|
4195
|
+
height: 12px;
|
|
4196
|
+
background: #FF5C02;
|
|
4197
|
+
border: 1px solid #FFFFFF;
|
|
4198
|
+
border-radius: 5px;
|
|
4199
|
+
pointer-events: none;
|
|
4200
|
+
box-sizing: border-box;
|
|
4201
|
+
}
|
|
4202
|
+
|
|
3933
4203
|
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item,
|
|
3934
4204
|
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item,
|
|
3935
4205
|
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item,
|
|
@@ -3951,34 +4221,32 @@ a.\${P}-list-item {
|
|
|
3951
4221
|
background: var(--\${P}-background-hover-color);
|
|
3952
4222
|
}
|
|
3953
4223
|
|
|
3954
|
-
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover
|
|
3955
|
-
.\${P}-wrapper.\${P}-
|
|
3956
|
-
.\${P}-wrapper.\${P}-entry-hover-
|
|
3957
|
-
.\${P}-wrapper.\${P}-
|
|
3958
|
-
.\${P}-wrapper.\${P}-
|
|
3959
|
-
.\${P}-wrapper.\${P}-
|
|
3960
|
-
|
|
4224
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:hover,
|
|
4225
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-list-item:hover),
|
|
4226
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-cut-item:hover),
|
|
4227
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,
|
|
4228
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-cut-item:hover,
|
|
4229
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item,
|
|
4230
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:hover,
|
|
4231
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-list-item:hover),
|
|
4232
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-cut-item:hover),
|
|
4233
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item,
|
|
4234
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-cut-item:hover,
|
|
4235
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item {
|
|
4236
|
+
border-bottom-color: var(--\${P}-divider-hover-color);
|
|
3961
4237
|
}
|
|
3962
4238
|
|
|
3963
|
-
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover,
|
|
3964
|
-
.\${P}-wrapper.\${P}-entry-hover-default
|
|
3965
|
-
.\${P}-wrapper.\${P}-
|
|
3966
|
-
.\${P}-wrapper.\${P}-entry-hover-
|
|
3967
|
-
|
|
3968
|
-
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item,
|
|
3969
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover,
|
|
3970
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-list-item:hover),
|
|
3971
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-cut-item:hover),
|
|
3972
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item,
|
|
3973
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover,
|
|
3974
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item {
|
|
3975
|
-
border-bottom-color: var(--\${P}-divider-hover-color);
|
|
4239
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-default .\${P}-list-item:hover:first-child,
|
|
4240
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,
|
|
4241
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,
|
|
4242
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {
|
|
4243
|
+
border-top-color: var(--\${P}-divider-hover-color);
|
|
3976
4244
|
}
|
|
3977
4245
|
|
|
3978
|
-
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover:first-child,
|
|
3979
|
-
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,
|
|
3980
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,
|
|
3981
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {
|
|
4246
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:hover:first-child,
|
|
4247
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,
|
|
4248
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,
|
|
4249
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {
|
|
3982
4250
|
border-top-color: var(--\${P}-divider-hover-color);
|
|
3983
4251
|
}
|
|
3984
4252
|
|
|
@@ -4026,16 +4294,22 @@ a.\${P}-list-item {
|
|
|
4026
4294
|
width: 100%;
|
|
4027
4295
|
overflow: visible;
|
|
4028
4296
|
position: relative;
|
|
4297
|
+
z-index: 3;
|
|
4029
4298
|
box-sizing: border-box;
|
|
4030
|
-
border-bottom-style: solid;
|
|
4031
|
-
border-bottom-color: var(--\${P}-divider-color);
|
|
4032
4299
|
user-select: none;
|
|
4033
4300
|
background: var(--\${P}-background-color);
|
|
4034
4301
|
}
|
|
4035
4302
|
|
|
4303
|
+
.\${P}-wrapper.\${P}-divider-bottom .\${P}-cut-item {
|
|
4304
|
+
border-bottom-style: solid;
|
|
4305
|
+
border-bottom-color: var(--\${P}-divider-color);
|
|
4306
|
+
}
|
|
4307
|
+
|
|
4036
4308
|
.\${P}-cut-label {
|
|
4037
4309
|
all: unset;
|
|
4038
4310
|
cursor: pointer;
|
|
4311
|
+
position: relative;
|
|
4312
|
+
z-index: 1;
|
|
4039
4313
|
color: var(--\${P}-text-color);
|
|
4040
4314
|
white-space: pre-wrap;
|
|
4041
4315
|
overflow-wrap: anywhere;
|
|
@@ -4044,20 +4318,7 @@ a.\${P}-list-item {
|
|
|
4044
4318
|
\`;
|
|
4045
4319
|
}
|
|
4046
4320
|
|
|
4047
|
-
|
|
4048
|
-
type ColumnPaddingRightKey = typeof COLUMN_PADDING_RIGHT_KEYS[number];
|
|
4049
|
-
|
|
4050
|
-
type ListItemColumn = {
|
|
4051
|
-
key: string;
|
|
4052
|
-
widthKey: ColumnWidthKey;
|
|
4053
|
-
width: number;
|
|
4054
|
-
paddingLeftKey: ColumnPaddingLeftKey;
|
|
4055
|
-
paddingRightKey: ColumnPaddingRightKey;
|
|
4056
|
-
paddingLeft: number;
|
|
4057
|
-
paddingRight: number;
|
|
4058
|
-
};
|
|
4059
|
-
|
|
4060
|
-
const COLUMN_CONTENT_KEYS = [
|
|
4321
|
+
export const COLUMN_CONTENT_KEYS = [
|
|
4061
4322
|
'AColumn',
|
|
4062
4323
|
'BColumnWidth',
|
|
4063
4324
|
'CColumnWidth',
|
|
@@ -4065,6 +4326,160 @@ const COLUMN_CONTENT_KEYS = [
|
|
|
4065
4326
|
'EColumnWidth',
|
|
4066
4327
|
] as const;
|
|
4067
4328
|
|
|
4329
|
+
export const COLUMN_TEXT_PREFIXES = [
|
|
4330
|
+
'AColumn',
|
|
4331
|
+
'BColumn',
|
|
4332
|
+
'CColumn',
|
|
4333
|
+
'DColumn',
|
|
4334
|
+
'EColumn',
|
|
4335
|
+
] as const;
|
|
4336
|
+
|
|
4337
|
+
const COLUMN_CONTENT_KEY_TO_TEXT_PREFIX: Record<
|
|
4338
|
+
typeof COLUMN_CONTENT_KEYS[number],
|
|
4339
|
+
typeof COLUMN_TEXT_PREFIXES[number]
|
|
4340
|
+
> = {
|
|
4341
|
+
AColumn: 'AColumn',
|
|
4342
|
+
BColumnWidth: 'BColumn',
|
|
4343
|
+
CColumnWidth: 'CColumn',
|
|
4344
|
+
DColumnWidth: 'DColumn',
|
|
4345
|
+
EColumnWidth: 'EColumn',
|
|
4346
|
+
};
|
|
4347
|
+
|
|
4348
|
+
export const LIST_GLOBAL_TEXT_STYLE_KEYS = [
|
|
4349
|
+
'textFontFamily',
|
|
4350
|
+
'textFontSettings',
|
|
4351
|
+
'textFontSize',
|
|
4352
|
+
'textLineHeight',
|
|
4353
|
+
'textLetterSpacing',
|
|
4354
|
+
'textWordSpacing',
|
|
4355
|
+
'textTextAppearance',
|
|
4356
|
+
] as const;
|
|
4357
|
+
|
|
4358
|
+
export type ListGlobalTextStyleKey = typeof LIST_GLOBAL_TEXT_STYLE_KEYS[number];
|
|
4359
|
+
|
|
4360
|
+
export function getListColumnTextSettingKey(
|
|
4361
|
+
prefix: typeof COLUMN_TEXT_PREFIXES[number],
|
|
4362
|
+
globalKey: ListGlobalTextStyleKey,
|
|
4363
|
+
): string {
|
|
4364
|
+
return \`\${prefix}\${globalKey.replace(/^text/, 'Text')}\`;
|
|
4365
|
+
}
|
|
4366
|
+
|
|
4367
|
+
type ListTextStyleFields = {
|
|
4368
|
+
textFontFamily?: string;
|
|
4369
|
+
textFontSettings?: { fontWeight: number; fontStyle: string };
|
|
4370
|
+
textFontSize?: number;
|
|
4371
|
+
textLineHeight?: number;
|
|
4372
|
+
textLetterSpacing?: number;
|
|
4373
|
+
textWordSpacing?: number;
|
|
4374
|
+
textTextAppearance?: TextStyles['textAppearance'];
|
|
4375
|
+
textColor?: string;
|
|
4376
|
+
};
|
|
4377
|
+
|
|
4378
|
+
type ResolvedListTextFields = {
|
|
4379
|
+
textFontFamily: string;
|
|
4380
|
+
textFontSettings: { fontWeight: number; fontStyle: string };
|
|
4381
|
+
textFontSize?: number;
|
|
4382
|
+
textLineHeight?: number;
|
|
4383
|
+
textLetterSpacing: number;
|
|
4384
|
+
textWordSpacing: number;
|
|
4385
|
+
textTextAppearance?: TextStyles['textAppearance'];
|
|
4386
|
+
textColor?: string;
|
|
4387
|
+
};
|
|
4388
|
+
|
|
4389
|
+
function resolveListGlobalTextFields(
|
|
4390
|
+
settings: ListTextStyleFields,
|
|
4391
|
+
): ResolvedListTextFields {
|
|
4392
|
+
return {
|
|
4393
|
+
textFontFamily: settings.textFontFamily ?? 'Arial',
|
|
4394
|
+
textFontSettings: settings.textFontSettings ?? {
|
|
4395
|
+
fontWeight: 400,
|
|
4396
|
+
fontStyle: 'normal',
|
|
4397
|
+
},
|
|
4398
|
+
textFontSize: settings.textFontSize,
|
|
4399
|
+
textLineHeight: settings.textLineHeight,
|
|
4400
|
+
textLetterSpacing: settings.textLetterSpacing ?? 0,
|
|
4401
|
+
textWordSpacing: settings.textWordSpacing ?? 0,
|
|
4402
|
+
textTextAppearance: settings.textTextAppearance,
|
|
4403
|
+
textColor: settings.textColor,
|
|
4404
|
+
};
|
|
4405
|
+
}
|
|
4406
|
+
|
|
4407
|
+
function resolveListColumnTextFields(
|
|
4408
|
+
settings: ListTextStyleFields & Record<string, unknown>,
|
|
4409
|
+
textPrefix: typeof COLUMN_TEXT_PREFIXES[number],
|
|
4410
|
+
): ResolvedListTextFields {
|
|
4411
|
+
const read = <K extends ListGlobalTextStyleKey>(globalKey: K) => {
|
|
4412
|
+
const columnKey = getListColumnTextSettingKey(textPrefix, globalKey);
|
|
4413
|
+
const columnValue = settings[columnKey];
|
|
4414
|
+
if (columnValue !== undefined) {
|
|
4415
|
+
return columnValue as ListTextStyleFields[K];
|
|
4416
|
+
}
|
|
4417
|
+
return settings[globalKey];
|
|
4418
|
+
};
|
|
4419
|
+
|
|
4420
|
+
return {
|
|
4421
|
+
textFontFamily: (read('textFontFamily') as string | undefined) ?? 'Arial',
|
|
4422
|
+
textFontSettings: (read('textFontSettings') as ListTextStyleFields['textFontSettings']) ?? {
|
|
4423
|
+
fontWeight: 400,
|
|
4424
|
+
fontStyle: 'normal',
|
|
4425
|
+
},
|
|
4426
|
+
textFontSize: read('textFontSize') as number | undefined,
|
|
4427
|
+
textLineHeight: read('textLineHeight') as number | undefined,
|
|
4428
|
+
textLetterSpacing: (read('textLetterSpacing') as number | undefined) ?? 0,
|
|
4429
|
+
textWordSpacing: (read('textWordSpacing') as number | undefined) ?? 0,
|
|
4430
|
+
textTextAppearance: read('textTextAppearance') as ListTextStyleFields['textTextAppearance'],
|
|
4431
|
+
textColor: settings.textColor,
|
|
4432
|
+
};
|
|
4433
|
+
}
|
|
4434
|
+
|
|
4435
|
+
function listColumnTextFieldsToCss(
|
|
4436
|
+
fields: ResolvedListTextFields,
|
|
4437
|
+
isEditor?: boolean,
|
|
4438
|
+
): React.CSSProperties {
|
|
4439
|
+
const resolvedFontSize = fields.textFontSize ?? 0.01;
|
|
4440
|
+
const minLineHeight = resolvedFontSize * 1.2;
|
|
4441
|
+
const resolvedLineHeight = Math.max(fields.textLineHeight ?? resolvedFontSize, minLineHeight);
|
|
4442
|
+
const resolvedTextStyle: TextStyles = {
|
|
4443
|
+
fontSettings: {
|
|
4444
|
+
fontFamily: fields.textFontFamily,
|
|
4445
|
+
fontWeight: fields.textFontSettings?.fontWeight ?? 400,
|
|
4446
|
+
fontStyle: fields.textFontSettings?.fontStyle ?? 'normal',
|
|
4447
|
+
},
|
|
4448
|
+
fontSize: resolvedFontSize,
|
|
4449
|
+
lineHeight: resolvedLineHeight,
|
|
4450
|
+
letterSpacing: fields.textLetterSpacing,
|
|
4451
|
+
wordSpacing: fields.textWordSpacing,
|
|
4452
|
+
textAppearance: fields.textTextAppearance,
|
|
4453
|
+
color: fields.textColor ?? '#767676',
|
|
4454
|
+
};
|
|
4455
|
+
|
|
4456
|
+
return omitTextColors(textStylesToCss(resolvedTextStyle, isEditor));
|
|
4457
|
+
}
|
|
4458
|
+
|
|
4459
|
+
function getListGlobalTextSyncUpdates(
|
|
4460
|
+
nextSettings: Record<string, unknown>,
|
|
4461
|
+
prevSettings: Record<string, unknown>,
|
|
4462
|
+
): Record<string, unknown> | null {
|
|
4463
|
+
const updates: Record<string, unknown> = {};
|
|
4464
|
+
let hasChanges = false;
|
|
4465
|
+
|
|
4466
|
+
for (const globalKey of LIST_GLOBAL_TEXT_STYLE_KEYS) {
|
|
4467
|
+
if (nextSettings[globalKey] === prevSettings[globalKey]) {
|
|
4468
|
+
continue;
|
|
4469
|
+
}
|
|
4470
|
+
if (nextSettings[globalKey] === undefined) {
|
|
4471
|
+
continue;
|
|
4472
|
+
}
|
|
4473
|
+
|
|
4474
|
+
hasChanges = true;
|
|
4475
|
+
for (const prefix of COLUMN_TEXT_PREFIXES) {
|
|
4476
|
+
updates[getListColumnTextSettingKey(prefix, globalKey)] = nextSettings[globalKey];
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
|
|
4480
|
+
return hasChanges ? updates : null;
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4068
4483
|
const COLUMN_WIDTH_KEYS = [
|
|
4069
4484
|
'AColumnWidth',
|
|
4070
4485
|
'BColumnWidth',
|
|
@@ -4089,7 +4504,50 @@ const COLUMN_PADDING_RIGHT_KEYS = [
|
|
|
4089
4504
|
'EColumnPaddingRight',
|
|
4090
4505
|
] as const;
|
|
4091
4506
|
|
|
4092
|
-
|
|
4507
|
+
const COLUMN_PADDING_BOTTOM_KEYS = [
|
|
4508
|
+
'AColumnPaddingBottom',
|
|
4509
|
+
'BColumnPaddingBottom',
|
|
4510
|
+
'CColumnPaddingBottom',
|
|
4511
|
+
'DColumnPaddingBottom',
|
|
4512
|
+
'EColumnPaddingBottom',
|
|
4513
|
+
] as const;
|
|
4514
|
+
|
|
4515
|
+
type ColumnWidthKey = typeof COLUMN_WIDTH_KEYS[number];
|
|
4516
|
+
type ColumnPaddingLeftKey = typeof COLUMN_PADDING_LEFT_KEYS[number];
|
|
4517
|
+
type ColumnPaddingRightKey = typeof COLUMN_PADDING_RIGHT_KEYS[number];
|
|
4518
|
+
type ColumnPaddingBottomKey = typeof COLUMN_PADDING_BOTTOM_KEYS[number];
|
|
4519
|
+
|
|
4520
|
+
type ListItemColumn = {
|
|
4521
|
+
key: string;
|
|
4522
|
+
textPrefix: typeof COLUMN_TEXT_PREFIXES[number];
|
|
4523
|
+
widthKey: ColumnWidthKey;
|
|
4524
|
+
paddingLeftKey: ColumnPaddingLeftKey;
|
|
4525
|
+
paddingRightKey: ColumnPaddingRightKey;
|
|
4526
|
+
paddingBottomKey: ColumnPaddingBottomKey;
|
|
4527
|
+
width: number;
|
|
4528
|
+
paddingLeft: number;
|
|
4529
|
+
paddingRight: number;
|
|
4530
|
+
paddingBottom: number;
|
|
4531
|
+
};
|
|
4532
|
+
|
|
4533
|
+
type ColorKeys =
|
|
4534
|
+
| 'textColor'
|
|
4535
|
+
| 'backgroundColor'
|
|
4536
|
+
| 'dividerColor'
|
|
4537
|
+
| 'textHoverColor'
|
|
4538
|
+
| 'backgroundHoverColor'
|
|
4539
|
+
| 'dividerHoverColor';
|
|
4540
|
+
|
|
4541
|
+
const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
4542
|
+
textColor: 'text-color',
|
|
4543
|
+
backgroundColor: 'background-color',
|
|
4544
|
+
dividerColor: 'divider-color',
|
|
4545
|
+
textHoverColor: 'text-hover-color',
|
|
4546
|
+
backgroundHoverColor: 'background-hover-color',
|
|
4547
|
+
dividerHoverColor: 'divider-hover-color',
|
|
4548
|
+
};
|
|
4549
|
+
|
|
4550
|
+
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
4093
4551
|
|
|
4094
4552
|
const COL_RESIZE_HANDLE_WIDTH = 0.004;
|
|
4095
4553
|
const COL_PADDING_HANDLE_WIDTH = 0.004;
|
|
@@ -4097,6 +4555,40 @@ const MIN_COLUMN_WIDTH_PX = 50;
|
|
|
4097
4555
|
const ARTICLE_DESIGN_WIDTH = 1440;
|
|
4098
4556
|
const MIN_COLUMN_WIDTH = MIN_COLUMN_WIDTH_PX / ARTICLE_DESIGN_WIDTH;
|
|
4099
4557
|
|
|
4558
|
+
export function getListMinColumnWidth(designWidthPx?: number): number {
|
|
4559
|
+
const designWidth = typeof designWidthPx === 'number' && designWidthPx > 0
|
|
4560
|
+
? designWidthPx
|
|
4561
|
+
: ARTICLE_DESIGN_WIDTH;
|
|
4562
|
+
|
|
4563
|
+
return MIN_COLUMN_WIDTH_PX / designWidth;
|
|
4564
|
+
}
|
|
4565
|
+
|
|
4566
|
+
function getEditorDesignWidth(element: HTMLElement | null | undefined): number {
|
|
4567
|
+
let el = element ?? null;
|
|
4568
|
+
|
|
4569
|
+
while (el) {
|
|
4570
|
+
const inline = el.style.getPropertyValue('--cntrl-article-width').trim();
|
|
4571
|
+
if (inline) {
|
|
4572
|
+
const px = parseFloat(inline);
|
|
4573
|
+
if (Number.isFinite(px) && px > 0) {
|
|
4574
|
+
return px;
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4577
|
+
|
|
4578
|
+
const computed = getComputedStyle(el).getPropertyValue('--cntrl-article-width').trim();
|
|
4579
|
+
if (computed) {
|
|
4580
|
+
const px = parseFloat(computed);
|
|
4581
|
+
if (Number.isFinite(px) && px > 0) {
|
|
4582
|
+
return px;
|
|
4583
|
+
}
|
|
4584
|
+
}
|
|
4585
|
+
|
|
4586
|
+
el = el.parentElement;
|
|
4587
|
+
}
|
|
4588
|
+
|
|
4589
|
+
return ARTICLE_DESIGN_WIDTH;
|
|
4590
|
+
}
|
|
4591
|
+
|
|
4100
4592
|
const DEFAULT_COLUMN_WIDTHS: Record<ColumnWidthKey, number> = {
|
|
4101
4593
|
AColumnWidth: 0.02,
|
|
4102
4594
|
BColumnWidth: 0.02,
|
|
@@ -4123,7 +4615,23 @@ export function getEqualListColumnWidthUpdates(
|
|
|
4123
4615
|
) as Record<ColumnWidthKey, number>;
|
|
4124
4616
|
}
|
|
4125
4617
|
|
|
4126
|
-
function
|
|
4618
|
+
function getResetListColumnPaddingUpdates(): Record<
|
|
4619
|
+
ColumnPaddingLeftKey | ColumnPaddingRightKey,
|
|
4620
|
+
number
|
|
4621
|
+
> {
|
|
4622
|
+
return Object.fromEntries([
|
|
4623
|
+
...COLUMN_PADDING_LEFT_KEYS.map((key) => [key, 0]),
|
|
4624
|
+
...COLUMN_PADDING_RIGHT_KEYS.map((key) => [key, 0]),
|
|
4625
|
+
]) as Record<ColumnPaddingLeftKey | ColumnPaddingRightKey, number>;
|
|
4626
|
+
}
|
|
4627
|
+
|
|
4628
|
+
function getResetListColumnPaddingBottomUpdates(): Record<ColumnPaddingBottomKey, number> {
|
|
4629
|
+
return Object.fromEntries(
|
|
4630
|
+
COLUMN_PADDING_BOTTOM_KEYS.map((key) => [key, 0]),
|
|
4631
|
+
) as Record<ColumnPaddingBottomKey, number>;
|
|
4632
|
+
}
|
|
4633
|
+
|
|
4634
|
+
function getStoredColumnWidths(
|
|
4127
4635
|
settings: Record<string, unknown>,
|
|
4128
4636
|
): Record<ColumnWidthKey, number> {
|
|
4129
4637
|
return Object.fromEntries(
|
|
@@ -4313,13 +4821,16 @@ function getColumnLayoutUpdatesForOrderChange(
|
|
|
4313
4821
|
const prevWidthKey = COLUMN_WIDTH_KEYS[prevSlotIndex];
|
|
4314
4822
|
const prevPaddingLeftKey = COLUMN_PADDING_LEFT_KEYS[prevSlotIndex];
|
|
4315
4823
|
const prevPaddingRightKey = COLUMN_PADDING_RIGHT_KEYS[prevSlotIndex];
|
|
4824
|
+
const prevPaddingBottomKey = COLUMN_PADDING_BOTTOM_KEYS[prevSlotIndex];
|
|
4316
4825
|
const widthKey = COLUMN_WIDTH_KEYS[index];
|
|
4317
4826
|
const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
|
|
4318
4827
|
const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
|
|
4828
|
+
const paddingBottomKey = COLUMN_PADDING_BOTTOM_KEYS[index];
|
|
4319
4829
|
|
|
4320
4830
|
const prevWidth = prevSettings[prevWidthKey];
|
|
4321
4831
|
const prevPaddingLeft = prevSettings[prevPaddingLeftKey];
|
|
4322
4832
|
const prevPaddingRight = prevSettings[prevPaddingRightKey];
|
|
4833
|
+
const prevPaddingBottom = prevSettings[prevPaddingBottomKey];
|
|
4323
4834
|
|
|
4324
4835
|
if (typeof prevWidth === 'number') {
|
|
4325
4836
|
updates[widthKey] = prevWidth;
|
|
@@ -4332,6 +4843,10 @@ function getColumnLayoutUpdatesForOrderChange(
|
|
|
4332
4843
|
if (typeof prevPaddingRight === 'number') {
|
|
4333
4844
|
updates[paddingRightKey] = prevPaddingRight;
|
|
4334
4845
|
}
|
|
4846
|
+
|
|
4847
|
+
if (typeof prevPaddingBottom === 'number') {
|
|
4848
|
+
updates[paddingBottomKey] = prevPaddingBottom;
|
|
4849
|
+
}
|
|
4335
4850
|
}
|
|
4336
4851
|
|
|
4337
4852
|
return updates;
|
|
@@ -4340,11 +4855,20 @@ function getColumnLayoutUpdatesForOrderChange(
|
|
|
4340
4855
|
export function applyListSettingsChange(
|
|
4341
4856
|
nextSettings: Record<string, unknown>,
|
|
4342
4857
|
prevSettings: Record<string, unknown>,
|
|
4858
|
+
options?: { designWidth?: number },
|
|
4343
4859
|
): Record<string, unknown> {
|
|
4860
|
+
const textSyncUpdates = getListGlobalTextSyncUpdates(nextSettings, prevSettings);
|
|
4861
|
+
if (textSyncUpdates) {
|
|
4862
|
+
nextSettings = { ...nextSettings, ...textSyncUpdates };
|
|
4863
|
+
}
|
|
4864
|
+
|
|
4865
|
+
const minColumnWidth = getListMinColumnWidth(options?.designWidth);
|
|
4344
4866
|
const nextColumns = nextSettings.columns;
|
|
4345
4867
|
const prevColumns = prevSettings.columns;
|
|
4346
4868
|
const nextContentWidth = getListEffectiveContentWidth(nextSettings);
|
|
4347
4869
|
const prevContentWidth = getListEffectiveContentWidth(prevSettings);
|
|
4870
|
+
const isVerticalLayout = nextSettings.type === 'B'
|
|
4871
|
+
|| (nextSettings.type === undefined && prevSettings.type === 'B');
|
|
4348
4872
|
const columns =
|
|
4349
4873
|
typeof nextColumns === 'number'
|
|
4350
4874
|
? nextColumns
|
|
@@ -4355,7 +4879,11 @@ export function applyListSettingsChange(
|
|
|
4355
4879
|
const withColumnPaddingUpdates = (
|
|
4356
4880
|
settings: Record<string, unknown>,
|
|
4357
4881
|
): Record<string, unknown> => {
|
|
4358
|
-
|
|
4882
|
+
if (isVerticalLayout) {
|
|
4883
|
+
return settings;
|
|
4884
|
+
}
|
|
4885
|
+
|
|
4886
|
+
const storedWidths = getStoredColumnWidths({ ...prevSettings, ...settings });
|
|
4359
4887
|
const contentWidth = getListEffectiveContentWidth(settings);
|
|
4360
4888
|
const effectiveWidths = getEffectiveListColumnWidths(columns, contentWidth, storedWidths);
|
|
4361
4889
|
const paddingUpdates = getListColumnPaddingUpdates(columns, effectiveWidths, {
|
|
@@ -4374,10 +4902,23 @@ export function applyListSettingsChange(
|
|
|
4374
4902
|
};
|
|
4375
4903
|
|
|
4376
4904
|
if (typeof nextColumns === 'number' && nextColumns !== prevColumns) {
|
|
4377
|
-
|
|
4905
|
+
const updates: Record<string, unknown> = {
|
|
4378
4906
|
...nextSettings,
|
|
4379
4907
|
...getEqualListColumnWidthUpdates(nextColumns, nextContentWidth),
|
|
4380
|
-
|
|
4908
|
+
...getResetListColumnPaddingUpdates(),
|
|
4909
|
+
};
|
|
4910
|
+
|
|
4911
|
+
if (isVerticalLayout) {
|
|
4912
|
+
for (const key of COLUMN_PADDING_BOTTOM_KEYS) {
|
|
4913
|
+
if (typeof prevSettings[key] === 'number') {
|
|
4914
|
+
updates[key] = prevSettings[key];
|
|
4915
|
+
}
|
|
4916
|
+
}
|
|
4917
|
+
} else {
|
|
4918
|
+
Object.assign(updates, getResetListColumnPaddingBottomUpdates());
|
|
4919
|
+
}
|
|
4920
|
+
|
|
4921
|
+
return updates;
|
|
4381
4922
|
}
|
|
4382
4923
|
|
|
4383
4924
|
const nextOrder = getColumnsOrder(nextSettings);
|
|
@@ -4391,8 +4932,8 @@ export function applyListSettingsChange(
|
|
|
4391
4932
|
}
|
|
4392
4933
|
|
|
4393
4934
|
if (nextContentWidth < prevContentWidth) {
|
|
4394
|
-
if (typeof columns === 'number') {
|
|
4395
|
-
const storedWidths =
|
|
4935
|
+
if (typeof columns === 'number' && !isVerticalLayout) {
|
|
4936
|
+
const storedWidths = getStoredColumnWidths({ ...prevSettings, ...nextSettings });
|
|
4396
4937
|
|
|
4397
4938
|
return withColumnPaddingUpdates({
|
|
4398
4939
|
...nextSettings,
|
|
@@ -4401,11 +4942,24 @@ export function applyListSettingsChange(
|
|
|
4401
4942
|
}
|
|
4402
4943
|
}
|
|
4403
4944
|
|
|
4404
|
-
|
|
4945
|
+
if (isVerticalLayout) {
|
|
4946
|
+
const storedTextPaddingLR = typeof nextSettings.textPaddingLR === 'number'
|
|
4947
|
+
? nextSettings.textPaddingLR as number
|
|
4948
|
+
: 0;
|
|
4949
|
+
const maxAllowedPadding = Math.max(0, (nextContentWidth - minColumnWidth) / 2);
|
|
4950
|
+
|
|
4951
|
+
if (storedTextPaddingLR > maxAllowedPadding) {
|
|
4952
|
+
return { ...nextSettings, textPaddingLR: maxAllowedPadding };
|
|
4953
|
+
}
|
|
4954
|
+
|
|
4955
|
+
return nextSettings;
|
|
4956
|
+
}
|
|
4957
|
+
|
|
4958
|
+
const storedWidths = getStoredColumnWidths({ ...prevSettings, ...nextSettings });
|
|
4405
4959
|
const prevEffectiveWidths = getEffectiveListColumnWidths(
|
|
4406
4960
|
columns,
|
|
4407
4961
|
prevContentWidth,
|
|
4408
|
-
|
|
4962
|
+
getStoredColumnWidths(prevSettings),
|
|
4409
4963
|
);
|
|
4410
4964
|
const nextEffectiveWidths = getEffectiveListColumnWidths(
|
|
4411
4965
|
columns,
|
|
@@ -4450,57 +5004,73 @@ function getColumnMaxWidth(
|
|
|
4450
5004
|
);
|
|
4451
5005
|
}
|
|
4452
5006
|
|
|
4453
|
-
type ListContentItem = {
|
|
4454
|
-
AColumn?: string;
|
|
4455
|
-
BColumnWidth?: string;
|
|
4456
|
-
CColumnWidth?: string;
|
|
4457
|
-
DColumnWidth?: string;
|
|
4458
|
-
EColumnWidth?: string;
|
|
4459
|
-
image?: {
|
|
4460
|
-
objectFit?: 'cover' | 'contain';
|
|
4461
|
-
url: string;
|
|
4462
|
-
name: string;
|
|
4463
|
-
};
|
|
4464
|
-
link?: string;
|
|
4465
|
-
};
|
|
4466
|
-
|
|
4467
|
-
type ListItemRow = {
|
|
4468
|
-
id: string | number;
|
|
4469
|
-
cells: Record<string, React.ReactNode>;
|
|
4470
|
-
image?: ListContentItem['image'];
|
|
4471
|
-
link?: string;
|
|
4472
|
-
};
|
|
4473
|
-
|
|
4474
|
-
type HoverImageState = {
|
|
4475
|
-
rowId: string | number;
|
|
4476
|
-
url: string;
|
|
4477
|
-
objectFit: 'cover' | 'contain';
|
|
4478
|
-
widthPx: number;
|
|
4479
|
-
};
|
|
4480
|
-
|
|
4481
5007
|
function randomBetween(min: number, max: number): number {
|
|
4482
5008
|
return Math.random() * (max - min) + min;
|
|
4483
5009
|
}
|
|
4484
5010
|
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
5011
|
+
function getColumnWidthsFromSettings(
|
|
5012
|
+
settings: Record<string, unknown>,
|
|
5013
|
+
): Record<ColumnWidthKey, number> {
|
|
5014
|
+
return Object.fromEntries(
|
|
5015
|
+
COLUMN_WIDTH_KEYS.map((key) => [
|
|
5016
|
+
key,
|
|
5017
|
+
typeof settings[key] === 'number' ? settings[key] as number : DEFAULT_COLUMN_WIDTHS[key],
|
|
5018
|
+
]),
|
|
5019
|
+
) as Record<ColumnWidthKey, number>;
|
|
5020
|
+
}
|
|
5021
|
+
|
|
5022
|
+
function getNumericSettingValues<K extends string>(
|
|
5023
|
+
settings: Record<string, unknown>,
|
|
5024
|
+
keys: readonly K[],
|
|
5025
|
+
fallback = 0,
|
|
5026
|
+
): Record<K, number> {
|
|
5027
|
+
return Object.fromEntries(
|
|
5028
|
+
keys.map((key) => [
|
|
5029
|
+
key,
|
|
5030
|
+
typeof settings[key] === 'number' ? settings[key] as number : fallback,
|
|
5031
|
+
]),
|
|
5032
|
+
) as Record<K, number>;
|
|
5033
|
+
}
|
|
5034
|
+
|
|
5035
|
+
function buildListColumns(
|
|
5036
|
+
columnContentOrder: readonly typeof COLUMN_CONTENT_KEYS[number][],
|
|
5037
|
+
columns: number,
|
|
5038
|
+
columnWidthByKey: Record<ColumnWidthKey, number>,
|
|
5039
|
+
columnPaddingLeftByKey: Record<ColumnPaddingLeftKey, number>,
|
|
5040
|
+
columnPaddingRightByKey: Record<ColumnPaddingRightKey, number>,
|
|
5041
|
+
columnPaddingBottomByKey: Record<ColumnPaddingBottomKey, number>,
|
|
5042
|
+
): ListItemColumn[] {
|
|
5043
|
+
return columnContentOrder.slice(0, columns).map((key, index) => {
|
|
5044
|
+
const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
|
|
5045
|
+
const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
|
|
5046
|
+
const paddingBottomKey = COLUMN_PADDING_BOTTOM_KEYS[index];
|
|
5047
|
+
|
|
5048
|
+
return {
|
|
5049
|
+
key,
|
|
5050
|
+
textPrefix: COLUMN_CONTENT_KEY_TO_TEXT_PREFIX[key],
|
|
5051
|
+
widthKey: COLUMN_WIDTH_KEYS[index],
|
|
5052
|
+
width: columnWidthByKey[COLUMN_WIDTH_KEYS[index]],
|
|
5053
|
+
paddingLeftKey,
|
|
5054
|
+
paddingRightKey,
|
|
5055
|
+
paddingBottomKey,
|
|
5056
|
+
paddingLeft: columnPaddingLeftByKey[paddingLeftKey],
|
|
5057
|
+
paddingRight: columnPaddingRightByKey[paddingRightKey],
|
|
5058
|
+
paddingBottom: columnPaddingBottomByKey[paddingBottomKey],
|
|
5059
|
+
};
|
|
5060
|
+
});
|
|
5061
|
+
}
|
|
4494
5062
|
|
|
4495
|
-
export function List({ settings, content, isEditor, isPreviewMode,
|
|
5063
|
+
export function List({ settings, content, isEditor, isPreviewMode, activeEvent, layoutId, onUpdateSettings }: ListProps) {
|
|
4496
5064
|
const { prefix: P } = useScopedStyles();
|
|
4497
5065
|
const showControls = Boolean(isEditor && isPreviewMode);
|
|
4498
5066
|
const {
|
|
4499
5067
|
columns,
|
|
5068
|
+
type,
|
|
4500
5069
|
wrapperWidth,
|
|
4501
5070
|
entriesCount,
|
|
4502
5071
|
cellMinHeight,
|
|
4503
5072
|
dividerWidth,
|
|
5073
|
+
showVisibility,
|
|
4504
5074
|
cut,
|
|
4505
5075
|
showCut,
|
|
4506
5076
|
cutCellMinHeight,
|
|
@@ -4510,22 +5080,9 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4510
5080
|
entryHoverEffect,
|
|
4511
5081
|
rowPaddingTop,
|
|
4512
5082
|
rowPaddingBottom,
|
|
4513
|
-
|
|
4514
|
-
AColumnPaddingLeft,
|
|
4515
|
-
AColumnPaddingRight,
|
|
4516
|
-
BColumnWidth,
|
|
4517
|
-
BColumnPaddingLeft,
|
|
4518
|
-
BColumnPaddingRight,
|
|
4519
|
-
CColumnWidth,
|
|
4520
|
-
CColumnPaddingLeft,
|
|
4521
|
-
CColumnPaddingRight,
|
|
4522
|
-
DColumnWidth,
|
|
4523
|
-
DColumnPaddingLeft,
|
|
4524
|
-
DColumnPaddingRight,
|
|
4525
|
-
EColumnWidth,
|
|
4526
|
-
EColumnPaddingLeft,
|
|
4527
|
-
EColumnPaddingRight,
|
|
5083
|
+
rowPaddingTopB,
|
|
4528
5084
|
columnsOrder,
|
|
5085
|
+
textPaddingLR,
|
|
4529
5086
|
textColor,
|
|
4530
5087
|
textFontFamily,
|
|
4531
5088
|
textFontSettings,
|
|
@@ -4545,32 +5102,73 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4545
5102
|
const [hoverImage, setHoverImage] = useState<HoverImageState | null>(null);
|
|
4546
5103
|
const showHoverImage = imageOnHover === 'On';
|
|
4547
5104
|
const cutEnabled = (cut ?? 0) > 0;
|
|
5105
|
+
const isVerticalLayout = type === 'B';
|
|
5106
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
5107
|
+
const [designWidth, setDesignWidth] = useState(ARTICLE_DESIGN_WIDTH);
|
|
5108
|
+
const minColumnWidth = getListMinColumnWidth(designWidth);
|
|
5109
|
+
|
|
5110
|
+
const storedTextPaddingLRMax = Math.max(0, ((wrapperWidth ?? 0) - minColumnWidth) / 2);
|
|
5111
|
+
const effectiveTextPaddingLR = Math.min(textPaddingLR ?? 0, storedTextPaddingLRMax);
|
|
5112
|
+
const textPaddingLRHandleWidth = Math.max(effectiveTextPaddingLR, COL_PADDING_HANDLE_WIDTH);
|
|
5113
|
+
const textPaddingLRMaxFraction = ((wrapperWidth ?? 0) + minColumnWidth) / 2;
|
|
5114
|
+
|
|
5115
|
+
useLayoutEffect(() => {
|
|
5116
|
+
if (!isEditor) {
|
|
5117
|
+
setDesignWidth(ARTICLE_DESIGN_WIDTH);
|
|
5118
|
+
return;
|
|
5119
|
+
}
|
|
5120
|
+
|
|
5121
|
+
const syncDesignWidth = () => {
|
|
5122
|
+
setDesignWidth(getEditorDesignWidth(containerRef.current));
|
|
5123
|
+
};
|
|
5124
|
+
|
|
5125
|
+
syncDesignWidth();
|
|
5126
|
+
|
|
5127
|
+
const observed = containerRef.current;
|
|
5128
|
+
if (!observed) {
|
|
5129
|
+
return;
|
|
5130
|
+
}
|
|
5131
|
+
|
|
5132
|
+
const observer = new ResizeObserver(syncDesignWidth);
|
|
5133
|
+
observer.observe(observed);
|
|
5134
|
+
|
|
5135
|
+
let pageEl: HTMLElement | null = observed;
|
|
5136
|
+
while (pageEl && !pageEl.style.getPropertyValue('--cntrl-article-width')) {
|
|
5137
|
+
pageEl = pageEl.parentElement;
|
|
5138
|
+
}
|
|
5139
|
+
if (pageEl) {
|
|
5140
|
+
observer.observe(pageEl);
|
|
5141
|
+
}
|
|
5142
|
+
|
|
5143
|
+
return () => observer.disconnect();
|
|
5144
|
+
}, [isEditor, layoutId]);
|
|
4548
5145
|
|
|
4549
5146
|
useEffect(() => {
|
|
4550
5147
|
setVisibleRowCount(undefined);
|
|
4551
5148
|
}, [cut, showCut, content, entriesCount]);
|
|
4552
5149
|
|
|
4553
|
-
const
|
|
4554
|
-
const minLineHeight = resolvedFontSize * 1.2;
|
|
4555
|
-
const resolvedLineHeight = Math.max(textLineHeight ?? resolvedFontSize, minLineHeight);
|
|
5150
|
+
const textFieldCss = listColumnTextFieldsToCss(resolveListGlobalTextFields(settings), isEditor);
|
|
4556
5151
|
|
|
4557
|
-
const
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
5152
|
+
const columnTextCssByPrefix = useMemo(
|
|
5153
|
+
() => Object.fromEntries(
|
|
5154
|
+
COLUMN_TEXT_PREFIXES.map((prefix) => [
|
|
5155
|
+
prefix,
|
|
5156
|
+
listColumnTextFieldsToCss(resolveListColumnTextFields(settings, prefix), isEditor),
|
|
5157
|
+
]),
|
|
5158
|
+
),
|
|
5159
|
+
[
|
|
5160
|
+
settings,
|
|
5161
|
+
textFontFamily,
|
|
5162
|
+
textFontSettings,
|
|
5163
|
+
textFontSize,
|
|
5164
|
+
textLineHeight,
|
|
5165
|
+
textLetterSpacing,
|
|
5166
|
+
textWordSpacing,
|
|
5167
|
+
textTextAppearance,
|
|
5168
|
+
textColor,
|
|
5169
|
+
isEditor,
|
|
5170
|
+
],
|
|
5171
|
+
);
|
|
4574
5172
|
|
|
4575
5173
|
const colorVars = buildColorVars(P, {
|
|
4576
5174
|
textColor,
|
|
@@ -4589,13 +5187,22 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4589
5187
|
? \`\${P}-entry-hover-blinds\`
|
|
4590
5188
|
: '';
|
|
4591
5189
|
const wrapperStateClasses = \`\${entryHoverClass} \${stateClass}\`.trim();
|
|
5190
|
+
const showDividerTop = showVisibility?.[0] ?? false;
|
|
5191
|
+
const showDividerBottom = showVisibility?.[1] ?? false;
|
|
4592
5192
|
|
|
4593
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
4594
5193
|
const prevSettingsRef = useRef(settings);
|
|
5194
|
+
const prevLayoutIdRef = useRef(layoutId);
|
|
4595
5195
|
|
|
4596
5196
|
useEffect(() => {
|
|
4597
5197
|
if (!onUpdateSettings || !isEditor) {
|
|
4598
5198
|
prevSettingsRef.current = settings;
|
|
5199
|
+
prevLayoutIdRef.current = layoutId;
|
|
5200
|
+
return;
|
|
5201
|
+
}
|
|
5202
|
+
|
|
5203
|
+
if (prevLayoutIdRef.current !== layoutId) {
|
|
5204
|
+
prevSettingsRef.current = settings;
|
|
5205
|
+
prevLayoutIdRef.current = layoutId;
|
|
4599
5206
|
return;
|
|
4600
5207
|
}
|
|
4601
5208
|
|
|
@@ -4603,6 +5210,7 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4603
5210
|
const updatedSettings = applyListSettingsChange(
|
|
4604
5211
|
settings as Record<string, unknown>,
|
|
4605
5212
|
prevSettings as Record<string, unknown>,
|
|
5213
|
+
{ designWidth },
|
|
4606
5214
|
) as ListSettings;
|
|
4607
5215
|
|
|
4608
5216
|
prevSettingsRef.current = settings;
|
|
@@ -4612,111 +5220,86 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4612
5220
|
}
|
|
4613
5221
|
|
|
4614
5222
|
onUpdateSettings(updatedSettings);
|
|
4615
|
-
}, [settings, onUpdateSettings, isEditor]);
|
|
4616
|
-
|
|
4617
|
-
const columnWidthByKey: Record<ColumnWidthKey, number> = {
|
|
4618
|
-
AColumnWidth: AColumnWidth ?? DEFAULT_COLUMN_WIDTHS.AColumnWidth,
|
|
4619
|
-
BColumnWidth: BColumnWidth ?? DEFAULT_COLUMN_WIDTHS.BColumnWidth,
|
|
4620
|
-
CColumnWidth: CColumnWidth ?? DEFAULT_COLUMN_WIDTHS.CColumnWidth,
|
|
4621
|
-
DColumnWidth: DColumnWidth ?? DEFAULT_COLUMN_WIDTHS.DColumnWidth,
|
|
4622
|
-
EColumnWidth: EColumnWidth ?? DEFAULT_COLUMN_WIDTHS.EColumnWidth,
|
|
4623
|
-
};
|
|
5223
|
+
}, [settings, onUpdateSettings, isEditor, layoutId, designWidth]);
|
|
4624
5224
|
|
|
4625
|
-
const
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
5225
|
+
const columnWidthByKey = useMemo(
|
|
5226
|
+
() => getColumnWidthsFromSettings(settings as Record<string, unknown>),
|
|
5227
|
+
[
|
|
5228
|
+
settings.AColumnWidth,
|
|
5229
|
+
settings.BColumnWidth,
|
|
5230
|
+
settings.CColumnWidth,
|
|
5231
|
+
settings.DColumnWidth,
|
|
5232
|
+
settings.EColumnWidth,
|
|
5233
|
+
],
|
|
5234
|
+
);
|
|
4632
5235
|
|
|
4633
|
-
const
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
5236
|
+
const columnPaddingLeftByKey = useMemo(
|
|
5237
|
+
() => getNumericSettingValues(settings as Record<string, unknown>, COLUMN_PADDING_LEFT_KEYS),
|
|
5238
|
+
[
|
|
5239
|
+
settings.AColumnPaddingLeft,
|
|
5240
|
+
settings.BColumnPaddingLeft,
|
|
5241
|
+
settings.CColumnPaddingLeft,
|
|
5242
|
+
settings.DColumnPaddingLeft,
|
|
5243
|
+
settings.EColumnPaddingLeft,
|
|
5244
|
+
],
|
|
5245
|
+
);
|
|
5246
|
+
|
|
5247
|
+
const columnPaddingRightByKey = useMemo(
|
|
5248
|
+
() => getNumericSettingValues(settings as Record<string, unknown>, COLUMN_PADDING_RIGHT_KEYS),
|
|
5249
|
+
[
|
|
5250
|
+
settings.AColumnPaddingRight,
|
|
5251
|
+
settings.BColumnPaddingRight,
|
|
5252
|
+
settings.CColumnPaddingRight,
|
|
5253
|
+
settings.DColumnPaddingRight,
|
|
5254
|
+
settings.EColumnPaddingRight,
|
|
5255
|
+
],
|
|
5256
|
+
);
|
|
5257
|
+
|
|
5258
|
+
const columnPaddingBottomByKey = useMemo(
|
|
5259
|
+
() => getNumericSettingValues(settings as Record<string, unknown>, COLUMN_PADDING_BOTTOM_KEYS),
|
|
5260
|
+
[
|
|
5261
|
+
settings.AColumnPaddingBottom,
|
|
5262
|
+
settings.BColumnPaddingBottom,
|
|
5263
|
+
settings.CColumnPaddingBottom,
|
|
5264
|
+
settings.DColumnPaddingBottom,
|
|
5265
|
+
settings.EColumnPaddingBottom,
|
|
5266
|
+
],
|
|
5267
|
+
);
|
|
4640
5268
|
|
|
4641
|
-
const
|
|
5269
|
+
const columnContentOrder = useMemo((): typeof COLUMN_CONTENT_KEYS[number][] => {
|
|
4642
5270
|
if (Array.isArray(columnsOrder) && columnsOrder.length > 0) {
|
|
4643
5271
|
return columnsOrder as typeof COLUMN_CONTENT_KEYS[number][];
|
|
4644
5272
|
}
|
|
4645
5273
|
return [...COLUMN_CONTENT_KEYS];
|
|
4646
5274
|
}, [columnsOrder]);
|
|
4647
5275
|
|
|
4648
|
-
const listColumns
|
|
4649
|
-
() =>
|
|
4650
|
-
|
|
4651
|
-
const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
|
|
4652
|
-
const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
|
|
4653
|
-
return {
|
|
4654
|
-
key,
|
|
4655
|
-
widthKey: COLUMN_WIDTH_KEYS[index],
|
|
4656
|
-
width: columnWidthByKey[COLUMN_WIDTH_KEYS[index]],
|
|
4657
|
-
paddingLeftKey,
|
|
4658
|
-
paddingRightKey,
|
|
4659
|
-
paddingLeft: columnPaddingLeftByKey[paddingLeftKey],
|
|
4660
|
-
paddingRight: columnPaddingRightByKey[paddingRightKey],
|
|
4661
|
-
};
|
|
4662
|
-
}),
|
|
4663
|
-
[
|
|
5276
|
+
const listColumns = useMemo(
|
|
5277
|
+
() => buildListColumns(
|
|
5278
|
+
columnContentOrder,
|
|
4664
5279
|
columns,
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
AColumnPaddingLeft,
|
|
4672
|
-
AColumnPaddingRight,
|
|
4673
|
-
BColumnPaddingLeft,
|
|
4674
|
-
BColumnPaddingRight,
|
|
4675
|
-
CColumnPaddingLeft,
|
|
4676
|
-
CColumnPaddingRight,
|
|
4677
|
-
DColumnPaddingLeft,
|
|
4678
|
-
DColumnPaddingRight,
|
|
4679
|
-
EColumnPaddingLeft,
|
|
4680
|
-
EColumnPaddingRight,
|
|
4681
|
-
]
|
|
5280
|
+
columnWidthByKey,
|
|
5281
|
+
columnPaddingLeftByKey,
|
|
5282
|
+
columnPaddingRightByKey,
|
|
5283
|
+
columnPaddingBottomByKey,
|
|
5284
|
+
),
|
|
5285
|
+
[columnContentOrder, columns, columnWidthByKey, columnPaddingLeftByKey, columnPaddingRightByKey, columnPaddingBottomByKey],
|
|
4682
5286
|
);
|
|
4683
5287
|
|
|
4684
5288
|
const resolvedContentWidth = getListEffectiveContentWidth(settings as Record<string, unknown>);
|
|
4685
|
-
|
|
5289
|
+
|
|
5290
|
+
const storedColumnWidths = useMemo(
|
|
4686
5291
|
() => COLUMN_WIDTH_KEYS.slice(0, columns).map((key) => columnWidthByKey[key]),
|
|
4687
|
-
[
|
|
4688
|
-
columns,
|
|
4689
|
-
AColumnWidth,
|
|
4690
|
-
BColumnWidth,
|
|
4691
|
-
CColumnWidth,
|
|
4692
|
-
DColumnWidth,
|
|
4693
|
-
EColumnWidth,
|
|
4694
|
-
],
|
|
5292
|
+
[columns, columnWidthByKey],
|
|
4695
5293
|
);
|
|
4696
|
-
|
|
5294
|
+
|
|
5295
|
+
const resolvedColumnWidths = useMemo(
|
|
4697
5296
|
() => resolveListColumnWidths(columns, resolvedContentWidth, columnWidthByKey),
|
|
4698
|
-
[
|
|
4699
|
-
columns,
|
|
4700
|
-
resolvedContentWidth,
|
|
4701
|
-
AColumnWidth,
|
|
4702
|
-
BColumnWidth,
|
|
4703
|
-
CColumnWidth,
|
|
4704
|
-
DColumnWidth,
|
|
4705
|
-
EColumnWidth,
|
|
4706
|
-
],
|
|
5297
|
+
[columns, resolvedContentWidth, columnWidthByKey],
|
|
4707
5298
|
);
|
|
4708
5299
|
|
|
4709
5300
|
const effectiveColumnWidths = useMemo(
|
|
4710
5301
|
() => getEffectiveListColumnWidths(columns, resolvedContentWidth, columnWidthByKey),
|
|
4711
|
-
[
|
|
4712
|
-
columns,
|
|
4713
|
-
resolvedContentWidth,
|
|
4714
|
-
AColumnWidth,
|
|
4715
|
-
BColumnWidth,
|
|
4716
|
-
CColumnWidth,
|
|
4717
|
-
DColumnWidth,
|
|
4718
|
-
EColumnWidth,
|
|
4719
|
-
],
|
|
5302
|
+
[columns, resolvedContentWidth, columnWidthByKey],
|
|
4720
5303
|
);
|
|
4721
5304
|
|
|
4722
5305
|
const effectiveColumnPaddings = useMemo(
|
|
@@ -4757,6 +5340,12 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4757
5340
|
|
|
4758
5341
|
const showCutLabel = cutEnabled && effectiveVisibleCount < allRows.length;
|
|
4759
5342
|
|
|
5343
|
+
const hasBetweenItemDividers = visibleRows.length > 1 || showCutLabel;
|
|
5344
|
+
const dividerClassNames = [
|
|
5345
|
+
showDividerTop ? \`\${P}-divider-top\` : '',
|
|
5346
|
+
showDividerBottom || hasBetweenItemDividers ? \`\${P}-divider-bottom\` : '',
|
|
5347
|
+
].filter(Boolean).join(' ');
|
|
5348
|
+
|
|
4760
5349
|
const handleShowMore = () => {
|
|
4761
5350
|
const currentVisible = visibleRowCount ?? cut;
|
|
4762
5351
|
if (!showCut) {
|
|
@@ -4767,8 +5356,12 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4767
5356
|
};
|
|
4768
5357
|
|
|
4769
5358
|
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
4770
|
-
const resolvedRowPaddingTop =
|
|
5359
|
+
const resolvedRowPaddingTop = isVerticalLayout
|
|
5360
|
+
? (rowPaddingTopB ?? 0)
|
|
5361
|
+
: (rowPaddingTop ?? 0);
|
|
4771
5362
|
const resolvedRowPaddingBottom = rowPaddingBottom ?? 0;
|
|
5363
|
+
const resolvedCellMinHeight = cellMinHeight ?? 0;
|
|
5364
|
+
const rowPaddingTopControlKey = isVerticalLayout ? 'rowPaddingTopB' : 'rowPaddingTop';
|
|
4772
5365
|
const firstColumn = listColumns[0];
|
|
4773
5366
|
const lastColumn = listColumns[listColumns.length - 1];
|
|
4774
5367
|
const firstColumnEffectivePadding = effectiveColumnPaddings[0];
|
|
@@ -4814,7 +5407,7 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4814
5407
|
<div style={colorVars}>
|
|
4815
5408
|
<div
|
|
4816
5409
|
ref={containerRef}
|
|
4817
|
-
className={\`\${P}-wrapper \${wrapperStateClasses}\`.trim()}
|
|
5410
|
+
className={\`\${P}-wrapper \${wrapperStateClasses}\${dividerClassNames ? \` \${dividerClassNames}\` : ''}\${isVerticalLayout ? \` \${P}-type-b\` : ''}\`.trim()}
|
|
4818
5411
|
style={{
|
|
4819
5412
|
width: scalingValue(wrapperWidth ?? 0, isEditor),
|
|
4820
5413
|
}}
|
|
@@ -4824,10 +5417,15 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4824
5417
|
{visibleRows.map((row, rowIdx) => {
|
|
4825
5418
|
const hasLink = (row.link?.length ?? 0) > 0;
|
|
4826
5419
|
const RowElement = hasLink ? 'a' : 'div';
|
|
4827
|
-
const rowStyle =
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
5420
|
+
const rowStyle = getEntryDividerWidths(
|
|
5421
|
+
rowIdx,
|
|
5422
|
+
visibleRows.length,
|
|
5423
|
+
showDividerTop,
|
|
5424
|
+
showDividerBottom,
|
|
5425
|
+
showCutLabel,
|
|
5426
|
+
dividerWidth ?? 0,
|
|
5427
|
+
isEditor ?? false,
|
|
5428
|
+
);
|
|
4831
5429
|
|
|
4832
5430
|
return (
|
|
4833
5431
|
<RowElement
|
|
@@ -4840,7 +5438,7 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4840
5438
|
{(resolvedRowPaddingTop > 0 || showControls) && (
|
|
4841
5439
|
<div
|
|
4842
5440
|
{...(showControls ? {
|
|
4843
|
-
'data-controls':
|
|
5441
|
+
'data-controls': rowPaddingTopControlKey,
|
|
4844
5442
|
'data-controls-axis': 'y',
|
|
4845
5443
|
'data-controls-min': '0',
|
|
4846
5444
|
} : {})}
|
|
@@ -4848,33 +5446,64 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4848
5446
|
style={{ height: scaled(resolvedRowPaddingTop) }}
|
|
4849
5447
|
/>
|
|
4850
5448
|
)}
|
|
4851
|
-
<div
|
|
5449
|
+
<div
|
|
5450
|
+
className={\`\${P}-list-cols-row\`}
|
|
5451
|
+
style={isVerticalLayout ? undefined : { minHeight: scaled(resolvedCellMinHeight) }}
|
|
5452
|
+
>
|
|
4852
5453
|
{listColumns.map((col, colIndex) => {
|
|
4853
5454
|
const isLastColumn = colIndex === listColumns.length - 1;
|
|
4854
|
-
const columnWidth = effectiveColumnWidths[colIndex];
|
|
4855
5455
|
const effectivePadding = effectiveColumnPaddings[colIndex];
|
|
5456
|
+
const columnPaddingBottom = col.paddingBottom;
|
|
5457
|
+
const hasColumnText = hasListColumnText(row.cells[col.key]);
|
|
5458
|
+
const showColumnPaddingBottom = isVerticalLayout
|
|
5459
|
+
&& hasColumnText
|
|
5460
|
+
&& (columnPaddingBottom > 0 || showControls);
|
|
5461
|
+
const columnSizeStyle = isVerticalLayout
|
|
5462
|
+
? { minHeight: scaled(resolvedCellMinHeight) }
|
|
5463
|
+
: (isLastColumn ? {} : { width: scaled(effectiveColumnWidths[colIndex]) });
|
|
5464
|
+
const columnPaddingStyle = isVerticalLayout
|
|
5465
|
+
? {
|
|
5466
|
+
paddingLeft: scaled(effectiveTextPaddingLR),
|
|
5467
|
+
paddingRight: scaled(effectiveTextPaddingLR),
|
|
5468
|
+
}
|
|
5469
|
+
: {
|
|
5470
|
+
paddingLeft: scaled(effectivePadding.paddingLeft),
|
|
5471
|
+
paddingRight: scaled(effectivePadding.paddingRight),
|
|
5472
|
+
};
|
|
5473
|
+
|
|
4856
5474
|
return (
|
|
4857
|
-
<div
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
data-test={col.width}
|
|
4866
|
-
>
|
|
4867
|
-
<span
|
|
4868
|
-
className={\`\${P}-list-col-title\`}
|
|
4869
|
-
style={textFieldCss}
|
|
5475
|
+
<div key={col.key}>
|
|
5476
|
+
<div
|
|
5477
|
+
className={\`\${P}-list-col\${isLastColumn ? \` \${P}-list-col-last\` : ''}\`}
|
|
5478
|
+
style={{
|
|
5479
|
+
...columnPaddingStyle,
|
|
5480
|
+
...columnSizeStyle,
|
|
5481
|
+
}}
|
|
5482
|
+
data-test={col.width}
|
|
4870
5483
|
>
|
|
4871
|
-
|
|
4872
|
-
|
|
5484
|
+
<span
|
|
5485
|
+
className={\`\${P}-list-col-title\`}
|
|
5486
|
+
style={columnTextCssByPrefix[col.textPrefix] ?? textFieldCss}
|
|
5487
|
+
>
|
|
5488
|
+
{row.cells[col.key] ?? null}
|
|
5489
|
+
</span>
|
|
5490
|
+
</div>
|
|
5491
|
+
{showColumnPaddingBottom && (
|
|
5492
|
+
<div
|
|
5493
|
+
{...(showControls ? {
|
|
5494
|
+
'data-controls': col.paddingBottomKey,
|
|
5495
|
+
'data-controls-axis': 'y',
|
|
5496
|
+
'data-controls-min': '0',
|
|
5497
|
+
} : {})}
|
|
5498
|
+
className={\`\${P}-row-padding-handle\`}
|
|
5499
|
+
style={{ height: scaled(columnPaddingBottom) }}
|
|
5500
|
+
/>
|
|
5501
|
+
)}
|
|
4873
5502
|
</div>
|
|
4874
5503
|
);
|
|
4875
5504
|
})}
|
|
4876
5505
|
</div>
|
|
4877
|
-
{(resolvedRowPaddingBottom > 0 || showControls) && (
|
|
5506
|
+
{!isVerticalLayout && (resolvedRowPaddingBottom > 0 || showControls) && (
|
|
4878
5507
|
<div
|
|
4879
5508
|
{...(showControls ? {
|
|
4880
5509
|
'data-controls': 'rowPaddingBottom',
|
|
@@ -4893,12 +5522,23 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4893
5522
|
className={\`\${P}-cut-item\`}
|
|
4894
5523
|
style={{
|
|
4895
5524
|
minHeight: scaled(cutCellMinHeight ?? 0),
|
|
4896
|
-
|
|
5525
|
+
...getCutItemDividerWidths(
|
|
5526
|
+
showDividerBottom,
|
|
5527
|
+
dividerWidth ?? 0,
|
|
5528
|
+
isEditor ?? false,
|
|
5529
|
+
),
|
|
4897
5530
|
}}
|
|
4898
5531
|
>
|
|
4899
5532
|
<div
|
|
4900
5533
|
className={\`\${P}-list-cols-row\`}
|
|
4901
|
-
style={
|
|
5534
|
+
style={
|
|
5535
|
+
isVerticalLayout
|
|
5536
|
+
? {
|
|
5537
|
+
paddingLeft: scaled(effectiveTextPaddingLR),
|
|
5538
|
+
paddingRight: scaled(effectiveTextPaddingLR),
|
|
5539
|
+
}
|
|
5540
|
+
: { justifyContent: 'center' }
|
|
5541
|
+
}
|
|
4902
5542
|
>
|
|
4903
5543
|
<button
|
|
4904
5544
|
type="button"
|
|
@@ -4912,7 +5552,7 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4912
5552
|
</div>
|
|
4913
5553
|
)}
|
|
4914
5554
|
</div>
|
|
4915
|
-
{showControls && firstColumn && lastColumn && (
|
|
5555
|
+
{showControls && !isVerticalLayout && firstColumn && lastColumn && (
|
|
4916
5556
|
<div key="column-edge-padding-handles" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
4917
5557
|
<div
|
|
4918
5558
|
data-controls={firstColumn.paddingLeftKey}
|
|
@@ -4956,15 +5596,15 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4956
5596
|
/>
|
|
4957
5597
|
</div>
|
|
4958
5598
|
)}
|
|
4959
|
-
{showControls && listColumns.slice(0, -1).map((col, colIndex) => {
|
|
5599
|
+
{showControls && !isVerticalLayout && listColumns.slice(0, -1).map((col, colIndex) => {
|
|
4960
5600
|
const nextCol = listColumns[colIndex + 1];
|
|
4961
5601
|
const maxColumnWidth = getColumnMaxWidth(
|
|
4962
5602
|
colIndex,
|
|
4963
|
-
|
|
4964
|
-
|
|
5603
|
+
resolvedColumnWidths,
|
|
5604
|
+
storedColumnWidths,
|
|
4965
5605
|
resolvedContentWidth,
|
|
4966
5606
|
);
|
|
4967
|
-
const
|
|
5607
|
+
const boundaryOffset = resolvedColumnWidths.slice(0, colIndex + 1).reduce((sum, width) => sum + width, 0);
|
|
4968
5608
|
const colEffectivePadding = effectiveColumnPaddings[colIndex];
|
|
4969
5609
|
const nextColEffectivePadding = effectiveColumnPaddings[colIndex + 1];
|
|
4970
5610
|
const paddingRightWidth = Math.max(
|
|
@@ -4975,7 +5615,7 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4975
5615
|
nextColEffectivePadding.paddingLeft,
|
|
4976
5616
|
COL_PADDING_HANDLE_WIDTH,
|
|
4977
5617
|
);
|
|
4978
|
-
const
|
|
5618
|
+
const columnWidthHandleOffset = boundaryOffset - COL_RESIZE_HANDLE_WIDTH / 2;
|
|
4979
5619
|
|
|
4980
5620
|
return (
|
|
4981
5621
|
<div key={\`\${col.widthKey}-junction\`} style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
@@ -4992,7 +5632,7 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4992
5632
|
style={{
|
|
4993
5633
|
position: 'absolute',
|
|
4994
5634
|
top: 0,
|
|
4995
|
-
left: scaled(
|
|
5635
|
+
left: scaled(boundaryOffset - paddingRightWidth),
|
|
4996
5636
|
width: scaled(paddingRightWidth),
|
|
4997
5637
|
height: '100%',
|
|
4998
5638
|
pointerEvents: 'auto',
|
|
@@ -5009,7 +5649,7 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
5009
5649
|
style={{
|
|
5010
5650
|
position: 'absolute',
|
|
5011
5651
|
top: '0px',
|
|
5012
|
-
left: scaled(
|
|
5652
|
+
left: scaled(columnWidthHandleOffset),
|
|
5013
5653
|
width: scaled(COL_RESIZE_HANDLE_WIDTH),
|
|
5014
5654
|
height: 'calc(100%)',
|
|
5015
5655
|
pointerEvents: 'auto',
|
|
@@ -5028,7 +5668,7 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
5028
5668
|
style={{
|
|
5029
5669
|
position: 'absolute',
|
|
5030
5670
|
top: 0,
|
|
5031
|
-
left: scaled(
|
|
5671
|
+
left: scaled(boundaryOffset),
|
|
5032
5672
|
width: scaled(paddingLeftWidth),
|
|
5033
5673
|
height: '100%',
|
|
5034
5674
|
pointerEvents: 'auto',
|
|
@@ -5038,6 +5678,47 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
5038
5678
|
</div>
|
|
5039
5679
|
);
|
|
5040
5680
|
})}
|
|
5681
|
+
{showControls && isVerticalLayout && (
|
|
5682
|
+
<div key="text-padding-lr-handles" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
5683
|
+
<div
|
|
5684
|
+
data-controls="textPaddingLR"
|
|
5685
|
+
data-controls-paired=""
|
|
5686
|
+
data-controls-axis="x"
|
|
5687
|
+
data-controls-min="0"
|
|
5688
|
+
data-controls-max-fraction={String(textPaddingLRMaxFraction)}
|
|
5689
|
+
data-controls-static-handle=""
|
|
5690
|
+
className={\`\${P}-text-padding-lr-handle\`}
|
|
5691
|
+
style={{
|
|
5692
|
+
position: 'absolute',
|
|
5693
|
+
top: 0,
|
|
5694
|
+
left: 0,
|
|
5695
|
+
width: scaled(textPaddingLRHandleWidth),
|
|
5696
|
+
height: '100%',
|
|
5697
|
+
pointerEvents: 'auto',
|
|
5698
|
+
zIndex: 2,
|
|
5699
|
+
}}
|
|
5700
|
+
/>
|
|
5701
|
+
<div
|
|
5702
|
+
data-controls="textPaddingLR"
|
|
5703
|
+
data-controls-paired=""
|
|
5704
|
+
data-controls-axis="x"
|
|
5705
|
+
data-controls-reverse=""
|
|
5706
|
+
data-controls-min="0"
|
|
5707
|
+
data-controls-max-fraction={String(textPaddingLRMaxFraction)}
|
|
5708
|
+
data-controls-static-handle=""
|
|
5709
|
+
className={\`\${P}-text-padding-lr-handle\`}
|
|
5710
|
+
style={{
|
|
5711
|
+
position: 'absolute',
|
|
5712
|
+
top: 0,
|
|
5713
|
+
left: scaled(Math.max(textPaddingLRHandleWidth, resolvedContentWidth - textPaddingLRHandleWidth)),
|
|
5714
|
+
width: scaled(textPaddingLRHandleWidth),
|
|
5715
|
+
height: '100%',
|
|
5716
|
+
pointerEvents: 'auto',
|
|
5717
|
+
zIndex: 2,
|
|
5718
|
+
}}
|
|
5719
|
+
/>
|
|
5720
|
+
</div>
|
|
5721
|
+
)}
|
|
5041
5722
|
{showHoverImage && hoverImage && (
|
|
5042
5723
|
<img
|
|
5043
5724
|
className={\`\${P}-hover-image\`}
|
|
@@ -5054,69 +5735,4 @@ export function List({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
5054
5735
|
</>
|
|
5055
5736
|
);
|
|
5056
5737
|
}
|
|
5057
|
-
|
|
5058
|
-
type ListSettings = {
|
|
5059
|
-
columns: number;
|
|
5060
|
-
wrapperWidth: number;
|
|
5061
|
-
entriesCount: number;
|
|
5062
|
-
cellMinHeight: number;
|
|
5063
|
-
imageOnHover: 'On' | 'Off';
|
|
5064
|
-
imageSize?: { min: number; max: number };
|
|
5065
|
-
dividerWidth: number;
|
|
5066
|
-
cut: number;
|
|
5067
|
-
showCut: number;
|
|
5068
|
-
cutCellMinHeight: number;
|
|
5069
|
-
cutLabel: string;
|
|
5070
|
-
entryHoverEffect: 'None' | 'Default' | 'Blinds';
|
|
5071
|
-
rowPaddingTop: number;
|
|
5072
|
-
rowPaddingBottom: number;
|
|
5073
|
-
AColumnWidth: number;
|
|
5074
|
-
AColumnPaddingLeft: number;
|
|
5075
|
-
AColumnPaddingRight: number;
|
|
5076
|
-
BColumnWidth: number;
|
|
5077
|
-
BColumnPaddingLeft: number;
|
|
5078
|
-
BColumnPaddingRight: number;
|
|
5079
|
-
CColumnWidth: number;
|
|
5080
|
-
CColumnPaddingLeft: number;
|
|
5081
|
-
CColumnPaddingRight: number;
|
|
5082
|
-
DColumnWidth: number;
|
|
5083
|
-
DColumnPaddingLeft: number;
|
|
5084
|
-
DColumnPaddingRight: number;
|
|
5085
|
-
EColumnWidth: number;
|
|
5086
|
-
EColumnPaddingLeft: number;
|
|
5087
|
-
EColumnPaddingRight: number;
|
|
5088
|
-
columnsOrder?: string[];
|
|
5089
|
-
textColor: string;
|
|
5090
|
-
textFontFamily: string;
|
|
5091
|
-
textFontSettings?: { fontWeight: number; fontStyle: string };
|
|
5092
|
-
textFontSize?: number;
|
|
5093
|
-
textLineHeight?: number;
|
|
5094
|
-
textLetterSpacing?: number;
|
|
5095
|
-
textWordSpacing?: number;
|
|
5096
|
-
textTextAppearance?: TextStyles['textAppearance'];
|
|
5097
|
-
backgroundColor: string;
|
|
5098
|
-
dividerColor: string;
|
|
5099
|
-
textHoverColor: string;
|
|
5100
|
-
backgroundHoverColor: string;
|
|
5101
|
-
dividerHoverColor: string;
|
|
5102
|
-
};
|
|
5103
|
-
|
|
5104
|
-
type ColorKeys =
|
|
5105
|
-
| 'textColor'
|
|
5106
|
-
| 'backgroundColor'
|
|
5107
|
-
| 'dividerColor'
|
|
5108
|
-
| 'textHoverColor'
|
|
5109
|
-
| 'backgroundHoverColor'
|
|
5110
|
-
| 'dividerHoverColor'
|
|
5111
|
-
|
|
5112
|
-
const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
5113
|
-
textColor: 'text-color',
|
|
5114
|
-
backgroundColor: 'background-color',
|
|
5115
|
-
dividerColor: 'divider-color',
|
|
5116
|
-
textHoverColor: 'text-hover-color',
|
|
5117
|
-
backgroundHoverColor: 'background-hover-color',
|
|
5118
|
-
dividerHoverColor: 'divider-hover-color',
|
|
5119
|
-
};
|
|
5120
|
-
|
|
5121
|
-
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5122
|
-
`,cc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},dc=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],uc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{AColumn:{type:"string",label:"A column",placeholder:"Add Title...",display:{type:"text-input"}},BColumnWidth:{type:"string",label:"B column",placeholder:"Add Title...",display:{type:"text-input"}},CColumnWidth:{type:"string",label:"C column",placeholder:"Add Title...",display:{type:"text-input"}},DColumnWidth:{type:"string",label:"D column",placeholder:"Add Title...",display:{type:"text-input"}},EColumnWidth:{type:"string",label:"E column",placeholder:"Add Title...",display:{type:"text-input"}},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:[{AColumn:"AColumn",BColumnWidth:"BColumnWidth",CColumnWidth:"CColumnWidth",DColumnWidth:"DColumnWidth",EColumnWidth:"EColumnWidth",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{AColumn:"AColumn 2",BColumnWidth:"BColumnWidth 2",CColumnWidth:"CColumnWidth 2",DColumnWidth:"DColumnWidth 2",EColumnWidth:"EColumnWidth 2",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{AColumn:"AColumn 3",BColumnWidth:"BColumnWidth 3",CColumnWidth:"CColumnWidth 3",DColumnWidth:"DColumnWidth 3",EColumnWidth:"EColumnWidth 3",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""}]}},settings:{sizing:"auto auto",properties:{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},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},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"}},AColumnWidth:{type:"number",scope:"layout",title:"A column width",min:0,max:100,display:{type:"range-control"}},AColumnPaddingLeft:{type:"number",scope:"layout",title:"A column padding left",min:0,max:100,display:{type:"range-control"}},AColumnPaddingRight:{type:"number",scope:"layout",title:"A column padding right",min:0,max:100,display:{type:"range-control"}},BColumnWidth:{type:"number",scope:"layout",title:"B column width",min:0,max:100,display:{type:"range-control"}},BColumnPaddingLeft:{type:"number",scope:"layout",title:"B column padding left",min:0,max:100,display:{type:"range-control"}},BColumnPaddingRight:{type:"number",scope:"layout",title:"B column padding right",min:0,max:100,display:{type:"range-control"}},CColumnWidth:{type:"number",scope:"layout",title:"C column width",min:0,max:100,display:{type:"range-control"}},CColumnPaddingLeft:{type:"number",scope:"layout",title:"C column padding left",min:0,max:100,display:{type:"range-control"}},CColumnPaddingRight:{type:"number",scope:"layout",title:"C column padding right",min:0,max:100,display:{type:"range-control"}},DColumnWidth:{type:"number",scope:"layout",title:"D column width",min:0,max:100,display:{type:"range-control"}},DColumnPaddingLeft:{type:"number",scope:"layout",title:"D column padding left",min:0,max:100,display:{type:"range-control"}},DColumnPaddingRight:{type:"number",scope:"layout",title:"D column padding right",min:0,max:100,display:{type:"range-control"}},EColumnWidth:{type:"number",scope:"layout",title:"E column width",min:0,max:100,display:{type:"range-control"}},EColumnPaddingLeft:{type:"number",scope:"layout",title:"E column padding left",min:0,max:100,display:{type:"range-control"}},EColumnPaddingRight:{type:"number",scope:"layout",title:"E column padding right",min:0,max:100,display:{type:"range-control"}},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:{...cc.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"}},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",textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:{columns:5,wrapperWidth:1,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,AColumnWidth:.2,AColumnPaddingLeft:0,AColumnPaddingRight:0,BColumnWidth:.2,BColumnPaddingLeft:0,BColumnPaddingRight:0,CColumnWidth:.2,CColumnPaddingLeft:0,CColumnPaddingRight:0,DColumnWidth:.2,DColumnPaddingLeft:0,DColumnPaddingRight:0,EColumnWidth:.2,EColumnPaddingLeft:0,EColumnPaddingRight:0,columnsOrder:["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043},d:{columns:5,wrapperWidth:1,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,AColumnWidth:.2,AColumnPaddingLeft:0,AColumnPaddingRight:0,BColumnWidth:.2,BColumnPaddingLeft:0,BColumnPaddingRight:0,CColumnWidth:.2,CColumnPaddingLeft:0,CColumnPaddingRight:0,DColumnWidth:.2,DColumnPaddingLeft:0,DColumnPaddingRight:0,EColumnWidth:.2,EColumnPaddingLeft:0,EColumnPaddingRight:0,columnsOrder:["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01}},displayRules:[{if:{name:"cut",value:0},then:{name:"properties.cutLabel.display.visible",value:!1}},{if:{name:"cut",value:0},then:{name:"properties.cutCellMinHeight.display.visible",value:!1}},{if:{name:"cut",value:0},then:{name:"properties.showCut.display.visible",value:!1}}],layout:["__componentName__","name","columns","wrapperWidth","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","AColumnWidth","AColumnPaddingLeft","AColumnPaddingRight","BColumnWidth","BColumnPaddingLeft","BColumnPaddingRight","CColumnWidth","CColumnPaddingLeft","CColumnPaddingRight","DColumnWidth","DColumnPaddingLeft","DColumnPaddingRight","EColumnWidth","EColumnPaddingLeft","EColumnPaddingRight","columnsOrder"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["dividerWidth","cut"]},{type:"row",title:"",items:["entryHoverEffect"]},{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:"Text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]}],paletteBookmark:{items:[...dc],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},pc={element:ic,id:"list",name:"Default List",category:"lists",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:uc,sourceCode:sc},mc=[pl,bl,ls,fs,Ls,As,Hs,qs,pc];exports.components=mc;exports.isSchemaV1=ri;
|
|
5738
|
+
`,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 Ur(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],r=`${t} column`;return[n,Bc(r)]}))}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 To(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 Lo(t){const{textFontSize:e,textLineHeight:n}=t;return qe.reduce((r,o)=>(e!==void 0&&(r[Et(o,"FontSize")]=e),n!==void 0&&(r[Et(o,"LineHeight")]=n),r),{})}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(r=>({if:{name:t,value:e},then:{name:`properties.${r}.display.visible`,value:!1}}))}function gr(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=[gr("",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"}),gr("2",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"}),gr("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:To({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,...Lo({textFontSize:.043,textLineHeight:.043})}),d:To({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,...Lo({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",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Qc,sourceCode:Nc},ed=[Ws,Os,Tl,Al,Vl,ql,ec,pc,td];exports.components=ed;exports.isSchemaV1=Ci;
|