@cntrl-site/components 1.0.1-alpha.8 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/ControlSlider/ControlSliderComponent.d.ts +2 -571
- package/dist/Components/Form/Form.d.ts +43 -23
- package/dist/Components/ImageRevealSlider/ControlImageRevealSliderComponent.d.ts +2 -248
- package/dist/Components/OnelinerForm/OnelinerForm.d.ts +32 -18
- package/dist/Components/OnelinerForm/OnelinerFormComponent.d.ts +2 -1
- package/dist/Components/utils/buildColorVars.d.ts +2 -0
- package/dist/Components/utils/formFieldValidation.d.ts +0 -2
- package/dist/Components/utils/index.d.ts +1 -0
- package/dist/Components/utils/textStylesToCss.d.ts +19 -0
- package/dist/components.css +1 -1
- package/dist/index.js +962 -280
- package/dist/index.mjs +3952 -2816
- package/dist/types/Component.d.ts +13 -0
- package/dist/types/SchemaV1.d.ts +1 -0
- package/dist/useScopedStyles-BSwFAT27.mjs +49 -0
- package/dist/useScopedStyles-DpVdqfXj.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +7 -6
- package/package.json +1 -1
- package/dist/useScopedStyles-Bibm8h9Z.js +0 -1
- package/dist/useScopedStyles-Da2iLz5N.mjs +0 -34
package/dist/index.js
CHANGED
|
@@ -1,140 +1,143 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),D=require("react"),pe=require("classnames"),k=require("./useScopedStyles-Bibm8h9Z.js"),Gr=require("react-dom");function Yr(e){return e.type==="object"&&e.version===1}const qr="ControlSlider-module__wrapper___sHEkd",Xr="ControlSlider-module__hoverArrow___A-dOH",Kr="ControlSlider-module__sliderItem___QQSkR",Jr="ControlSlider-module__sliderImage___9hRl-",Zr="ControlSlider-module__arrow___05ghY",Qr="ControlSlider-module__arrowVertical___tBfVN",eo="ControlSlider-module__nextArrow___-30Yc",to="ControlSlider-module__arrowInner___aEra3",no="ControlSlider-module__arrowIcon___S4ztF",ro="ControlSlider-module__arrowImg___2dwJW",oo="ControlSlider-module__mirror___brd6U",io="ControlSlider-module__pagination___bicLF",ao="ControlSlider-module__paginationInner___bT-P-",lo="ControlSlider-module__paginationVertical___zYqKw",so="ControlSlider-module__paginationItem___nTRbk",co="ControlSlider-module__dot___p1Qun",uo="ControlSlider-module__activeDot___LHFaj",po="ControlSlider-module__paginationInsideBottom___R3FWn",go="ControlSlider-module__paginationInsideTop___V-qb-",fo="ControlSlider-module__paginationOutsideBottom___14w8D",mo="ControlSlider-module__paginationOutsideTop___SCLqB",yo="ControlSlider-module__paginationInsideLeft___yOBRZ",vo="ControlSlider-module__paginationInsideRight___Rtt3o",ho="ControlSlider-module__paginationOutsideLeft___lahaw",bo="ControlSlider-module__paginationOutsideRight___EtuQa",xo="ControlSlider-module__imgWrapper___UjEgB",Co="ControlSlider-module__captionBlock___dJ6-j",So="ControlSlider-module__captionTextWrapper___HFlpf",_o="ControlSlider-module__captionText___uGBVc",wo="ControlSlider-module__active___WZK4G",$o="ControlSlider-module__withPointerEvents___t-18M",Eo="ControlSlider-module__topLeftAlignment___zjnGM",To="ControlSlider-module__topCenterAlignment___gD1xW",Ao="ControlSlider-module__topRightAlignment___NMapS",Io="ControlSlider-module__middleLeftAlignment___OnUrY",Lo="ControlSlider-module__middleCenterAlignment___Tdkl0",ko="ControlSlider-module__middleRightAlignment___wEbfX",Ro="ControlSlider-module__bottomLeftAlignment___cTP2-",No="ControlSlider-module__bottomCenterAlignment___c54fB",Vo="ControlSlider-module__bottomRightAlignment___kEwrz",Oo="ControlSlider-module__clickOverlay___DZA28",jo="ControlSlider-module__contain___pLyq7",Fo="ControlSlider-module__cover___KdDat",q={wrapper:qr,hoverArrow:Xr,sliderItem:Kr,sliderImage:Jr,arrow:Zr,arrowVertical:Qr,nextArrow:eo,arrowInner:to,arrowIcon:no,arrowImg:ro,mirror:oo,pagination:io,paginationInner:ao,paginationVertical:lo,paginationItem:so,dot:co,activeDot:uo,paginationInsideBottom:po,paginationInsideTop:go,paginationOutsideBottom:fo,paginationOutsideTop:mo,paginationInsideLeft:yo,paginationInsideRight:vo,paginationOutsideLeft:ho,paginationOutsideRight:bo,imgWrapper:xo,captionBlock:Co,captionTextWrapper:So,captionText:_o,active:wo,withPointerEvents:$o,topLeftAlignment:Eo,topCenterAlignment:To,topRightAlignment:Ao,middleLeftAlignment:Io,middleCenterAlignment:Lo,middleRightAlignment:ko,bottomLeftAlignment:Ro,bottomCenterAlignment:No,bottomRightAlignment:Vo,clickOverlay:Oo,contain:jo,cover:Fo};function Bo(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 Mo(e,t,n){return t&&Bo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Vn="(prefers-reduced-motion: reduce)",Ze=1,zo=2,tt=3,ot=4,vt=5,Lt=6,Vt=7,Do={CREATED:Ze,MOUNTED:zo,IDLE:tt,MOVING:ot,SCROLLING:vt,DRAGGING:Lt,DESTROYED:Vt};function Ve(e){e.length=0}function ze(e,t,n){return Array.prototype.slice.call(e,t,n)}function se(e){return e.bind.apply(e,[null].concat(ze(arguments,1)))}var ar=setTimeout,on=function(){};function On(e){return requestAnimationFrame(e)}function Mt(e,t){return typeof t===e}function ut(e){return!mn(e)&&Mt("object",e)}var fn=Array.isArray,lr=se(Mt,"function"),Be=se(Mt,"string"),ht=se(Mt,"undefined");function mn(e){return e===null}function sr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function bt(e){return fn(e)?e:[e]}function Ce(e,t){bt(e).forEach(t)}function yn(e,t){return e.indexOf(t)>-1}function kt(e,t){return e.push.apply(e,bt(t)),e}function ke(e,t,n){e&&Ce(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Ee(e,t){ke(e,Be(t)?t.split(" "):t,!0)}function xt(e,t){Ce(t,e.appendChild.bind(e))}function vn(e,t){Ce(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function pt(e,t){return sr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function cr(e,t){var n=e?ze(e.children):[];return t?n.filter(function(r){return pt(r,t)}):n}function Ct(e,t){return t?cr(e,t)[0]:e.firstElementChild}var dt=Object.keys;function He(e,t,n){return e&&(n?dt(e).reverse():dt(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function gt(e){return ze(arguments,1).forEach(function(t){He(t,function(n,r){e[r]=t[r]})}),e}function Fe(e){return ze(arguments,1).forEach(function(t){He(t,function(n,r){fn(n)?e[r]=n.slice():ut(n)?e[r]=Fe({},ut(e[r])?e[r]:{},n):e[r]=n})}),e}function jn(e,t){Ce(t||dt(e),function(n){delete e[n]})}function Te(e,t){Ce(e,function(n){Ce(t,function(r){n&&n.removeAttribute(r)})})}function Q(e,t,n){ut(t)?He(t,function(r,o){Q(e,o,r)}):Ce(e,function(r){mn(n)||n===""?Te(r,t):r.setAttribute(t,String(n))})}function Qe(e,t,n){var r=document.createElement(e);return t&&(Be(t)?Ee(r,t):Q(r,t)),n&&xt(n,r),r}function _e(e,t,n){if(ht(n))return getComputedStyle(e)[t];mn(n)||(e.style[t]=""+n)}function ft(e,t){_e(e,"display",t)}function ur(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function we(e,t){return e.getAttribute(t)}function Fn(e,t){return e&&e.classList.contains(t)}function be(e){return e.getBoundingClientRect()}function Ue(e){Ce(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function pr(e){return Ct(new DOMParser().parseFromString(e,"text/html").body)}function Le(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function dr(e,t){return e&&e.querySelector(t)}function hn(e,t){return t?ze(e.querySelectorAll(t)):[]}function Re(e,t){ke(e,t,!1)}function an(e){return e.timeStamp}function Pe(e){return Be(e)?e:e?e+"px":""}var St="splide",bn="data-"+St;function lt(e,t){if(!e)throw new Error("["+St+"] "+(t||""))}var Me=Math.min,Ot=Math.max,jt=Math.floor,mt=Math.ceil,he=Math.abs;function gr(e,t,n){return he(e-t)<n}function Rt(e,t,n,r){var o=Me(t,n),a=Ot(t,n);return r?o<e&&e<a:o<=e&&e<=a}function Ke(e,t,n){var r=Me(t,n),o=Ot(t,n);return Me(Ot(r,e),o)}function ln(e){return+(e>0)-+(e<0)}function sn(e,t){return Ce(t,function(n){e=e.replace("%s",""+n)}),e}function xn(e){return e<10?"0"+e:""+e}var Bn={};function Wo(e){return""+e+xn(Bn[e]=(Bn[e]||0)+1)}function fr(){var e=[];function t(i,s,l,p){o(i,s,function(c,_,m){var y="addEventListener"in c,u=y?c.removeEventListener.bind(c,_,l,p):c.removeListener.bind(c,l);y?c.addEventListener(_,l,p):c.addListener(l),e.push([c,_,m,l,u])})}function n(i,s,l){o(i,s,function(p,c,_){e=e.filter(function(m){return m[0]===p&&m[1]===c&&m[2]===_&&(!l||m[3]===l)?(m[4](),!1):!0})})}function r(i,s,l){var p,c=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:c,detail:l}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,c,!1,l)),i.dispatchEvent(p),p}function o(i,s,l){Ce(i,function(p){p&&Ce(s,function(c){c.split(" ").forEach(function(_){var m=_.split(".");l(p,m[0],m[1])})})})}function a(){e.forEach(function(i){i[4]()}),Ve(e)}return{bind:t,unbind:n,dispatch:r,destroy:a}}var De="mounted",cn="ready",Oe="move",it="moved",Cn="click",mr="active",yr="inactive",vr="visible",hr="hidden",me="refresh",ve="updated",nt="resize",zt="resized",br="drag",xr="dragging",Cr="dragged",Dt="scroll",Ye="scrolled",Po="overflow",Sn="destroy",Sr="arrows:mounted",_r="arrows:updated",wr="pagination:mounted",$r="pagination:updated",_n="navigation:mounted",wn="autoplay:play",Er="autoplay:playing",$n="autoplay:pause",En="lazyload:loaded",Tr="sk",Ar="sh",Ft="ei";function de(e){var t=e?e.event.bus:document.createDocumentFragment(),n=fr();function r(a,i){n.bind(t,bt(a).join(" "),function(s){i.apply(i,fn(s.detail)?s.detail:[])})}function o(a){n.dispatch(t,a,ze(arguments,1))}return e&&e.event.on(Sn,n.destroy),gt(n,{bus:t,on:r,off:se(n.unbind,t),emit:o})}function Wt(e,t,n,r){var o=Date.now,a,i=0,s,l=!0,p=0;function c(){if(!l){if(i=e?Me((o()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=o(),r&&++p>=r))return m();s=On(c)}}function _(E){E||u(),a=o()-(E?i*e:0),l=!1,s=On(c)}function m(){l=!0}function y(){a=o(),i=0,n&&n(i)}function u(){s&&cancelAnimationFrame(s),i=0,s=0,l=!0}function g(E){e=E}function $(){return l}return{start:_,rewind:y,pause:m,cancel:u,set:g,isPaused:$}}function Ho(e){var t=e;function n(o){t=o}function r(o){return yn(bt(o),t)}return{set:n,is:r}}function Uo(e,t){var n=Wt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Go(e,t,n){var r=e.state,o=n.breakpoints||{},a=n.reducedMotion||{},i=fr(),s=[];function l(){var u=n.mediaQuery==="min";dt(o).sort(function(g,$){return u?+g-+$:+$-+g}).forEach(function(g){c(o[g],"("+(u?"min":"max")+"-width:"+g+"px)")}),c(a,Vn),_()}function p(u){u&&i.destroy()}function c(u,g){var $=matchMedia(g);i.bind($,"change",_),s.push([u,$])}function _(){var u=r.is(Vt),g=n.direction,$=s.reduce(function(E,d){return Fe(E,d[1].matches?d[0]:{})},{});jn(n),y($),n.destroy?e.destroy(n.destroy==="completely"):u?(p(!0),e.mount()):g!==n.direction&&e.refresh()}function m(u){matchMedia(Vn).matches&&(u?Fe(n,a):jn(n,dt(a)))}function y(u,g,$){Fe(n,u),g&&Fe(Object.getPrototypeOf(n),u),($||!r.is(Ze))&&e.emit(ve,n)}return{setup:l,destroy:p,reduce:m,set:y}}var Pt="Arrow",Ht=Pt+"Left",Ut=Pt+"Right",Ir=Pt+"Up",Lr=Pt+"Down",Mn="rtl",Gt="ttb",Kt={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ir,Ut],ArrowRight:[Lr,Ht]};function Yo(e,t,n){function r(a,i,s){s=s||n.direction;var l=s===Mn&&!i?1:s===Gt?0:-1;return Kt[a]&&Kt[a][l]||a.replace(/width|left|right/i,function(p,c){var _=Kt[p.toLowerCase()][l]||p;return c>0?_.charAt(0).toUpperCase()+_.slice(1):_})}function o(a){return a*(n.direction===Mn?1:-1)}return{resolve:r,orient:o}}var Ne="role",et="tabindex",qo="disabled",$e="aria-",_t=$e+"controls",kr=$e+"current",zn=$e+"selected",xe=$e+"label",Tn=$e+"labelledby",Rr=$e+"hidden",An=$e+"orientation",yt=$e+"roledescription",Dn=$e+"live",Wn=$e+"busy",Pn=$e+"atomic",In=[Ne,et,qo,_t,kr,xe,Tn,Rr,An,yt],Ae=St+"__",We="is-",Jt=St,Hn=Ae+"track",Xo=Ae+"list",Yt=Ae+"slide",Nr=Yt+"--clone",Ko=Yt+"__container",Ln=Ae+"arrows",qt=Ae+"arrow",Vr=qt+"--prev",Or=qt+"--next",Xt=Ae+"pagination",jr=Xt+"__page",Jo=Ae+"progress",Zo=Jo+"__bar",Qo=Ae+"toggle",ei=Ae+"spinner",ti=Ae+"sr",ni=We+"initialized",Ge=We+"active",Fr=We+"prev",Br=We+"next",un=We+"visible",pn=We+"loading",Mr=We+"focus-in",zr=We+"overflow",ri=[Ge,un,Fr,Br,pn,Mr,zr],oi={slide:Yt,clone:Nr,arrows:Ln,arrow:qt,prev:Vr,next:Or,pagination:Xt,page:jr,spinner:ei};function ii(e,t){if(lr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!pt(n,t);)n=n.parentElement;return n}var ai=5,Un=200,Dr="touchstart mousedown",Zt="touchmove mousemove",Qt="touchend touchcancel mouseup click";function li(e,t,n){var r=de(e),o=r.on,a=r.bind,i=e.root,s=n.i18n,l={},p=[],c=[],_=[],m,y,u;function g(){h(),W(),d()}function $(){o(me,E),o(me,g),o(ve,d),a(document,Dr+" keydown",function(v){u=v.type==="keydown"},{capture:!0}),a(i,"focusin",function(){ke(i,Mr,!!u)})}function E(v){var T=In.concat("style");Ve(p),Re(i,c),Re(m,_),Te([m,y],T),Te(i,v?T:["style",yt])}function d(){Re(i,c),Re(m,_),c=w(Jt),_=w(Hn),Ee(i,c),Ee(m,_),Q(i,xe,n.label),Q(i,Tn,n.labelledby)}function h(){m=M("."+Hn),y=Ct(m,"."+Xo),lt(m&&y,"A track/list element is missing."),kt(p,cr(y,"."+Yt+":not(."+Nr+")")),He({arrows:Ln,pagination:Xt,prev:Vr,next:Or,bar:Zo,toggle:Qo},function(v,T){l[T]=M("."+v)}),gt(l,{root:i,track:m,list:y,slides:p})}function W(){var v=i.id||Wo(St),T=n.role;i.id=v,m.id=m.id||v+"-track",y.id=y.id||v+"-list",!we(i,Ne)&&i.tagName!=="SECTION"&&T&&Q(i,Ne,T),Q(i,yt,s.carousel),Q(y,Ne,"presentation")}function M(v){var T=dr(i,v);return T&&ii(T,"."+Jt)===i?T:void 0}function w(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===Jt&&Ge]}return gt(l,{setup:g,mount:$,destroy:E})}var rt="slide",at="loop",wt="fade";function si(e,t,n,r){var o=de(e),a=o.on,i=o.emit,s=o.bind,l=e.Components,p=e.root,c=e.options,_=c.isNavigation,m=c.updateOnMove,y=c.i18n,u=c.pagination,g=c.slideFocus,$=l.Direction.resolve,E=we(r,"style"),d=we(r,xe),h=n>-1,W=Ct(r,"."+Ko),M;function w(){h||(r.id=p.id+"-slide"+xn(t+1),Q(r,Ne,u?"tabpanel":"group"),Q(r,yt,y.slide),Q(r,xe,d||sn(y.slideLabel,[t+1,e.length]))),v()}function v(){s(r,"click",se(i,Cn,A)),s(r,"keydown",se(i,Tr,A)),a([it,Ar,Ye],L),a(_n,N),m&&a(Oe,z)}function T(){M=!0,o.destroy(),Re(r,ri),Te(r,In),Q(r,"style",E),Q(r,xe,d||"")}function N(){var b=e.splides.map(function(C){var j=C.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");Q(r,xe,sn(y.slideX,(h?n:t)+1)),Q(r,_t,b),Q(r,Ne,g?"button":""),g&&Te(r,yt)}function z(){M||L()}function L(){if(!M){var b=e.index;O(),F(),ke(r,Fr,t===b-1),ke(r,Br,t===b+1)}}function O(){var b=H();b!==Fn(r,Ge)&&(ke(r,Ge,b),Q(r,kr,_&&b||""),i(b?mr:yr,A))}function F(){var b=f(),C=!b&&(!H()||h);if(e.state.is([ot,vt])||Q(r,Rr,C||""),Q(hn(r,c.focusableNodes||""),et,C?-1:""),g&&Q(r,et,C?-1:0),b!==Fn(r,un)&&(ke(r,un,b),i(b?vr:hr,A)),!b&&document.activeElement===r){var j=l.Slides.getAt(e.index);j&&ur(j.slide)}}function G(b,C,j){_e(j&&W||r,b,C)}function H(){var b=e.index;return b===t||c.cloneStatus&&b===n}function f(){if(e.is(wt))return H();var b=be(l.Elements.track),C=be(r),j=$("left",!0),Z=$("right",!0);return jt(b[j])<=mt(C[j])&&jt(C[Z])<=mt(b[Z])}function R(b,C){var j=he(b-t);return!h&&(c.rewind||e.is(at))&&(j=Me(j,e.length-j)),j<=C}var A={index:t,slideIndex:n,slide:r,container:W,isClone:h,mount:w,destroy:T,update:L,style:G,isWithin:R};return A}function ci(e,t,n){var r=de(e),o=r.on,a=r.emit,i=r.bind,s=t.Elements,l=s.slides,p=s.list,c=[];function _(){m(),o(me,y),o(me,m)}function m(){l.forEach(function(L,O){g(L,O,-1)})}function y(){M(function(L){L.destroy()}),Ve(c)}function u(){M(function(L){L.update()})}function g(L,O,F){var G=si(e,O,F,L);G.mount(),c.push(G),c.sort(function(H,f){return H.index-f.index})}function $(L){return L?w(function(O){return!O.isClone}):c}function E(L){var O=t.Controller,F=O.toIndex(L),G=O.hasFocus()?1:n.perPage;return w(function(H){return Rt(H.index,F,F+G-1)})}function d(L){return w(L)[0]}function h(L,O){Ce(L,function(F){if(Be(F)&&(F=pr(F)),sr(F)){var G=l[O];G?vn(F,G):xt(p,F),Ee(F,n.classes.slide),T(F,se(a,nt))}}),a(me)}function W(L){Ue(w(L).map(function(O){return O.slide})),a(me)}function M(L,O){$(O).forEach(L)}function w(L){return c.filter(lr(L)?L:function(O){return Be(L)?pt(O.slide,L):yn(bt(L),O.index)})}function v(L,O,F){M(function(G){G.style(L,O,F)})}function T(L,O){var F=hn(L,"img"),G=F.length;G?F.forEach(function(H){i(H,"load error",function(){--G||O()})}):O()}function N(L){return L?l.length:c.length}function z(){return c.length>n.perPage}return{mount:_,destroy:y,update:u,register:g,get:$,getIn:E,getAt:d,add:h,remove:W,forEach:M,filter:w,style:v,getLength:N,isEnough:z}}function ui(e,t,n){var r=de(e),o=r.on,a=r.bind,i=r.emit,s=t.Slides,l=t.Direction.resolve,p=t.Elements,c=p.root,_=p.track,m=p.list,y=s.getAt,u=s.style,g,$,E;function d(){h(),a(window,"resize load",Uo(se(i,nt))),o([ve,me],h),o(nt,W)}function h(){g=n.direction===Gt,_e(c,"maxWidth",Pe(n.width)),_e(_,l("paddingLeft"),M(!1)),_e(_,l("paddingRight"),M(!0)),W(!0)}function W(A){var b=be(c);(A||$.width!==b.width||$.height!==b.height)&&(_e(_,"height",w()),u(l("marginRight"),Pe(n.gap)),u("width",T()),u("height",N(),!0),$=b,i(zt),E!==(E=R())&&(ke(c,zr,E),i(Po,E)))}function M(A){var b=n.padding,C=l(A?"right":"left");return b&&Pe(b[C]||(ut(b)?0:b))||"0px"}function w(){var A="";return g&&(A=v(),lt(A,"height or heightRatio is missing."),A="calc("+A+" - "+M(!1)+" - "+M(!0)+")"),A}function v(){return Pe(n.height||be(m).width*n.heightRatio)}function T(){return n.autoWidth?null:Pe(n.fixedWidth)||(g?"":z())}function N(){return Pe(n.fixedHeight)||(g?n.autoHeight?null:z():v())}function z(){var A=Pe(n.gap);return"calc((100%"+(A&&" + "+A)+")/"+(n.perPage||1)+(A&&" - "+A)+")"}function L(){return be(m)[l("width")]}function O(A,b){var C=y(A||0);return C?be(C.slide)[l("width")]+(b?0:H()):0}function F(A,b){var C=y(A);if(C){var j=be(C.slide)[l("right")],Z=be(m)[l("left")];return he(j-Z)+(b?0:H())}return 0}function G(A){return F(e.length-1)-F(0)+O(0,A)}function H(){var A=y(0);return A&&parseFloat(_e(A.slide,l("marginRight")))||0}function f(A){return parseFloat(_e(_,l("padding"+(A?"Right":"Left"))))||0}function R(){return e.is(wt)||G(!0)>L()}return{mount:d,resize:W,listSize:L,slideSize:O,sliderSize:G,totalSize:F,getPadding:f,isOverflow:R}}var pi=2;function di(e,t,n){var r=de(e),o=r.on,a=t.Elements,i=t.Slides,s=t.Direction.resolve,l=[],p;function c(){o(me,_),o([ve,nt],y),(p=$())&&(u(p),t.Layout.resize(!0))}function _(){m(),c()}function m(){Ue(l),Ve(l),r.destroy()}function y(){var E=$();p!==E&&(p<E||!E)&&r.emit(me)}function u(E){var d=i.get().slice(),h=d.length;if(h){for(;d.length<E;)kt(d,d);kt(d.slice(-E),d.slice(0,E)).forEach(function(W,M){var w=M<E,v=g(W.slide,M);w?vn(v,d[0].slide):xt(a.list,v),kt(l,v),i.register(v,M-E+(w?0:h),W.index)})}}function g(E,d){var h=E.cloneNode(!0);return Ee(h,n.classes.clone),h.id=e.root.id+"-clone"+xn(d+1),h}function $(){var E=n.clones;if(!e.is(at))E=0;else if(ht(E)){var d=n[s("fixedWidth")]&&t.Layout.slideSize(0),h=d&&mt(be(a.track)[s("width")]/d);E=h||n[s("autoWidth")]&&e.length||n.perPage*pi}return E}return{mount:c,destroy:m}}function gi(e,t,n){var r=de(e),o=r.on,a=r.emit,i=e.state.set,s=t.Layout,l=s.slideSize,p=s.getPadding,c=s.totalSize,_=s.listSize,m=s.sliderSize,y=t.Direction,u=y.resolve,g=y.orient,$=t.Elements,E=$.list,d=$.track,h;function W(){h=t.Transition,o([De,zt,ve,me],M)}function M(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function w(C,j,Z,te){C!==j&&A(C>Z)&&(L(),T(z(G(),C>Z),!0)),i(ot),a(Oe,j,Z,C),h.start(j,function(){i(tt),a(it,j,Z,C),te&&te()})}function v(C){T(F(C,!0))}function T(C,j){if(!e.is(wt)){var Z=j?C:N(C);_e(E,"transform","translate"+u("X")+"("+Z+"px)"),C!==Z&&a(Ar)}}function N(C){if(e.is(at)){var j=O(C),Z=j>t.Controller.getEnd(),te=j<0;(te||Z)&&(C=z(C,Z))}return C}function z(C,j){var Z=C-R(j),te=m();return C-=g(te*(mt(he(Z)/te)||1))*(j?1:-1),C}function L(){T(G(),!0),h.cancel()}function O(C){for(var j=t.Slides.get(),Z=0,te=1/0,ee=0;ee<j.length;ee++){var ge=j[ee].index,I=he(F(ge,!0)-C);if(I<=te)te=I,Z=ge;else break}return Z}function F(C,j){var Z=g(c(C-1)-f(C));return j?H(Z):Z}function G(){var C=u("left");return be(E)[C]-be(d)[C]+g(p(!1))}function H(C){return n.trimSpace&&e.is(rt)&&(C=Ke(C,0,g(m(!0)-_()))),C}function f(C){var j=n.focus;return j==="center"?(_()-l(C,!0))/2:+j*l(C)||0}function R(C){return F(C?t.Controller.getEnd():0,!!n.trimSpace)}function A(C){var j=g(z(G(),C));return C?j>=0:j<=E[u("scrollWidth")]-be(d)[u("width")]}function b(C,j){j=ht(j)?G():j;var Z=C!==!0&&g(j)<g(R(!1)),te=C!==!1&&g(j)>g(R(!0));return Z||te}return{mount:W,move:w,jump:v,translate:T,shift:z,cancel:L,toIndex:O,toPosition:F,getPosition:G,getLimit:R,exceededLimit:b,reposition:M}}function fi(e,t,n){var r=de(e),o=r.on,a=r.emit,i=t.Move,s=i.getPosition,l=i.getLimit,p=i.toPosition,c=t.Slides,_=c.isEnough,m=c.getLength,y=n.omitEnd,u=e.is(at),g=e.is(rt),$=se(G,!1),E=se(G,!0),d=n.start||0,h,W=d,M,w,v;function T(){N(),o([ve,me,Ft],N),o(zt,z)}function N(){M=m(!0),w=n.perMove,v=n.perPage,h=A();var I=Ke(d,0,y?h:M-1);I!==d&&(d=I,i.reposition())}function z(){h!==A()&&a(Ft)}function L(I,X,ce){if(!ge()){var ae=F(I),ue=R(ae);ue>-1&&(X||ue!==d)&&(Z(ue),i.move(ae,ue,W,ce))}}function O(I,X,ce,ae){t.Scroll.scroll(I,X,ce,function(){var ue=R(i.toIndex(s()));Z(y?Me(ue,h):ue),ae&&ae()})}function F(I){var X=d;if(Be(I)){var ce=I.match(/([+\-<>])(\d+)?/)||[],ae=ce[1],ue=ce[2];ae==="+"||ae==="-"?X=H(d+ +(""+ae+(+ue||1)),d):ae===">"?X=ue?b(+ue):$(!0):ae==="<"&&(X=E(!0))}else X=u?I:Ke(I,0,h);return X}function G(I,X){var ce=w||(ee()?1:v),ae=H(d+ce*(I?-1:1),d,!(w||ee()));return ae===-1&&g&&!gr(s(),l(!I),1)?I?0:h:X?ae:R(ae)}function H(I,X,ce){if(_()||ee()){var ae=f(I);ae!==I&&(X=I,I=ae,ce=!1),I<0||I>h?!w&&(Rt(0,I,X,!0)||Rt(h,X,I,!0))?I=b(C(I)):u?I=ce?I<0?-(M%v||v):M:I:n.rewind?I=I<0?h:0:I=-1:ce&&I!==X&&(I=b(C(X)+(I<X?-1:1)))}else I=-1;return I}function f(I){if(g&&n.trimSpace==="move"&&I!==d)for(var X=s();X===p(I,!0)&&Rt(I,0,e.length-1,!n.rewind);)I<d?--I:++I;return I}function R(I){return u?(I+M)%M||0:I}function A(){for(var I=M-(ee()||u&&w?1:v);y&&I-- >0;)if(p(M-1,!0)!==p(I,!0)){I++;break}return Ke(I,0,M-1)}function b(I){return Ke(ee()?I:v*I,0,h)}function C(I){return ee()?Me(I,h):jt((I>=h?M-1:I)/v)}function j(I){var X=i.toIndex(I);return g?Ke(X,0,h):X}function Z(I){I!==d&&(W=d,d=I)}function te(I){return I?W:d}function ee(){return!ht(n.focus)||n.isNavigation}function ge(){return e.state.is([ot,vt])&&!!n.waitForTransition}return{mount:T,go:L,scroll:O,getNext:$,getPrev:E,getAdjacent:G,getEnd:A,setIndex:Z,getIndex:te,toIndex:b,toPage:C,toDest:j,hasFocus:ee,isBusy:ge}}var mi="http://www.w3.org/2000/svg",yi="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",Tt=40;function vi(e,t,n){var r=de(e),o=r.on,a=r.bind,i=r.emit,s=n.classes,l=n.i18n,p=t.Elements,c=t.Controller,_=p.arrows,m=p.track,y=_,u=p.prev,g=p.next,$,E,d={};function h(){M(),o(ve,W)}function W(){w(),h()}function M(){var O=n.arrows;O&&!(u&&g)&&N(),u&&g&&(gt(d,{prev:u,next:g}),ft(y,O?"":"none"),Ee(y,E=Ln+"--"+n.direction),O&&(v(),L(),Q([u,g],_t,m.id),i(Sr,u,g)))}function w(){r.destroy(),Re(y,E),$?(Ue(_?[u,g]:y),u=g=null):Te([u,g],In)}function v(){o([De,it,me,Ye,Ft],L),a(g,"click",se(T,">")),a(u,"click",se(T,"<"))}function T(O){c.go(O,!0)}function N(){y=_||Qe("div",s.arrows),u=z(!0),g=z(!1),$=!0,xt(y,[u,g]),!_&&vn(y,m)}function z(O){var F='<button class="'+s.arrow+" "+(O?s.prev:s.next)+'" type="button"><svg xmlns="'+mi+'" viewBox="0 0 '+Tt+" "+Tt+'" width="'+Tt+'" height="'+Tt+'" focusable="false"><path d="'+(n.arrowPath||yi)+'" />';return pr(F)}function L(){if(u&&g){var O=e.index,F=c.getPrev(),G=c.getNext(),H=F>-1&&O<F?l.last:l.prev,f=G>-1&&O>G?l.first:l.next;u.disabled=F<0,g.disabled=G<0,Q(u,xe,H),Q(g,xe,f),i(_r,u,g,F,G)}}return{arrows:d,mount:h,destroy:w,update:L}}var hi=bn+"-interval";function bi(e,t,n){var r=de(e),o=r.on,a=r.bind,i=r.emit,s=Wt(n.interval,e.go.bind(e,">"),v),l=s.isPaused,p=t.Elements,c=t.Elements,_=c.root,m=c.toggle,y=n.autoplay,u,g,$=y==="pause";function E(){y&&(d(),m&&Q(m,_t,p.track.id),$||h(),w())}function d(){n.pauseOnHover&&a(_,"mouseenter mouseleave",function(N){u=N.type==="mouseenter",M()}),n.pauseOnFocus&&a(_,"focusin focusout",function(N){g=N.type==="focusin",M()}),m&&a(m,"click",function(){$?h():W(!0)}),o([Oe,Dt,me],s.rewind),o(Oe,T)}function h(){l()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),g=u=$=!1,w(),i(wn))}function W(N){N===void 0&&(N=!0),$=!!N,w(),l()||(s.pause(),i($n))}function M(){$||(u||g?W(!1):h())}function w(){m&&(ke(m,Ge,!$),Q(m,xe,n.i18n[$?"play":"pause"]))}function v(N){var z=p.bar;z&&_e(z,"width",N*100+"%"),i(Er,N)}function T(N){var z=t.Slides.getAt(N);s.set(z&&+we(z.slide,hi)||n.interval)}return{mount:E,destroy:s.cancel,play:h,pause:W,isPaused:l}}function xi(e,t,n){var r=de(e),o=r.on;function a(){n.cover&&(o(En,se(s,!0)),o([De,ve,me],se(i,!0)))}function i(l){t.Slides.forEach(function(p){var c=Ct(p.container||p.slide,"img");c&&c.src&&s(l,c,p)})}function s(l,p,c){c.style("background",l?'center/cover no-repeat url("'+p.src+'")':"",!0),ft(p,l?"none":"")}return{mount:a,destroy:se(i,!1)}}var Ci=10,Si=600,_i=.6,wi=1.5,$i=800;function Ei(e,t,n){var r=de(e),o=r.on,a=r.emit,i=e.state.set,s=t.Move,l=s.getPosition,p=s.getLimit,c=s.exceededLimit,_=s.translate,m=e.is(rt),y,u,g=1;function $(){o(Oe,W),o([ve,me],M)}function E(v,T,N,z,L){var O=l();if(W(),N&&(!m||!c())){var F=t.Layout.sliderSize(),G=ln(v)*F*jt(he(v)/F)||0;v=s.toPosition(t.Controller.toDest(v%F))+G}var H=gr(O,v,1);g=1,T=H?0:T||Ot(he(v-O)/wi,$i),u=z,y=Wt(T,d,se(h,O,v,L),1),i(vt),a(Dt),y.start()}function d(){i(tt),u&&u(),a(Ye)}function h(v,T,N,z){var L=l(),O=v+(T-v)*w(z),F=(O-L)*g;_(L+F),m&&!N&&c()&&(g*=_i,he(F)<Ci&&E(p(c(!0)),Si,!1,u,!0))}function W(){y&&y.cancel()}function M(){y&&!y.isPaused()&&(W(),d())}function w(v){var T=n.easingFunc;return T?T(v):1-Math.pow(1-v,4)}return{mount:$,destroy:W,scroll:E,cancel:M}}var Je={passive:!1,capture:!0};function Ti(e,t,n){var r=de(e),o=r.on,a=r.emit,i=r.bind,s=r.unbind,l=e.state,p=t.Move,c=t.Scroll,_=t.Controller,m=t.Elements.track,y=t.Media.reduce,u=t.Direction,g=u.resolve,$=u.orient,E=p.getPosition,d=p.exceededLimit,h,W,M,w,v,T=!1,N,z,L;function O(){i(m,Zt,on,Je),i(m,Qt,on,Je),i(m,Dr,G,Je),i(m,"click",R,{capture:!0}),i(m,"dragstart",Le),o([De,ve],F)}function F(){var V=n.drag;je(!V),w=V==="free"}function G(V){if(N=!1,!z){var x=ue(V);ae(V.target)&&(x||!V.button)&&(_.isBusy()?Le(V,!0):(L=x?m:window,v=l.is([ot,vt]),M=null,i(L,Zt,H,Je),i(L,Qt,f,Je),p.cancel(),c.cancel(),A(V)))}}function H(V){if(l.is(Lt)||(l.set(Lt),a(br)),V.cancelable)if(v){p.translate(h+ce(ee(V)));var x=ge(V)>Un,P=T!==(T=d());(x||P)&&A(V),N=!0,a(xr),Le(V)}else j(V)&&(v=C(V),Le(V))}function f(V){l.is(Lt)&&(l.set(tt),a(Cr)),v&&(b(V),Le(V)),s(L,Zt,H),s(L,Qt,f),v=!1}function R(V){!z&&N&&Le(V,!0)}function A(V){M=W,W=V,h=E()}function b(V){var x=Z(V),P=te(x),U=n.rewind&&n.rewindByDrag;y(!1),w?_.scroll(P,0,n.snap):e.is(wt)?_.go($(ln(x))<0?U?"<":"-":U?">":"+"):e.is(rt)&&T&&U?_.go(d(!0)?">":"<"):_.go(_.toDest(P),!0),y(!0)}function C(V){var x=n.dragMinThreshold,P=ut(x),U=P&&x.mouse||0,K=(P?x.touch:+x)||10;return he(ee(V))>(ue(V)?K:U)}function j(V){return he(ee(V))>he(ee(V,!0))}function Z(V){if(e.is(at)||!T){var x=ge(V);if(x&&x<Un)return ee(V)/x}return 0}function te(V){return E()+ln(V)*Me(he(V)*(n.flickPower||600),w?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function ee(V,x){return X(V,x)-X(I(V),x)}function ge(V){return an(V)-an(I(V))}function I(V){return W===V&&M||W}function X(V,x){return(ue(V)?V.changedTouches[0]:V)["page"+g(x?"Y":"X")]}function ce(V){return V/(T&&e.is(rt)?ai:1)}function ae(V){var x=n.noDrag;return!pt(V,"."+jr+", ."+qt)&&(!x||!pt(V,x))}function ue(V){return typeof TouchEvent<"u"&&V instanceof TouchEvent}function Se(){return v}function je(V){z=V}return{mount:O,disable:je,isDragging:Se}}var Ai={Spacebar:" ",Right:Ut,Left:Ht,Up:Ir,Down:Lr};function kn(e){return e=Be(e)?e:e.key,Ai[e]||e}var Gn="keydown";function Ii(e,t,n){var r=de(e),o=r.on,a=r.bind,i=r.unbind,s=e.root,l=t.Direction.resolve,p,c;function _(){m(),o(ve,y),o(ve,m),o(Oe,g)}function m(){var E=n.keyboard;E&&(p=E==="global"?window:s,a(p,Gn,$))}function y(){i(p,Gn)}function u(E){c=E}function g(){var E=c;c=!0,ar(function(){c=E})}function $(E){if(!c){var d=kn(E);d===l(Ht)?e.go("<"):d===l(Ut)&&e.go(">")}}return{mount:_,destroy:y,disable:u}}var st=bn+"-lazy",Nt=st+"-srcset",Li="["+st+"], ["+Nt+"]";function ki(e,t,n){var r=de(e),o=r.on,a=r.off,i=r.bind,s=r.emit,l=n.lazyLoad==="sequential",p=[it,Ye],c=[];function _(){n.lazyLoad&&(m(),o(me,m))}function m(){Ve(c),y(),l?E():(a(p),o(p,u),u())}function y(){t.Slides.forEach(function(d){hn(d.slide,Li).forEach(function(h){var W=we(h,st),M=we(h,Nt);if(W!==h.src||M!==h.srcset){var w=n.classes.spinner,v=h.parentElement,T=Ct(v,"."+w)||Qe("span",w,v);c.push([h,d,T]),h.src||ft(h,"none")}})})}function u(){c=c.filter(function(d){var h=n.perPage*((n.preloadPages||1)+1)-1;return d[1].isWithin(e.index,h)?g(d):!0}),c.length||a(p)}function g(d){var h=d[0];Ee(d[1].slide,pn),i(h,"load error",se($,d)),Q(h,"src",we(h,st)),Q(h,"srcset",we(h,Nt)),Te(h,st),Te(h,Nt)}function $(d,h){var W=d[0],M=d[1];Re(M.slide,pn),h.type!=="error"&&(Ue(d[2]),ft(W,""),s(En,W,M),s(nt)),l&&E()}function E(){c.length&&g(c.shift())}return{mount:_,destroy:se(Ve,c),check:u}}function Ri(e,t,n){var r=de(e),o=r.on,a=r.emit,i=r.bind,s=t.Slides,l=t.Elements,p=t.Controller,c=p.hasFocus,_=p.getIndex,m=p.go,y=t.Direction.resolve,u=l.pagination,g=[],$,E;function d(){h(),o([ve,me,Ft],d);var z=n.pagination;u&&ft(u,z?"":"none"),z&&(o([Oe,Dt,Ye],N),W(),N(),a(wr,{list:$,items:g},T(e.index)))}function h(){$&&(Ue(u?ze($.children):$),Re($,E),Ve(g),$=null),r.destroy()}function W(){var z=e.length,L=n.classes,O=n.i18n,F=n.perPage,G=c()?p.getEnd()+1:mt(z/F);$=u||Qe("ul",L.pagination,l.track.parentElement),Ee($,E=Xt+"--"+v()),Q($,Ne,"tablist"),Q($,xe,O.select),Q($,An,v()===Gt?"vertical":"");for(var H=0;H<G;H++){var f=Qe("li",null,$),R=Qe("button",{class:L.page,type:"button"},f),A=s.getIn(H).map(function(C){return C.slide.id}),b=!c()&&F>1?O.pageX:O.slideX;i(R,"click",se(M,H)),n.paginationKeyboard&&i(R,"keydown",se(w,H)),Q(f,Ne,"presentation"),Q(R,Ne,"tab"),Q(R,_t,A.join(" ")),Q(R,xe,sn(b,H+1)),Q(R,et,-1),g.push({li:f,button:R,page:H})}}function M(z){m(">"+z,!0)}function w(z,L){var O=g.length,F=kn(L),G=v(),H=-1;F===y(Ut,!1,G)?H=++z%O:F===y(Ht,!1,G)?H=(--z+O)%O:F==="Home"?H=0:F==="End"&&(H=O-1);var f=g[H];f&&(ur(f.button),m(">"+H),Le(L,!0))}function v(){return n.paginationDirection||n.direction}function T(z){return g[p.toPage(z)]}function N(){var z=T(_(!0)),L=T(_());if(z){var O=z.button;Re(O,Ge),Te(O,zn),Q(O,et,-1)}if(L){var F=L.button;Ee(F,Ge),Q(F,zn,!0),Q(F,et,"")}a($r,{list:$,items:g},z,L)}return{items:g,mount:d,destroy:h,getAt:T,update:N}}var Ni=[" ","Enter"];function Vi(e,t,n){var r=n.isNavigation,o=n.slideFocus,a=[];function i(){e.splides.forEach(function(u){u.isParent||(p(e,u.splide),p(u.splide,e))}),r&&c()}function s(){a.forEach(function(u){u.destroy()}),Ve(a)}function l(){s(),i()}function p(u,g){var $=de(u);$.on(Oe,function(E,d,h){g.go(g.is(at)?h:E)}),a.push($)}function c(){var u=de(e),g=u.on;g(Cn,m),g(Tr,y),g([De,ve],_),a.push(u),u.emit(_n,e.splides)}function _(){Q(t.Elements.list,An,n.direction===Gt?"vertical":"")}function m(u){e.go(u.index)}function y(u,g){yn(Ni,kn(g))&&(m(u),Le(g))}return{setup:se(t.Media.set,{slideFocus:ht(o)?r:o},!0),mount:i,destroy:s,remount:l}}function Oi(e,t,n){var r=de(e),o=r.bind,a=0;function i(){n.wheel&&o(t.Elements.track,"wheel",s,Je)}function s(p){if(p.cancelable){var c=p.deltaY,_=c<0,m=an(p),y=n.wheelMinThreshold||0,u=n.wheelSleep||0;he(c)>y&&m-a>u&&(e.go(_?"<":">"),a=m),l(_)&&Le(p)}}function l(p){return!n.releaseWheel||e.state.is(ot)||t.Controller.getAdjacent(p)!==-1}return{mount:i}}var ji=90;function Fi(e,t,n){var r=de(e),o=r.on,a=t.Elements.track,i=n.live&&!n.isNavigation,s=Qe("span",ti),l=Wt(ji,se(c,!1));function p(){i&&(m(!t.Autoplay.isPaused()),Q(a,Pn,!0),s.textContent="…",o(wn,se(m,!0)),o($n,se(m,!1)),o([it,Ye],se(c,!0)))}function c(y){Q(a,Wn,y),y?(xt(a,s),l.start()):(Ue(s),l.cancel())}function _(){Te(a,[Dn,Pn,Wn]),Ue(s)}function m(y){i&&Q(a,Dn,y?"off":"polite")}return{mount:p,disable:m,destroy:_}}var Bi=Object.freeze({__proto__:null,Media:Go,Direction:Yo,Elements:li,Slides:ci,Layout:ui,Clones:di,Move:gi,Controller:fi,Arrows:vi,Autoplay:bi,Cover:xi,Scroll:Ei,Drag:Ti,Keyboard:Ii,LazyLoad:ki,Pagination:Ri,Sync:Vi,Wheel:Oi,Live:Fi}),Mi={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"},zi={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:oi,i18n:Mi,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Di(e,t,n){var r=t.Slides;function o(){de(e).on([De,me],a)}function a(){r.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function i(s,l){r.style("transition","opacity "+n.speed+"ms "+n.easing),ar(l)}return{mount:o,start:i,cancel:on}}function Wi(e,t,n){var r=t.Move,o=t.Controller,a=t.Scroll,i=t.Elements.list,s=se(_e,i,"transition"),l;function p(){de(e).bind(i,"transitionend",function(y){y.target===i&&l&&(_(),l())})}function c(y,u){var g=r.toPosition(y,!0),$=r.getPosition(),E=m(y);he(g-$)>=1&&E>=1?n.useScroll?a.scroll(g,E,!1,u):(s("transform "+E+"ms "+n.easing),r.translate(g,!0),l=u):(r.jump(y),u())}function _(){s(""),a.cancel()}function m(y){var u=n.rewindSpeed;if(e.is(rt)&&u){var g=o.getIndex(!0),$=o.getEnd();if(g===0&&y>=$||g>=$&&y===0)return u}return n.speed}return{mount:p,start:c,cancel:_}}var Pi=(function(){function e(n,r){this.event=de(),this.Components={},this.state=Ho(Ze),this.splides=[],this._o={},this._E={};var o=Be(n)?dr(document,n):n;lt(o,o+" is invalid."),this.root=o,r=Fe({label:we(o,xe)||"",labelledby:we(o,Tn)||""},zi,e.defaults,r||{});try{Fe(r,JSON.parse(we(o,bn)))}catch{lt(!1,"Invalid JSON")}this._o=Object.create(Fe({},r))}var t=e.prototype;return t.mount=function(r,o){var a=this,i=this.state,s=this.Components;lt(i.is([Ze,Vt]),"Already mounted!"),i.set(Ze),this._C=s,this._T=o||this._T||(this.is(wt)?Di:Wi),this._E=r||this._E;var l=gt({},Bi,this._E,{Transition:this._T});return He(l,function(p,c){var _=p(a,s,a._o);s[c]=_,_.setup&&_.setup()}),He(s,function(p){p.mount&&p.mount()}),this.emit(De),Ee(this.root,ni),i.set(tt),this.emit(cn),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(tt)&&(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(ze(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(me),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,a=this.state;return a.is(Ze)?de(this).on(cn,this.destroy.bind(this,r)):(He(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(Sn),o.destroy(),r&&Ve(this.splides),a.set(Vt)),this},Mo(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})(),Rn=Pi;Rn.defaults={};Rn.STATES=Do;var Yn=[[De,"onMounted"],[cn,"onReady"],[Oe,"onMove"],[it,"onMoved"],[Cn,"onClick"],[mr,"onActive"],[yr,"onInactive"],[vr,"onVisible"],[hr,"onHidden"],[me,"onRefresh"],[ve,"onUpdated"],[nt,"onResize"],[zt,"onResized"],[br,"onDrag"],[xr,"onDragging"],[Cr,"onDragged"],[Dt,"onScroll"],[Ye,"onScrolled"],[Sn,"onDestroy"],[Sr,"onArrowsMounted"],[_r,"onArrowsUpdated"],[wr,"onPaginationMounted"],[$r,"onPaginationUpdated"],[_n,"onNavigationMounted"],[wn,"onAutoplayPlay"],[Er,"onAutoplayPlaying"],[$n,"onAutoplayPause"],[En,"onLazyLoadLoaded"]];function Nn(...e){return e.filter(Boolean).join(" ")}function Bt(e){return e!==null&&typeof e=="object"}function dn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!dn(n,t[r]));if(Bt(e)&&Bt(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!dn(e[o],t[o]))}return e===t}function Hi(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function Ui(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 gn(e,t){const n=e;return Ui(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Bt(r)?n[o]=gn(Bt(n[o])?n[o]:{},r):n[o]=r}),n}var Gi=({children:e,className:t,...n})=>D.createElement("div",{className:Nn("splide__track",t),...n},D.createElement("ul",{className:"splide__list"},e)),Wr=class extends D.Component{constructor(){super(...arguments),this.splideRef=D.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Rn(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=gn({},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&&!dn(this.options,e)&&(this.splide.options=e,this.options=gn({},e));const t=this.getSlides();Hi(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){Yn.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 D.createElement(t,{className:Nn("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yn.map(a=>a[1])])},n?D.createElement(Gi,null,r):r)}},Pr=({children:e,className:t,...n})=>D.createElement("li",{className:Nn("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),j=require("react"),dt=require("classnames"),F=require("./useScopedStyles-DpVdqfXj.js"),pr=require("react-dom");function dr(t){return t.type==="object"&&t.version===1}const gr="ControlSlider-module__wrapper___sHEkd",mr="ControlSlider-module__hoverArrow___A-dOH",fr="ControlSlider-module__sliderItem___QQSkR",hr="ControlSlider-module__sliderImage___9hRl-",vr="ControlSlider-module__arrow___05ghY",yr="ControlSlider-module__arrowVertical___tBfVN",br="ControlSlider-module__nextArrow___-30Yc",Sr="ControlSlider-module__arrowInner___aEra3",xr="ControlSlider-module__arrowIcon___S4ztF",Cr="ControlSlider-module__arrowImg___2dwJW",$r="ControlSlider-module__mirror___brd6U",_r="ControlSlider-module__pagination___bicLF",wr="ControlSlider-module__paginationInner___bT-P-",Tr="ControlSlider-module__paginationVertical___zYqKw",Er="ControlSlider-module__paginationItem___nTRbk",Lr="ControlSlider-module__dot___p1Qun",Ar="ControlSlider-module__activeDot___LHFaj",Ir="ControlSlider-module__paginationInsideBottom___R3FWn",kr="ControlSlider-module__paginationInsideTop___V-qb-",Fr="ControlSlider-module__paginationOutsideBottom___14w8D",Rr="ControlSlider-module__paginationOutsideTop___SCLqB",Br="ControlSlider-module__paginationInsideLeft___yOBRZ",Vr="ControlSlider-module__paginationInsideRight___Rtt3o",Or="ControlSlider-module__paginationOutsideLeft___lahaw",Pr="ControlSlider-module__paginationOutsideRight___EtuQa",Nr="ControlSlider-module__imgWrapper___UjEgB",Wr="ControlSlider-module__captionBlock___dJ6-j",zr="ControlSlider-module__captionTextWrapper___HFlpf",jr="ControlSlider-module__captionText___uGBVc",Mr="ControlSlider-module__active___WZK4G",Hr="ControlSlider-module__withPointerEvents___t-18M",Dr="ControlSlider-module__topLeftAlignment___zjnGM",Ur="ControlSlider-module__topCenterAlignment___gD1xW",Yr="ControlSlider-module__topRightAlignment___NMapS",Gr="ControlSlider-module__middleLeftAlignment___OnUrY",qr="ControlSlider-module__middleCenterAlignment___Tdkl0",Xr="ControlSlider-module__middleRightAlignment___wEbfX",Kr="ControlSlider-module__bottomLeftAlignment___cTP2-",Jr="ControlSlider-module__bottomCenterAlignment___c54fB",Zr="ControlSlider-module__bottomRightAlignment___kEwrz",Qr="ControlSlider-module__clickOverlay___DZA28",ti="ControlSlider-module__contain___pLyq7",ei="ControlSlider-module__cover___KdDat",Y={wrapper:gr,hoverArrow:mr,sliderItem:fr,sliderImage:hr,arrow:vr,arrowVertical:yr,nextArrow:br,arrowInner:Sr,arrowIcon:xr,arrowImg:Cr,mirror:$r,pagination:_r,paginationInner:wr,paginationVertical:Tr,paginationItem:Er,dot:Lr,activeDot:Ar,paginationInsideBottom:Ir,paginationInsideTop:kr,paginationOutsideBottom:Fr,paginationOutsideTop:Rr,paginationInsideLeft:Br,paginationInsideRight:Vr,paginationOutsideLeft:Or,paginationOutsideRight:Pr,imgWrapper:Nr,captionBlock:Wr,captionTextWrapper:zr,captionText:jr,active:Mr,withPointerEvents:Hr,topLeftAlignment:Dr,topCenterAlignment:Ur,topRightAlignment:Yr,middleLeftAlignment:Gr,middleCenterAlignment:qr,middleRightAlignment:Xr,bottomLeftAlignment:Kr,bottomCenterAlignment:Jr,bottomRightAlignment:Zr,clickOverlay:Qr,contain:ti,cover:ei};function ni(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function oi(t,e,n){return e&&ni(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Zn="(prefers-reduced-motion: reduce)",ue=1,ri=2,me=3,ve=4,ke=5,Ue=6,Xe=7,ii={CREATED:ue,MOUNTED:ri,IDLE:me,MOVING:ve,SCROLLING:ke,DRAGGING:Ue,DESTROYED:Xe};function zt(t){t.length=0}function qt(t,e,n){return Array.prototype.slice.call(t,e,n)}function at(t){return t.bind.apply(t,[null].concat(qt(arguments,1)))}var So=setTimeout,bn=function(){};function Qn(t){return requestAnimationFrame(t)}function tn(t,e){return typeof e===t}function _e(t){return!An(t)&&tn("object",t)}var Ln=Array.isArray,xo=at(tn,"function"),Yt=at(tn,"string"),Fe=at(tn,"undefined");function An(t){return t===null}function Co(t){try{return t instanceof(t.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Re(t){return Ln(t)?t:[t]}function Tt(t,e){Re(t).forEach(e)}function In(t,e){return t.indexOf(e)>-1}function Ye(t,e){return t.push.apply(t,Re(e)),t}function Pt(t,e,n){t&&Tt(e,function(o){o&&t.classList[n?"add":"remove"](o)})}function Rt(t,e){Pt(t,Yt(e)?e.split(" "):e,!0)}function Be(t,e){Tt(e,t.appendChild.bind(t))}function kn(t,e){Tt(t,function(n){var o=(e||n).parentNode;o&&o.insertBefore(n,e)})}function we(t,e){return Co(t)&&(t.msMatchesSelector||t.matches).call(t,e)}function $o(t,e){var n=t?qt(t.children):[];return e?n.filter(function(o){return we(o,e)}):n}function Ve(t,e){return e?$o(t,e)[0]:t.firstElementChild}var Te=Object.keys;function te(t,e,n){return t&&(n?Te(t).reverse():Te(t)).forEach(function(o){o!=="__proto__"&&e(t[o],o)}),t}function Ee(t){return qt(arguments,1).forEach(function(e){te(e,function(n,o){t[o]=e[o]})}),t}function Ut(t){return qt(arguments,1).forEach(function(e){te(e,function(n,o){Ln(n)?t[o]=n.slice():_e(n)?t[o]=Ut({},_e(t[o])?t[o]:{},n):t[o]=n})}),t}function to(t,e){Tt(e||Te(t),function(n){delete t[n]})}function Bt(t,e){Tt(t,function(n){Tt(e,function(o){n&&n.removeAttribute(o)})})}function Z(t,e,n){_e(e)?te(e,function(o,r){Z(t,r,o)}):Tt(t,function(o){An(n)||n===""?Bt(o,e):o.setAttribute(e,String(n))})}function pe(t,e,n){var o=document.createElement(t);return e&&(Yt(e)?Rt(o,e):Z(o,e)),n&&Be(n,o),o}function Lt(t,e,n){if(Fe(n))return getComputedStyle(t)[e];An(n)||(t.style[e]=""+n)}function Le(t,e){Lt(t,"display",e)}function _o(t){t.setActive&&t.setActive()||t.focus({preventScroll:!0})}function At(t,e){return t.getAttribute(e)}function eo(t,e){return t&&t.classList.contains(e)}function _t(t){return t.getBoundingClientRect()}function ee(t){Tt(t,function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}function wo(t){return Ve(new DOMParser().parseFromString(t,"text/html").body)}function Ot(t,e){t.preventDefault(),e&&(t.stopPropagation(),t.stopImmediatePropagation())}function To(t,e){return t&&t.querySelector(e)}function Fn(t,e){return e?qt(t.querySelectorAll(e)):[]}function Nt(t,e){Pt(t,e,!1)}function Sn(t){return t.timeStamp}function Zt(t){return Yt(t)?t:t?t+"px":""}var Oe="splide",Rn="data-"+Oe;function Ce(t,e){if(!t)throw new Error("["+Oe+"] "+(e||""))}var Gt=Math.min,Ke=Math.max,Je=Math.floor,Ae=Math.ceil,xt=Math.abs;function Eo(t,e,n){return xt(t-e)<n}function Ge(t,e,n,o){var r=Gt(e,n),a=Ke(e,n);return o?r<t&&t<a:r<=t&&t<=a}function se(t,e,n){var o=Gt(e,n),r=Ke(e,n);return Gt(Ke(o,t),r)}function xn(t){return+(t>0)-+(t<0)}function Cn(t,e){return Tt(e,function(n){t=t.replace("%s",""+n)}),t}function Bn(t){return t<10?"0"+t:""+t}var no={};function ai(t){return""+t+Bn(no[t]=(no[t]||0)+1)}function Lo(){var t=[];function e(i,c,l,p){r(i,c,function(s,w,v){var m="addEventListener"in s,u=m?s.removeEventListener.bind(s,w,l,p):s.removeListener.bind(s,l);m?s.addEventListener(w,l,p):s.addListener(l),t.push([s,w,v,l,u])})}function n(i,c,l){r(i,c,function(p,s,w){t=t.filter(function(v){return v[0]===p&&v[1]===s&&v[2]===w&&(!l||v[3]===l)?(v[4](),!1):!0})})}function o(i,c,l){var p,s=!0;return typeof CustomEvent=="function"?p=new CustomEvent(c,{bubbles:s,detail:l}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(c,s,!1,l)),i.dispatchEvent(p),p}function r(i,c,l){Tt(i,function(p){p&&Tt(c,function(s){s.split(" ").forEach(function(w){var v=w.split(".");l(p,v[0],v[1])})})})}function a(){t.forEach(function(i){i[4]()}),zt(t)}return{bind:e,unbind:n,dispatch:o,destroy:a}}var Xt="mounted",$n="ready",jt="move",ye="moved",Vn="click",Ao="active",Io="inactive",ko="visible",Fo="hidden",vt="refresh",St="updated",fe="resize",en="resized",Ro="drag",Bo="dragging",Vo="dragged",nn="scroll",oe="scrolled",li="overflow",On="destroy",Oo="arrows:mounted",Po="arrows:updated",No="pagination:mounted",Wo="pagination:updated",Pn="navigation:mounted",Nn="autoplay:play",zo="autoplay:playing",Wn="autoplay:pause",zn="lazyload:loaded",jo="sk",Mo="sh",Ze="ei";function gt(t){var e=t?t.event.bus:document.createDocumentFragment(),n=Lo();function o(a,i){n.bind(e,Re(a).join(" "),function(c){i.apply(i,Ln(c.detail)?c.detail:[])})}function r(a){n.dispatch(e,a,qt(arguments,1))}return t&&t.event.on(On,n.destroy),Ee(n,{bus:e,on:o,off:at(n.unbind,e),emit:r})}function on(t,e,n,o){var r=Date.now,a,i=0,c,l=!0,p=0;function s(){if(!l){if(i=t?Gt((r()-a)/t,1):1,n&&n(i),i>=1&&(e(),a=r(),o&&++p>=o))return v();c=Qn(s)}}function w(b){b||u(),a=r()-(b?i*t:0),l=!1,c=Qn(s)}function v(){l=!0}function m(){a=r(),i=0,n&&n(i)}function u(){c&&cancelAnimationFrame(c),i=0,c=0,l=!0}function d(b){t=b}function C(){return l}return{start:w,rewind:m,pause:v,cancel:u,set:d,isPaused:C}}function si(t){var e=t;function n(r){e=r}function o(r){return In(Re(r),e)}return{set:n,is:o}}function ci(t,e){var n=on(0,t,null,1);return function(){n.isPaused()&&n.start()}}function ui(t,e,n){var o=t.state,r=n.breakpoints||{},a=n.reducedMotion||{},i=Lo(),c=[];function l(){var u=n.mediaQuery==="min";Te(r).sort(function(d,C){return u?+d-+C:+C-+d}).forEach(function(d){s(r[d],"("+(u?"min":"max")+"-width:"+d+"px)")}),s(a,Zn),w()}function p(u){u&&i.destroy()}function s(u,d){var C=matchMedia(d);i.bind(C,"change",w),c.push([u,C])}function w(){var u=o.is(Xe),d=n.direction,C=c.reduce(function(b,f){return Ut(b,f[1].matches?f[0]:{})},{});to(n),m(C),n.destroy?t.destroy(n.destroy==="completely"):u?(p(!0),t.mount()):d!==n.direction&&t.refresh()}function v(u){matchMedia(Zn).matches&&(u?Ut(n,a):to(n,Te(a)))}function m(u,d,C){Ut(n,u),d&&Ut(Object.getPrototypeOf(n),u),(C||!o.is(ue))&&t.emit(St,n)}return{setup:l,destroy:p,reduce:v,set:m}}var rn="Arrow",an=rn+"Left",ln=rn+"Right",Ho=rn+"Up",Do=rn+"Down",oo="rtl",sn="ttb",gn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ho,ln],ArrowRight:[Do,an]};function pi(t,e,n){function o(a,i,c){c=c||n.direction;var l=c===oo&&!i?1:c===sn?0:-1;return gn[a]&&gn[a][l]||a.replace(/width|left|right/i,function(p,s){var w=gn[p.toLowerCase()][l]||p;return s>0?w.charAt(0).toUpperCase()+w.slice(1):w})}function r(a){return a*(n.direction===oo?1:-1)}return{resolve:o,orient:r}}var Wt="role",de="tabindex",di="disabled",It="aria-",Pe=It+"controls",Uo=It+"current",ro=It+"selected",wt=It+"label",jn=It+"labelledby",Yo=It+"hidden",Mn=It+"orientation",Ie=It+"roledescription",io=It+"live",ao=It+"busy",lo=It+"atomic",Hn=[Wt,de,di,Pe,Uo,wt,jn,Yo,Mn,Ie],Vt=Oe+"__",Kt="is-",mn=Oe,so=Vt+"track",gi=Vt+"list",cn=Vt+"slide",Go=cn+"--clone",mi=cn+"__container",Dn=Vt+"arrows",un=Vt+"arrow",qo=un+"--prev",Xo=un+"--next",pn=Vt+"pagination",Ko=pn+"__page",fi=Vt+"progress",hi=fi+"__bar",vi=Vt+"toggle",yi=Vt+"spinner",bi=Vt+"sr",Si=Kt+"initialized",ne=Kt+"active",Jo=Kt+"prev",Zo=Kt+"next",_n=Kt+"visible",wn=Kt+"loading",Qo=Kt+"focus-in",tr=Kt+"overflow",xi=[ne,_n,Jo,Zo,wn,Qo,tr],Ci={slide:cn,clone:Go,arrows:Dn,arrow:un,prev:qo,next:Xo,pagination:pn,page:Ko,spinner:yi};function $i(t,e){if(xo(t.closest))return t.closest(e);for(var n=t;n&&n.nodeType===1&&!we(n,e);)n=n.parentElement;return n}var _i=5,co=200,er="touchstart mousedown",fn="touchmove mousemove",hn="touchend touchcancel mouseup click";function wi(t,e,n){var o=gt(t),r=o.on,a=o.bind,i=t.root,c=n.i18n,l={},p=[],s=[],w=[],v,m,u;function d(){$(),M(),f()}function C(){r(vt,b),r(vt,d),r(St,f),a(document,er+" keydown",function(h){u=h.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Pt(i,Qo,!!u)})}function b(h){var L=Hn.concat("style");zt(p),Nt(i,s),Nt(v,w),Bt([v,m],L),Bt(i,h?L:["style",Ie])}function f(){Nt(i,s),Nt(v,w),s=T(mn),w=T(so),Rt(i,s),Rt(v,w),Z(i,wt,n.label),Z(i,jn,n.labelledby)}function $(){v=P("."+so),m=Ve(v,"."+gi),Ce(v&&m,"A track/list element is missing."),Ye(p,$o(m,"."+cn+":not(."+Go+")")),te({arrows:Dn,pagination:pn,prev:qo,next:Xo,bar:hi,toggle:vi},function(h,L){l[L]=P("."+h)}),Ee(l,{root:i,track:v,list:m,slides:p})}function M(){var h=i.id||ai(Oe),L=n.role;i.id=h,v.id=v.id||h+"-track",m.id=m.id||h+"-list",!At(i,Wt)&&i.tagName!=="SECTION"&&L&&Z(i,Wt,L),Z(i,Ie,c.carousel),Z(m,Wt,"presentation")}function P(h){var L=To(i,h);return L&&$i(L,"."+mn)===i?L:void 0}function T(h){return[h+"--"+n.type,h+"--"+n.direction,n.drag&&h+"--draggable",n.isNavigation&&h+"--nav",h===mn&&ne]}return Ee(l,{setup:d,mount:C,destroy:b})}var he="slide",be="loop",Ne="fade";function Ti(t,e,n,o){var r=gt(t),a=r.on,i=r.emit,c=r.bind,l=t.Components,p=t.root,s=t.options,w=s.isNavigation,v=s.updateOnMove,m=s.i18n,u=s.pagination,d=s.slideFocus,C=l.Direction.resolve,b=At(o,"style"),f=At(o,wt),$=n>-1,M=Ve(o,"."+mi),P;function T(){$||(o.id=p.id+"-slide"+Bn(e+1),Z(o,Wt,u?"tabpanel":"group"),Z(o,Ie,m.slide),Z(o,wt,f||Cn(m.slideLabel,[e+1,t.length]))),h()}function h(){c(o,"click",at(i,Vn,I)),c(o,"keydown",at(i,jo,I)),a([ye,Mo,oe],k),a(Pn,R),v&&a(jt,W)}function L(){P=!0,r.destroy(),Nt(o,xi),Bt(o,Hn),Z(o,"style",b),Z(o,wt,f||"")}function R(){var _=t.splides.map(function(y){var V=y.splide.Components.Slides.getAt(e);return V?V.slide.id:""}).join(" ");Z(o,wt,Cn(m.slideX,($?n:e)+1)),Z(o,Pe,_),Z(o,Wt,d?"button":""),d&&Bt(o,Ie)}function W(){P||k()}function k(){if(!P){var _=t.index;B(),O(),Pt(o,Jo,e===_-1),Pt(o,Zo,e===_+1)}}function B(){var _=D();_!==eo(o,ne)&&(Pt(o,ne,_),Z(o,Uo,w&&_||""),i(_?Ao:Io,I))}function O(){var _=g(),y=!_&&(!D()||$);if(t.state.is([ve,ke])||Z(o,Yo,y||""),Z(Fn(o,s.focusableNodes||""),de,y?-1:""),d&&Z(o,de,y?-1:0),_!==eo(o,_n)&&(Pt(o,_n,_),i(_?ko:Fo,I)),!_&&document.activeElement===o){var V=l.Slides.getAt(t.index);V&&_o(V.slide)}}function U(_,y,V){Lt(V&&M||o,_,y)}function D(){var _=t.index;return _===e||s.cloneStatus&&_===n}function g(){if(t.is(Ne))return D();var _=_t(l.Elements.track),y=_t(o),V=C("left",!0),X=C("right",!0);return Je(_[V])<=Ae(y[V])&&Je(y[X])<=Ae(_[X])}function A(_,y){var V=xt(_-e);return!$&&(s.rewind||t.is(be))&&(V=Gt(V,t.length-V)),V<=y}var I={index:e,slideIndex:n,slide:o,container:M,isClone:$,mount:T,destroy:L,update:k,style:U,isWithin:A};return I}function Ei(t,e,n){var o=gt(t),r=o.on,a=o.emit,i=o.bind,c=e.Elements,l=c.slides,p=c.list,s=[];function w(){v(),r(vt,m),r(vt,v)}function v(){l.forEach(function(k,B){d(k,B,-1)})}function m(){P(function(k){k.destroy()}),zt(s)}function u(){P(function(k){k.update()})}function d(k,B,O){var U=Ti(t,B,O,k);U.mount(),s.push(U),s.sort(function(D,g){return D.index-g.index})}function C(k){return k?T(function(B){return!B.isClone}):s}function b(k){var B=e.Controller,O=B.toIndex(k),U=B.hasFocus()?1:n.perPage;return T(function(D){return Ge(D.index,O,O+U-1)})}function f(k){return T(k)[0]}function $(k,B){Tt(k,function(O){if(Yt(O)&&(O=wo(O)),Co(O)){var U=l[B];U?kn(O,U):Be(p,O),Rt(O,n.classes.slide),L(O,at(a,fe))}}),a(vt)}function M(k){ee(T(k).map(function(B){return B.slide})),a(vt)}function P(k,B){C(B).forEach(k)}function T(k){return s.filter(xo(k)?k:function(B){return Yt(k)?we(B.slide,k):In(Re(k),B.index)})}function h(k,B,O){P(function(U){U.style(k,B,O)})}function L(k,B){var O=Fn(k,"img"),U=O.length;U?O.forEach(function(D){i(D,"load error",function(){--U||B()})}):B()}function R(k){return k?l.length:s.length}function W(){return s.length>n.perPage}return{mount:w,destroy:m,update:u,register:d,get:C,getIn:b,getAt:f,add:$,remove:M,forEach:P,filter:T,style:h,getLength:R,isEnough:W}}function Li(t,e,n){var o=gt(t),r=o.on,a=o.bind,i=o.emit,c=e.Slides,l=e.Direction.resolve,p=e.Elements,s=p.root,w=p.track,v=p.list,m=c.getAt,u=c.style,d,C,b;function f(){$(),a(window,"resize load",ci(at(i,fe))),r([St,vt],$),r(fe,M)}function $(){d=n.direction===sn,Lt(s,"maxWidth",Zt(n.width)),Lt(w,l("paddingLeft"),P(!1)),Lt(w,l("paddingRight"),P(!0)),M(!0)}function M(I){var _=_t(s);(I||C.width!==_.width||C.height!==_.height)&&(Lt(w,"height",T()),u(l("marginRight"),Zt(n.gap)),u("width",L()),u("height",R(),!0),C=_,i(en),b!==(b=A())&&(Pt(s,tr,b),i(li,b)))}function P(I){var _=n.padding,y=l(I?"right":"left");return _&&Zt(_[y]||(_e(_)?0:_))||"0px"}function T(){var I="";return d&&(I=h(),Ce(I,"height or heightRatio is missing."),I="calc("+I+" - "+P(!1)+" - "+P(!0)+")"),I}function h(){return Zt(n.height||_t(v).width*n.heightRatio)}function L(){return n.autoWidth?null:Zt(n.fixedWidth)||(d?"":W())}function R(){return Zt(n.fixedHeight)||(d?n.autoHeight?null:W():h())}function W(){var I=Zt(n.gap);return"calc((100%"+(I&&" + "+I)+")/"+(n.perPage||1)+(I&&" - "+I)+")"}function k(){return _t(v)[l("width")]}function B(I,_){var y=m(I||0);return y?_t(y.slide)[l("width")]+(_?0:D()):0}function O(I,_){var y=m(I);if(y){var V=_t(y.slide)[l("right")],X=_t(v)[l("left")];return xt(V-X)+(_?0:D())}return 0}function U(I){return O(t.length-1)-O(0)+B(0,I)}function D(){var I=m(0);return I&&parseFloat(Lt(I.slide,l("marginRight")))||0}function g(I){return parseFloat(Lt(w,l("padding"+(I?"Right":"Left"))))||0}function A(){return t.is(Ne)||U(!0)>k()}return{mount:f,resize:M,listSize:k,slideSize:B,sliderSize:U,totalSize:O,getPadding:g,isOverflow:A}}var Ai=2;function Ii(t,e,n){var o=gt(t),r=o.on,a=e.Elements,i=e.Slides,c=e.Direction.resolve,l=[],p;function s(){r(vt,w),r([St,fe],m),(p=C())&&(u(p),e.Layout.resize(!0))}function w(){v(),s()}function v(){ee(l),zt(l),o.destroy()}function m(){var b=C();p!==b&&(p<b||!b)&&o.emit(vt)}function u(b){var f=i.get().slice(),$=f.length;if($){for(;f.length<b;)Ye(f,f);Ye(f.slice(-b),f.slice(0,b)).forEach(function(M,P){var T=P<b,h=d(M.slide,P);T?kn(h,f[0].slide):Be(a.list,h),Ye(l,h),i.register(h,P-b+(T?0:$),M.index)})}}function d(b,f){var $=b.cloneNode(!0);return Rt($,n.classes.clone),$.id=t.root.id+"-clone"+Bn(f+1),$}function C(){var b=n.clones;if(!t.is(be))b=0;else if(Fe(b)){var f=n[c("fixedWidth")]&&e.Layout.slideSize(0),$=f&&Ae(_t(a.track)[c("width")]/f);b=$||n[c("autoWidth")]&&t.length||n.perPage*Ai}return b}return{mount:s,destroy:v}}function ki(t,e,n){var o=gt(t),r=o.on,a=o.emit,i=t.state.set,c=e.Layout,l=c.slideSize,p=c.getPadding,s=c.totalSize,w=c.listSize,v=c.sliderSize,m=e.Direction,u=m.resolve,d=m.orient,C=e.Elements,b=C.list,f=C.track,$;function M(){$=e.Transition,r([Xt,en,St,vt],P)}function P(){e.Controller.isBusy()||(e.Scroll.cancel(),h(t.index),e.Slides.update())}function T(y,V,X,rt){y!==V&&I(y>X)&&(k(),L(W(U(),y>X),!0)),i(ve),a(jt,V,X,y),$.start(V,function(){i(me),a(ye,V,X,y),rt&&rt()})}function h(y){L(O(y,!0))}function L(y,V){if(!t.is(Ne)){var X=V?y:R(y);Lt(b,"transform","translate"+u("X")+"("+X+"px)"),y!==X&&a(Mo)}}function R(y){if(t.is(be)){var V=B(y),X=V>e.Controller.getEnd(),rt=V<0;(rt||X)&&(y=W(y,X))}return y}function W(y,V){var X=y-A(V),rt=v();return y-=d(rt*(Ae(xt(X)/rt)||1))*(V?1:-1),y}function k(){L(U(),!0),$.cancel()}function B(y){for(var V=e.Slides.get(),X=0,rt=1/0,Q=0;Q<V.length;Q++){var ut=V[Q].index,E=xt(O(ut,!0)-y);if(E<=rt)rt=E,X=ut;else break}return X}function O(y,V){var X=d(s(y-1)-g(y));return V?D(X):X}function U(){var y=u("left");return _t(b)[y]-_t(f)[y]+d(p(!1))}function D(y){return n.trimSpace&&t.is(he)&&(y=se(y,0,d(v(!0)-w()))),y}function g(y){var V=n.focus;return V==="center"?(w()-l(y,!0))/2:+V*l(y)||0}function A(y){return O(y?e.Controller.getEnd():0,!!n.trimSpace)}function I(y){var V=d(W(U(),y));return y?V>=0:V<=b[u("scrollWidth")]-_t(f)[u("width")]}function _(y,V){V=Fe(V)?U():V;var X=y!==!0&&d(V)<d(A(!1)),rt=y!==!1&&d(V)>d(A(!0));return X||rt}return{mount:M,move:T,jump:h,translate:L,shift:W,cancel:k,toIndex:B,toPosition:O,getPosition:U,getLimit:A,exceededLimit:_,reposition:P}}function Fi(t,e,n){var o=gt(t),r=o.on,a=o.emit,i=e.Move,c=i.getPosition,l=i.getLimit,p=i.toPosition,s=e.Slides,w=s.isEnough,v=s.getLength,m=n.omitEnd,u=t.is(be),d=t.is(he),C=at(U,!1),b=at(U,!0),f=n.start||0,$,M=f,P,T,h;function L(){R(),r([St,vt,Ze],R),r(en,W)}function R(){P=v(!0),T=n.perMove,h=n.perPage,$=I();var E=se(f,0,m?$:P-1);E!==f&&(f=E,i.reposition())}function W(){$!==I()&&a(Ze)}function k(E,K,ht){if(!ut()){var it=O(E),mt=A(it);mt>-1&&(K||mt!==f)&&(X(mt),i.move(it,mt,M,ht))}}function B(E,K,ht,it){e.Scroll.scroll(E,K,ht,function(){var mt=A(i.toIndex(c()));X(m?Gt(mt,$):mt),it&&it()})}function O(E){var K=f;if(Yt(E)){var ht=E.match(/([+\-<>])(\d+)?/)||[],it=ht[1],mt=ht[2];it==="+"||it==="-"?K=D(f+ +(""+it+(+mt||1)),f):it===">"?K=mt?_(+mt):C(!0):it==="<"&&(K=b(!0))}else K=u?E:se(E,0,$);return K}function U(E,K){var ht=T||(Q()?1:h),it=D(f+ht*(E?-1:1),f,!(T||Q()));return it===-1&&d&&!Eo(c(),l(!E),1)?E?0:$:K?it:A(it)}function D(E,K,ht){if(w()||Q()){var it=g(E);it!==E&&(K=E,E=it,ht=!1),E<0||E>$?!T&&(Ge(0,E,K,!0)||Ge($,K,E,!0))?E=_(y(E)):u?E=ht?E<0?-(P%h||h):P:E:n.rewind?E=E<0?$:0:E=-1:ht&&E!==K&&(E=_(y(K)+(E<K?-1:1)))}else E=-1;return E}function g(E){if(d&&n.trimSpace==="move"&&E!==f)for(var K=c();K===p(E,!0)&&Ge(E,0,t.length-1,!n.rewind);)E<f?--E:++E;return E}function A(E){return u?(E+P)%P||0:E}function I(){for(var E=P-(Q()||u&&T?1:h);m&&E-- >0;)if(p(P-1,!0)!==p(E,!0)){E++;break}return se(E,0,P-1)}function _(E){return se(Q()?E:h*E,0,$)}function y(E){return Q()?Gt(E,$):Je((E>=$?P-1:E)/h)}function V(E){var K=i.toIndex(E);return d?se(K,0,$):K}function X(E){E!==f&&(M=f,f=E)}function rt(E){return E?M:f}function Q(){return!Fe(n.focus)||n.isNavigation}function ut(){return t.state.is([ve,ke])&&!!n.waitForTransition}return{mount:L,go:k,scroll:B,getNext:C,getPrev:b,getAdjacent:U,getEnd:I,setIndex:X,getIndex:rt,toIndex:_,toPage:y,toDest:V,hasFocus:Q,isBusy:ut}}var Ri="http://www.w3.org/2000/svg",Bi="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",ze=40;function Vi(t,e,n){var o=gt(t),r=o.on,a=o.bind,i=o.emit,c=n.classes,l=n.i18n,p=e.Elements,s=e.Controller,w=p.arrows,v=p.track,m=w,u=p.prev,d=p.next,C,b,f={};function $(){P(),r(St,M)}function M(){T(),$()}function P(){var B=n.arrows;B&&!(u&&d)&&R(),u&&d&&(Ee(f,{prev:u,next:d}),Le(m,B?"":"none"),Rt(m,b=Dn+"--"+n.direction),B&&(h(),k(),Z([u,d],Pe,v.id),i(Oo,u,d)))}function T(){o.destroy(),Nt(m,b),C?(ee(w?[u,d]:m),u=d=null):Bt([u,d],Hn)}function h(){r([Xt,ye,vt,oe,Ze],k),a(d,"click",at(L,">")),a(u,"click",at(L,"<"))}function L(B){s.go(B,!0)}function R(){m=w||pe("div",c.arrows),u=W(!0),d=W(!1),C=!0,Be(m,[u,d]),!w&&kn(m,v)}function W(B){var O='<button class="'+c.arrow+" "+(B?c.prev:c.next)+'" type="button"><svg xmlns="'+Ri+'" viewBox="0 0 '+ze+" "+ze+'" width="'+ze+'" height="'+ze+'" focusable="false"><path d="'+(n.arrowPath||Bi)+'" />';return wo(O)}function k(){if(u&&d){var B=t.index,O=s.getPrev(),U=s.getNext(),D=O>-1&&B<O?l.last:l.prev,g=U>-1&&B>U?l.first:l.next;u.disabled=O<0,d.disabled=U<0,Z(u,wt,D),Z(d,wt,g),i(Po,u,d,O,U)}}return{arrows:f,mount:$,destroy:T,update:k}}var Oi=Rn+"-interval";function Pi(t,e,n){var o=gt(t),r=o.on,a=o.bind,i=o.emit,c=on(n.interval,t.go.bind(t,">"),h),l=c.isPaused,p=e.Elements,s=e.Elements,w=s.root,v=s.toggle,m=n.autoplay,u,d,C=m==="pause";function b(){m&&(f(),v&&Z(v,Pe,p.track.id),C||$(),T())}function f(){n.pauseOnHover&&a(w,"mouseenter mouseleave",function(R){u=R.type==="mouseenter",P()}),n.pauseOnFocus&&a(w,"focusin focusout",function(R){d=R.type==="focusin",P()}),v&&a(v,"click",function(){C?$():M(!0)}),r([jt,nn,vt],c.rewind),r(jt,L)}function $(){l()&&e.Slides.isEnough()&&(c.start(!n.resetProgress),d=u=C=!1,T(),i(Nn))}function M(R){R===void 0&&(R=!0),C=!!R,T(),l()||(c.pause(),i(Wn))}function P(){C||(u||d?M(!1):$())}function T(){v&&(Pt(v,ne,!C),Z(v,wt,n.i18n[C?"play":"pause"]))}function h(R){var W=p.bar;W&&Lt(W,"width",R*100+"%"),i(zo,R)}function L(R){var W=e.Slides.getAt(R);c.set(W&&+At(W.slide,Oi)||n.interval)}return{mount:b,destroy:c.cancel,play:$,pause:M,isPaused:l}}function Ni(t,e,n){var o=gt(t),r=o.on;function a(){n.cover&&(r(zn,at(c,!0)),r([Xt,St,vt],at(i,!0)))}function i(l){e.Slides.forEach(function(p){var s=Ve(p.container||p.slide,"img");s&&s.src&&c(l,s,p)})}function c(l,p,s){s.style("background",l?'center/cover no-repeat url("'+p.src+'")':"",!0),Le(p,l?"none":"")}return{mount:a,destroy:at(i,!1)}}var Wi=10,zi=600,ji=.6,Mi=1.5,Hi=800;function Di(t,e,n){var o=gt(t),r=o.on,a=o.emit,i=t.state.set,c=e.Move,l=c.getPosition,p=c.getLimit,s=c.exceededLimit,w=c.translate,v=t.is(he),m,u,d=1;function C(){r(jt,M),r([St,vt],P)}function b(h,L,R,W,k){var B=l();if(M(),R&&(!v||!s())){var O=e.Layout.sliderSize(),U=xn(h)*O*Je(xt(h)/O)||0;h=c.toPosition(e.Controller.toDest(h%O))+U}var D=Eo(B,h,1);d=1,L=D?0:L||Ke(xt(h-B)/Mi,Hi),u=W,m=on(L,f,at($,B,h,k),1),i(ke),a(nn),m.start()}function f(){i(me),u&&u(),a(oe)}function $(h,L,R,W){var k=l(),B=h+(L-h)*T(W),O=(B-k)*d;w(k+O),v&&!R&&s()&&(d*=ji,xt(O)<Wi&&b(p(s(!0)),zi,!1,u,!0))}function M(){m&&m.cancel()}function P(){m&&!m.isPaused()&&(M(),f())}function T(h){var L=n.easingFunc;return L?L(h):1-Math.pow(1-h,4)}return{mount:C,destroy:M,scroll:b,cancel:P}}var ce={passive:!1,capture:!0};function Ui(t,e,n){var o=gt(t),r=o.on,a=o.emit,i=o.bind,c=o.unbind,l=t.state,p=e.Move,s=e.Scroll,w=e.Controller,v=e.Elements.track,m=e.Media.reduce,u=e.Direction,d=u.resolve,C=u.orient,b=p.getPosition,f=p.exceededLimit,$,M,P,T,h,L=!1,R,W,k;function B(){i(v,fn,bn,ce),i(v,hn,bn,ce),i(v,er,U,ce),i(v,"click",A,{capture:!0}),i(v,"dragstart",Ot),r([Xt,St],O)}function O(){var z=n.drag;Mt(!z),T=z==="free"}function U(z){if(R=!1,!W){var S=mt(z);it(z.target)&&(S||!z.button)&&(w.isBusy()?Ot(z,!0):(k=S?v:window,h=l.is([ve,ke]),P=null,i(k,fn,D,ce),i(k,hn,g,ce),p.cancel(),s.cancel(),I(z)))}}function D(z){if(l.is(Ue)||(l.set(Ue),a(Ro)),z.cancelable)if(h){p.translate($+ht(Q(z)));var S=ut(z)>co,H=L!==(L=f());(S||H)&&I(z),R=!0,a(Bo),Ot(z)}else V(z)&&(h=y(z),Ot(z))}function g(z){l.is(Ue)&&(l.set(me),a(Vo)),h&&(_(z),Ot(z)),c(k,fn,D),c(k,hn,g),h=!1}function A(z){!W&&R&&Ot(z,!0)}function I(z){P=M,M=z,$=b()}function _(z){var S=X(z),H=rt(S),G=n.rewind&&n.rewindByDrag;m(!1),T?w.scroll(H,0,n.snap):t.is(Ne)?w.go(C(xn(S))<0?G?"<":"-":G?">":"+"):t.is(he)&&L&&G?w.go(f(!0)?">":"<"):w.go(w.toDest(H),!0),m(!0)}function y(z){var S=n.dragMinThreshold,H=_e(S),G=H&&S.mouse||0,J=(H?S.touch:+S)||10;return xt(Q(z))>(mt(z)?J:G)}function V(z){return xt(Q(z))>xt(Q(z,!0))}function X(z){if(t.is(be)||!L){var S=ut(z);if(S&&S<co)return Q(z)/S}return 0}function rt(z){return b()+xn(z)*Gt(xt(z)*(n.flickPower||600),T?1/0:e.Layout.listSize()*(n.flickMaxPages||1))}function Q(z,S){return K(z,S)-K(E(z),S)}function ut(z){return Sn(z)-Sn(E(z))}function E(z){return M===z&&P||M}function K(z,S){return(mt(z)?z.changedTouches[0]:z)["page"+d(S?"Y":"X")]}function ht(z){return z/(L&&t.is(he)?_i:1)}function it(z){var S=n.noDrag;return!we(z,"."+Ko+", ."+un)&&(!S||!we(z,S))}function mt(z){return typeof TouchEvent<"u"&&z instanceof TouchEvent}function bt(){return h}function Mt(z){W=z}return{mount:B,disable:Mt,isDragging:bt}}var Yi={Spacebar:" ",Right:ln,Left:an,Up:Ho,Down:Do};function Un(t){return t=Yt(t)?t:t.key,Yi[t]||t}var uo="keydown";function Gi(t,e,n){var o=gt(t),r=o.on,a=o.bind,i=o.unbind,c=t.root,l=e.Direction.resolve,p,s;function w(){v(),r(St,m),r(St,v),r(jt,d)}function v(){var b=n.keyboard;b&&(p=b==="global"?window:c,a(p,uo,C))}function m(){i(p,uo)}function u(b){s=b}function d(){var b=s;s=!0,So(function(){s=b})}function C(b){if(!s){var f=Un(b);f===l(an)?t.go("<"):f===l(ln)&&t.go(">")}}return{mount:w,destroy:m,disable:u}}var $e=Rn+"-lazy",qe=$e+"-srcset",qi="["+$e+"], ["+qe+"]";function Xi(t,e,n){var o=gt(t),r=o.on,a=o.off,i=o.bind,c=o.emit,l=n.lazyLoad==="sequential",p=[ye,oe],s=[];function w(){n.lazyLoad&&(v(),r(vt,v))}function v(){zt(s),m(),l?b():(a(p),r(p,u),u())}function m(){e.Slides.forEach(function(f){Fn(f.slide,qi).forEach(function($){var M=At($,$e),P=At($,qe);if(M!==$.src||P!==$.srcset){var T=n.classes.spinner,h=$.parentElement,L=Ve(h,"."+T)||pe("span",T,h);s.push([$,f,L]),$.src||Le($,"none")}})})}function u(){s=s.filter(function(f){var $=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(t.index,$)?d(f):!0}),s.length||a(p)}function d(f){var $=f[0];Rt(f[1].slide,wn),i($,"load error",at(C,f)),Z($,"src",At($,$e)),Z($,"srcset",At($,qe)),Bt($,$e),Bt($,qe)}function C(f,$){var M=f[0],P=f[1];Nt(P.slide,wn),$.type!=="error"&&(ee(f[2]),Le(M,""),c(zn,M,P),c(fe)),l&&b()}function b(){s.length&&d(s.shift())}return{mount:w,destroy:at(zt,s),check:u}}function Ki(t,e,n){var o=gt(t),r=o.on,a=o.emit,i=o.bind,c=e.Slides,l=e.Elements,p=e.Controller,s=p.hasFocus,w=p.getIndex,v=p.go,m=e.Direction.resolve,u=l.pagination,d=[],C,b;function f(){$(),r([St,vt,Ze],f);var W=n.pagination;u&&Le(u,W?"":"none"),W&&(r([jt,nn,oe],R),M(),R(),a(No,{list:C,items:d},L(t.index)))}function $(){C&&(ee(u?qt(C.children):C),Nt(C,b),zt(d),C=null),o.destroy()}function M(){var W=t.length,k=n.classes,B=n.i18n,O=n.perPage,U=s()?p.getEnd()+1:Ae(W/O);C=u||pe("ul",k.pagination,l.track.parentElement),Rt(C,b=pn+"--"+h()),Z(C,Wt,"tablist"),Z(C,wt,B.select),Z(C,Mn,h()===sn?"vertical":"");for(var D=0;D<U;D++){var g=pe("li",null,C),A=pe("button",{class:k.page,type:"button"},g),I=c.getIn(D).map(function(y){return y.slide.id}),_=!s()&&O>1?B.pageX:B.slideX;i(A,"click",at(P,D)),n.paginationKeyboard&&i(A,"keydown",at(T,D)),Z(g,Wt,"presentation"),Z(A,Wt,"tab"),Z(A,Pe,I.join(" ")),Z(A,wt,Cn(_,D+1)),Z(A,de,-1),d.push({li:g,button:A,page:D})}}function P(W){v(">"+W,!0)}function T(W,k){var B=d.length,O=Un(k),U=h(),D=-1;O===m(ln,!1,U)?D=++W%B:O===m(an,!1,U)?D=(--W+B)%B:O==="Home"?D=0:O==="End"&&(D=B-1);var g=d[D];g&&(_o(g.button),v(">"+D),Ot(k,!0))}function h(){return n.paginationDirection||n.direction}function L(W){return d[p.toPage(W)]}function R(){var W=L(w(!0)),k=L(w());if(W){var B=W.button;Nt(B,ne),Bt(B,ro),Z(B,de,-1)}if(k){var O=k.button;Rt(O,ne),Z(O,ro,!0),Z(O,de,"")}a(Wo,{list:C,items:d},W,k)}return{items:d,mount:f,destroy:$,getAt:L,update:R}}var Ji=[" ","Enter"];function Zi(t,e,n){var o=n.isNavigation,r=n.slideFocus,a=[];function i(){t.splides.forEach(function(u){u.isParent||(p(t,u.splide),p(u.splide,t))}),o&&s()}function c(){a.forEach(function(u){u.destroy()}),zt(a)}function l(){c(),i()}function p(u,d){var C=gt(u);C.on(jt,function(b,f,$){d.go(d.is(be)?$:b)}),a.push(C)}function s(){var u=gt(t),d=u.on;d(Vn,v),d(jo,m),d([Xt,St],w),a.push(u),u.emit(Pn,t.splides)}function w(){Z(e.Elements.list,Mn,n.direction===sn?"vertical":"")}function v(u){t.go(u.index)}function m(u,d){In(Ji,Un(d))&&(v(u),Ot(d))}return{setup:at(e.Media.set,{slideFocus:Fe(r)?o:r},!0),mount:i,destroy:c,remount:l}}function Qi(t,e,n){var o=gt(t),r=o.bind,a=0;function i(){n.wheel&&r(e.Elements.track,"wheel",c,ce)}function c(p){if(p.cancelable){var s=p.deltaY,w=s<0,v=Sn(p),m=n.wheelMinThreshold||0,u=n.wheelSleep||0;xt(s)>m&&v-a>u&&(t.go(w?"<":">"),a=v),l(w)&&Ot(p)}}function l(p){return!n.releaseWheel||t.state.is(ve)||e.Controller.getAdjacent(p)!==-1}return{mount:i}}var ta=90;function ea(t,e,n){var o=gt(t),r=o.on,a=e.Elements.track,i=n.live&&!n.isNavigation,c=pe("span",bi),l=on(ta,at(s,!1));function p(){i&&(v(!e.Autoplay.isPaused()),Z(a,lo,!0),c.textContent="…",r(Nn,at(v,!0)),r(Wn,at(v,!1)),r([ye,oe],at(s,!0)))}function s(m){Z(a,ao,m),m?(Be(a,c),l.start()):(ee(c),l.cancel())}function w(){Bt(a,[io,lo,ao]),ee(c)}function v(m){i&&Z(a,io,m?"off":"polite")}return{mount:p,disable:v,destroy:w}}var na=Object.freeze({__proto__:null,Media:ui,Direction:pi,Elements:wi,Slides:Ei,Layout:Li,Clones:Ii,Move:ki,Controller:Fi,Arrows:Vi,Autoplay:Pi,Cover:Ni,Scroll:Di,Drag:Ui,Keyboard:Gi,LazyLoad:Xi,Pagination:Ki,Sync:Zi,Wheel:Qi,Live:ea}),oa={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"},ra={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:Ci,i18n:oa,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ia(t,e,n){var o=e.Slides;function r(){gt(t).on([Xt,vt],a)}function a(){o.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function i(c,l){o.style("transition","opacity "+n.speed+"ms "+n.easing),So(l)}return{mount:r,start:i,cancel:bn}}function aa(t,e,n){var o=e.Move,r=e.Controller,a=e.Scroll,i=e.Elements.list,c=at(Lt,i,"transition"),l;function p(){gt(t).bind(i,"transitionend",function(m){m.target===i&&l&&(w(),l())})}function s(m,u){var d=o.toPosition(m,!0),C=o.getPosition(),b=v(m);xt(d-C)>=1&&b>=1?n.useScroll?a.scroll(d,b,!1,u):(c("transform "+b+"ms "+n.easing),o.translate(d,!0),l=u):(o.jump(m),u())}function w(){c(""),a.cancel()}function v(m){var u=n.rewindSpeed;if(t.is(he)&&u){var d=r.getIndex(!0),C=r.getEnd();if(d===0&&m>=C||d>=C&&m===0)return u}return n.speed}return{mount:p,start:s,cancel:w}}var la=(function(){function t(n,o){this.event=gt(),this.Components={},this.state=si(ue),this.splides=[],this._o={},this._E={};var r=Yt(n)?To(document,n):n;Ce(r,r+" is invalid."),this.root=r,o=Ut({label:At(r,wt)||"",labelledby:At(r,jn)||""},ra,t.defaults,o||{});try{Ut(o,JSON.parse(At(r,Rn)))}catch{Ce(!1,"Invalid JSON")}this._o=Object.create(Ut({},o))}var e=t.prototype;return e.mount=function(o,r){var a=this,i=this.state,c=this.Components;Ce(i.is([ue,Xe]),"Already mounted!"),i.set(ue),this._C=c,this._T=r||this._T||(this.is(Ne)?ia:aa),this._E=o||this._E;var l=Ee({},na,this._E,{Transition:this._T});return te(l,function(p,s){var w=p(a,c,a._o);c[s]=w,w.setup&&w.setup()}),te(c,function(p){p.mount&&p.mount()}),this.emit(Xt),Rt(this.root,Si),i.set(me),this.emit($n),this},e.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(me)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},e.go=function(o){return this._C.Controller.go(o),this},e.on=function(o,r){return this.event.on(o,r),this},e.off=function(o){return this.event.off(o),this},e.emit=function(o){var r;return(r=this.event).emit.apply(r,[o].concat(qt(arguments,1))),this},e.add=function(o,r){return this._C.Slides.add(o,r),this},e.remove=function(o){return this._C.Slides.remove(o),this},e.is=function(o){return this._o.type===o},e.refresh=function(){return this.emit(vt),this},e.destroy=function(o){o===void 0&&(o=!0);var r=this.event,a=this.state;return a.is(ue)?gt(this).on($n,this.destroy.bind(this,o)):(te(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(On),r.destroy(),o&&zt(this.splides),a.set(Xe)),this},oi(t,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),t})(),Yn=la;Yn.defaults={};Yn.STATES=ii;var po=[[Xt,"onMounted"],[$n,"onReady"],[jt,"onMove"],[ye,"onMoved"],[Vn,"onClick"],[Ao,"onActive"],[Io,"onInactive"],[ko,"onVisible"],[Fo,"onHidden"],[vt,"onRefresh"],[St,"onUpdated"],[fe,"onResize"],[en,"onResized"],[Ro,"onDrag"],[Bo,"onDragging"],[Vo,"onDragged"],[nn,"onScroll"],[oe,"onScrolled"],[On,"onDestroy"],[Oo,"onArrowsMounted"],[Po,"onArrowsUpdated"],[No,"onPaginationMounted"],[Wo,"onPaginationUpdated"],[Pn,"onNavigationMounted"],[Nn,"onAutoplayPlay"],[zo,"onAutoplayPlaying"],[Wn,"onAutoplayPause"],[zn,"onLazyLoadLoaded"]];function Gn(...t){return t.filter(Boolean).join(" ")}function Qe(t){return t!==null&&typeof t=="object"}function Tn(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&!t.some((n,o)=>!Tn(n,e[o]));if(Qe(t)&&Qe(e)){const n=Object.keys(t),o=Object.keys(e);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(e,r)||!Tn(t[r],e[r]))}return t===e}function sa(t,e){return t.length===e.length&&!t.some((n,o)=>n!==e[o])}function ca(t,e){if(t){const n=Object.keys(t);for(let o=0;o<n.length;o++){const r=n[o];if(r!=="__proto__"&&e(t[r],r)===!1)break}}return t}function En(t,e){const n=t;return ca(e,(o,r)=>{Array.isArray(o)?n[r]=o.slice():Qe(o)?n[r]=En(Qe(n[r])?n[r]:{},o):n[r]=o}),n}var ua=({children:t,className:e,...n})=>j.createElement("div",{className:Gn("splide__track",e),...n},j.createElement("ul",{className:"splide__list"},t)),nr=class extends j.Component{constructor(){super(...arguments),this.splideRef=j.createRef(),this.slides=[]}componentDidMount(){const{options:t,extensions:e,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Yn(o,t),this.bind(this.splide),this.splide.mount(e,n),this.options=En({},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&&!Tn(this.options,t)&&(this.splide.options=t,this.options=En({},t));const e=this.getSlides();sa(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){po.forEach(([e,n])=>{const o=this.props[n];typeof o=="function"&&t.on(e,(...r)=>{o(t,...r)})})}omit(t,e){return e.forEach(n=>{Object.prototype.hasOwnProperty.call(t,n)&&delete t[n]}),t}render(){const{className:t,tag:e="div",hasTrack:n=!0,children:o,...r}=this.props;return j.createElement(e,{className:Gn("splide",t),ref:this.splideRef,...this.omit(r,["options",...po.map(a=>a[1])])},n?j.createElement(ua,null,o):o)}},or=({children:t,className:e,...n})=>j.createElement("li",{className:Gn("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 Yi="RichTextRenderer-module__link___BWeZ2",qi={link:Yi},Hr=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?S.jsx("a",{className:qi.link,href:r.value,target:r.target,children:t(r.children)},o):S.jsx("span",{style:Xi(r),children:r.text},o));return S.jsx(S.Fragment,{children:e.map((n,r)=>{const o=n.children;return S.jsx("div",{children:t(o)},r)})})};function Xi(e){return{...e.fontFamily&&{fontFamily: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 Ki="SvgImage-module__svg___q3xE-",Ji="SvgImage-module__img___VsTm-",qn={svg:Ki,img:Ji},ct=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r=""})=>{const[o,a]=D.useState(!0);return D.useEffect(()=>{if(typeof window<"u"&&window.CSS){const i=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(i)}},[]),!e.endsWith(".svg")||!o?S.jsx("img",{src:e,alt:"",className:pe(qn.img,r)}):S.jsx("span",{"data-supports-mask":o,className:pe(qn.svg,r),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},Zi={"top-left":q.topLeftAlignment,"top-center":q.topCenterAlignment,"top-right":q.topRightAlignment,"middle-left":q.middleLeftAlignment,"middle-center":q.middleCenterAlignment,"middle-right":q.middleRightAlignment,"bottom-left":q.bottomLeftAlignment,"bottom-center":q.bottomCenterAlignment,"bottom-right":q.bottomRightAlignment};function Qi({settings:e,content:t,styles:n,isEditor:r}){const[o,a]=D.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:p,wordSpacing:c,fontSizeLineHeight:_,textAppearance:m,color:y}=n.imageCaption,[u,g]=D.useState(void 0),[$,E]=D.useState(null),[d,h]=D.useState(0),[W,M]=D.useState(0),{direction:w,transition:v,controls:T,pagination:N,imageCaption:z,triggers:L}=e,O=D.useRef(v.type),{x:F,y:G}=e.controls.offset,H=f=>{o&&o.go(f)};return D.useEffect(()=>{if(!$)return;const f=new ResizeObserver(R=>{if(!o)return;const[A]=R;g({width:Math.round(A.contentRect.width),height:Math.round(A.contentRect.height)})});return f.observe($),()=>f.unobserve($)},[$]),D.useEffect(()=>{!o||O.current===v.type||(M(f=>f+1),O.current=v.type)},[v.type]),S.jsx("div",{className:pe(q.wrapper,{[q.editor]:r}),ref:E,children:S.jsxs("div",{className:q.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&S.jsx("div",{className:pe(q.captionBlock),children:S.jsx("div",{className:q.captionTextWrapper,children:t.map((f,R)=>S.jsx("div",{className:pe(q.captionText,Zi[z.alignment],{[q.withPointerEvents]:R===d&&r,[q.active]:R===d}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":k.scalingValue(i.width,r),letterSpacing:k.scalingValue(l,r),wordSpacing:k.scalingValue(c,r),textAlign:p,fontSize:k.scalingValue(_.fontSize,r),lineHeight:k.scalingValue(_.lineHeight,r),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:y,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:S.jsx("div",{"data-styles":"imageCaption",className:q.captionTextInner,style:{"--link-hover-color":z.linkHoverColor,"--link-color":z.linkColor,position:"relative",top:k.scalingValue(z.offset.y,r),left:k.scalingValue(z.offset.x,r)},children:S.jsx(Hr,{content:f.imageCaption})})},R))})}),S.jsx(Wr,{onMove:f=>{h(f.index)},ref:a,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:w==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,R)=>S.jsx(Pr,{children:S.jsx("div",{className:q.sliderItem,children:S.jsx("div",{className:q.imgWrapper,children:S.jsx("img",{className:pe(q.sliderImage,{[q.contain]:f.image.objectFit==="contain",[q.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},R))},W),T.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:pe(q.arrow,{[q.arrowVertical]:w==="vert",[q.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{onClick:()=>{H("-1")},className:q.arrowInner,style:{transform:`translate(${k.scalingValue(F,r)}, ${k.scalingValue(G*(w==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(ct,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:pe(q.arrowImg,q.mirror)}),!T.arrowsImgUrl&&S.jsx(Xn,{color:T.color,className:pe(q.arrowIcon,q.arrowImg,q.mirror)})]})}),S.jsx("div",{className:pe(q.arrow,q.nextArrow,{[q.arrowVertical]:w==="vert",[q.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{className:q.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${k.scalingValue(F*(w==="horiz"?-1:1),r)}, ${k.scalingValue(G,r)}) scale(${e.controls.scale/100}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(ct,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:q.arrowImg}),!T.arrowsImgUrl&&S.jsx(Xn,{color:T.color,className:pe(q.arrowIcon,q.arrowImg)})]})})]}),L.triggersList.click&&S.jsx("div",{className:q.clickOverlay,onClick:()=>{o&&o.go("+1")}}),N.isActive&&S.jsx("div",{className:pe(q.pagination,{[q.paginationInsideBottom]:N.position==="inside-1"&&w==="horiz",[q.paginationInsideTop]:N.position==="inside-2"&&w==="horiz",[q.paginationOutsideBottom]:N.position==="outside-1"&&w==="horiz",[q.paginationOutsideTop]:N.position==="outside-2"&&w==="horiz",[q.paginationInsideLeft]:N.position==="inside-1"&&w==="vert",[q.paginationInsideRight]:N.position==="inside-2"&&w==="vert",[q.paginationOutsideLeft]:N.position==="outside-1"&&w==="vert",[q.paginationOutsideRight]:N.position==="outside-2"&&w==="vert",[q.paginationVertical]:w==="vert"}),children:S.jsx("div",{className:q.paginationInner,style:{backgroundColor:N.colors[2],transform:`scale(${N.scale/100}) translate(${k.scalingValue(N.offset.x,r)}, ${k.scalingValue(N.offset.y,r)}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:t.map((f,R)=>S.jsx("button",{onClick:()=>{o&&o.go(R)},className:pe(q.paginationItem),children:S.jsx("div",{className:pe(q.dot,{[q.activeDot]:R===d}),style:{backgroundColor:R===d?N.colors[0]:N.colors[1],"--pagination-hover-color":N.hover}})},R))})})]})})}function Xn({color:e,className:t}){return S.jsx("svg",{viewBox:"0 0 10 18",className:t,children:S.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:S.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 ea={element:Qi,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"outside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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"]}},ta="ImageRevealSlider-module__imageRevealSlider___UE5Ob",na="ImageRevealSlider-module__image___Qjt-e",ra="ImageRevealSlider-module__link___N-iLG",oa="ImageRevealSlider-module__cursor___2U03d",qe={imageRevealSlider:ta,image:na,link:ra,cursor:oa};function Kn(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const a=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*a,s=a/2,l=i/2;if(e>=r.x-s&&e<=r.x+s&&t>=r.y-l&&t<=r.y+l)return!0}return!1}function en(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ia(e,t,n,r){let o,a;if(t==="custom"){o=n;const i=await en(e);a=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await en(e);a=i.height/i.width*o}else{const i=await en(e);o=i.width,a=i.height}return{width:o,height:a,finalWidth:`${o}px`}}function aa({settings:e,content:t,isEditor:n}){const[r,o]=D.useState(null),[a,i]=D.useState([]),[s,l]=D.useState(0),p=D.useRef(0),[c,_]=D.useState({x:0,y:0}),[m,y]=D.useState(1),[u,g]=D.useState("none"),$=D.useRef({x:0,y:0}),[E,d]=D.useState(!1),{sizeType:h,imageWidth:W,randomRangeImageWidth:M}=e.imageSize,{revealPosition:w,visible:v}=e.position,{cursorType:T,target:N,defaultCursorScale:z,defaultCursor:L,hoverCursorScale:O,hoverCursor:F}=e.cursor;D.useEffect(()=>{if(!r)return;const f=(b,C)=>{const j=r.getBoundingClientRect(),Z=b-j.left,te=C-j.top;if(_({x:Z,y:te}),T==="system"){g("none"),y(1);return}const ee=Z,ge=te,I=document.elementFromPoint(j.left+ee,j.top+ge);if(I&&I.closest("a")){g("none"),y(1);return}const X=Kn(ee,ge,a)||N==="area"?{img:F??"none",scale:O}:{img:L??"none",scale:z};g(X.img),y(X.scale)},R=b=>{b.stopPropagation(),$.current={x:b.clientX,y:b.clientY},f(b.clientX,b.clientY)},A=()=>{E&&f($.current.x,$.current.y)};return r.addEventListener("mousemove",R),window.addEventListener("scroll",A,!0),()=>{r.removeEventListener("mousemove",R),window.removeEventListener("scroll",A,!0)}},[r,E,c,T,N,F,L,O,z,a]),D.useEffect(()=>{E||(g("none"),y(0))},[E]);const G=async(f,R,A,b={})=>{const{width:C,height:j,finalWidth:Z}=await ia(f.image.url,h,W,M);let te=0,ee=0;w==="same"?(te=R/2,ee=A/2):(te=b.x??Math.random()*R,ee=b.y??Math.random()*A);const ge=Math.min(Math.max(te,C/2),R-C/2),I=Math.min(Math.max(ee,j/2),A-j/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:ge,y:I,width:Z}};D.useEffect(()=>{if(!r||t.length===0)return;const f=r.getBoundingClientRect(),R=f.width,A=f.height,b=[];(async()=>{const j=t[0],Z=await G(j,R,A);b.push(Z),i(b),l(1)})()},[h,W,M,w,r]),D.useEffect(()=>{v==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[v]);const H=async f=>{if(!r)return;const R=r.getBoundingClientRect(),A=f.clientX-R.left,b=f.clientY-R.top;if(N==="image"&&!Kn(A,b,a))return;let C=0,j=0;w==="on Click"?(C=A,j=b):w==="same"?(C=R.width/2,j=R.height/2):(C=Math.random()*R.width,j=Math.random()*R.height);const Z=t[s],te=await G(Z,R.width,R.height,{x:C,y:j});i(ee=>v==="all"?[...ee,te]:[te]),l(ee=>ee>=t.length-1?0:ee+1)};return S.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:qe.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[a.map(f=>S.jsx("div",{className:qe.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:u==="none"?"default":"none"},children:N==="area"&&f.link?S.jsx("a",{href:f.link,target:"_blank",className:qe.link,children:S.jsx("img",{src:f.url,alt:f.name,className:qe.image},f.id)}):S.jsx("img",{src:f.url,alt:f.name,className:qe.image},f.id)},f.id)),E&&S.jsx("div",{className:qe.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const la={element:aa,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{width:"100%",height:"100%"},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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:""}]}}}},sa="LightBox-module__hidden___9s-9x",ca="LightBox-module__heroImage___sTxNF",ua="LightBox-module__background___rm9ml",pa="LightBox-module__editor___4ACaY",da="LightBox-module__contentStyle___Bgnsq",ga="LightBox-module__imageStyle___tLIlB",fa="LightBox-module__imgWrapper___LuFUp",ma="LightBox-module__contain___8-yaS",ya="LightBox-module__cover___hNvOG",va="LightBox-module__caption___b6L2I",ha="LightBox-module__captionTextInner___rCGNH",ba="LightBox-module__lightboxSplide___XFuWC",xa="LightBox-module__arrow___iz38X",Ca="LightBox-module__arrowVertical___Zfz81",Sa="LightBox-module__nextArrow___zkAQN",_a="LightBox-module__arrowInner___p48sW",wa="LightBox-module__arrowIcon___3VaFf",$a="LightBox-module__arrowImg___pNV88",Ea="LightBox-module__mirror___pjeXc",Ta="LightBox-module__thumbsWrapper___GB-nU",Aa="LightBox-module__thumbsContainerVertical___wttk5",Ia="LightBox-module__thumbsContainer___osSma",La="LightBox-module__thumbsAlignStart___MO6tY",ka="LightBox-module__thumbsAlignCenter___Q4sUx",Ra="LightBox-module__thumbsAlignEnd___p4y9R",Na="LightBox-module__thumbItem___HvnF3",Va="LightBox-module__closeButton___g2khP",Oa="LightBox-module__fadeIn___0m5GW",ja="LightBox-module__slideInLeft___gPYwC",Fa="LightBox-module__slideInRight___S-pPp",Ba="LightBox-module__slideInTop___DFdAj",Ma="LightBox-module__slideInBottom___m27kZ",za="LightBox-module__fadeOut___55qBR",Da="LightBox-module__slideOutLeft___NvU7P",Wa="LightBox-module__slideOutRight___SK7eC",Pa="LightBox-module__slideOutTop___Vgg0z",Ha="LightBox-module__slideOutBottom___nJ0Ef",Ua="LightBox-module__scaleSlide___vZriG",B={hidden:sa,heroImage:ca,background:ua,editor:pa,contentStyle:da,imageStyle:ga,imgWrapper:fa,contain:ma,cover:ya,caption:va,captionTextInner:ha,lightboxSplide:ba,arrow:xa,arrowVertical:Ca,nextArrow:Sa,arrowInner:_a,arrowIcon:wa,arrowImg:$a,mirror:Ea,thumbsWrapper:Ta,thumbsContainerVertical:Aa,thumbsContainer:Ia,thumbsAlignStart:La,thumbsAlignCenter:ka,thumbsAlignEnd:Ra,thumbItem:Na,closeButton:Va,fadeIn:Oa,slideInLeft:ja,slideInRight:Fa,slideInTop:Ba,slideInBottom:Ma,fadeOut:za,slideOutLeft:Da,slideOutRight:Wa,slideOutTop:Pa,slideOutBottom:Ha,scaleSlide:Ua},At=(e,t,n)=>{const r={},[o,a]=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"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),o==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), calc(-50% + ${k.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${k.scalingValue(t.x,n)}, calc(-50% + ${k.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), ${k.scalingValue(t.y,n)})`:r.transform=`translate(${k.scalingValue(t.x,n)}, ${k.scalingValue(t.y,n)})`,r};function Ur(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 Jn(e){const t=e.getBoundingClientRect(),n=Ur(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,s=r/o,l=a/i;let p,c;l>s?(p=r,c=r/l):(c=o,p=o*l);const _=t.left+n.left,m=t.top+n.top,y=(r-p)/2+_,u=(o-c)/2+m;return{x:y,y:u,width:p,height:c}}function Zn(e){const t=e.getBoundingClientRect(),n=Ur(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qn(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 Ga(e,t){const n=(()=>{if(e==="fade in")return B.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return B.fadeIn;if(e==="slide in")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return B.fadeOut;if(e==="slide in")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})(),a=(()=>{if(e==="fade in")return B.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:a}}const Ya=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:a})=>{const[i,s]=D.useState(!1),{url:l}=e.thumbnailBlock.cover;return D.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),S.jsxs(S.Fragment,{children:[S.jsx("img",{src:l,alt:"Cover",className:B.heroImage,onClick:()=>s(!0)}),S.jsx(qa,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},qa=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:s})=>{var V;const[l,p]=D.useState(0),[c,_]=D.useState(0),[m,y]=D.useState(!1),[u,g]=D.useState(!1),[$,E]=D.useState({}),d=D.useRef(null),h=D.useRef(null),W=D.useRef(null),M=D.useRef(!1),w=D.useRef(null),v=D.useRef(null),T=D.useRef(null),N=D.useRef(null),z=D.useRef(!1),L=D.useRef(null),[O,F]=D.useState(!1),{appear:G,triggers:H,slider:f,thumbnail:R,controls:A,area:b,caption:C,layout:j}=o.lightboxBlock,{appearClass:Z,backdropAppearClass:te,backdropDisappearClass:ee,disappearClass:ge}=Ga(G.type,G.direction),I=(s==null?void 0:s.itemId)??null;D.useEffect(()=>{const x=()=>{setTimeout(()=>{var U,K;(K=(U=d.current)==null?void 0:U.splide)==null||K.refresh()},16)},P=()=>{_(U=>U+1)};return window.addEventListener("ArticleEditor.Layout:change",x),window.addEventListener("ArticleEditor.ComponentContent:change",P),()=>{window.removeEventListener("ArticleEditor.Layout:change",x),window.removeEventListener("ArticleEditor.ComponentContent:change",P)}},[]),D.useEffect(()=>{if(!e||!R.isActive){F(!1);return}const x=L.current;if(!x)return;const P=()=>{f.direction==="horiz"?F(x.scrollWidth>x.clientWidth):F(x.scrollHeight>x.clientHeight)};P();const U=new ResizeObserver(P);return U.observe(x),()=>U.disconnect()},[e,R.isActive,n.length,$,f.direction]);const X=D.useCallback(()=>{const x=window.matchMedia("(max-width: 768px)").matches,P=Qn(b.color);x&&!i&&P>.9&&(document.body.style.backgroundColor=""),y(!0),M.current=!0;const U=K=>{K.target===w.current&&K.animationName&&(w.current&&v.current&&w.current.removeEventListener("animationend",v.current),v.current=null,M.current&&(M.current=!1,t()),y(!1))};w.current&&(v.current=U,w.current.addEventListener("animationend",U))},[t,b.color,i]),ce=(x,P,U)=>{var K,re;if(x){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?X():(K=d.current)==null||K.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const Y=x.getBoundingClientRect(),J=P-Y.left,oe=U-Y.top,le=Y.width,ie=Y.height;let ye;f.direction==="horiz"?ye=J<le/2?"-1":"+1":ye=oe<ie/2?"-1":"+1",(re=d.current)==null||re.go(ye)}}},ae=x=>{if(z.current){z.current=!1;return}const P=n[l],U=(P==null?void 0:P.image.objectFit)==="cover";let K,re;if("changedTouches"in x&&x.changedTouches.length>0)K=x.changedTouches[0].clientX,re=x.changedTouches[0].clientY;else if("clientX"in x)K=x.clientX,re=x.clientY;else return;let Y;if(U&&W.current){const J=Zn(W.current);Y=K>=J.left&&K<=J.right&&re>=J.top&&re<=J.bottom}else{const J=W.current?Jn(W.current):null;if(!J){x.target===x.currentTarget&&X();return}Y=K>=J.x&&K<=J.x+J.width&&re>=J.y&&re<=J.y+J.height}Y?ce(W.current,K,re):X()},ue=x=>{const P=x.target;(P.classList.contains(B.thumbsWrapper)||P.classList.contains(B.thumbsContainer))&&ae(x)};D.useEffect(()=>{if(!e)return;const x=P=>{var U,K;if(P.key==="Escape"){X();return}if(P.key==="ArrowRight"){p(re=>(re+1)%Math.max(n.length,1)),(U=d.current)==null||U.go("+1");return}P.key==="ArrowLeft"&&(p(re=>(re-1+Math.max(n.length,1))%Math.max(n.length,1)),(K=d.current)==null||K.go("-1"))};return window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x)}},[e,X,n.length]),D.useEffect(()=>{if(e){if(p(0),_(P=>P+1),M.current=!1,y(!1),g(!1),E({}),!I)return;const x=new CustomEvent("page-overlay",{detail:{itemId:I}});window.dispatchEvent(x)}return()=>{w.current&&v.current&&(w.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,I]),D.useEffect(()=>{h.current!==null&&h.current!==f.type&&_(x=>x+1),h.current=f.type},[f.type]),D.useEffect(()=>{if(!e)return;const x=document.body.style.overflow,P=window.matchMedia("(max-width: 768px)").matches,U=Qn(b.color);document.body.style.overflow="hidden",g(!1);const K=Y=>{Y.target===w.current&&!M.current&&Y.animationName&&(P&&!i&&U>.9&&(document.body.style.backgroundColor=b.color),g(!0),w.current&&T.current&&w.current.removeEventListener("animationend",T.current),T.current=null)};w.current&&(T.current=K,w.current.addEventListener("animationend",K));const re=Y=>{const J=Y.target;J&&(J.closest(`.${B.thumbsWrapper}`)||J.closest(`.${B.thumbsContainer}`))||f.type!=="slide"&&Y.preventDefault()};return document.addEventListener("touchmove",re,{passive:!1}),()=>{document.body.style.overflow=x,document.removeEventListener("touchmove",re),w.current&&T.current&&(w.current.removeEventListener("animationend",T.current),T.current=null),g(!1)}},[e,i,b.color,f.type]),D.useEffect(()=>{if(!e)return;const x=P=>{var K,re;if(M.current){P.stopPropagation();return}if(z.current){z.current=!1;return}const U=P.target;if(!(U&&(U.closest(`.${B.thumbsContainer}`)||U.closest(`.${B.thumbItem}`)))){if(f.type==="slide"&&H.type==="drag"&&((re=(K=d.current)==null?void 0:K.splide)!=null&&re.root)){const Y=d.current.splide.root;if(U&&(Y.contains(U)||Y===U))return}if(P.touches.length===0&&P.changedTouches.length>0){const Y=n[l],J=(Y==null?void 0:Y.image.objectFit)==="cover",oe=P.changedTouches[0];let le;if(J&&W.current){const ie=Zn(W.current);le=oe.clientX>=ie.left&&oe.clientX<=ie.right&&oe.clientY>=ie.top&&oe.clientY<=ie.bottom}else{const ie=W.current?Jn(W.current):null;if(!ie)return;le=oe.clientX>=ie.x&&oe.clientX<=ie.x+ie.width&&oe.clientY>=ie.y&&oe.clientY<=ie.y+ie.height}if(!le){P.stopPropagation(),M.current=!0;const ie=ye=>{ye.stopPropagation(),ye.preventDefault(),document.removeEventListener("click",ie,!0)};document.addEventListener("click",ie,!0),X()}}}};return document.addEventListener("touchend",x,{passive:!0}),()=>{document.removeEventListener("touchend",x)}},[e,X,l,n]);const Se=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&H.type==="drag";D.useEffect(()=>{var ye,$t;if(!e||!Se||!(($t=(ye=d.current)==null?void 0:ye.splide)!=null&&$t.root))return;const x=d.current.splide.root,P=30,U=(ne,fe)=>{if(N.current){const Ie=Math.abs(ne-N.current.x),Et=Math.abs(fe-N.current.y);(Ie>0||Et>0)&&(z.current=!0)}},K=ne=>{N.current&&(ne.preventDefault(),U(ne.clientX,ne.clientY))},re=ne=>{N.current&&ne.touches.length>0&&(ne.preventDefault(),U(ne.touches[0].clientX,ne.touches[0].clientY))},Y=(ne,fe)=>{if(!N.current||!d.current){N.current=null;return}const Ie=Math.abs(ne-N.current.x),Et=Math.abs(fe-N.current.y);Et>P&&Et>Ie&&d.current.go(fe<N.current.y?"+1":"-1"),N.current=null},J=ne=>{N.current&&Y(ne.clientX,ne.clientY),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("pointermove",K)},oe=ne=>{if(N.current){if(ne.changedTouches.length>0){const fe=ne.changedTouches[0];Y(fe.clientX,fe.clientY)}document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),document.removeEventListener("touchmove",re)}},le=ne=>{N.current={x:ne.clientX,y:ne.clientY},z.current=!1,document.addEventListener("pointermove",K,{passive:!1}),document.addEventListener("pointerup",J),document.addEventListener("pointercancel",J)},ie=ne=>{ne.touches.length>0&&(N.current={x:ne.touches[0].clientX,y:ne.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",re,{passive:!1}),document.addEventListener("touchend",oe),document.addEventListener("touchcancel",oe))};return x.addEventListener("pointerdown",le),x.addEventListener("touchstart",ie),()=>{x.removeEventListener("pointerdown",le),x.removeEventListener("touchstart",ie),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),N.current=null,z.current=!1}},[e,Se,c]);const je={backgroundColor:b.color,backdropFilter:`blur(${b.blur}px)`,animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Gr.createPortal(S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:i?null:w,className:pe(B.background,m?ee:te,{[B.editor]:i},{[B.hidden]:!e}),style:{...je,...u&&!i&&!m?{position:"absolute"}:{}}}),S.jsxs("div",{ref:i?w:null,className:pe(B.contentStyle,m?ge:Z,{[B.editor]:i},{[B.hidden]:!e}),style:{animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[S.jsx(Wr,{onMove:x=>p(x.index),ref:d,className:B.lightboxSplide,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,direction:f.direction==="horiz"||f.type==="fade"||f.type==="scale"?"ltr":"ttb",pagination:!1,drag:H.type==="drag"&&!Se,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:H.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((x,P)=>{const U=At(j.position,j.offset,i),K=`${k.scalingValue(j.padding.top,i)} ${k.scalingValue(j.padding.right,i)} ${k.scalingValue(j.padding.bottom,i)} ${k.scalingValue(j.padding.left,i)}`,re=f.type==="scale"?(()=>{const{transform:Y,...J}=U;return{...J,position:"absolute",padding:K,boxSizing:"border-box","--position-transform":Y||"none"}})():{...U,position:"absolute",padding:K,boxSizing:"border-box"};return S.jsx(Pr,{children:S.jsx("div",{className:B.imgWrapper,onClick:ae,children:S.jsx("img",{ref:P===l?W:null,className:pe(B.imageStyle,{[B.contain]:x.image.objectFit==="contain",[B.cover]:x.image.objectFit==="cover",[B.scaleSlide]:f.type==="scale"}),src:x.image.url,alt:x.image.name??"",style:{...re,pointerEvents:x.image.objectFit==="contain"?"none":"auto"}})})},P)})},c),A.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:pe(B.arrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(A.offset.x,i)}, ${k.scalingValue(A.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${A.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=d.current)==null?void 0:x.go("-1")},"aria-label":"Previous",children:[A.arrowsImgUrl&&S.jsx(ct,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:pe(B.arrowImg,B.mirror)}),!A.arrowsImgUrl&&S.jsx(er,{color:A.color,className:pe(B.arrowIcon,B.arrowImg,B.mirror)})]})}),S.jsx("div",{className:pe(B.arrow,B.nextArrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(A.offset.x*(f.direction==="horiz"?-1:1),i)}, ${k.scalingValue(A.offset.y,i)}) scale(${A.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=d.current)==null?void 0:x.go("+1")},"aria-label":"Next",children:[A.arrowsImgUrl&&S.jsx(ct,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:B.arrowImg}),!A.arrowsImgUrl&&S.jsx(er,{color:A.color,className:pe(B.arrowIcon,B.arrowImg)})]})})]}),b.closeIconUrl&&(()=>{const x=At(b.closeIconAlign,b.closeIconOffset,i),P=`scale(${b.closeIconScale})`,U=x.transform?`${x.transform} ${P}`:P;return S.jsx("button",{className:B.closeButton,style:{...x,transform:U},onClick:X,"aria-label":"Close lightbox",children:S.jsx(ct,{url:b.closeIconUrl,fill:b.closeIconColor??"#000000",hoverFill:b.closeIconHover??"#cccccc"})})})(),C&&C.isActive&&r.imageCaption&&((V=n[l])==null?void 0:V.imageCaption)&&(()=>{const{widthSettings:x,fontSettings:P,letterSpacing:U,textAlign:K,wordSpacing:re,fontSizeLineHeight:Y,textAppearance:J,color:oe}=r.imageCaption;return S.jsx("div",{className:B.caption,style:{...At(C.alignment,C.offset,i),fontFamily:P.fontFamily,fontWeight:P.fontWeight,fontStyle:P.fontStyle,width:x.sizing==="auto"?"max-content":k.scalingValue(x.width,i),letterSpacing:k.scalingValue(U,i),wordSpacing:k.scalingValue(re,i),textAlign:K,fontSize:k.scalingValue(Y.fontSize,i),lineHeight:k.scalingValue(Y.lineHeight,i),textTransform:J.textTransform??"none",textDecoration:J.textDecoration??"none",fontVariant:J.fontVariant??"normal",color:oe},onClick:le=>le.stopPropagation(),children:S.jsx("div",{"data-styles":"imageCaption",className:B.captionTextInner,style:{"--link-color":C.linkColor,"--link-hover-color":C.linkHoverColor},children:S.jsx(Hr,{content:n[l].imageCaption})})})})(),R.isActive&&(()=>{const[x,P]=R.position.split("-"),U=f.direction==="horiz"?`${x}-left`:R.position,K=At(U,R.offset,i),re=()=>{if(f.direction==="horiz"){if(P==="left")return"flex-start";if(P==="center")return"center";if(P==="right")return"flex-end"}else{if(x==="top")return"flex-start";if(x==="middle")return"center";if(x==="bottom")return"flex-end"}return"flex-start"};return S.jsx("div",{ref:L,className:B.thumbsWrapper,onClick:Y=>ue(Y),style:{position:i?"absolute":"fixed",...K,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:S.jsx("div",{className:pe(B.thumbsContainer,{[B.thumbsContainerVertical]:f.direction==="vert",[B.thumbsAlignStart]:R.align==="start",[B.thumbsAlignCenter]:R.align==="center",[B.thumbsAlignEnd]:R.align==="end"}),style:{gap:k.scalingValue(R.grid.gap,i),justifyContent:O?"flex-start":re()},children:n.map((Y,J)=>{const oe=J===l,le=$[J],ye=R.grid.size*(oe?R.activeState.scale:1),$t=()=>{if(R.fit!=="fit")return{};if(!le)return f.direction==="horiz"?{height:k.scalingValue(ye,i)}:{width:k.scalingValue(ye,i)};const ne=le.width/le.height;if(f.direction==="horiz"){const fe=ye,Ie=fe*ne;return{width:k.scalingValue(Ie,i),height:k.scalingValue(fe,i)}}else{const fe=ye,Ie=fe/ne;return{width:k.scalingValue(fe,i),height:k.scalingValue(Ie,i)}}};return S.jsx("button",{className:B.thumbItem,style:{...f.direction==="horiz"&&R.fit!=="fit"?{height:k.scalingValue(ye,i)}:{},...f.direction==="vert"&&R.fit!=="fit"?{width:k.scalingValue(ye,i)}:{},...R.fit==="cover"?{width:k.scalingValue(ye,i),height:k.scalingValue(ye,i)}:{},...$t(),transition:oe?"all 0.25s ease-out":"none",opacity:oe?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:ne=>{var fe;ne.stopPropagation(),p(J),(fe=d.current)==null||fe.go(J)},onMouseEnter:()=>{var ne;R.triggers==="hov"&&((ne=d.current)==null||ne.go(J))},children:S.jsx("img",{src:Y.image.url,alt:Y.image.name??"",onLoad:ne=>{const fe=ne.currentTarget;fe.naturalWidth&&fe.naturalHeight&&E(Ie=>({...Ie,[J]:{width:fe.naturalWidth,height:fe.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Y.image.name}-${J}`)})})})})()]})]}),document.getElementById(a)):null};function er({color:e,className:t}){return S.jsx("svg",{viewBox:"0 0 10 18",className:t,children:S.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:S.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 Xa={element:Ya,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",minWidth:58,maxWidth:108},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",minWidth:300,maxWidth:550}}},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 Xe(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ka(e){return`
|
|
7
|
-
.${
|
|
6
|
+
*/const pa="RichTextRenderer-module__link___BWeZ2",da={link:pa},rr=({content:t})=>{const e=n=>n.map((o,r)=>o.type==="link"?x.jsx("a",{className:da.link,href:o.value,target:o.target,children:e(o.children)},r):x.jsx("span",{style:ga(o),children:o.text},r));return x.jsx(x.Fragment,{children:t.map((n,o)=>{const r=n.children;return x.jsx("div",{children:e(r)},o)})})};function ga(t){return{...t.fontFamily&&{fontFamily: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 ma="SvgImage-module__svg___q3xE-",fa="SvgImage-module__img___VsTm-",go={svg:ma,img:fa},ha=t=>{const e=t.trim();return e.startsWith("data:image/svg+xml")?!0:(e.split(/[?#]/)[0]??e).endsWith(".svg")},va=t=>`url("${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,ge=({url:t,fill:e="#000000",hoverFill:n="#CCCCCC",className:o=""})=>{const[r,a]=j.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return j.useEffect(()=>{if(typeof window<"u"&&window.CSS){const i=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(i)}},[]),!ha(t)||!r?x.jsx("img",{src:t,alt:"",className:dt(go.img,o)}):x.jsx("span",{"data-supports-mask":r,className:dt(go.svg,o),style:{"--svg":va(t),"--fill":e,"--hover-fill":n}})},ya={"top-left":Y.topLeftAlignment,"top-center":Y.topCenterAlignment,"top-right":Y.topRightAlignment,"middle-left":Y.middleLeftAlignment,"middle-center":Y.middleCenterAlignment,"middle-right":Y.middleRightAlignment,"bottom-left":Y.bottomLeftAlignment,"bottom-center":Y.bottomCenterAlignment,"bottom-right":Y.bottomRightAlignment};function ba({settings:t,content:e,styles:n,isEditor:o}){const[r,a]=j.useState(null),{widthSettings:i,fontSettings:c,letterSpacing:l,textAlign:p,wordSpacing:s,fontSizeLineHeight:w,textAppearance:v,color:m}=n.imageCaption,[u,d]=j.useState(void 0),[C,b]=j.useState(null),[f,$]=j.useState(0),[M,P]=j.useState(0),{direction:T,transition:h,controls:L,pagination:R,imageCaption:W,triggers:k}=t,B=j.useRef(h.type),{x:O,y:U}=t.controls.offset,D=g=>{r&&r.go(g)};return j.useEffect(()=>{if(!C)return;const g=new ResizeObserver(A=>{if(!r)return;const[I]=A;d({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return g.observe(C),()=>g.unobserve(C)},[C]),j.useEffect(()=>{!r||B.current===h.type||(P(g=>g+1),B.current=h.type)},[h.type]),x.jsx("div",{className:dt(Y.wrapper,{[Y.editor]:o}),ref:b,children:x.jsxs("div",{className:Y.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:h.backgroundColor&&h.type==="fade in"?h.backgroundColor:"transparent"},children:[t.imageCaption.isActive&&x.jsx("div",{className:dt(Y.captionBlock),children:x.jsx("div",{className:Y.captionTextWrapper,children:e.map((g,A)=>x.jsx("div",{className:dt(Y.captionText,ya[W.alignment],{[Y.withPointerEvents]:A===f&&o,[Y.active]:A===f}),style:{fontFamily:c.fontFamily,fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:i.sizing==="auto"?"max-content":F.scalingValue(i.width,o),letterSpacing:F.scalingValue(l,o),wordSpacing:F.scalingValue(s,o),textAlign:p,fontSize:F.scalingValue(w.fontSize,o),lineHeight:F.scalingValue(w.lineHeight,o),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:m,transitionDuration:h.duration?`${Math.round(parseInt(h.duration)/2)}ms`:"500ms"},children:x.jsx("div",{"data-styles":"imageCaption",className:Y.captionTextInner,style:{"--link-hover-color":W.linkHoverColor,"--link-color":W.linkColor,position:"relative",top:F.scalingValue(W.offset.y,o),left:F.scalingValue(W.offset.x,o)},children:x.jsx(rr,{content:g.imageCaption})})},A))})}),x.jsx(nr,{onMove:g=>{$(g.index)},ref:a,options:{arrows:!1,speed:h.duration?parseInt(h.duration):500,autoplay:k.autoPlay!==null,...k.autoPlay!==null&&{interval:parseInt(k.autoPlay)*1e3},direction:T==="horiz"||h.type==="fade in"?"ltr":"ttb",pagination:!1,drag:k.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:h.type==="fade in"?"fade":"loop",rewind:!0},children:e.map((g,A)=>x.jsx(or,{children:x.jsx("div",{className:Y.sliderItem,children:x.jsx("div",{className:Y.imgWrapper,children:x.jsx("img",{className:dt(Y.sliderImage,{[Y.contain]:g.image.objectFit==="contain",[Y.cover]:g.image.objectFit==="cover"}),src:g.image.url,alt:g.image.name??""})})})},A))},M),L.isActive&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:dt(Y.arrow,{[Y.arrowVertical]:T==="vert",[Y.hoverArrow]:L.show==="on hover"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:x.jsxs("button",{onClick:()=>{D("-1")},className:Y.arrowInner,style:{transform:`translate(${F.scalingValue(O,o)}, ${F.scalingValue(U*(T==="horiz"?1:-1),o)}) scale(${t.controls.scale/100}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:[L.arrowsImgUrl&&x.jsx(ge,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:dt(Y.arrowImg,Y.mirror)}),!L.arrowsImgUrl&&x.jsx(mo,{color:L.color,className:dt(Y.arrowIcon,Y.arrowImg,Y.mirror)})]})}),x.jsx("div",{className:dt(Y.arrow,Y.nextArrow,{[Y.arrowVertical]:T==="vert",[Y.hoverArrow]:L.show==="on hover"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:x.jsxs("button",{className:Y.arrowInner,onClick:()=>D("+1"),style:{transform:`translate(${F.scalingValue(O*(T==="horiz"?-1:1),o)}, ${F.scalingValue(U,o)}) scale(${t.controls.scale/100}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:[L.arrowsImgUrl&&x.jsx(ge,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:Y.arrowImg}),!L.arrowsImgUrl&&x.jsx(mo,{color:L.color,className:dt(Y.arrowIcon,Y.arrowImg)})]})})]}),k.triggersList.click&&x.jsx("div",{className:Y.clickOverlay,onClick:()=>{r&&r.go("+1")}}),R.isActive&&x.jsx("div",{className:dt(Y.pagination,{[Y.paginationInsideBottom]:R.position==="inside-1"&&T==="horiz",[Y.paginationInsideTop]:R.position==="inside-2"&&T==="horiz",[Y.paginationOutsideBottom]:R.position==="outside-1"&&T==="horiz",[Y.paginationOutsideTop]:R.position==="outside-2"&&T==="horiz",[Y.paginationInsideLeft]:R.position==="inside-1"&&T==="vert",[Y.paginationInsideRight]:R.position==="inside-2"&&T==="vert",[Y.paginationOutsideLeft]:R.position==="outside-1"&&T==="vert",[Y.paginationOutsideRight]:R.position==="outside-2"&&T==="vert",[Y.paginationVertical]:T==="vert"}),children:x.jsx("div",{className:Y.paginationInner,style:{backgroundColor:R.colors[2],transform:`scale(${R.scale/100}) translate(${F.scalingValue(R.offset.x,o)}, ${F.scalingValue(R.offset.y,o)}) rotate(${T==="horiz"?"0deg":"90deg"})`},children:e.map((g,A)=>x.jsx("button",{onClick:()=>{r&&r.go(A)},className:dt(Y.paginationItem),children:x.jsx("div",{className:dt(Y.dot,{[Y.activeDot]:A===f}),style:{backgroundColor:A===f?R.colors[0]:R.colors[1],"--pagination-hover-color":R.hover}})},A))})})]})})}function mo({color:t,className:e}){return x.jsx("svg",{viewBox:"0 0 10 18",className:e,children:x.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:x.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 Sa={element:ba,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"outside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},xa="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Ca="ImageRevealSlider-module__image___Qjt-e",$a="ImageRevealSlider-module__link___N-iLG",_a="ImageRevealSlider-module__cursor___2U03d",le={imageRevealSlider:xa,image:Ca,link:$a,cursor:_a};function fo(t,e,n){for(const o of n){const r=new Image;r.src=o.url;const a=o.width?Number.parseFloat(o.width):r.naturalWidth,i=r.naturalHeight/r.naturalWidth*a,c=a/2,l=i/2;if(t>=o.x-c&&t<=o.x+c&&e>=o.y-l&&e<=o.y+l)return!0}return!1}function vn(t){return new Promise(e=>{const n=new Image;n.src=t,n.onload=()=>{e({width:n.naturalWidth,height:n.naturalHeight})}})}async function wa(t,e,n,o){let r,a;if(e==="custom"){r=n;const i=await vn(t);a=i.height/i.width*r}else if(e==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await vn(t);a=i.height/i.width*r}else{const i=await vn(t);r=i.width,a=i.height}return{width:r,height:a,finalWidth:`${r}px`}}function Ta({settings:t,content:e,isEditor:n}){const[o,r]=j.useState(null),[a,i]=j.useState([]),[c,l]=j.useState(0),p=j.useRef(0),[s,w]=j.useState({x:0,y:0}),[v,m]=j.useState(1),[u,d]=j.useState("none"),C=j.useRef({x:0,y:0}),[b,f]=j.useState(!1),{sizeType:$,imageWidth:M,randomRangeImageWidth:P}=t.imageSize,{revealPosition:T,visible:h}=t.position,{cursorType:L,target:R,defaultCursorScale:W,defaultCursor:k,hoverCursorScale:B,hoverCursor:O}=t.cursor;j.useEffect(()=>{if(!o)return;const g=(_,y)=>{const V=o.getBoundingClientRect(),X=_-V.left,rt=y-V.top;if(w({x:X,y:rt}),L==="system"){d("none"),m(1);return}const Q=X,ut=rt,E=document.elementFromPoint(V.left+Q,V.top+ut);if(E&&E.closest("a")){d("none"),m(1);return}const K=fo(Q,ut,a)||R==="area"?{img:O??"none",scale:B}:{img:k??"none",scale:W};d(K.img),m(K.scale)},A=_=>{_.stopPropagation(),C.current={x:_.clientX,y:_.clientY},g(_.clientX,_.clientY)},I=()=>{b&&g(C.current.x,C.current.y)};return o.addEventListener("mousemove",A),window.addEventListener("scroll",I,!0),()=>{o.removeEventListener("mousemove",A),window.removeEventListener("scroll",I,!0)}},[o,b,s,L,R,O,k,B,W,a]),j.useEffect(()=>{b||(d("none"),m(0))},[b]);const U=async(g,A,I,_={})=>{const{width:y,height:V,finalWidth:X}=await wa(g.image.url,$,M,P);let rt=0,Q=0;T==="same"?(rt=A/2,Q=I/2):(rt=_.x??Math.random()*A,Q=_.y??Math.random()*I);const ut=Math.min(Math.max(rt,y/2),A-y/2),E=Math.min(Math.max(Q,V/2),I-V/2);return{id:p.current++,url:g.image.url,link:g.link,name:g.image.name,x:ut,y:E,width:X}};j.useEffect(()=>{if(!o||e.length===0)return;const g=o.getBoundingClientRect(),A=g.width,I=g.height,_=[];(async()=>{const V=e[0],X=await U(V,A,I);_.push(X),i(_),l(1)})()},[$,M,P,T,o]),j.useEffect(()=>{h==="last One"&&i(g=>g.length>0?[g[g.length-1]]:[])},[h]);const D=async g=>{if(!o)return;const A=o.getBoundingClientRect(),I=g.clientX-A.left,_=g.clientY-A.top;if(R==="image"&&!fo(I,_,a))return;let y=0,V=0;T==="on Click"?(y=I,V=_):T==="same"?(y=A.width/2,V=A.height/2):(y=Math.random()*A.width,V=Math.random()*A.height);const X=e[c],rt=await U(X,A.width,A.height,{x:y,y:V});i(Q=>h==="all"?[...Q,rt]:[rt]),l(Q=>Q>=e.length-1?0:Q+1)};return x.jsxs("div",{ref:r,onClick:D,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:le.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[a.map(g=>x.jsx("div",{className:le.wrapper,style:{top:`${g.y}px`,left:`${g.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:g.width??"auto",height:"auto",cursor:u==="none"?"default":"none"},children:R==="area"&&g.link?x.jsx("a",{href:g.link,target:"_blank",className:le.link,children:x.jsx("img",{src:g.url,alt:g.name,className:le.image},g.id)}):x.jsx("img",{src:g.url,alt:g.name,className:le.image},g.id)},g.id)),b&&x.jsx("div",{className:le.cursor,style:{left:`${s.x}px`,top:`${s.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Ea={element:Ta,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:""}]}}}},La="LightBox-module__hidden___9s-9x",Aa="LightBox-module__heroImage___sTxNF",Ia="LightBox-module__background___rm9ml",ka="LightBox-module__editor___4ACaY",Fa="LightBox-module__contentStyle___Bgnsq",Ra="LightBox-module__imageStyle___tLIlB",Ba="LightBox-module__imgWrapper___LuFUp",Va="LightBox-module__contain___8-yaS",Oa="LightBox-module__cover___hNvOG",Pa="LightBox-module__caption___b6L2I",Na="LightBox-module__captionTextInner___rCGNH",Wa="LightBox-module__lightboxSplide___XFuWC",za="LightBox-module__arrow___iz38X",ja="LightBox-module__arrowVertical___Zfz81",Ma="LightBox-module__nextArrow___zkAQN",Ha="LightBox-module__arrowInner___p48sW",Da="LightBox-module__arrowIcon___3VaFf",Ua="LightBox-module__arrowImg___pNV88",Ya="LightBox-module__mirror___pjeXc",Ga="LightBox-module__thumbsWrapper___GB-nU",qa="LightBox-module__thumbsContainerVertical___wttk5",Xa="LightBox-module__thumbsContainer___osSma",Ka="LightBox-module__thumbsAlignStart___MO6tY",Ja="LightBox-module__thumbsAlignCenter___Q4sUx",Za="LightBox-module__thumbsAlignEnd___p4y9R",Qa="LightBox-module__thumbItem___HvnF3",tl="LightBox-module__closeButton___g2khP",el="LightBox-module__fadeIn___0m5GW",nl="LightBox-module__slideInLeft___gPYwC",ol="LightBox-module__slideInRight___S-pPp",rl="LightBox-module__slideInTop___DFdAj",il="LightBox-module__slideInBottom___m27kZ",al="LightBox-module__fadeOut___55qBR",ll="LightBox-module__slideOutLeft___NvU7P",sl="LightBox-module__slideOutRight___SK7eC",cl="LightBox-module__slideOutTop___Vgg0z",ul="LightBox-module__slideOutBottom___nJ0Ef",pl="LightBox-module__scaleSlide___vZriG",N={hidden:La,heroImage:Aa,background:Ia,editor:ka,contentStyle:Fa,imageStyle:Ra,imgWrapper:Ba,contain:Va,cover:Oa,caption:Pa,captionTextInner:Na,lightboxSplide:Wa,arrow:za,arrowVertical:ja,nextArrow:Ma,arrowInner:Ha,arrowIcon:Da,arrowImg:Ua,mirror:Ya,thumbsWrapper:Ga,thumbsContainerVertical:qa,thumbsContainer:Xa,thumbsAlignStart:Ka,thumbsAlignCenter:Ja,thumbsAlignEnd:Za,thumbItem:Qa,closeButton:tl,fadeIn:el,slideInLeft:nl,slideInRight:ol,slideInTop:rl,slideInBottom:il,fadeOut:al,slideOutLeft:ll,slideOutRight:sl,slideOutTop:cl,slideOutBottom:ul,scaleSlide:pl},je=(t,e,n)=>{const o={},[r,a]=t.split("-");return r==="top"?(o.top="0",o.bottom="auto"):r==="middle"?(o.top="50%",o.bottom="auto"):r==="bottom"&&(o.top="auto",o.bottom="0"),a==="left"?(o.left="0",o.right="auto"):a==="center"?(o.left="50%",o.right="auto"):a==="right"&&(o.left="auto",o.right="0"),r==="middle"&&a==="center"?o.transform=`translate(calc(-50% + ${F.scalingValue(e.x,n)}), calc(-50% + ${F.scalingValue(e.y,n)}))`:r==="middle"?o.transform=`translate(${F.scalingValue(e.x,n)}, calc(-50% + ${F.scalingValue(e.y,n)}))`:a==="center"?o.transform=`translate(calc(-50% + ${F.scalingValue(e.x,n)}), ${F.scalingValue(e.y,n)})`:o.transform=`translate(${F.scalingValue(e.x,n)}, ${F.scalingValue(e.y,n)})`,o};function ir(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 ho(t){const e=t.getBoundingClientRect(),n=ir(t),o=Math.max(0,e.width-n.left-n.right),r=Math.max(0,e.height-n.top-n.bottom),a=t.naturalWidth,i=t.naturalHeight,c=o/r,l=a/i;let p,s;l>c?(p=o,s=o/l):(s=r,p=r*l);const w=e.left+n.left,v=e.top+n.top,m=(o-p)/2+w,u=(r-s)/2+v;return{x:m,y:u,width:p,height:s}}function vo(t){const e=t.getBoundingClientRect(),n=ir(t);return{left:e.left+n.left,right:e.right-n.right,top:e.top+n.top,bottom:e.bottom-n.bottom}}function yo(t){const e=t.match(/rgba?\(([^)]+)\)/);if(e){const o=e[1].split(",").map(r=>parseFloat(r.trim()));return o.length===4?o[3]:1}const n=t.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return t.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function dl(t,e){const n=(()=>{if(t==="fade in")return N.fadeIn;if(t==="slide in"||t==="mix")switch(e){case"left":return N.slideInLeft;case"right":return N.slideInRight;case"top":return N.slideInTop;case"bottom":return N.slideInBottom;default:return N.slideInRight}return N.fadeIn})(),o=(()=>{if(t==="fade in"||t==="mix")return N.fadeIn;if(t==="slide in")switch(e){case"left":return N.slideInLeft;case"right":return N.slideInRight;case"top":return N.slideInTop;case"bottom":return N.slideInBottom;default:return N.slideInRight}return N.fadeIn})(),r=(()=>{if(t==="fade in"||t==="mix")return N.fadeOut;if(t==="slide in")switch(e){case"left":return N.slideOutLeft;case"right":return N.slideOutRight;case"top":return N.slideOutTop;case"bottom":return N.slideOutBottom;default:return N.slideOutRight}return N.fadeOut})(),a=(()=>{if(t==="fade in")return N.fadeOut;if(t==="slide in"||t==="mix")switch(e){case"left":return N.slideOutLeft;case"right":return N.slideOutRight;case"top":return N.slideOutTop;case"bottom":return N.slideOutBottom;default:return N.slideOutRight}return N.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:r,disappearClass:a}}const gl=({settings:t,content:e,styles:n,portalId:o,activeEvent:r,isEditor:a})=>{const[i,c]=j.useState(!1),{url:l}=t.thumbnailBlock.cover;return j.useEffect(()=>{r==="close"&&c(!1),r==="open"&&c(!0)},[r]),x.jsxs(x.Fragment,{children:[x.jsx("img",{src:l,alt:"Cover",className:N.heroImage,onClick:()=>c(!0)}),x.jsx(ml,{isOpen:i,onClose:()=>c(!1),content:e,settings:t,lightboxStyles:n,portalId:o,isEditor:a})]})},ml=({isOpen:t,onClose:e,content:n,lightboxStyles:o,settings:r,portalId:a,isEditor:i,metadata:c})=>{var z;const[l,p]=j.useState(0),[s,w]=j.useState(0),[v,m]=j.useState(!1),[u,d]=j.useState(!1),[C,b]=j.useState({}),f=j.useRef(null),$=j.useRef(null),M=j.useRef(null),P=j.useRef(!1),T=j.useRef(null),h=j.useRef(null),L=j.useRef(null),R=j.useRef(null),W=j.useRef(!1),k=j.useRef(null),[B,O]=j.useState(!1),{appear:U,triggers:D,slider:g,thumbnail:A,controls:I,area:_,caption:y,layout:V}=r.lightboxBlock,{appearClass:X,backdropAppearClass:rt,backdropDisappearClass:Q,disappearClass:ut}=dl(U.type,U.direction),E=(c==null?void 0:c.itemId)??null;j.useEffect(()=>{const S=()=>{setTimeout(()=>{var G,J;(J=(G=f.current)==null?void 0:G.splide)==null||J.refresh()},16)},H=()=>{w(G=>G+1)};return window.addEventListener("ArticleEditor.Layout:change",S),window.addEventListener("ArticleEditor.ComponentContent:change",H),()=>{window.removeEventListener("ArticleEditor.Layout:change",S),window.removeEventListener("ArticleEditor.ComponentContent:change",H)}},[]),j.useEffect(()=>{if(!t||!A.isActive){O(!1);return}const S=k.current;if(!S)return;const H=()=>{g.direction==="horiz"?O(S.scrollWidth>S.clientWidth):O(S.scrollHeight>S.clientHeight)};H();const G=new ResizeObserver(H);return G.observe(S),()=>G.disconnect()},[t,A.isActive,n.length,C,g.direction]);const K=j.useCallback(()=>{const S=window.matchMedia("(max-width: 768px)").matches,H=yo(_.color);S&&!i&&H>.9&&(document.body.style.backgroundColor=""),m(!0),P.current=!0;const G=J=>{J.target===T.current&&J.animationName&&(T.current&&h.current&&T.current.removeEventListener("animationend",h.current),h.current=null,P.current&&(P.current=!1,e()),m(!1))};T.current&&(h.current=G,T.current.addEventListener("animationend",G))},[e,_.color,i]),ht=(S,H,G)=>{var J,ot;if(S){if(D.type==="click"&&D.switch==="image")D.repeat==="close"&&l===n.length-1?K():(J=f.current)==null||J.go("+1");else if(D.type==="click"&&D.switch==="50/50"){const tt=S.getBoundingClientRect(),q=H-tt.left,nt=G-tt.top,yt=tt.width,lt=tt.height;let pt;g.direction==="horiz"?pt=q<yt/2?"-1":"+1":pt=nt<lt/2?"-1":"+1",(ot=f.current)==null||ot.go(pt)}}},it=S=>{if(W.current){W.current=!1;return}const H=n[l],G=(H==null?void 0:H.image.objectFit)==="cover";let J,ot;if("changedTouches"in S&&S.changedTouches.length>0)J=S.changedTouches[0].clientX,ot=S.changedTouches[0].clientY;else if("clientX"in S)J=S.clientX,ot=S.clientY;else return;let tt;if(G&&M.current){const q=vo(M.current);tt=J>=q.left&&J<=q.right&&ot>=q.top&&ot<=q.bottom}else{const q=M.current?ho(M.current):null;if(!q){S.target===S.currentTarget&&K();return}tt=J>=q.x&&J<=q.x+q.width&&ot>=q.y&&ot<=q.y+q.height}tt?ht(M.current,J,ot):K()},mt=S=>{const H=S.target;(H.classList.contains(N.thumbsWrapper)||H.classList.contains(N.thumbsContainer))&&it(S)};j.useEffect(()=>{if(!t)return;const S=H=>{var G,J;if(H.key==="Escape"){K();return}if(H.key==="ArrowRight"){p(ot=>(ot+1)%Math.max(n.length,1)),(G=f.current)==null||G.go("+1");return}H.key==="ArrowLeft"&&(p(ot=>(ot-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=f.current)==null||J.go("-1"))};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}},[t,K,n.length]),j.useEffect(()=>{if(t){if(p(0),w(H=>H+1),P.current=!1,m(!1),d(!1),b({}),!E)return;const S=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(S)}return()=>{T.current&&h.current&&(T.current.removeEventListener("animationend",h.current),h.current=null),d(!1)}},[t,E]),j.useEffect(()=>{$.current!==null&&$.current!==g.type&&w(S=>S+1),$.current=g.type},[g.type]),j.useEffect(()=>{if(!t)return;const S=document.body.style.overflow,H=window.matchMedia("(max-width: 768px)").matches,G=yo(_.color);document.body.style.overflow="hidden",d(!1);const J=tt=>{tt.target===T.current&&!P.current&&tt.animationName&&(H&&!i&&G>.9&&(document.body.style.backgroundColor=_.color),d(!0),T.current&&L.current&&T.current.removeEventListener("animationend",L.current),L.current=null)};T.current&&(L.current=J,T.current.addEventListener("animationend",J));const ot=tt=>{const q=tt.target;q&&(q.closest(`.${N.thumbsWrapper}`)||q.closest(`.${N.thumbsContainer}`))||g.type!=="slide"&&tt.preventDefault()};return document.addEventListener("touchmove",ot,{passive:!1}),()=>{document.body.style.overflow=S,document.removeEventListener("touchmove",ot),T.current&&L.current&&(T.current.removeEventListener("animationend",L.current),L.current=null),d(!1)}},[t,i,_.color,g.type]),j.useEffect(()=>{if(!t)return;const S=H=>{var J,ot;if(P.current){H.stopPropagation();return}if(W.current){W.current=!1;return}const G=H.target;if(!(G&&(G.closest(`.${N.thumbsContainer}`)||G.closest(`.${N.thumbItem}`)))){if(g.type==="slide"&&D.type==="drag"&&((ot=(J=f.current)==null?void 0:J.splide)!=null&&ot.root)){const tt=f.current.splide.root;if(G&&(tt.contains(G)||tt===G))return}if(H.touches.length===0&&H.changedTouches.length>0){const tt=n[l],q=(tt==null?void 0:tt.image.objectFit)==="cover",nt=H.changedTouches[0];let yt;if(q&&M.current){const lt=vo(M.current);yt=nt.clientX>=lt.left&&nt.clientX<=lt.right&&nt.clientY>=lt.top&&nt.clientY<=lt.bottom}else{const lt=M.current?ho(M.current):null;if(!lt)return;yt=nt.clientX>=lt.x&&nt.clientX<=lt.x+lt.width&&nt.clientY>=lt.y&&nt.clientY<=lt.y+lt.height}if(!yt){H.stopPropagation(),P.current=!0;const lt=pt=>{pt.stopPropagation(),pt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0),K()}}}};return document.addEventListener("touchend",S,{passive:!0}),()=>{document.removeEventListener("touchend",S)}},[t,K,l,n]);const bt=(g.type==="scale"||g.type==="fade")&&g.direction==="vert"&&D.type==="drag";j.useEffect(()=>{var pt,kt;if(!t||!bt||!((kt=(pt=f.current)==null?void 0:pt.splide)!=null&&kt.root))return;const S=f.current.splide.root,H=30,G=(et,st)=>{if(R.current){const Ct=Math.abs(et-R.current.x),Ht=Math.abs(st-R.current.y);(Ct>0||Ht>0)&&(W.current=!0)}},J=et=>{R.current&&(et.preventDefault(),G(et.clientX,et.clientY))},ot=et=>{R.current&&et.touches.length>0&&(et.preventDefault(),G(et.touches[0].clientX,et.touches[0].clientY))},tt=(et,st)=>{if(!R.current||!f.current){R.current=null;return}const Ct=Math.abs(et-R.current.x),Ht=Math.abs(st-R.current.y);Ht>H&&Ht>Ct&&f.current.go(st<R.current.y?"+1":"-1"),R.current=null},q=et=>{R.current&&tt(et.clientX,et.clientY),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",q),document.removeEventListener("pointermove",J)},nt=et=>{if(R.current){if(et.changedTouches.length>0){const st=et.changedTouches[0];tt(st.clientX,st.clientY)}document.removeEventListener("touchend",nt),document.removeEventListener("touchcancel",nt),document.removeEventListener("touchmove",ot)}},yt=et=>{R.current={x:et.clientX,y:et.clientY},W.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",q),document.addEventListener("pointercancel",q)},lt=et=>{et.touches.length>0&&(R.current={x:et.touches[0].clientX,y:et.touches[0].clientY},W.current=!1,document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",nt),document.addEventListener("touchcancel",nt))};return S.addEventListener("pointerdown",yt),S.addEventListener("touchstart",lt),()=>{S.removeEventListener("pointerdown",yt),S.removeEventListener("touchstart",lt),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",q),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",nt),document.removeEventListener("touchcancel",nt),R.current=null,W.current=!1}},[t,bt,s]);const Mt={backgroundColor:_.color,backdropFilter:`blur(${_.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(a)?null:pr.createPortal(x.jsxs(x.Fragment,{children:[x.jsx("div",{ref:i?null:T,className:dt(N.background,v?Q:rt,{[N.editor]:i},{[N.hidden]:!t}),style:{...Mt,...u&&!i&&!v?{position:"absolute"}:{}}}),x.jsxs("div",{ref:i?T:null,className:dt(N.contentStyle,v?ut:X,{[N.editor]:i},{[N.hidden]:!t}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[x.jsx(nr,{onMove:S=>p(S.index),ref:f,className:N.lightboxSplide,options:{arrows:!1,speed:g.duration?parseInt(g.duration):500,direction:g.direction==="horiz"||g.type==="fade"||g.type==="scale"?"ltr":"ttb",pagination:!1,drag:D.type==="drag"&&!bt,perPage:1,width:"100%",height:"100%",type:g.type==="fade"||g.type==="scale"?"fade":"loop",padding:0,rewind:D.repeat!=="close",start:0},style:{"--splide-speed":g.duration},children:n.map((S,H)=>{const G=je(V.position,V.offset,i),J=`${F.scalingValue(V.padding.top,i)} ${F.scalingValue(V.padding.right,i)} ${F.scalingValue(V.padding.bottom,i)} ${F.scalingValue(V.padding.left,i)}`,ot=g.type==="scale"?(()=>{const{transform:tt,...q}=G;return{...q,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":tt||"none"}})():{...G,position:"absolute",padding:J,boxSizing:"border-box"};return x.jsx(or,{children:x.jsx("div",{className:N.imgWrapper,onClick:it,children:x.jsx("img",{ref:H===l?M:null,className:dt(N.imageStyle,{[N.contain]:S.image.objectFit==="contain",[N.cover]:S.image.objectFit==="cover",[N.scaleSlide]:g.type==="scale"}),src:S.image.url,alt:S.image.name??"",style:{...ot,pointerEvents:S.image.objectFit==="contain"?"none":"auto"}})})},H)})},s),I.isActive&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:dt(N.arrow,{[N.arrowVertical]:g.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:x.jsxs("button",{className:N.arrowInner,style:{transform:`translate(${F.scalingValue(I.offset.x,i)}, ${F.scalingValue(I.offset.y*(g.direction==="horiz"?1:-1),i)}) scale(${I.scale}) rotate(${g.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var S;return(S=f.current)==null?void 0:S.go("-1")},"aria-label":"Previous",children:[I.arrowsImgUrl&&x.jsx(ge,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:dt(N.arrowImg,N.mirror)}),!I.arrowsImgUrl&&x.jsx(bo,{color:I.color,className:dt(N.arrowIcon,N.arrowImg,N.mirror)})]})}),x.jsx("div",{className:dt(N.arrow,N.nextArrow,{[N.arrowVertical]:g.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:x.jsxs("button",{className:N.arrowInner,style:{transform:`translate(${F.scalingValue(I.offset.x*(g.direction==="horiz"?-1:1),i)}, ${F.scalingValue(I.offset.y,i)}) scale(${I.scale}) rotate(${g.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var S;return(S=f.current)==null?void 0:S.go("+1")},"aria-label":"Next",children:[I.arrowsImgUrl&&x.jsx(ge,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:N.arrowImg}),!I.arrowsImgUrl&&x.jsx(bo,{color:I.color,className:dt(N.arrowIcon,N.arrowImg)})]})})]}),_.closeIconUrl&&(()=>{const S=je(_.closeIconAlign,_.closeIconOffset,i),H=`scale(${_.closeIconScale})`,G=S.transform?`${S.transform} ${H}`:H;return x.jsx("button",{className:N.closeButton,style:{...S,transform:G},onClick:K,"aria-label":"Close lightbox",children:x.jsx(ge,{url:_.closeIconUrl,fill:_.closeIconColor??"#000000",hoverFill:_.closeIconHover??"#cccccc"})})})(),y&&y.isActive&&o.imageCaption&&((z=n[l])==null?void 0:z.imageCaption)&&(()=>{const{widthSettings:S,fontSettings:H,letterSpacing:G,textAlign:J,wordSpacing:ot,fontSizeLineHeight:tt,textAppearance:q,color:nt}=o.imageCaption;return x.jsx("div",{className:N.caption,style:{...je(y.alignment,y.offset,i),fontFamily:H.fontFamily,fontWeight:H.fontWeight,fontStyle:H.fontStyle,width:S.sizing==="auto"?"max-content":F.scalingValue(S.width,i),letterSpacing:F.scalingValue(G,i),wordSpacing:F.scalingValue(ot,i),textAlign:J,fontSize:F.scalingValue(tt.fontSize,i),lineHeight:F.scalingValue(tt.lineHeight,i),textTransform:q.textTransform??"none",textDecoration:q.textDecoration??"none",fontVariant:q.fontVariant??"normal",color:nt},onClick:yt=>yt.stopPropagation(),children:x.jsx("div",{"data-styles":"imageCaption",className:N.captionTextInner,style:{"--link-color":y.linkColor,"--link-hover-color":y.linkHoverColor},children:x.jsx(rr,{content:n[l].imageCaption})})})})(),A.isActive&&(()=>{const[S,H]=A.position.split("-"),G=g.direction==="horiz"?`${S}-left`:A.position,J=je(G,A.offset,i),ot=()=>{if(g.direction==="horiz"){if(H==="left")return"flex-start";if(H==="center")return"center";if(H==="right")return"flex-end"}else{if(S==="top")return"flex-start";if(S==="middle")return"center";if(S==="bottom")return"flex-end"}return"flex-start"};return x.jsx("div",{ref:k,className:N.thumbsWrapper,onClick:tt=>mt(tt),style:{position:i?"absolute":"fixed",...J,...g.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:x.jsx("div",{className:dt(N.thumbsContainer,{[N.thumbsContainerVertical]:g.direction==="vert",[N.thumbsAlignStart]:A.align==="start",[N.thumbsAlignCenter]:A.align==="center",[N.thumbsAlignEnd]:A.align==="end"}),style:{gap:F.scalingValue(A.grid.gap,i),justifyContent:B?"flex-start":ot()},children:n.map((tt,q)=>{const nt=q===l,yt=C[q],pt=A.grid.size*(nt?A.activeState.scale:1),kt=()=>{if(A.fit!=="fit")return{};if(!yt)return g.direction==="horiz"?{height:F.scalingValue(pt,i)}:{width:F.scalingValue(pt,i)};const et=yt.width/yt.height;if(g.direction==="horiz"){const st=pt,Ct=st*et;return{width:F.scalingValue(Ct,i),height:F.scalingValue(st,i)}}else{const st=pt,Ct=st/et;return{width:F.scalingValue(st,i),height:F.scalingValue(Ct,i)}}};return x.jsx("button",{className:N.thumbItem,style:{...g.direction==="horiz"&&A.fit!=="fit"?{height:F.scalingValue(pt,i)}:{},...g.direction==="vert"&&A.fit!=="fit"?{width:F.scalingValue(pt,i)}:{},...A.fit==="cover"?{width:F.scalingValue(pt,i),height:F.scalingValue(pt,i)}:{},...kt(),transition:nt?"all 0.25s ease-out":"none",opacity:nt?A.activeState.opacity/100:A.opacity/100,"--thumb-hover":A.activeState.opacity/100},onClick:et=>{var st;et.stopPropagation(),p(q),(st=f.current)==null||st.go(q)},onMouseEnter:()=>{var et;A.triggers==="hov"&&((et=f.current)==null||et.go(q))},children:x.jsx("img",{src:tt.image.url,alt:tt.image.name??"",onLoad:et=>{const st=et.currentTarget;st.naturalWidth&&st.naturalHeight&&b(Ct=>({...Ct,[q]:{width:st.naturalWidth,height:st.naturalHeight}}))},style:{objectFit:A.fit==="cover"?"cover":"contain",...A.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...A.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${tt.image.name}-${q}`)})})})})()]})]}),document.getElementById(a))};function bo({color:t,className:e}){return x.jsx("svg",{viewBox:"0 0 10 18",className:e,children:x.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:x.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 fl={element:gl,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 Qt(t,e){var n,o,r;return{fontFamily:t.fontSettings.fontFamily,fontWeight:t.fontSettings.fontWeight,fontStyle:t.fontSettings.fontStyle,letterSpacing:F.scalingValue(t.letterSpacing,e),wordSpacing:F.scalingValue(t.wordSpacing,e),fontSize:F.scalingValue(t.fontSize,e),lineHeight:t.lineHeight!==void 0?F.scalingValue(t.lineHeight,e):void 0,textTransform:(n=t.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=t.textAppearance)==null?void 0:o.textDecoration,fontVariant:(r=t.textAppearance)==null?void 0:r.fontVariant,color:t.color}}function Me(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function hl(t){return`
|
|
7
|
+
.${t}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${Me(48)};
|
|
12
12
|
}
|
|
13
|
-
.${
|
|
13
|
+
.${t}-wrapper.${t}-type-C .${t}-input:focus-visible,
|
|
14
|
+
.${t}-wrapper.${t}-type-C .${t}-button:focus-visible {
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
.${t}-form {
|
|
14
18
|
display: flex;
|
|
15
19
|
flex-direction: column;
|
|
16
20
|
width: 100%;
|
|
17
21
|
}
|
|
18
|
-
.${
|
|
22
|
+
.${t}-fields {
|
|
19
23
|
display: flex;
|
|
20
24
|
flex-direction: column;
|
|
21
25
|
flex: 1;
|
|
22
26
|
min-width: 0;
|
|
23
27
|
}
|
|
24
|
-
.${
|
|
28
|
+
.${t}-field-group {
|
|
25
29
|
display: flex;
|
|
26
30
|
flex-direction: column;
|
|
27
31
|
flex: 1;
|
|
28
32
|
min-width: 0;
|
|
29
33
|
}
|
|
30
|
-
.${
|
|
31
|
-
gap: ${
|
|
34
|
+
.${t}-field-group.${t}-labeled {
|
|
35
|
+
gap: ${Me(4)};
|
|
32
36
|
}
|
|
33
|
-
.${
|
|
37
|
+
.${t}-field-label {
|
|
34
38
|
white-space: nowrap;
|
|
35
|
-
color: var(--${
|
|
39
|
+
color: var(--${t}-label-text-color);
|
|
36
40
|
}
|
|
37
|
-
.${
|
|
41
|
+
.${t}-input {
|
|
38
42
|
width: 100%;
|
|
39
43
|
box-sizing: border-box;
|
|
40
|
-
line-height: 1.4;
|
|
41
44
|
outline: none;
|
|
42
|
-
|
|
43
|
-
color: var(--${
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
-webkit-tap-highlight-color: transparent;
|
|
46
|
+
background-color: var(--${t}-input-color);
|
|
47
|
+
color: var(--${t}-input-text-color);
|
|
48
|
+
border-color: var(--${t}-input-border-color);
|
|
49
|
+
transition: color 250ms, border-color 250ms, background-color 250ms;
|
|
50
|
+
}
|
|
51
|
+
.${t}-input::placeholder {
|
|
52
|
+
color: var(--${t}-placeholder-color);
|
|
49
53
|
opacity: 1;
|
|
50
|
-
transition:
|
|
51
|
-
}
|
|
52
|
-
.${
|
|
53
|
-
background-color: var(--${
|
|
54
|
-
color: var(--${
|
|
55
|
-
border-color: var(--${
|
|
56
|
-
}
|
|
57
|
-
.${
|
|
58
|
-
background-color: var(--${
|
|
59
|
-
color: var(--${
|
|
60
|
-
border-color: var(--${
|
|
61
|
-
}
|
|
62
|
-
.${
|
|
63
|
-
.${
|
|
64
|
-
.${
|
|
65
|
-
background-color: var(--${
|
|
66
|
-
color: var(--${
|
|
67
|
-
border-color: var(--${
|
|
68
|
-
}
|
|
69
|
-
.${
|
|
70
|
-
background-color: var(--${
|
|
71
|
-
color: var(--${
|
|
72
|
-
border-color: var(--${
|
|
73
|
-
}
|
|
74
|
-
.${
|
|
75
|
-
.${
|
|
54
|
+
transition: color 250ms, opacity 250ms;
|
|
55
|
+
}
|
|
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-success .${t}-input,
|
|
79
|
+
.${t}-wrapper.${t}-state-success .${t}-button {
|
|
76
80
|
pointer-events: none;
|
|
77
81
|
}
|
|
78
|
-
.${
|
|
82
|
+
.${t}-wrapper.${t}-state-error .${t}-input {
|
|
79
83
|
}
|
|
80
|
-
.${
|
|
84
|
+
.${t}-input[data-field-type="textarea"] {
|
|
81
85
|
resize: vertical;
|
|
82
86
|
}
|
|
83
|
-
.${
|
|
84
|
-
background: #f5f5f5;
|
|
87
|
+
.${t}-input:disabled {
|
|
85
88
|
cursor: not-allowed;
|
|
86
89
|
}
|
|
87
|
-
.${
|
|
90
|
+
.${t}-button {
|
|
88
91
|
cursor: pointer;
|
|
89
92
|
white-space: nowrap;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
outline: none;
|
|
95
|
+
background-color: var(--${t}-button-color);
|
|
96
|
+
color: var(--${t}-button-text-color);
|
|
97
|
+
border-color: var(--${t}-button-border-color);
|
|
98
|
+
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
99
|
+
}
|
|
100
|
+
.${t}-button:hover {
|
|
101
|
+
background-color: var(--${t}-hover-button-color, var(--${t}-button-color));
|
|
102
|
+
color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
103
|
+
border-color: var(--${t}-hover-button-border-color, var(--${t}-button-border-color));
|
|
104
|
+
}
|
|
105
|
+
.${t}-wrapper.${t}-state-hover .${t}-button {
|
|
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}-button:focus,
|
|
111
|
+
.${t}-button:focus-visible,
|
|
112
|
+
.${t}-wrapper.${t}-state-focus .${t}-button {
|
|
113
|
+
background-color: var(--${t}-focus-button-color, var(--${t}-button-color));
|
|
114
|
+
color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
115
|
+
border-color: var(--${t}-focus-button-border-color, var(--${t}-button-border-color));
|
|
116
|
+
}
|
|
117
|
+
.${t}-input:focus-visible,
|
|
118
|
+
.${t}-wrapper.${t}-state-focus .${t}-input {
|
|
119
|
+
outline: none;
|
|
120
|
+
}
|
|
121
|
+
.${t}-button:focus-visible,
|
|
122
|
+
.${t}-wrapper.${t}-state-focus .${t}-button {
|
|
90
123
|
outline: none;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
.${
|
|
97
|
-
|
|
98
|
-
color: var(--${
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
.${e}-wrapper.${e}-state-hover .${e}-button {
|
|
102
|
-
background-color: var(--${e}-hover-button-color, var(--${e}-button-color));
|
|
103
|
-
color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
|
|
104
|
-
border-color: var(--${e}-hover-button-border-color, var(--${e}-button-border-color));
|
|
105
|
-
}
|
|
106
|
-
.${e}-button:focus,
|
|
107
|
-
.${e}-button:focus-visible,
|
|
108
|
-
.${e}-wrapper.${e}-state-focus .${e}-button {
|
|
109
|
-
background-color: var(--${e}-focus-button-color, var(--${e}-button-color));
|
|
110
|
-
color: var(--${e}-focus-button-text-color, var(--${e}-button-text-color));
|
|
111
|
-
border-color: var(--${e}-focus-button-border-color, var(--${e}-button-border-color));
|
|
112
|
-
}
|
|
113
|
-
.${e}-input:focus-visible,
|
|
114
|
-
.${e}-wrapper.${e}-state-focus .${e}-input {
|
|
115
|
-
outline: 1px solid var(--${e}-focus-input-border-color, var(--${e}-input-border-color));
|
|
116
|
-
}
|
|
117
|
-
.${e}-button:focus-visible,
|
|
118
|
-
.${e}-wrapper.${e}-state-focus .${e}-button {
|
|
119
|
-
outline: 1px solid var(--${e}-focus-button-border-color, var(--${e}-button-border-color));
|
|
120
|
-
}
|
|
121
|
-
.${e}-success {
|
|
122
|
-
margin-top: ${Xe(8)};
|
|
123
|
-
font-size: ${Xe(14)};
|
|
124
|
-
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
125
|
-
}
|
|
126
|
-
.${e}-error {
|
|
127
|
-
margin-top: ${Xe(8)};
|
|
128
|
-
font-size: ${Xe(14)};
|
|
129
|
-
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
130
|
-
}
|
|
131
|
-
.${e}-overlay-anchor {
|
|
124
|
+
}
|
|
125
|
+
.${t}-success {
|
|
126
|
+
margin-top: ${Me(8)};
|
|
127
|
+
color: var(--${t}-success-success-color, var(--${t}-success-color));
|
|
128
|
+
}
|
|
129
|
+
.${t}-error {
|
|
130
|
+
margin-top: ${Me(8)};
|
|
131
|
+
color: var(--${t}-error-error-color, var(--${t}-error-color));
|
|
132
|
+
}
|
|
133
|
+
.${t}-overlay-anchor {
|
|
132
134
|
position: relative;
|
|
133
135
|
height: auto;
|
|
134
136
|
}
|
|
135
|
-
`}function
|
|
137
|
+
`}function vl({settings:t,isEditor:e,metadata:n,activeEvent:o}){const{prefix:r}=F.useScopedStyles(),{type:a="A",fieldsToShow:i=2,fields:c=[],buttonLabel:l,gap:p,fieldsGap:s,buttonCorners:w,buttonStroke:v,buttonPadding:m,isButtonFullWidth:u,inputCorners:d,inputStroke:C,inputPadding:b,inputColor:f,inputTextColor:$,inputBorderColor:M,placeholderColor:P,buttonColor:T,buttonTextColor:h,buttonBorderColor:L,labelTextColor:R,successColor:W,errorColor:k,fontFamily:B,inputFontSettings:O,inputFontSize:U,inputLineHeight:D,inputLetterSpacing:g,inputWordSpacing:A,inputTextAppearance:I,buttonFontSettings:_,buttonFontSize:y,buttonLineHeight:V,buttonLetterSpacing:X,buttonWordSpacing:rt,buttonTextAppearance:Q,labelFontSettings:ut,labelFontSize:E,labelLineHeight:K,labelLetterSpacing:ht,labelWordSpacing:it,labelTextAppearance:mt,statusFontSettings:bt,statusFontSize:Mt,statusLineHeight:z,statusLetterSpacing:S,statusWordSpacing:H,statusTextAppearance:G,successMessage:J,errorMessage:ot,stateOverrides:tt}=t,q=a==="B",nt=c.slice(0,Math.min(i,c.length)),yt={fontSettings:{fontFamily:B,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:U??.01,lineHeight:D,letterSpacing:g??0,wordSpacing:A??0,textAppearance:I,color:$},lt=Qt(yt,e),pt=F.scalingValue(C??0,e),kt={...lt,borderStyle:"solid",borderRadius:a==="C"?0:F.scalingValue(d??0,e),...a==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:pt,borderLeftWidth:0}:{borderWidth:pt},paddingTop:F.scalingValue((b==null?void 0:b.top)??0,e),paddingRight:F.scalingValue((b==null?void 0:b.right)??0,e),paddingBottom:F.scalingValue((b==null?void 0:b.bottom)??0,e),paddingLeft:F.scalingValue((b==null?void 0:b.left)??0,e)},et={fontSettings:{fontFamily:B,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:y??.01,lineHeight:V,letterSpacing:X??0,wordSpacing:rt??0,textAppearance:Q,color:h},st=Qt(et,e),Ct=F.scalingValue(v??0,e),Ht={fontSettings:{fontFamily:B,fontWeight:(ut==null?void 0:ut.fontWeight)??400,fontStyle:(ut==null?void 0:ut.fontStyle)??"normal"},fontSize:E??.01,lineHeight:K,letterSpacing:ht??0,wordSpacing:it??0,textAppearance:mt,color:R},ft=Qt(Ht,e),re={fontSettings:{fontFamily:B,fontWeight:(bt==null?void 0:bt.fontWeight)??400,fontStyle:(bt==null?void 0:bt.fontStyle)??"normal"},fontSize:Mt??.01,lineHeight:z,letterSpacing:S??0,wordSpacing:H??0,textAppearance:G,color:W},Jt=Qt(re,e),$t=F.buildColorVars(r,{inputColor:f,inputTextColor:$,inputBorderColor:M,placeholderColor:P!=null&&P.trim()?P:"#cccccc",buttonColor:T,buttonTextColor:h,buttonBorderColor:L,labelTextColor:R,successColor:W,errorColor:k},yl,bl,tt),[Ft,qn]=j.useState(()=>Object.fromEntries(nt.map(ct=>[ct.name,""]))),[Xn,Se]=j.useState("idle"),[ar,We]=j.useState(null),dn=o==="success"?"success":o==="error"?"error":Xn,lr=o==="error"?ot:ar,xe=o==="filled"?Object.fromEntries(nt.map(ct=>[ct.name,"Filled"])):Ft,sr=dn==="error"?F.getFormFieldValidationError(nt,xe):null,cr=`${o&&o!=="default"?`${r}-state-${o}`:""}`.trim(),Kn=n==null?void 0:n.submitUrl,Jn=(ct,ie)=>{qn(Dt=>({...Dt,[ct]:ie}))},ur=async ct=>{ct.preventDefault();const ie=Object.fromEntries(nt.map(Et=>{var ae;return[Et.name,((ae=Ft[Et.name])==null?void 0:ae.trim())??""]}).filter(([,Et])=>Et));if(!Kn){Se("error"),We("No integrations were found for this form.");return}if(Object.keys(ie).length===0)return;const Dt=F.getFormFieldValidationError(nt,Ft);if(Dt){Se("error"),We(Dt);return}Se("submitting"),We(null);try{const Et=await fetch(Kn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ie)});if(!Et.ok){const ae=await Et.text();throw new Error(ae||`Request failed: ${Et.status}`)}Se("success"),qn(Object.fromEntries(nt.map(ae=>[ae.name,""])))}catch(Et){Se("error"),We(Et instanceof Error?Et.message:"Something went wrong")}};return x.jsxs("div",{className:`${r}-wrapper ${r}-type-${a} ${cr}`.trim(),style:$t,children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:hl(r)}}),x.jsxs("form",{onSubmit:ur,className:`${r}-form`,style:{gap:F.scalingValue(p??0,e)},children:[x.jsx("div",{className:`${r}-fields`,style:{gap:F.scalingValue(s??0,e)},children:nt.map((ct,ie)=>x.jsxs("div",{className:`${r}-field-group${q?` ${r}-labeled`:""}`,children:[q&&x.jsx("span",{className:`${r}-field-label`,style:ft?{...ft,lineHeight:ft.fontSize}:void 0,children:ct.label||ct.name}),ct.type==="textarea"?x.jsx("textarea",{name:ct.name,autoComplete:"off",value:xe[ct.name]??"",onChange:Dt=>Jn(ct.name,Dt.target.value),placeholder:ct.placeholder,className:`${r}-input`,style:kt,rows:1,"data-filled":(xe[ct.name]??"").trim().length>0,"data-field-type":"textarea"}):x.jsx("input",{type:ct.type==="phone"?"tel":ct.type==="email"?"email":"text",name:ct.name,autoComplete:"off",value:xe[ct.name]??"",onChange:Dt=>Jn(ct.name,Dt.target.value),placeholder:ct.placeholder,required:ct.isRequired??ct.type==="email",className:`${r}-input`,style:kt,"data-filled":(xe[ct.name]??"").trim().length>0})]},ie))}),x.jsx("div",{className:`${r}-overlay-anchor`,children:x.jsx("button",{type:"submit",className:`${r}-button`,style:{borderStyle:"solid",borderRadius:F.scalingValue(w??0,e),borderWidth:Ct,paddingTop:F.scalingValue((m==null?void 0:m.top)??0,e),paddingRight:F.scalingValue((m==null?void 0:m.right)??0,e),paddingBottom:F.scalingValue((m==null?void 0:m.bottom)??0,e),paddingLeft:F.scalingValue((m==null?void 0:m.left)??0,e),...st,...u?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:x.jsx("span",{className:`${r}-overlay-anchor`,style:u?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Xn==="submitting"?"...":l})})})]}),dn==="success"&&x.jsx("p",{className:`${r}-success`,style:{...Jt},children:J}),dn==="error"&&x.jsx("p",{className:`${r}-error`,style:{...Jt},role:"alert",children:sr??lr??ot})]})}const yl={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"},bl=["hover","focus","filled","success","error"],Sl=`import React, { useState } from 'react';
|
|
136
138
|
import { CommonComponentProps } from '../props';
|
|
137
|
-
import { getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
139
|
+
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
140
|
+
import { textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
138
141
|
|
|
139
142
|
function sv(px: number): string {
|
|
140
143
|
return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
|
|
@@ -148,6 +151,10 @@ function getCSS(P: string): string {
|
|
|
148
151
|
width: 100%;
|
|
149
152
|
min-height: \${sv(48)};
|
|
150
153
|
}
|
|
154
|
+
.\${P}-wrapper.\${P}-type-C .\${P}-input:focus-visible,
|
|
155
|
+
.\${P}-wrapper.\${P}-type-C .\${P}-button:focus-visible {
|
|
156
|
+
outline: none;
|
|
157
|
+
}
|
|
151
158
|
.\${P}-form {
|
|
152
159
|
display: flex;
|
|
153
160
|
flex-direction: column;
|
|
@@ -175,17 +182,17 @@ function getCSS(P: string): string {
|
|
|
175
182
|
.\${P}-input {
|
|
176
183
|
width: 100%;
|
|
177
184
|
box-sizing: border-box;
|
|
178
|
-
line-height: 1.4;
|
|
179
185
|
outline: none;
|
|
186
|
+
-webkit-tap-highlight-color: transparent;
|
|
180
187
|
background-color: var(--\${P}-input-color);
|
|
181
188
|
color: var(--\${P}-input-text-color);
|
|
182
189
|
border-color: var(--\${P}-input-border-color);
|
|
183
|
-
transition:
|
|
190
|
+
transition: color 250ms, border-color 250ms, background-color 250ms;
|
|
184
191
|
}
|
|
185
192
|
.\${P}-input::placeholder {
|
|
186
193
|
color: var(--\${P}-placeholder-color);
|
|
187
194
|
opacity: 1;
|
|
188
|
-
transition:
|
|
195
|
+
transition: color 250ms, opacity 250ms;
|
|
189
196
|
}
|
|
190
197
|
.\${P}-input:hover {
|
|
191
198
|
background-color: var(--\${P}-hover-input-color, var(--\${P}-input-color));
|
|
@@ -204,7 +211,7 @@ function getCSS(P: string): string {
|
|
|
204
211
|
color: var(--\${P}-focus-input-text-color, var(--\${P}-input-text-color));
|
|
205
212
|
border-color: var(--\${P}-focus-input-border-color, var(--\${P}-input-border-color));
|
|
206
213
|
}
|
|
207
|
-
.\${P}-
|
|
214
|
+
.\${P}-input[data-filled="true"] {
|
|
208
215
|
background-color: var(--\${P}-filled-input-color, var(--\${P}-input-color));
|
|
209
216
|
color: var(--\${P}-filled-input-text-color, var(--\${P}-input-text-color));
|
|
210
217
|
border-color: var(--\${P}-filled-input-border-color, var(--\${P}-input-border-color));
|
|
@@ -219,17 +226,17 @@ function getCSS(P: string): string {
|
|
|
219
226
|
resize: vertical;
|
|
220
227
|
}
|
|
221
228
|
.\${P}-input:disabled {
|
|
222
|
-
background: #f5f5f5;
|
|
223
229
|
cursor: not-allowed;
|
|
224
230
|
}
|
|
225
231
|
.\${P}-button {
|
|
226
232
|
cursor: pointer;
|
|
227
233
|
white-space: nowrap;
|
|
234
|
+
box-sizing: border-box;
|
|
228
235
|
outline: none;
|
|
229
236
|
background-color: var(--\${P}-button-color);
|
|
230
237
|
color: var(--\${P}-button-text-color);
|
|
231
238
|
border-color: var(--\${P}-button-border-color);
|
|
232
|
-
transition:
|
|
239
|
+
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
233
240
|
}
|
|
234
241
|
.\${P}-button:hover {
|
|
235
242
|
background-color: var(--\${P}-hover-button-color, var(--\${P}-button-color));
|
|
@@ -250,20 +257,18 @@ function getCSS(P: string): string {
|
|
|
250
257
|
}
|
|
251
258
|
.\${P}-input:focus-visible,
|
|
252
259
|
.\${P}-wrapper.\${P}-state-focus .\${P}-input {
|
|
253
|
-
outline:
|
|
260
|
+
outline: none;
|
|
254
261
|
}
|
|
255
262
|
.\${P}-button:focus-visible,
|
|
256
263
|
.\${P}-wrapper.\${P}-state-focus .\${P}-button {
|
|
257
|
-
outline:
|
|
264
|
+
outline: none;
|
|
258
265
|
}
|
|
259
266
|
.\${P}-success {
|
|
260
267
|
margin-top: \${sv(8)};
|
|
261
|
-
font-size: \${sv(14)};
|
|
262
268
|
color: var(--\${P}-success-success-color, var(--\${P}-success-color));
|
|
263
269
|
}
|
|
264
270
|
.\${P}-error {
|
|
265
271
|
margin-top: \${sv(8)};
|
|
266
|
-
font-size: \${sv(14)};
|
|
267
272
|
color: var(--\${P}-error-error-color, var(--\${P}-error-color));
|
|
268
273
|
}
|
|
269
274
|
.\${P}-overlay-anchor {
|
|
@@ -287,17 +292,15 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
287
292
|
type = 'A',
|
|
288
293
|
fieldsToShow = 2,
|
|
289
294
|
fields = [],
|
|
290
|
-
buttonLabel
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
gap = 0.008,
|
|
294
|
-
fieldsGap = 0.008,
|
|
295
|
-
label: labelTextStyle,
|
|
295
|
+
buttonLabel,
|
|
296
|
+
gap,
|
|
297
|
+
fieldsGap,
|
|
296
298
|
buttonCorners,
|
|
297
299
|
buttonStroke,
|
|
300
|
+
buttonPadding,
|
|
301
|
+
isButtonFullWidth,
|
|
298
302
|
inputCorners,
|
|
299
303
|
inputStroke,
|
|
300
|
-
buttonPadding,
|
|
301
304
|
inputPadding,
|
|
302
305
|
inputColor,
|
|
303
306
|
inputTextColor,
|
|
@@ -310,6 +313,30 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
310
313
|
successColor,
|
|
311
314
|
errorColor,
|
|
312
315
|
fontFamily,
|
|
316
|
+
inputFontSettings,
|
|
317
|
+
inputFontSize,
|
|
318
|
+
inputLineHeight,
|
|
319
|
+
inputLetterSpacing,
|
|
320
|
+
inputWordSpacing,
|
|
321
|
+
inputTextAppearance,
|
|
322
|
+
buttonFontSettings,
|
|
323
|
+
buttonFontSize,
|
|
324
|
+
buttonLineHeight,
|
|
325
|
+
buttonLetterSpacing,
|
|
326
|
+
buttonWordSpacing,
|
|
327
|
+
buttonTextAppearance,
|
|
328
|
+
labelFontSettings,
|
|
329
|
+
labelFontSize,
|
|
330
|
+
labelLineHeight,
|
|
331
|
+
labelLetterSpacing,
|
|
332
|
+
labelWordSpacing,
|
|
333
|
+
labelTextAppearance,
|
|
334
|
+
statusFontSettings,
|
|
335
|
+
statusFontSize,
|
|
336
|
+
statusLineHeight,
|
|
337
|
+
statusLetterSpacing,
|
|
338
|
+
statusWordSpacing,
|
|
339
|
+
statusTextAppearance,
|
|
313
340
|
successMessage,
|
|
314
341
|
errorMessage: errorMessageText,
|
|
315
342
|
stateOverrides,
|
|
@@ -317,43 +344,85 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
317
344
|
|
|
318
345
|
const showLabels = type === 'B';
|
|
319
346
|
const visibleFields = fields.slice(0, Math.min(fieldsToShow, fields.length));
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
:
|
|
347
|
+
|
|
348
|
+
const resolvedInputTextStyle: TextStyles = {
|
|
349
|
+
fontSettings: {
|
|
350
|
+
fontFamily,
|
|
351
|
+
fontWeight: inputFontSettings?.fontWeight ?? 400,
|
|
352
|
+
fontStyle: inputFontSettings?.fontStyle ?? 'normal',
|
|
353
|
+
},
|
|
354
|
+
fontSize: inputFontSize ?? 0.01,
|
|
355
|
+
lineHeight: inputLineHeight,
|
|
356
|
+
letterSpacing: inputLetterSpacing ?? 0,
|
|
357
|
+
wordSpacing: inputWordSpacing ?? 0,
|
|
358
|
+
textAppearance: inputTextAppearance,
|
|
359
|
+
color: inputTextColor,
|
|
360
|
+
};
|
|
361
|
+
const inputCss = textStylesToCss(resolvedInputTextStyle, isEditor);
|
|
362
|
+
const strokeForInput = scalingValue(inputStroke ?? 0, isEditor);
|
|
329
363
|
const inputFieldCss = {
|
|
330
364
|
...inputCss,
|
|
331
365
|
borderStyle: 'solid',
|
|
332
|
-
borderRadius: scalingValue(inputCorners ?? 0, isEditor),
|
|
333
|
-
|
|
366
|
+
borderRadius: type === 'C' ? 0 : scalingValue(inputCorners ?? 0, isEditor),
|
|
367
|
+
...(type === 'C'
|
|
368
|
+
? {
|
|
369
|
+
borderTopWidth: 0,
|
|
370
|
+
borderRightWidth: 0,
|
|
371
|
+
borderBottomWidth: strokeForInput,
|
|
372
|
+
borderLeftWidth: 0,
|
|
373
|
+
}
|
|
374
|
+
: { borderWidth: strokeForInput }),
|
|
334
375
|
paddingTop: scalingValue(inputPadding?.top ?? 0, isEditor),
|
|
335
376
|
paddingRight: scalingValue(inputPadding?.right ?? 0, isEditor),
|
|
336
377
|
paddingBottom: scalingValue(inputPadding?.bottom ?? 0, isEditor),
|
|
337
378
|
paddingLeft: scalingValue(inputPadding?.left ?? 0, isEditor),
|
|
338
379
|
} as React.CSSProperties;
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
380
|
+
|
|
381
|
+
const resolvedButtonTextStyle: TextStyles = {
|
|
382
|
+
fontSettings: {
|
|
383
|
+
fontFamily,
|
|
384
|
+
fontWeight: buttonFontSettings?.fontWeight ?? 400,
|
|
385
|
+
fontStyle: buttonFontSettings?.fontStyle ?? 'normal',
|
|
386
|
+
},
|
|
387
|
+
fontSize: buttonFontSize ?? 0.01,
|
|
388
|
+
lineHeight: buttonLineHeight,
|
|
389
|
+
letterSpacing: buttonLetterSpacing ?? 0,
|
|
390
|
+
wordSpacing: buttonWordSpacing ?? 0,
|
|
391
|
+
textAppearance: buttonTextAppearance,
|
|
392
|
+
color: buttonTextColor,
|
|
393
|
+
};
|
|
394
|
+
const buttonTextCss = textStylesToCss(resolvedButtonTextStyle, isEditor);
|
|
395
|
+
const strokeForButton = scalingValue(buttonStroke ?? 0, isEditor);
|
|
396
|
+
|
|
397
|
+
const resolvedLabelTextStyle: TextStyles = {
|
|
398
|
+
fontSettings: {
|
|
399
|
+
fontFamily,
|
|
400
|
+
fontWeight: labelFontSettings?.fontWeight ?? 400,
|
|
401
|
+
fontStyle: labelFontSettings?.fontStyle ?? 'normal',
|
|
402
|
+
},
|
|
403
|
+
fontSize: labelFontSize ?? 0.01,
|
|
404
|
+
lineHeight: labelLineHeight,
|
|
405
|
+
letterSpacing: labelLetterSpacing ?? 0,
|
|
406
|
+
wordSpacing: labelWordSpacing ?? 0,
|
|
407
|
+
textAppearance: labelTextAppearance,
|
|
408
|
+
color: labelTextColor,
|
|
409
|
+
};
|
|
410
|
+
const labelTextCss = textStylesToCss(resolvedLabelTextStyle, isEditor);
|
|
411
|
+
|
|
412
|
+
const resolvedStatusTextStyle: TextStyles = {
|
|
413
|
+
fontSettings: {
|
|
414
|
+
fontFamily,
|
|
415
|
+
fontWeight: statusFontSettings?.fontWeight ?? 400,
|
|
416
|
+
fontStyle: statusFontSettings?.fontStyle ?? 'normal',
|
|
417
|
+
},
|
|
418
|
+
fontSize: statusFontSize ?? 0.01,
|
|
419
|
+
lineHeight: statusLineHeight,
|
|
420
|
+
letterSpacing: statusLetterSpacing ?? 0,
|
|
421
|
+
wordSpacing: statusWordSpacing ?? 0,
|
|
422
|
+
textAppearance: statusTextAppearance,
|
|
423
|
+
color: successColor,
|
|
424
|
+
};
|
|
425
|
+
const statusTextCss = textStylesToCss(resolvedStatusTextStyle, isEditor);
|
|
357
426
|
|
|
358
427
|
const colorVars = buildColorVars(P, {
|
|
359
428
|
inputColor,
|
|
@@ -366,7 +435,7 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
366
435
|
labelTextColor,
|
|
367
436
|
successColor,
|
|
368
437
|
errorColor,
|
|
369
|
-
}, stateOverrides);
|
|
438
|
+
}, COLOR_VAR_MAP, STATE_KEYS, stateOverrides);
|
|
370
439
|
|
|
371
440
|
const [fieldValues, setFieldValues] = useState<Record<string, string>>(() =>
|
|
372
441
|
Object.fromEntries(visibleFields.map((f) => [f.name, '']))
|
|
@@ -386,6 +455,7 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
386
455
|
? getFormFieldValidationError(visibleFields, displayValues)
|
|
387
456
|
: null;
|
|
388
457
|
const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
|
|
458
|
+
const wrapperStateClasses = \`\${stateClass}\`.trim();
|
|
389
459
|
|
|
390
460
|
const submitUrl = metadata?.submitUrl as string | undefined;
|
|
391
461
|
const handleFieldChange = (name: string, value: string) => {
|
|
@@ -397,7 +467,12 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
397
467
|
const payload = Object.fromEntries(
|
|
398
468
|
visibleFields.map((f) => [f.name, fieldValues[f.name]?.trim() ?? '']).filter(([, v]) => v)
|
|
399
469
|
);
|
|
400
|
-
if (!submitUrl
|
|
470
|
+
if (!submitUrl) {
|
|
471
|
+
setStatus('error');
|
|
472
|
+
setErrorMessage('No integrations were found for this form.');
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (Object.keys(payload).length === 0) return;
|
|
401
476
|
|
|
402
477
|
const validationError = getFormFieldValidationError(visibleFields, fieldValues);
|
|
403
478
|
if (validationError) {
|
|
@@ -429,16 +504,16 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
429
504
|
};
|
|
430
505
|
|
|
431
506
|
return (
|
|
432
|
-
<div className={\`\${P}-wrapper \${
|
|
433
|
-
<style
|
|
507
|
+
<div className={\`\${P}-wrapper \${P}-type-\${type} \${wrapperStateClasses}\`.trim()} style={colorVars}>
|
|
508
|
+
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
434
509
|
<form
|
|
435
510
|
onSubmit={handleSubmit}
|
|
436
511
|
className={\`\${P}-form\`}
|
|
437
|
-
style={{ gap: scalingValue(gap, isEditor) }}
|
|
512
|
+
style={{ gap: scalingValue(gap ?? 0, isEditor) }}
|
|
438
513
|
>
|
|
439
514
|
<div
|
|
440
515
|
className={\`\${P}-fields\`}
|
|
441
|
-
style={{ gap: scalingValue(fieldsGap, isEditor) }}
|
|
516
|
+
style={{ gap: scalingValue(fieldsGap ?? 0, isEditor) }}
|
|
442
517
|
>
|
|
443
518
|
{visibleFields.map((field, index) => (
|
|
444
519
|
<div key={index} className={\`\${P}-field-group\${showLabels ? \` \${P}-labeled\` : ''}\`}>
|
|
@@ -457,6 +532,7 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
457
532
|
className={\`\${P}-input\`}
|
|
458
533
|
style={inputFieldCss}
|
|
459
534
|
rows={1}
|
|
535
|
+
data-filled={((displayValues[field.name] ?? '') as string).trim().length > 0}
|
|
460
536
|
data-field-type="textarea"
|
|
461
537
|
/>
|
|
462
538
|
) : (
|
|
@@ -467,9 +543,10 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
467
543
|
value={displayValues[field.name] ?? ''}
|
|
468
544
|
onChange={(e) => handleFieldChange(field.name, e.target.value)}
|
|
469
545
|
placeholder={field.placeholder}
|
|
470
|
-
required={field.type === 'email'}
|
|
546
|
+
required={field.isRequired ?? field.type === 'email'}
|
|
471
547
|
className={\`\${P}-input\`}
|
|
472
548
|
style={inputFieldCss}
|
|
549
|
+
data-filled={((displayValues[field.name] ?? '') as string).trim().length > 0}
|
|
473
550
|
/>
|
|
474
551
|
)}
|
|
475
552
|
</div>
|
|
@@ -482,15 +559,32 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
482
559
|
style={{
|
|
483
560
|
borderStyle: 'solid',
|
|
484
561
|
borderRadius: scalingValue(buttonCorners ?? 0, isEditor),
|
|
485
|
-
borderWidth:
|
|
562
|
+
borderWidth: strokeForButton,
|
|
486
563
|
paddingTop: scalingValue(buttonPadding?.top ?? 0, isEditor),
|
|
487
564
|
paddingRight: scalingValue(buttonPadding?.right ?? 0, isEditor),
|
|
488
565
|
paddingBottom: scalingValue(buttonPadding?.bottom ?? 0, isEditor),
|
|
489
566
|
paddingLeft: scalingValue(buttonPadding?.left ?? 0, isEditor),
|
|
490
567
|
...buttonTextCss,
|
|
568
|
+
...(isButtonFullWidth
|
|
569
|
+
? {
|
|
570
|
+
width: '100%',
|
|
571
|
+
textAlign: 'center',
|
|
572
|
+
whiteSpace: 'normal',
|
|
573
|
+
}
|
|
574
|
+
: {}),
|
|
491
575
|
}}
|
|
492
576
|
>
|
|
493
|
-
<span
|
|
577
|
+
<span
|
|
578
|
+
className={\`\${P}-overlay-anchor\`}
|
|
579
|
+
style={isButtonFullWidth
|
|
580
|
+
? {
|
|
581
|
+
display: 'inline-block',
|
|
582
|
+
maxWidth: '100%',
|
|
583
|
+
whiteSpace: 'normal',
|
|
584
|
+
textAlign: 'center',
|
|
585
|
+
}
|
|
586
|
+
: undefined}
|
|
587
|
+
>
|
|
494
588
|
{status === 'submitting' ? '...' : buttonLabel}
|
|
495
589
|
</span>
|
|
496
590
|
</button>
|
|
@@ -499,7 +593,7 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
499
593
|
{displayStatus === 'success' && (
|
|
500
594
|
<p
|
|
501
595
|
className={\`\${P}-success\`}
|
|
502
|
-
style={{ ...
|
|
596
|
+
style={{ ...statusTextCss }}
|
|
503
597
|
>
|
|
504
598
|
{successMessage}
|
|
505
599
|
</p>
|
|
@@ -507,7 +601,7 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
507
601
|
{displayStatus === 'error' && (
|
|
508
602
|
<p
|
|
509
603
|
className={\`\${P}-error\`}
|
|
510
|
-
style={{ ...
|
|
604
|
+
style={{ ...statusTextCss}}
|
|
511
605
|
role="alert"
|
|
512
606
|
>
|
|
513
607
|
{validationErrorMessage ?? displayError ?? errorMessageText}
|
|
@@ -524,24 +618,8 @@ export type FormFieldItem = {
|
|
|
524
618
|
type: FormFieldType;
|
|
525
619
|
placeholder: string;
|
|
526
620
|
label?: string;
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
type TextStyles = {
|
|
530
|
-
fontSettings: {
|
|
531
|
-
fontFamily?: string;
|
|
532
|
-
fontWeight: number;
|
|
533
|
-
fontStyle: string;
|
|
534
|
-
};
|
|
535
|
-
letterSpacing: number;
|
|
536
|
-
wordSpacing: number;
|
|
537
|
-
fontSize: number;
|
|
538
|
-
lineHeight?: number;
|
|
539
|
-
textAppearance?: {
|
|
540
|
-
textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';
|
|
541
|
-
textDecoration?: 'none' | 'underline';
|
|
542
|
-
fontVariant?: 'normal' | 'small-caps';
|
|
543
|
-
};
|
|
544
|
-
color: string;
|
|
621
|
+
isRequired?: boolean;
|
|
622
|
+
error?: string;
|
|
545
623
|
};
|
|
546
624
|
|
|
547
625
|
type Padding = {
|
|
@@ -566,29 +644,51 @@ type ColorKeys =
|
|
|
566
644
|
type StateColorOverrides = Partial<Record<ColorKeys, string>>;
|
|
567
645
|
|
|
568
646
|
type FormSettings = {
|
|
569
|
-
type: 'A' | 'B';
|
|
647
|
+
type: 'A' | 'B' | 'C';
|
|
570
648
|
fontFamily: string;
|
|
571
649
|
fieldsToShow: number;
|
|
572
650
|
fields: FormFieldItem[];
|
|
573
651
|
buttonLabel?: string;
|
|
574
|
-
input?: TextStyles;
|
|
575
|
-
button?: TextStyles;
|
|
576
652
|
gap?: number;
|
|
577
653
|
fieldsGap?: number;
|
|
578
|
-
|
|
654
|
+
inputFontSettings?: { fontWeight: number; fontStyle: string };
|
|
655
|
+
inputFontSize?: number;
|
|
656
|
+
inputLineHeight?: number;
|
|
657
|
+
inputLetterSpacing?: number;
|
|
658
|
+
inputWordSpacing?: number;
|
|
659
|
+
inputTextAppearance?: TextStyles['textAppearance'];
|
|
660
|
+
buttonFontSettings?: { fontWeight: number; fontStyle: string };
|
|
661
|
+
buttonFontSize?: number;
|
|
662
|
+
buttonLineHeight?: number;
|
|
663
|
+
buttonLetterSpacing?: number;
|
|
664
|
+
buttonWordSpacing?: number;
|
|
665
|
+
buttonTextAppearance?: TextStyles['textAppearance'];
|
|
666
|
+
labelFontSettings?: { fontWeight: number; fontStyle: string };
|
|
667
|
+
labelFontSize?: number;
|
|
668
|
+
labelLineHeight?: number;
|
|
669
|
+
labelLetterSpacing?: number;
|
|
670
|
+
labelWordSpacing?: number;
|
|
671
|
+
labelTextAppearance?: TextStyles['textAppearance'];
|
|
672
|
+
statusFontSettings?: { fontWeight: number; fontStyle: string };
|
|
673
|
+
statusFontSize?: number;
|
|
674
|
+
statusLineHeight?: number;
|
|
675
|
+
statusLetterSpacing?: number;
|
|
676
|
+
statusWordSpacing?: number;
|
|
677
|
+
statusTextAppearance?: TextStyles['textAppearance'];
|
|
579
678
|
buttonCorners?: number;
|
|
580
679
|
buttonStroke?: number;
|
|
680
|
+
buttonPadding?: Padding;
|
|
681
|
+
isButtonFullWidth?: boolean;
|
|
581
682
|
inputCorners?: number;
|
|
582
683
|
inputStroke?: number;
|
|
583
|
-
buttonPadding?: Padding;
|
|
584
684
|
inputPadding?: Padding;
|
|
585
685
|
inputColor: string;
|
|
586
686
|
inputTextColor: string;
|
|
587
687
|
inputBorderColor: string;
|
|
588
|
-
placeholderColor: string;
|
|
589
688
|
buttonColor: string;
|
|
590
689
|
buttonTextColor: string;
|
|
591
690
|
buttonBorderColor: string;
|
|
691
|
+
placeholderColor: string;
|
|
592
692
|
labelTextColor: string;
|
|
593
693
|
successColor: string;
|
|
594
694
|
errorColor: string;
|
|
@@ -611,47 +711,210 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
611
711
|
};
|
|
612
712
|
|
|
613
713
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
714
|
+
`,xl=[{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"}],He={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Cl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],$l={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control"},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},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:{...He.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:{...He.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:{...He.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:{...He.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:xl,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#0A00F8",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:0,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:0,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.visible",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.visible",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}}]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"",items:["inputPadding"]}]},{type:"group",title:"Button",items:[{type:"row",items:["isButtonFullWidth"]},{type:"row",items:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"",items:["buttonPadding"]}]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Cl],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"]},_l={element:vl,id:"form",name:"Newsletter Stacked",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:300,height:42},schema:$l,sourceCode:Sl};function De(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function wl(t){return`
|
|
715
|
+
.${t}-wrapper {
|
|
716
|
+
display: flex;
|
|
717
|
+
flex-direction: column;
|
|
718
|
+
width: 100%;
|
|
719
|
+
height: 100%;
|
|
720
|
+
align-items: stretch;
|
|
721
|
+
justify-content: center;
|
|
722
|
+
}
|
|
723
|
+
.${t}-form {
|
|
724
|
+
display: flex;
|
|
725
|
+
width: 100%;
|
|
726
|
+
align-items: stretch;
|
|
727
|
+
overflow: hidden;
|
|
728
|
+
border-color: var(--${t}-stroke-color);
|
|
729
|
+
transition: border-color 250ms;
|
|
730
|
+
}
|
|
731
|
+
.${t}-form:hover {
|
|
732
|
+
border-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
733
|
+
}
|
|
734
|
+
.${t}-form:focus-within {
|
|
735
|
+
border-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
736
|
+
}
|
|
737
|
+
.${t}-wrapper.${t}-state-hover .${t}-form {
|
|
738
|
+
border-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
739
|
+
}
|
|
740
|
+
.${t}-wrapper.${t}-state-focus .${t}-form {
|
|
741
|
+
border-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
742
|
+
}
|
|
743
|
+
.${t}-wrapper.${t}-state-filled .${t}-form {
|
|
744
|
+
border-color: var(--${t}-filled-stroke-color, var(--${t}-stroke-color));
|
|
745
|
+
}
|
|
746
|
+
.${t}-inputWrap {
|
|
747
|
+
position: relative;
|
|
748
|
+
display: flex;
|
|
749
|
+
align-items: center;
|
|
750
|
+
flex: 1;
|
|
751
|
+
min-width: 0;
|
|
752
|
+
background-color: var(--${t}-input-color);
|
|
753
|
+
transition: background-color 250ms;
|
|
754
|
+
}
|
|
755
|
+
.${t}-inputWrap:hover,
|
|
756
|
+
.${t}-wrapper.${t}-state-hover .${t}-inputWrap {
|
|
757
|
+
background-color: var(--${t}-hover-input-color, var(--${t}-input-color));
|
|
758
|
+
}
|
|
759
|
+
.${t}-inputWrap:focus-within,
|
|
760
|
+
.${t}-wrapper.${t}-state-focus .${t}-inputWrap {
|
|
761
|
+
background-color: var(--${t}-focus-input-color, var(--${t}-input-color));
|
|
762
|
+
}
|
|
763
|
+
.${t}-wrapper.${t}-state-filled .${t}-inputWrap {
|
|
764
|
+
background-color: var(--${t}-filled-input-color, var(--${t}-input-color));
|
|
765
|
+
}
|
|
766
|
+
.${t}-input {
|
|
767
|
+
flex: 1;
|
|
768
|
+
min-width: 0;
|
|
769
|
+
background: transparent;
|
|
770
|
+
border: none;
|
|
771
|
+
outline: none;
|
|
772
|
+
-webkit-tap-highlight-color: transparent;
|
|
773
|
+
color: var(--${t}-input-text-color);
|
|
774
|
+
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
775
|
+
}
|
|
776
|
+
.${t}-input:hover {
|
|
777
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
778
|
+
}
|
|
779
|
+
.${t}-inputWrap:hover .${t}-input,
|
|
780
|
+
.${t}-wrapper.${t}-state-hover .${t}-input {
|
|
781
|
+
color: var(--${t}-hover-input-text-color, var(--${t}-input-text-color));
|
|
782
|
+
}
|
|
783
|
+
.${t}-input:focus,
|
|
784
|
+
.${t}-wrapper.${t}-state-focus .${t}-input {
|
|
785
|
+
color: var(--${t}-focus-input-text-color, var(--${t}-input-text-color));
|
|
786
|
+
}
|
|
787
|
+
.${t}-wrapper.${t}-state-filled .${t}-input {
|
|
788
|
+
color: var(--${t}-filled-input-text-color, var(--${t}-input-text-color));
|
|
789
|
+
}
|
|
790
|
+
.${t}-input::placeholder {
|
|
791
|
+
color: var(--${t}-placeholder-color);
|
|
792
|
+
opacity: 1;
|
|
793
|
+
transition: color 250ms, opacity 250ms;
|
|
794
|
+
}
|
|
795
|
+
.${t}-inputWrap:hover .${t}-input::placeholder,
|
|
796
|
+
.${t}-wrapper.${t}-state-hover .${t}-input::placeholder {
|
|
797
|
+
color: var(--${t}-hover-placeholder-color, var(--${t}-placeholder-color));
|
|
798
|
+
}
|
|
799
|
+
.${t}-inputWrap:focus-within .${t}-input::placeholder,
|
|
800
|
+
.${t}-wrapper.${t}-state-focus .${t}-input::placeholder {
|
|
801
|
+
color: var(--${t}-focus-placeholder-color, var(--${t}-placeholder-color));
|
|
802
|
+
}
|
|
803
|
+
.${t}-wrapper.${t}-state-filled .${t}-input::placeholder {
|
|
804
|
+
color: var(--${t}-filled-placeholder-color, var(--${t}-placeholder-color));
|
|
805
|
+
}
|
|
806
|
+
.${t}-submitBtn {
|
|
807
|
+
box-sizing: border-box;
|
|
808
|
+
height: 100%;
|
|
809
|
+
display: flex;
|
|
810
|
+
align-items: center;
|
|
811
|
+
justify-content: center;
|
|
812
|
+
border: none;
|
|
813
|
+
cursor: pointer;
|
|
814
|
+
white-space: nowrap;
|
|
815
|
+
background-color: var(--${t}-button-color);
|
|
816
|
+
color: var(--${t}-button-text-color);
|
|
817
|
+
border-left-style: solid;
|
|
818
|
+
border-left-color: var(--${t}-stroke-color);
|
|
819
|
+
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
820
|
+
}
|
|
821
|
+
.${t}-submitBtn img {
|
|
822
|
+
display: block;
|
|
823
|
+
box-sizing: border-box;
|
|
824
|
+
flex: 0 1 auto;
|
|
825
|
+
min-width: 0;
|
|
826
|
+
height: 100%;
|
|
827
|
+
width: auto;
|
|
828
|
+
max-width: 100%;
|
|
829
|
+
max-height: 100%;
|
|
830
|
+
object-fit: contain;
|
|
831
|
+
}
|
|
832
|
+
.${t}-submitBtn svg {
|
|
833
|
+
display: block;
|
|
834
|
+
box-sizing: border-box;
|
|
835
|
+
flex: 0 1 auto;
|
|
836
|
+
min-width: 0;
|
|
837
|
+
height: 100%;
|
|
838
|
+
width: auto;
|
|
839
|
+
max-width: 100%;
|
|
840
|
+
max-height: 100%;
|
|
841
|
+
}
|
|
842
|
+
.${t}-submitBtn .${t}-submitBtnIcon {
|
|
843
|
+
position: relative;
|
|
844
|
+
top: auto;
|
|
845
|
+
left: auto;
|
|
846
|
+
transform: none;
|
|
847
|
+
display: block;
|
|
848
|
+
box-sizing: border-box;
|
|
849
|
+
flex: 0 1 auto;
|
|
850
|
+
align-self: stretch;
|
|
851
|
+
min-width: 0;
|
|
852
|
+
width: auto;
|
|
853
|
+
height: auto;
|
|
854
|
+
aspect-ratio: 1;
|
|
855
|
+
max-width: 100%;
|
|
856
|
+
max-height: 100%;
|
|
857
|
+
}
|
|
858
|
+
.${t}-submitBtn:hover,
|
|
859
|
+
.${t}-wrapper.${t}-state-hover .${t}-submitBtn {
|
|
860
|
+
background-color: var(--${t}-hover-button-color, var(--${t}-button-color));
|
|
861
|
+
color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
862
|
+
border-left-color: var(--${t}-hover-stroke-color, var(--${t}-stroke-color));
|
|
863
|
+
}
|
|
864
|
+
.${t}-submitBtn:focus,
|
|
865
|
+
.${t}-wrapper.${t}-state-focus .${t}-submitBtn {
|
|
866
|
+
background-color: var(--${t}-focus-button-color, var(--${t}-button-color));
|
|
867
|
+
color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
868
|
+
border-left-color: var(--${t}-focus-stroke-color, var(--${t}-stroke-color));
|
|
869
|
+
}
|
|
870
|
+
.${t}-wrapper.${t}-state-filled .${t}-submitBtn {
|
|
871
|
+
background-color: var(--${t}-filled-button-color, var(--${t}-button-color));
|
|
872
|
+
color: var(--${t}-filled-button-text-color, var(--${t}-button-text-color));
|
|
873
|
+
border-left-color: var(--${t}-filled-stroke-color, var(--${t}-stroke-color));
|
|
874
|
+
}
|
|
875
|
+
.${t}-submitBtn:hover .${t}-submitBtnIcon,
|
|
876
|
+
.${t}-wrapper.${t}-state-hover .${t}-submitBtn .${t}-submitBtnIcon {
|
|
877
|
+
background-color: var(--${t}-hover-button-text-color, var(--${t}-button-text-color));
|
|
878
|
+
}
|
|
879
|
+
.${t}-submitBtn:focus .${t}-submitBtnIcon,
|
|
880
|
+
.${t}-wrapper.${t}-state-focus .${t}-submitBtn .${t}-submitBtnIcon {
|
|
881
|
+
background-color: var(--${t}-focus-button-text-color, var(--${t}-button-text-color));
|
|
882
|
+
}
|
|
883
|
+
.${t}-wrapper.${t}-state-filled .${t}-submitBtn .${t}-submitBtnIcon {
|
|
884
|
+
background-color: var(--${t}-filled-button-text-color, var(--${t}-button-text-color));
|
|
885
|
+
}
|
|
886
|
+
.${t}-wrapper.${t}-state-success .${t}-input,
|
|
887
|
+
.${t}-wrapper.${t}-state-success .${t}-submitBtn {
|
|
888
|
+
pointer-events: none;
|
|
889
|
+
}
|
|
890
|
+
.${t}-overlayAnchor {
|
|
891
|
+
position: relative;
|
|
892
|
+
display: flex;
|
|
893
|
+
align-items: center;
|
|
894
|
+
}
|
|
895
|
+
.${t}-success {
|
|
896
|
+
margin-top: ${De(8)};
|
|
897
|
+
font-size: ${De(14)};
|
|
898
|
+
color: var(--${t}-success-success-color, var(--${t}-success-color));
|
|
899
|
+
}
|
|
900
|
+
.${t}-error {
|
|
901
|
+
margin-top: ${De(8)};
|
|
902
|
+
font-size: ${De(14)};
|
|
903
|
+
color: var(--${t}-error-error-color, var(--${t}-error-color));
|
|
904
|
+
}
|
|
905
|
+
`}const Tl=({settings:t,isEditor:e,metadata:n,activeEvent:o})=>{const{prefix:r}=F.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,buttonLabel:c,fieldsToShow:l=1,fontFamily:p,inputFontSettings:s,inputFontSize:w,inputLineHeight:v,inputLetterSpacing:m,inputWordSpacing:u,inputTextAppearance:d,buttonFontSettings:C,buttonFontSize:b,buttonLineHeight:f,buttonLetterSpacing:$,buttonWordSpacing:M,buttonTextAppearance:P,statusFontSettings:T,statusFontSize:h,statusLineHeight:L,statusLetterSpacing:R,statusWordSpacing:W,statusTextAppearance:k,minHeight:B,corners:O,stroke:U,stateOverrides:D,inputPadding:g,buttonPadding:A,successMessage:I="Thanks for subscribing!",errorMessage:_="Please, fill all required fields."}=t,y=a.slice(0,Math.min(l,a.length)),[V,X]=j.useState(()=>Object.fromEntries(y.map(ft=>[ft.name,""]))),[rt,Q]=j.useState("idle"),[ut,E]=j.useState(null),K=o==="success"?"success":o==="error"?"error":rt,ht=o==="error"?_:ut,it=o==="filled"?Object.fromEntries(y.map(ft=>[ft.name,"Filled"])):V,mt=K==="error"?F.getFormFieldValidationError(y,it):null,bt=o&&o!=="default"?`${r}-state-${o}`:"",Mt=y.some(ft=>(it[ft.name]??"").trim().length>0),z=bt!==`${r}-state-filled`&&Mt?`${r}-state-filled`:"",S=`${bt} ${z}`.trim(),H=n==null?void 0:n.submitUrl,G=c??"",J=(i==null?void 0:i.icon)??"",ot=(i==null?void 0:i.mode)==="On",tt=G||"Submit",q={fontSettings:{fontFamily:p,fontWeight:(s==null?void 0:s.fontWeight)??400,fontStyle:(s==null?void 0:s.fontStyle)??"normal"},fontSize:w??.01,lineHeight:v,letterSpacing:m??0,wordSpacing:u??0,textAppearance:d,color:t.inputTextColor??"#111111"},nt={fontSettings:{fontFamily:p,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:b??.01,lineHeight:f,letterSpacing:$??0,wordSpacing:M??0,textAppearance:P,color:t.buttonTextColor??"#ffffff"},yt={fontSettings:{fontFamily:p,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:h??.01,lineHeight:L,letterSpacing:R??0,wordSpacing:W??0,textAppearance:k,color:t.successColor??"#22c55e"},lt=Qt(q,e),pt=Qt(nt,e),kt=Qt(yt,e),et=F.buildColorVars(r,{strokeColor:t.strokeColor,inputColor:t.inputColor,placeholderColor:t.placeholderColor,buttonColor:t.buttonColor,successColor:t.successColor,errorColor:t.errorColor,inputTextColor:t.inputTextColor??(q==null?void 0:q.color)??"#111111",buttonTextColor:t.buttonTextColor??(nt==null?void 0:nt.color)??"#ffffff"},El,Ll,D),st={borderRadius:F.scalingValue(O,e),borderWidth:F.scalingValue(U,e),borderStyle:"solid"},Ct={borderLeftWidth:F.scalingValue(U,e)},Ht=async ft=>{ft.preventDefault();const re=Object.fromEntries(y.map($t=>{var Ft;return[$t.name,((Ft=V[$t.name])==null?void 0:Ft.trim())??""]}).filter(([,$t])=>$t));if(!H){Q("error"),E("No integrations were found for this form.");return}if(Object.keys(re).length===0)return;const Jt=F.getFormFieldValidationError(y,V);if(Jt){Q("error"),E(Jt);return}Q("submitting"),E(null);try{const $t=await fetch(H,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(re)});if(!$t.ok){const Ft=await $t.text();throw new Error(Ft||`Request failed: ${$t.status}`)}Q("success"),X(Object.fromEntries(y.map(Ft=>[Ft.name,""])))}catch($t){Q("error"),E($t instanceof Error?$t.message:"Something went wrong")}};return x.jsxs("div",{className:`${r}-wrapper ${S}`.trim(),style:et,children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:wl(r)}}),x.jsxs("form",{onSubmit:Ht,className:`${r}-form`,style:{...st,height:F.scalingValue(B,e),minHeight:F.scalingValue(B,e)},children:[x.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:y.map(ft=>x.jsx("input",{type:ft.type==="email"?"email":ft.type==="phone"?"tel":"text",name:ft.name,autoComplete:"off",value:it[ft.name]??"",onChange:re=>X(Jt=>({...Jt,[ft.name]:re.target.value})),placeholder:ft.placeholder,required:ft.isRequired??ft.type==="email",className:`${r}-input`,style:{...lt,paddingRight:F.scalingValue(g.right,e),paddingLeft:F.scalingValue(g.left,e),paddingTop:F.scalingValue(g.top,e),paddingBottom:F.scalingValue(g.bottom,e)}},ft.name))}),x.jsx("div",{className:`${r}-overlayAnchor`,children:x.jsx("button",{type:"submit",className:`${r}-submitBtn`,"aria-label":tt,style:{...pt,...Ct,paddingRight:F.scalingValue(A.right,e),paddingLeft:F.scalingValue(A.left,e),paddingTop:F.scalingValue(A.top,e),paddingBottom:F.scalingValue(A.bottom,e)},children:rt==="submitting"?"...":ot?J&&x.jsx(ge,{url:J,className:`${r}-submitBtnIcon`,fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):G})})]}),K==="success"&&x.jsx("p",{className:`${r}-success`,style:{...kt},children:I}),K==="error"&&x.jsx("p",{className:`${r}-error`,style:{...kt},role:"alert",children:mt??ht??_})]})},El={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"},Ll=["hover","focus","filled","success","error"],Al=`import React, { useState } from 'react';
|
|
906
|
+
import { CommonComponentProps } from '../props';
|
|
907
|
+
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
908
|
+
import { textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
909
|
+
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
614
910
|
|
|
615
|
-
function
|
|
616
|
-
|
|
617
|
-
defaults: Record<ColorKeys, string>,
|
|
618
|
-
stateOverrides?: Record<string, StateColorOverrides>,
|
|
619
|
-
): React.CSSProperties {
|
|
620
|
-
const vars: Record<string, string> = {};
|
|
621
|
-
for (const [key, varSuffix] of Object.entries(COLOR_VAR_MAP)) {
|
|
622
|
-
vars[\`--\${P}-\${varSuffix}\`] = defaults[key as ColorKeys];
|
|
623
|
-
}
|
|
624
|
-
if (stateOverrides) {
|
|
625
|
-
for (const state of STATE_KEYS) {
|
|
626
|
-
const overrides = stateOverrides[state];
|
|
627
|
-
if (!overrides) continue;
|
|
628
|
-
for (const [key, varSuffix] of Object.entries(COLOR_VAR_MAP)) {
|
|
629
|
-
const val = overrides[key as ColorKeys];
|
|
630
|
-
if (val !== undefined) {
|
|
631
|
-
vars[\`--\${P}-\${state}-\${varSuffix}\`] = val;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
return vars as unknown as React.CSSProperties;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSProperties {
|
|
640
|
-
return {
|
|
641
|
-
fontFamily: textStyles.fontSettings.fontFamily,
|
|
642
|
-
fontWeight: textStyles.fontSettings.fontWeight,
|
|
643
|
-
fontStyle: textStyles.fontSettings.fontStyle,
|
|
644
|
-
letterSpacing: scalingValue(textStyles.letterSpacing, isEditor),
|
|
645
|
-
wordSpacing: scalingValue(textStyles.wordSpacing, isEditor),
|
|
646
|
-
fontSize: scalingValue(textStyles.fontSize, isEditor),
|
|
647
|
-
lineHeight: textStyles.lineHeight !== undefined ? scalingValue(textStyles.lineHeight, isEditor) : undefined,
|
|
648
|
-
textTransform: textStyles.textAppearance?.textTransform,
|
|
649
|
-
textDecoration: textStyles.textAppearance?.textDecoration,
|
|
650
|
-
fontVariant: textStyles.textAppearance?.fontVariant
|
|
651
|
-
};
|
|
911
|
+
function sv(px: number): string {
|
|
912
|
+
return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
|
|
652
913
|
}
|
|
653
|
-
|
|
654
|
-
|
|
914
|
+
|
|
915
|
+
function getCSS(P: string): string {
|
|
916
|
+
return \`
|
|
917
|
+
.\${P}-wrapper {
|
|
655
918
|
display: flex;
|
|
656
919
|
flex-direction: column;
|
|
657
920
|
width: 100%;
|
|
@@ -659,65 +922,90 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
|
|
|
659
922
|
align-items: stretch;
|
|
660
923
|
justify-content: center;
|
|
661
924
|
}
|
|
662
|
-
|
|
925
|
+
.\${P}-form {
|
|
663
926
|
display: flex;
|
|
664
927
|
width: 100%;
|
|
665
928
|
align-items: stretch;
|
|
666
929
|
overflow: hidden;
|
|
930
|
+
border-color: var(--\${P}-stroke-color);
|
|
931
|
+
transition: border-color 250ms;
|
|
932
|
+
}
|
|
933
|
+
.\${P}-form:hover {
|
|
934
|
+
border-color: var(--\${P}-hover-stroke-color, var(--\${P}-stroke-color));
|
|
935
|
+
}
|
|
936
|
+
.\${P}-form:focus-within {
|
|
937
|
+
border-color: var(--\${P}-focus-stroke-color, var(--\${P}-stroke-color));
|
|
667
938
|
}
|
|
668
|
-
|
|
939
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-form {
|
|
940
|
+
border-color: var(--\${P}-hover-stroke-color, var(--\${P}-stroke-color));
|
|
941
|
+
}
|
|
942
|
+
.\${P}-wrapper.\${P}-state-focus .\${P}-form {
|
|
943
|
+
border-color: var(--\${P}-focus-stroke-color, var(--\${P}-stroke-color));
|
|
944
|
+
}
|
|
945
|
+
.\${P}-wrapper.\${P}-state-filled .\${P}-form {
|
|
946
|
+
border-color: var(--\${P}-filled-stroke-color, var(--\${P}-stroke-color));
|
|
947
|
+
}
|
|
948
|
+
.\${P}-inputWrap {
|
|
669
949
|
position: relative;
|
|
670
950
|
display: flex;
|
|
671
951
|
align-items: center;
|
|
672
952
|
flex: 1;
|
|
673
953
|
min-width: 0;
|
|
674
|
-
background-color: var(
|
|
675
|
-
transition:
|
|
954
|
+
background-color: var(--\${P}-input-color);
|
|
955
|
+
transition: background-color 250ms;
|
|
676
956
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
background-color: var(
|
|
957
|
+
.\${P}-inputWrap:hover,
|
|
958
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-inputWrap {
|
|
959
|
+
background-color: var(--\${P}-hover-input-color, var(--\${P}-input-color));
|
|
680
960
|
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
background-color: var(
|
|
961
|
+
.\${P}-inputWrap:focus-within,
|
|
962
|
+
.\${P}-wrapper.\${P}-state-focus .\${P}-inputWrap {
|
|
963
|
+
background-color: var(--\${P}-focus-input-color, var(--\${P}-input-color));
|
|
684
964
|
}
|
|
685
|
-
|
|
686
|
-
background-color: var(
|
|
965
|
+
.\${P}-wrapper.\${P}-state-filled .\${P}-inputWrap {
|
|
966
|
+
background-color: var(--\${P}-filled-input-color, var(--\${P}-input-color));
|
|
687
967
|
}
|
|
688
|
-
|
|
968
|
+
.\${P}-input {
|
|
689
969
|
flex: 1;
|
|
690
970
|
min-width: 0;
|
|
691
971
|
background: transparent;
|
|
692
972
|
border: none;
|
|
693
973
|
outline: none;
|
|
694
|
-
|
|
695
|
-
|
|
974
|
+
-webkit-tap-highlight-color: transparent;
|
|
975
|
+
color: var(--\${P}-input-text-color);
|
|
976
|
+
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
696
977
|
}
|
|
697
|
-
|
|
698
|
-
color: var(
|
|
978
|
+
.\${P}-input:hover {
|
|
979
|
+
color: var(--\${P}-hover-input-text-color, var(--\${P}-input-text-color));
|
|
699
980
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
color: var(
|
|
981
|
+
.\${P}-inputWrap:hover .\${P}-input,
|
|
982
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-input {
|
|
983
|
+
color: var(--\${P}-hover-input-text-color, var(--\${P}-input-text-color));
|
|
703
984
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
color: var(
|
|
985
|
+
.\${P}-input:focus,
|
|
986
|
+
.\${P}-wrapper.\${P}-state-focus .\${P}-input {
|
|
987
|
+
color: var(--\${P}-focus-input-text-color, var(--\${P}-input-text-color));
|
|
707
988
|
}
|
|
708
|
-
|
|
709
|
-
color: var(
|
|
989
|
+
.\${P}-wrapper.\${P}-state-filled .\${P}-input {
|
|
990
|
+
color: var(--\${P}-filled-input-text-color, var(--\${P}-input-text-color));
|
|
710
991
|
}
|
|
711
|
-
|
|
712
|
-
color: var(
|
|
992
|
+
.\${P}-input::placeholder {
|
|
993
|
+
color: var(--\${P}-placeholder-color);
|
|
713
994
|
opacity: 1;
|
|
714
|
-
transition:
|
|
995
|
+
transition: color 250ms, opacity 250ms;
|
|
996
|
+
}
|
|
997
|
+
.\${P}-inputWrap:hover .\${P}-input::placeholder,
|
|
998
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-input::placeholder {
|
|
999
|
+
color: var(--\${P}-hover-placeholder-color, var(--\${P}-placeholder-color));
|
|
1000
|
+
}
|
|
1001
|
+
.\${P}-inputWrap:focus-within .\${P}-input::placeholder,
|
|
1002
|
+
.\${P}-wrapper.\${P}-state-focus .\${P}-input::placeholder {
|
|
1003
|
+
color: var(--\${P}-focus-placeholder-color, var(--\${P}-placeholder-color));
|
|
715
1004
|
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
color: var(--${e}-hover-placeholder-color, var(--${e}-placeholder-color));
|
|
1005
|
+
.\${P}-wrapper.\${P}-state-filled .\${P}-input::placeholder {
|
|
1006
|
+
color: var(--\${P}-filled-placeholder-color, var(--\${P}-placeholder-color));
|
|
719
1007
|
}
|
|
720
|
-
|
|
1008
|
+
.\${P}-submitBtn {
|
|
721
1009
|
box-sizing: border-box;
|
|
722
1010
|
height: 100%;
|
|
723
1011
|
display: flex;
|
|
@@ -726,13 +1014,13 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
|
|
|
726
1014
|
border: none;
|
|
727
1015
|
cursor: pointer;
|
|
728
1016
|
white-space: nowrap;
|
|
729
|
-
background-color: var(
|
|
730
|
-
color: var(
|
|
1017
|
+
background-color: var(--\${P}-button-color);
|
|
1018
|
+
color: var(--\${P}-button-text-color);
|
|
731
1019
|
border-left-style: solid;
|
|
732
|
-
border-left-color: var(
|
|
733
|
-
transition:
|
|
1020
|
+
border-left-color: var(--\${P}-stroke-color);
|
|
1021
|
+
transition: color 250ms, background-color 250ms, border-color 250ms;
|
|
734
1022
|
}
|
|
735
|
-
|
|
1023
|
+
.\${P}-submitBtn img {
|
|
736
1024
|
display: block;
|
|
737
1025
|
box-sizing: border-box;
|
|
738
1026
|
flex: 0 1 auto;
|
|
@@ -743,40 +1031,434 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
|
|
|
743
1031
|
max-height: 100%;
|
|
744
1032
|
object-fit: contain;
|
|
745
1033
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
1034
|
+
.\${P}-submitBtn svg {
|
|
1035
|
+
display: block;
|
|
1036
|
+
box-sizing: border-box;
|
|
1037
|
+
flex: 0 1 auto;
|
|
1038
|
+
min-width: 0;
|
|
1039
|
+
height: 100%;
|
|
1040
|
+
width: auto;
|
|
1041
|
+
max-width: 100%;
|
|
1042
|
+
max-height: 100%;
|
|
1043
|
+
}
|
|
1044
|
+
.\${P}-submitBtn .\${P}-submitBtnIcon {
|
|
1045
|
+
position: relative;
|
|
1046
|
+
top: auto;
|
|
1047
|
+
left: auto;
|
|
1048
|
+
transform: none;
|
|
1049
|
+
display: block;
|
|
1050
|
+
box-sizing: border-box;
|
|
1051
|
+
flex: 0 1 auto;
|
|
1052
|
+
align-self: stretch;
|
|
1053
|
+
min-width: 0;
|
|
1054
|
+
width: auto;
|
|
1055
|
+
height: auto;
|
|
1056
|
+
aspect-ratio: 1;
|
|
1057
|
+
max-width: 100%;
|
|
1058
|
+
max-height: 100%;
|
|
1059
|
+
}
|
|
1060
|
+
.\${P}-submitBtn:hover,
|
|
1061
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-submitBtn {
|
|
1062
|
+
background-color: var(--\${P}-hover-button-color, var(--\${P}-button-color));
|
|
1063
|
+
color: var(--\${P}-hover-button-text-color, var(--\${P}-button-text-color));
|
|
1064
|
+
border-left-color: var(--\${P}-hover-stroke-color, var(--\${P}-stroke-color));
|
|
1065
|
+
}
|
|
1066
|
+
.\${P}-submitBtn:focus,
|
|
1067
|
+
.\${P}-wrapper.\${P}-state-focus .\${P}-submitBtn {
|
|
1068
|
+
background-color: var(--\${P}-focus-button-color, var(--\${P}-button-color));
|
|
1069
|
+
color: var(--\${P}-focus-button-text-color, var(--\${P}-button-text-color));
|
|
1070
|
+
border-left-color: var(--\${P}-focus-stroke-color, var(--\${P}-stroke-color));
|
|
1071
|
+
}
|
|
1072
|
+
.\${P}-wrapper.\${P}-state-filled .\${P}-submitBtn {
|
|
1073
|
+
background-color: var(--\${P}-filled-button-color, var(--\${P}-button-color));
|
|
1074
|
+
color: var(--\${P}-filled-button-text-color, var(--\${P}-button-text-color));
|
|
1075
|
+
border-left-color: var(--\${P}-filled-stroke-color, var(--\${P}-stroke-color));
|
|
1076
|
+
}
|
|
1077
|
+
.\${P}-submitBtn:hover .\${P}-submitBtnIcon,
|
|
1078
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-submitBtn .\${P}-submitBtnIcon {
|
|
1079
|
+
background-color: var(--\${P}-hover-button-text-color, var(--\${P}-button-text-color));
|
|
1080
|
+
}
|
|
1081
|
+
.\${P}-submitBtn:focus .\${P}-submitBtnIcon,
|
|
1082
|
+
.\${P}-wrapper.\${P}-state-focus .\${P}-submitBtn .\${P}-submitBtnIcon {
|
|
1083
|
+
background-color: var(--\${P}-focus-button-text-color, var(--\${P}-button-text-color));
|
|
1084
|
+
}
|
|
1085
|
+
.\${P}-wrapper.\${P}-state-filled .\${P}-submitBtn .\${P}-submitBtnIcon {
|
|
1086
|
+
background-color: var(--\${P}-filled-button-text-color, var(--\${P}-button-text-color));
|
|
1087
|
+
}
|
|
1088
|
+
.\${P}-wrapper.\${P}-state-success .\${P}-input,
|
|
1089
|
+
.\${P}-wrapper.\${P}-state-success .\${P}-submitBtn {
|
|
765
1090
|
pointer-events: none;
|
|
766
1091
|
}
|
|
767
|
-
|
|
1092
|
+
.\${P}-overlayAnchor {
|
|
768
1093
|
position: relative;
|
|
769
1094
|
display: flex;
|
|
770
1095
|
align-items: center;
|
|
771
1096
|
}
|
|
772
|
-
|
|
773
|
-
margin-top:
|
|
774
|
-
font-size:
|
|
775
|
-
color: var(
|
|
1097
|
+
.\${P}-success {
|
|
1098
|
+
margin-top: \${sv(8)};
|
|
1099
|
+
font-size: \${sv(14)};
|
|
1100
|
+
color: var(--\${P}-success-success-color, var(--\${P}-success-color));
|
|
776
1101
|
}
|
|
777
|
-
|
|
778
|
-
margin-top:
|
|
779
|
-
font-size:
|
|
780
|
-
color: var(
|
|
1102
|
+
.\${P}-error {
|
|
1103
|
+
margin-top: \${sv(8)};
|
|
1104
|
+
font-size: \${sv(14)};
|
|
1105
|
+
color: var(--\${P}-error-error-color, var(--\${P}-error-color));
|
|
781
1106
|
}
|
|
782
|
-
`}const al=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=k.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,submitButtonContent:s,buttonLabel:l,buttonIcon:p,fieldsToShow:c=1,fontFamily:_,input:m,button:y,minHeight:u,corners:g,stroke:$,stateOverrides:E,inputPadding:d,buttonPadding:h,successMessage:W="Thanks for subscribing!",errorMessage:M="Please, fill all required fields."}=e,w=a.slice(0,Math.min(c,a.length)),[v,T]=D.useState(()=>Object.fromEntries(w.map(V=>[V.name,""]))),[N,z]=D.useState("idle"),[L,O]=D.useState(null),F=r==="success"?"success":r==="error"?"error":N,G=r==="error"?M:L,H=r==="filled"?Object.fromEntries(w.map(V=>[V.name,"Filled"])):v,f=F==="error"?k.getFormFieldValidationError(w,H):null,R=r&&r!=="default"?`${o}-state-${r}`:"",A=n==null?void 0:n.submitUrl,b=i,C=(b==null?void 0:b.mode)==="Icon"||(b==null?void 0:b.mode)==="Label"?b.mode:s==="Icon"?"Icon":"Label",j=b===void 0?l:b.label!==void 0?b.label:l,Z=b===void 0?p:b.icon!==void 0?b.icon:p,te=j??"",ee=Z??"",ge=C==="Icon",I=te||"Submit",X=m?rr({...m,fontSettings:{...m.fontSettings,fontFamily:_??m.fontSettings.fontFamily}},t):void 0,ce=y?rr({...y,fontSettings:{...y.fontSettings,fontFamily:_??y.fontSettings.fontFamily}},t):void 0,ae=sl(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(m==null?void 0:m.color)??"#111111",buttonTextColor:e.buttonTextColor??(y==null?void 0:y.color)??"#ffffff"},E),ue={borderRadius:k.scalingValue(g,t),borderWidth:k.scalingValue($,t),borderStyle:"solid",borderColor:`var(--${o}-stroke-color)`},Se={borderLeftWidth:k.scalingValue($,t)},je=async V=>{V.preventDefault();const x=Object.fromEntries(w.map(U=>{var K;return[U.name,((K=v[U.name])==null?void 0:K.trim())??""]}).filter(([,U])=>U));if(!A||Object.keys(x).length===0)return;const P=k.getFormFieldValidationError(w,v);if(P){z("error"),O(P);return}z("submitting"),O(null);try{const U=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!U.ok){const K=await U.text();throw new Error(K||`Request failed: ${U.status}`)}z("success"),T(Object.fromEntries(w.map(K=>[K.name,""])))}catch(U){z("error"),O(U instanceof Error?U.message:"Something went wrong")}};return S.jsxs("div",{className:`${o}-wrapper ${R}`.trim(),style:ae,children:[S.jsx("style",{children:il(o)}),S.jsxs("form",{onSubmit:je,className:`${o}-form`,style:{...ue,minHeight:k.scalingValue(u,t)},children:[S.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:w.map(V=>S.jsx("input",{type:V.type==="email"?"email":V.type==="phone"?"tel":"text",name:V.name,autoComplete:"off",value:H[V.name]??"",onChange:x=>T(P=>({...P,[V.name]:x.target.value})),placeholder:V.placeholder,required:V.type==="email",className:`${o}-input`,style:{...X,paddingRight:k.scalingValue(d.right,t),paddingLeft:k.scalingValue(d.left,t),paddingTop:k.scalingValue(d.top,t),paddingBottom:k.scalingValue(d.bottom,t)}},V.name))}),S.jsx("div",{className:`${o}-overlayAnchor`,children:S.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":I,style:{...ce,...Se,paddingRight:k.scalingValue(h.right,t),paddingLeft:k.scalingValue(h.left,t),paddingTop:k.scalingValue(h.top,t),paddingBottom:k.scalingValue(h.bottom,t)},children:N==="submitting"?"...":ge?ee?S.jsx("img",{src:ee,alt:"",draggable:!1}):null:te})})]}),F==="success"&&S.jsx("p",{className:`${o}-success`,style:{...X,lineHeight:X==null?void 0:X.fontSize},children:W}),F==="error"&&S.jsx("p",{className:`${o}-error`,style:{...X,lineHeight:X==null?void 0:X.fontSize},role:"alert",children:f??G??M})]})},nr={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"},ll=["hover","focus","filled","success","error"];function sl(e,t,n){const r={};for(const[o,a]of Object.entries(nr))r[`--${e}-${a}`]=t[o];if(n)for(const o of ll){const a=n[o];if(a)for(const[i,s]of Object.entries(nr)){const l=a[i];l!==void 0&&(r[`--${e}-${o}-${s}`]=l)}}return r}function rr(e,t){return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:k.scalingValue(e.letterSpacing,t),wordSpacing:k.scalingValue(e.wordSpacing,t),fontSize:k.scalingValue(e.fontSize,t)}}const cl=[{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"},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"}},color:{type:"string",title:"Text Color",display:{type:"palette-color-picker"}}},ul=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],ir=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,fontSize:.01,lineHeight:.01,color:"#111111"}),pl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"layout",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","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonContent:{type:"object",scope:"common",display:{type:"button-content-switch"},properties:{mode:{type:"string",enum:["Label","Icon"]},label:{type:["string","null"],title:"Label",message:"Subscribe",display:{type:"text-input"}},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},strokeColor:{type:"string",scope:"layout",title:"Border Color",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"layout"},input:{type:"object",scope:"layout",title:"Input",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]},button:{type:"object",scope:"layout",title:"Button",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]}},defaults:{fields:cl,fieldsToShow:1,buttonContent:{mode:"Label",label:"Submit",icon:null},fontFamily:"Arial",inputPadding:{right:.01,left:.01,top:.01,bottom:.01},buttonPadding:{right:.01,left:.01,top:.01,bottom:.01},minHeight:.028,corners:.05,stroke:.001,strokeColor:"#cccccc",inputColor:"#ffffff",inputTextColor:"#999999",placeholderColor:"#cccccc",buttonColor:"#cccccc",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{},input:ir(400),button:ir(400)}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonContent"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"row",title:"Input",items:["input"]},{type:"row",title:"Button",items:["button"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...ul],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],hover:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],focus:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],filled:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},states:["default","hover","focus","filled","success","error"]},dl={element:al,id:"oneliner-form",name:"Newsletter Single Line",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.png"},defaultSize:{width:"30%",height:60},schema:pl},gl=[ea,la,Xa,ol,dl];exports.components=gl;exports.isSchemaV1=Yr;
|
|
1107
|
+
\`;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
type OnelinerFormProps = {
|
|
1111
|
+
settings: OnelinerFormSettings;
|
|
1112
|
+
content?: unknown;
|
|
1113
|
+
isEditor?: boolean;
|
|
1114
|
+
activeEvent?: string;
|
|
1115
|
+
} & CommonComponentProps;
|
|
1116
|
+
|
|
1117
|
+
export const OnelinerForm = ({ settings, isEditor, metadata, activeEvent }: OnelinerFormProps) => {
|
|
1118
|
+
const { prefix: P } = useScopedStyles();
|
|
1119
|
+
const {
|
|
1120
|
+
fields = [{ name: 'email', type: 'email', placeholder: 'Your email' }],
|
|
1121
|
+
buttonContent,
|
|
1122
|
+
buttonLabel,
|
|
1123
|
+
fieldsToShow = 1,
|
|
1124
|
+
fontFamily,
|
|
1125
|
+
inputFontSettings,
|
|
1126
|
+
inputFontSize,
|
|
1127
|
+
inputLineHeight,
|
|
1128
|
+
inputLetterSpacing,
|
|
1129
|
+
inputWordSpacing,
|
|
1130
|
+
inputTextAppearance,
|
|
1131
|
+
buttonFontSettings,
|
|
1132
|
+
buttonFontSize,
|
|
1133
|
+
buttonLineHeight,
|
|
1134
|
+
buttonLetterSpacing,
|
|
1135
|
+
buttonWordSpacing,
|
|
1136
|
+
buttonTextAppearance,
|
|
1137
|
+
statusFontSettings,
|
|
1138
|
+
statusFontSize,
|
|
1139
|
+
statusLineHeight,
|
|
1140
|
+
statusLetterSpacing,
|
|
1141
|
+
statusWordSpacing,
|
|
1142
|
+
statusTextAppearance,
|
|
1143
|
+
minHeight,
|
|
1144
|
+
corners,
|
|
1145
|
+
stroke,
|
|
1146
|
+
stateOverrides,
|
|
1147
|
+
inputPadding,
|
|
1148
|
+
buttonPadding,
|
|
1149
|
+
successMessage = 'Thanks for subscribing!',
|
|
1150
|
+
errorMessage: errorMessageText = 'Please, fill all required fields.',
|
|
1151
|
+
} = settings;
|
|
1152
|
+
|
|
1153
|
+
const visibleFields = fields.slice(0, Math.min(fieldsToShow, fields.length));
|
|
1154
|
+
const [values, setValues] = useState<Record<string, string>>(() =>
|
|
1155
|
+
Object.fromEntries(visibleFields.map((f) => [f.name, '']))
|
|
1156
|
+
);
|
|
1157
|
+
const [status, setStatus] = useState<'idle' | 'submitting' | 'success' | 'error'>('idle');
|
|
1158
|
+
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
|
1159
|
+
|
|
1160
|
+
const displayStatus = activeEvent === 'success' ? 'success'
|
|
1161
|
+
: activeEvent === 'error' ? 'error'
|
|
1162
|
+
: status;
|
|
1163
|
+
const displayError = activeEvent === 'error' ? errorMessageText : errorMessage;
|
|
1164
|
+
const displayValues = activeEvent === 'filled'
|
|
1165
|
+
? Object.fromEntries(visibleFields.map((f) => [f.name, 'Filled']))
|
|
1166
|
+
: values;
|
|
1167
|
+
const validationErrorMessage = displayStatus === 'error'
|
|
1168
|
+
? getFormFieldValidationError(visibleFields, displayValues)
|
|
1169
|
+
: null;
|
|
1170
|
+
const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
|
|
1171
|
+
const hasFilledFieldValue = visibleFields.some((f) => (displayValues[f.name] ?? '').trim().length > 0);
|
|
1172
|
+
const filledStateClass =
|
|
1173
|
+
stateClass !== \`\${P}-state-filled\` && hasFilledFieldValue ? \`\${P}-state-filled\` : '';
|
|
1174
|
+
const wrapperStateClasses = \`\${stateClass} \${filledStateClass}\`.trim();
|
|
1175
|
+
|
|
1176
|
+
const submitUrl = metadata?.submitUrl as string | undefined;
|
|
1177
|
+
const labelText = buttonLabel ?? '';
|
|
1178
|
+
const iconSrc = buttonContent?.icon ?? '';
|
|
1179
|
+
const useIconButton = buttonContent?.mode === 'On';
|
|
1180
|
+
const submitAriaLabel = labelText || 'Submit';
|
|
1181
|
+
|
|
1182
|
+
const resolvedInputTextStyle: TextStyles = {
|
|
1183
|
+
fontSettings: {
|
|
1184
|
+
fontFamily,
|
|
1185
|
+
fontWeight: inputFontSettings?.fontWeight ?? 400,
|
|
1186
|
+
fontStyle: inputFontSettings?.fontStyle ?? 'normal',
|
|
1187
|
+
},
|
|
1188
|
+
fontSize: inputFontSize ?? 0.01,
|
|
1189
|
+
lineHeight: inputLineHeight,
|
|
1190
|
+
letterSpacing: inputLetterSpacing ?? 0,
|
|
1191
|
+
wordSpacing: inputWordSpacing ?? 0,
|
|
1192
|
+
textAppearance: inputTextAppearance,
|
|
1193
|
+
color: settings.inputTextColor ?? '#111111',
|
|
1194
|
+
};
|
|
1195
|
+
|
|
1196
|
+
const resolvedButtonTextStyle: TextStyles = {
|
|
1197
|
+
fontSettings: {
|
|
1198
|
+
fontFamily,
|
|
1199
|
+
fontWeight: buttonFontSettings?.fontWeight ?? 400,
|
|
1200
|
+
fontStyle: buttonFontSettings?.fontStyle ?? 'normal',
|
|
1201
|
+
},
|
|
1202
|
+
fontSize: buttonFontSize ?? 0.01,
|
|
1203
|
+
lineHeight: buttonLineHeight,
|
|
1204
|
+
letterSpacing: buttonLetterSpacing ?? 0,
|
|
1205
|
+
wordSpacing: buttonWordSpacing ?? 0,
|
|
1206
|
+
textAppearance: buttonTextAppearance,
|
|
1207
|
+
color: settings.buttonTextColor ?? '#ffffff',
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
const resolvedStatusTextStyle: TextStyles = {
|
|
1211
|
+
fontSettings: {
|
|
1212
|
+
fontFamily,
|
|
1213
|
+
fontWeight: statusFontSettings?.fontWeight ?? 400,
|
|
1214
|
+
fontStyle: statusFontSettings?.fontStyle ?? 'normal',
|
|
1215
|
+
},
|
|
1216
|
+
fontSize: statusFontSize ?? 0.01,
|
|
1217
|
+
lineHeight: statusLineHeight,
|
|
1218
|
+
letterSpacing: statusLetterSpacing ?? 0,
|
|
1219
|
+
wordSpacing: statusWordSpacing ?? 0,
|
|
1220
|
+
textAppearance: statusTextAppearance,
|
|
1221
|
+
color: settings.successColor ?? '#22c55e',
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1224
|
+
const inputCss = textStylesToCss(resolvedInputTextStyle, isEditor);
|
|
1225
|
+
const buttonCss = textStylesToCss(resolvedButtonTextStyle, isEditor);
|
|
1226
|
+
const statusCss = textStylesToCss(resolvedStatusTextStyle, isEditor);
|
|
1227
|
+
const colorVars = buildColorVars(P, {
|
|
1228
|
+
strokeColor: settings.strokeColor,
|
|
1229
|
+
inputColor: settings.inputColor,
|
|
1230
|
+
placeholderColor: settings.placeholderColor,
|
|
1231
|
+
buttonColor: settings.buttonColor,
|
|
1232
|
+
successColor: settings.successColor,
|
|
1233
|
+
errorColor: settings.errorColor,
|
|
1234
|
+
inputTextColor: settings.inputTextColor ?? resolvedInputTextStyle?.color ?? '#111111',
|
|
1235
|
+
buttonTextColor: settings.buttonTextColor ?? resolvedButtonTextStyle?.color ?? '#ffffff',
|
|
1236
|
+
}, COLOR_VAR_MAP, STATE_KEYS, stateOverrides);
|
|
1237
|
+
|
|
1238
|
+
const formStyle: React.CSSProperties = {
|
|
1239
|
+
borderRadius: scalingValue(corners, isEditor),
|
|
1240
|
+
borderWidth: scalingValue(stroke, isEditor),
|
|
1241
|
+
borderStyle: 'solid',
|
|
1242
|
+
};
|
|
1243
|
+
|
|
1244
|
+
const dividerWidthStyle = { borderLeftWidth: scalingValue(stroke, isEditor) };
|
|
1245
|
+
|
|
1246
|
+
const handleSubmit = async (e: React.FormEvent) => {
|
|
1247
|
+
e.preventDefault();
|
|
1248
|
+
const payload = Object.fromEntries(
|
|
1249
|
+
visibleFields.map((f) => [f.name, values[f.name]?.trim() ?? '']).filter(([, v]) => v)
|
|
1250
|
+
);
|
|
1251
|
+
if (!submitUrl) {
|
|
1252
|
+
setStatus('error');
|
|
1253
|
+
setErrorMessage('No integrations were found for this form.');
|
|
1254
|
+
return;
|
|
1255
|
+
}
|
|
1256
|
+
if (Object.keys(payload).length === 0) return;
|
|
1257
|
+
|
|
1258
|
+
const validationError = getFormFieldValidationError(visibleFields, values);
|
|
1259
|
+
if (validationError) {
|
|
1260
|
+
setStatus('error');
|
|
1261
|
+
setErrorMessage(validationError);
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
setStatus('submitting');
|
|
1266
|
+
setErrorMessage(null);
|
|
1267
|
+
|
|
1268
|
+
try {
|
|
1269
|
+
const res = await fetch(submitUrl, {
|
|
1270
|
+
method: 'POST',
|
|
1271
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1272
|
+
body: JSON.stringify(payload),
|
|
1273
|
+
});
|
|
1274
|
+
|
|
1275
|
+
if (!res.ok) {
|
|
1276
|
+
const text = await res.text();
|
|
1277
|
+
throw new Error(text || \`Request failed: \${res.status}\`);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
setStatus('success');
|
|
1281
|
+
setValues(Object.fromEntries(visibleFields.map((f) => [f.name, ''])));
|
|
1282
|
+
} catch (err) {
|
|
1283
|
+
setStatus('error');
|
|
1284
|
+
setErrorMessage(err instanceof Error ? err.message : 'Something went wrong');
|
|
1285
|
+
}
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
return (
|
|
1289
|
+
<div className={\`\${P}-wrapper \${wrapperStateClasses}\`.trim()} style={colorVars}>
|
|
1290
|
+
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
1291
|
+
<form
|
|
1292
|
+
onSubmit={handleSubmit}
|
|
1293
|
+
className={\`\${P}-form\`}
|
|
1294
|
+
style={{
|
|
1295
|
+
...formStyle,
|
|
1296
|
+
height: scalingValue(minHeight, isEditor),
|
|
1297
|
+
minHeight: scalingValue(minHeight, isEditor),
|
|
1298
|
+
}}
|
|
1299
|
+
>
|
|
1300
|
+
<div
|
|
1301
|
+
className={\`\${P}-inputWrap \${P}-overlayAnchor\`}
|
|
1302
|
+
style={{ flex: 1, minWidth: 0 }}
|
|
1303
|
+
>
|
|
1304
|
+
{visibleFields.map((field) => (
|
|
1305
|
+
<input
|
|
1306
|
+
key={field.name}
|
|
1307
|
+
type={field.type === 'email' ? 'email' : field.type === 'phone' ? 'tel' : 'text'}
|
|
1308
|
+
name={field.name}
|
|
1309
|
+
autoComplete="off"
|
|
1310
|
+
value={displayValues[field.name] ?? ''}
|
|
1311
|
+
onChange={(e) => setValues((prev) => ({ ...prev, [field.name]: e.target.value }))}
|
|
1312
|
+
placeholder={field.placeholder}
|
|
1313
|
+
required={field.isRequired ?? field.type === 'email'}
|
|
1314
|
+
className={\`\${P}-input\`}
|
|
1315
|
+
style={{
|
|
1316
|
+
...inputCss,
|
|
1317
|
+
paddingRight: scalingValue(inputPadding.right, isEditor),
|
|
1318
|
+
paddingLeft: scalingValue(inputPadding.left, isEditor),
|
|
1319
|
+
paddingTop: scalingValue(inputPadding.top, isEditor),
|
|
1320
|
+
paddingBottom: scalingValue(inputPadding.bottom, isEditor),
|
|
1321
|
+
}}
|
|
1322
|
+
/>
|
|
1323
|
+
))}
|
|
1324
|
+
</div>
|
|
1325
|
+
<div className={\`\${P}-overlayAnchor\`}>
|
|
1326
|
+
<button
|
|
1327
|
+
type="submit"
|
|
1328
|
+
className={\`\${P}-submitBtn\`}
|
|
1329
|
+
aria-label={submitAriaLabel}
|
|
1330
|
+
style={{
|
|
1331
|
+
...buttonCss,
|
|
1332
|
+
...dividerWidthStyle,
|
|
1333
|
+
paddingRight: scalingValue(buttonPadding.right, isEditor),
|
|
1334
|
+
paddingLeft: scalingValue(buttonPadding.left, isEditor),
|
|
1335
|
+
paddingTop: scalingValue(buttonPadding.top, isEditor),
|
|
1336
|
+
paddingBottom: scalingValue(buttonPadding.bottom, isEditor),
|
|
1337
|
+
}}
|
|
1338
|
+
>
|
|
1339
|
+
{status === 'submitting'
|
|
1340
|
+
? '...'
|
|
1341
|
+
: useIconButton
|
|
1342
|
+
? (iconSrc && (
|
|
1343
|
+
<SvgImage
|
|
1344
|
+
url={iconSrc}
|
|
1345
|
+
className={\`\${P}-submitBtnIcon\`}
|
|
1346
|
+
fill={\`var(--\${P}-button-text-color)\`}
|
|
1347
|
+
hoverFill={\`var(--\${P}-button-text-color)\`}
|
|
1348
|
+
/>
|
|
1349
|
+
))
|
|
1350
|
+
: labelText}
|
|
1351
|
+
</button>
|
|
1352
|
+
</div>
|
|
1353
|
+
</form>
|
|
1354
|
+
{displayStatus === 'success' && (
|
|
1355
|
+
<p
|
|
1356
|
+
className={\`\${P}-success\`}
|
|
1357
|
+
style={{ ...statusCss }}
|
|
1358
|
+
>
|
|
1359
|
+
{successMessage}
|
|
1360
|
+
</p>
|
|
1361
|
+
)}
|
|
1362
|
+
{displayStatus === 'error' && (
|
|
1363
|
+
<p
|
|
1364
|
+
className={\`\${P}-error\`}
|
|
1365
|
+
style={{ ...statusCss }}
|
|
1366
|
+
role="alert"
|
|
1367
|
+
>
|
|
1368
|
+
{validationErrorMessage ?? displayError ?? errorMessageText}
|
|
1369
|
+
</p>
|
|
1370
|
+
)}
|
|
1371
|
+
</div>
|
|
1372
|
+
);
|
|
1373
|
+
};
|
|
1374
|
+
|
|
1375
|
+
type FieldConfig = {
|
|
1376
|
+
name: string;
|
|
1377
|
+
type: 'text' | 'phone' | 'email';
|
|
1378
|
+
placeholder: string;
|
|
1379
|
+
isRequired?: boolean;
|
|
1380
|
+
error?: string;
|
|
1381
|
+
};
|
|
1382
|
+
|
|
1383
|
+
type OnelinerColorKeys =
|
|
1384
|
+
| 'strokeColor'
|
|
1385
|
+
| 'inputColor'
|
|
1386
|
+
| 'placeholderColor'
|
|
1387
|
+
| 'buttonColor'
|
|
1388
|
+
| 'inputTextColor'
|
|
1389
|
+
| 'buttonTextColor'
|
|
1390
|
+
| 'successColor'
|
|
1391
|
+
| 'errorColor';
|
|
1392
|
+
|
|
1393
|
+
type StateColorOverrides = Partial<Record<OnelinerColorKeys, string>>;
|
|
1394
|
+
|
|
1395
|
+
export type OnelinerFormButtonContent = {
|
|
1396
|
+
mode?: 'On' | 'Off';
|
|
1397
|
+
icon?: string | null;
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1400
|
+
export type OnelinerFormSettings = {
|
|
1401
|
+
fields: FieldConfig[];
|
|
1402
|
+
fieldsToShow: number;
|
|
1403
|
+
buttonLabel?: string | null;
|
|
1404
|
+
buttonContent?: OnelinerFormButtonContent | null;
|
|
1405
|
+
fontFamily?: string;
|
|
1406
|
+
inputFontSettings?: { fontWeight: number; fontStyle: string };
|
|
1407
|
+
inputFontSize?: number;
|
|
1408
|
+
inputLineHeight?: number;
|
|
1409
|
+
inputLetterSpacing?: number;
|
|
1410
|
+
inputWordSpacing?: number;
|
|
1411
|
+
inputTextAppearance?: TextStyles['textAppearance'];
|
|
1412
|
+
buttonFontSettings?: { fontWeight: number; fontStyle: string };
|
|
1413
|
+
buttonFontSize?: number;
|
|
1414
|
+
buttonLineHeight?: number;
|
|
1415
|
+
buttonLetterSpacing?: number;
|
|
1416
|
+
buttonWordSpacing?: number;
|
|
1417
|
+
buttonTextAppearance?: TextStyles['textAppearance'];
|
|
1418
|
+
statusFontSettings?: { fontWeight: number; fontStyle: string };
|
|
1419
|
+
statusFontSize?: number;
|
|
1420
|
+
statusLineHeight?: number;
|
|
1421
|
+
statusLetterSpacing?: number;
|
|
1422
|
+
statusWordSpacing?: number;
|
|
1423
|
+
statusTextAppearance?: TextStyles['textAppearance'];
|
|
1424
|
+
minHeight: number;
|
|
1425
|
+
corners: number;
|
|
1426
|
+
stroke: number;
|
|
1427
|
+
inputPadding: {
|
|
1428
|
+
left: number;
|
|
1429
|
+
right: number;
|
|
1430
|
+
top: number;
|
|
1431
|
+
bottom: number;
|
|
1432
|
+
};
|
|
1433
|
+
buttonPadding: {
|
|
1434
|
+
left: number;
|
|
1435
|
+
right: number;
|
|
1436
|
+
top: number;
|
|
1437
|
+
bottom: number;
|
|
1438
|
+
};
|
|
1439
|
+
strokeColor: string;
|
|
1440
|
+
inputColor: string;
|
|
1441
|
+
placeholderColor: string;
|
|
1442
|
+
buttonColor: string;
|
|
1443
|
+
successColor: string;
|
|
1444
|
+
errorColor: string;
|
|
1445
|
+
inputTextColor?: string;
|
|
1446
|
+
buttonTextColor?: string;
|
|
1447
|
+
stateOverrides?: Record<string, StateColorOverrides>;
|
|
1448
|
+
successMessage?: string;
|
|
1449
|
+
errorMessage?: string;
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
1453
|
+
strokeColor: 'stroke-color',
|
|
1454
|
+
inputColor: 'input-color',
|
|
1455
|
+
placeholderColor: 'placeholder-color',
|
|
1456
|
+
buttonColor: 'button-color',
|
|
1457
|
+
inputTextColor: 'input-text-color',
|
|
1458
|
+
buttonTextColor: 'button-text-color',
|
|
1459
|
+
successColor: 'success-color',
|
|
1460
|
+
errorColor: 'error-color',
|
|
1461
|
+
};
|
|
1462
|
+
|
|
1463
|
+
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1464
|
+
`,Il="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="6" height="9"><path fill="white" transform="translate(0.0625 0.0595703)" d="M0.18305826 0.18305826C0.40836075 -0.042244215 0.76288015 -0.059575174 1.0080621 0.13106538L1.0669417 0.18305826L4.8169417 3.9330583C5.0422444 4.158361 5.0595751 4.5128803 4.8689346 4.7580624L4.8169417 4.8169417L1.0669417 8.5669422C0.82286406 8.8110189 0.42713594 8.8110189 0.18305826 8.5669422C-0.042244215 8.3416395 -0.059575174 7.9871197 0.13106538 7.7419376L0.18305826 7.6830583L3.4906249 4.375L0.18305826 1.0669417C-0.042244215 0.84163928 -0.059575174 0.48711985 0.13106538 0.24193785L0.18305826 0.18305826Z" fill-rule="evenodd"/></svg>'),kl=[{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."}],yn={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Fl=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Rl={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"}},buttonContent:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-content-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...yn.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:{...yn.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:{...yn.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:kl,fieldsToShow:1,buttonLabel:"Subscribe",buttonContent:{mode:"Off",icon:Il},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,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,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:"buttonContent.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonContent.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonContent.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonContent.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonContent.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonContent.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}}]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonContent"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Fl],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"]},Bl={element:Tl,id:"oneliner-form",name:"Newsletter Single Line",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.png"},defaultSize:{width:400,height:60},schema:Rl,sourceCode:Al},Vl=[Sa,Ea,fl,_l,Bl];exports.components=Vl;exports.isSchemaV1=dr;
|