@cntrl-site/components 1.0.1-alpha.1 → 1.0.1-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,14 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),z=require("react"),ce=require("classnames"),j=require("./useScopedStyles-b8cb4EW8.js"),Ur=require("react-dom");function Gr(e){return e.type==="object"&&e.version===1}const Yr="ControlSlider-module__wrapper___sHEkd",qr="ControlSlider-module__hoverArrow___A-dOH",Xr="ControlSlider-module__sliderItem___QQSkR",Kr="ControlSlider-module__sliderImage___9hRl-",Jr="ControlSlider-module__arrow___05ghY",Zr="ControlSlider-module__arrowVertical___tBfVN",Qr="ControlSlider-module__nextArrow___-30Yc",eo="ControlSlider-module__arrowInner___aEra3",to="ControlSlider-module__arrowIcon___S4ztF",no="ControlSlider-module__arrowImg___2dwJW",ro="ControlSlider-module__mirror___brd6U",oo="ControlSlider-module__pagination___bicLF",io="ControlSlider-module__paginationInner___bT-P-",ao="ControlSlider-module__paginationVertical___zYqKw",lo="ControlSlider-module__paginationItem___nTRbk",so="ControlSlider-module__dot___p1Qun",co="ControlSlider-module__activeDot___LHFaj",uo="ControlSlider-module__paginationInsideBottom___R3FWn",po="ControlSlider-module__paginationInsideTop___V-qb-",go="ControlSlider-module__paginationOutsideBottom___14w8D",fo="ControlSlider-module__paginationOutsideTop___SCLqB",mo="ControlSlider-module__paginationInsideLeft___yOBRZ",yo="ControlSlider-module__paginationInsideRight___Rtt3o",ho="ControlSlider-module__paginationOutsideLeft___lahaw",vo="ControlSlider-module__paginationOutsideRight___EtuQa",bo="ControlSlider-module__imgWrapper___UjEgB",_o="ControlSlider-module__captionBlock___dJ6-j",So="ControlSlider-module__captionTextWrapper___HFlpf",Co="ControlSlider-module__captionText___uGBVc",xo="ControlSlider-module__active___WZK4G",wo="ControlSlider-module__withPointerEvents___t-18M",Eo="ControlSlider-module__topLeftAlignment___zjnGM",Ao="ControlSlider-module__topCenterAlignment___gD1xW",To="ControlSlider-module__topRightAlignment___NMapS",Io="ControlSlider-module__middleLeftAlignment___OnUrY",$o="ControlSlider-module__middleCenterAlignment___Tdkl0",Lo="ControlSlider-module__middleRightAlignment___wEbfX",Ro="ControlSlider-module__bottomLeftAlignment___cTP2-",ko="ControlSlider-module__bottomCenterAlignment___c54fB",No="ControlSlider-module__bottomRightAlignment___kEwrz",Oo="ControlSlider-module__clickOverlay___DZA28",jo="ControlSlider-module__contain___pLyq7",Vo="ControlSlider-module__cover___KdDat",G={wrapper:Yr,hoverArrow:qr,sliderItem:Xr,sliderImage:Kr,arrow:Jr,arrowVertical:Zr,nextArrow:Qr,arrowInner:eo,arrowIcon:to,arrowImg:no,mirror:ro,pagination:oo,paginationInner:io,paginationVertical:ao,paginationItem:lo,dot:so,activeDot:co,paginationInsideBottom:uo,paginationInsideTop:po,paginationOutsideBottom:go,paginationOutsideTop:fo,paginationInsideLeft:mo,paginationInsideRight:yo,paginationOutsideLeft:ho,paginationOutsideRight:vo,imgWrapper:bo,captionBlock:_o,captionTextWrapper:So,captionText:Co,active:xo,withPointerEvents:wo,topLeftAlignment:Eo,topCenterAlignment:Ao,topRightAlignment:To,middleLeftAlignment:Io,middleCenterAlignment:$o,middleRightAlignment:Lo,bottomLeftAlignment:Ro,bottomCenterAlignment:ko,bottomRightAlignment:No,clickOverlay:Oo,contain:jo,cover:Vo};function Po(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 Bo(e,t,n){return t&&Po(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var On="(prefers-reduced-motion: reduce)",et=1,Fo=2,rt=3,at=4,bt=5,Lt=6,Ot=7,Do={CREATED:et,MOUNTED:Fo,IDLE:rt,MOVING:at,SCROLLING:bt,DRAGGING:Lt,DESTROYED:Ot};function Ne(e){e.length=0}function ze(e,t,n){return Array.prototype.slice.call(e,t,n)}function ae(e){return e.bind.apply(e,[null].concat(ze(arguments,1)))}var ir=setTimeout,on=function(){};function jn(e){return requestAnimationFrame(e)}function Ft(e,t){return typeof t===e}function dt(e){return!mn(e)&&Ft("object",e)}var fn=Array.isArray,ar=ae(Ft,"function"),Fe=ae(Ft,"string"),_t=ae(Ft,"undefined");function mn(e){return e===null}function lr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function St(e){return fn(e)?e:[e]}function Se(e,t){St(e).forEach(t)}function yn(e,t){return e.indexOf(t)>-1}function Rt(e,t){return e.push.apply(e,St(t)),e}function Le(e,t,n){e&&Se(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Ee(e,t){Le(e,Fe(t)?t.split(" "):t,!0)}function Ct(e,t){Se(t,e.appendChild.bind(e))}function hn(e,t){Se(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function gt(e,t){return lr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function sr(e,t){var n=e?ze(e.children):[];return t?n.filter(function(r){return gt(r,t)}):n}function xt(e,t){return t?sr(e,t)[0]:e.firstElementChild}var ft=Object.keys;function Ue(e,t,n){return e&&(n?ft(e).reverse():ft(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function mt(e){return ze(arguments,1).forEach(function(t){Ue(t,function(n,r){e[r]=t[r]})}),e}function Be(e){return ze(arguments,1).forEach(function(t){Ue(t,function(n,r){fn(n)?e[r]=n.slice():dt(n)?e[r]=Be({},dt(e[r])?e[r]:{},n):e[r]=n})}),e}function Vn(e,t){Se(t||ft(e),function(n){delete e[n]})}function Ae(e,t){Se(e,function(n){Se(t,function(r){n&&n.removeAttribute(r)})})}function Q(e,t,n){dt(t)?Ue(t,function(r,o){Q(e,o,r)}):Se(e,function(r){mn(n)||n===""?Ae(r,t):r.setAttribute(t,String(n))})}function tt(e,t,n){var r=document.createElement(e);return t&&(Fe(t)?Ee(r,t):Q(r,t)),n&&Ct(n,r),r}function Ce(e,t,n){if(_t(n))return getComputedStyle(e)[t];mn(n)||(e.style[t]=""+n)}function yt(e,t){Ce(e,"display",t)}function cr(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function xe(e,t){return e.getAttribute(t)}function Pn(e,t){return e&&e.classList.contains(t)}function be(e){return e.getBoundingClientRect()}function Ge(e){Se(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ur(e){return xt(new DOMParser().parseFromString(e,"text/html").body)}function $e(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function pr(e,t){return e&&e.querySelector(t)}function vn(e,t){return t?ze(e.querySelectorAll(t)):[]}function Re(e,t){Le(e,t,!1)}function an(e){return e.timeStamp}function He(e){return Fe(e)?e:e?e+"px":""}var wt="splide",bn="data-"+wt;function ct(e,t){if(!e)throw new Error("["+wt+"] "+(t||""))}var De=Math.min,jt=Math.max,Vt=Math.floor,ht=Math.ceil,ve=Math.abs;function dr(e,t,n){return ve(e-t)<n}function kt(e,t,n,r){var o=De(t,n),a=jt(t,n);return r?o<e&&e<a:o<=e&&e<=a}function Ze(e,t,n){var r=De(t,n),o=jt(t,n);return De(jt(r,e),o)}function ln(e){return+(e>0)-+(e<0)}function sn(e,t){return Se(t,function(n){e=e.replace("%s",""+n)}),e}function _n(e){return e<10?"0"+e:""+e}var Bn={};function zo(e){return""+e+_n(Bn[e]=(Bn[e]||0)+1)}function gr(){var e=[];function t(i,s,l,p){o(i,s,function(c,w,v){var b="addEventListener"in c,u=b?c.removeEventListener.bind(c,w,l,p):c.removeListener.bind(c,l);b?c.addEventListener(w,l,p):c.addListener(l),e.push([c,w,v,l,u])})}function n(i,s,l){o(i,s,function(p,c,w){e=e.filter(function(v){return v[0]===p&&v[1]===c&&v[2]===w&&(!l||v[3]===l)?(v[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){Se(i,function(p){p&&Se(s,function(c){c.split(" ").forEach(function(w){var v=w.split(".");l(p,v[0],v[1])})})})}function a(){e.forEach(function(i){i[4]()}),Ne(e)}return{bind:t,unbind:n,dispatch:r,destroy:a}}var Me="mounted",cn="ready",Oe="move",lt="moved",Sn="click",fr="active",mr="inactive",yr="visible",hr="hidden",me="refresh",he="updated",ot="resize",Dt="resized",vr="drag",br="dragging",_r="dragged",zt="scroll",qe="scrolled",Mo="overflow",Cn="destroy",Sr="arrows:mounted",Cr="arrows:updated",xr="pagination:mounted",wr="pagination:updated",xn="navigation:mounted",wn="autoplay:play",Er="autoplay:playing",En="autoplay:pause",An="lazyload:loaded",Ar="sk",Tr="sh",Pt="ei";function ue(e){var t=e?e.event.bus:document.createDocumentFragment(),n=gr();function r(a,i){n.bind(t,St(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(Cn,n.destroy),mt(n,{bus:t,on:r,off:ae(n.unbind,t),emit:o})}function Mt(e,t,n,r){var o=Date.now,a,i=0,s,l=!0,p=0;function c(){if(!l){if(i=e?De((o()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=o(),r&&++p>=r))return v();s=jn(c)}}function w(E){E||u(),a=o()-(E?i*e:0),l=!1,s=jn(c)}function v(){l=!0}function b(){a=o(),i=0,n&&n(i)}function u(){s&&cancelAnimationFrame(s),i=0,s=0,l=!0}function d(E){e=E}function A(){return l}return{start:w,rewind:b,pause:v,cancel:u,set:d,isPaused:A}}function Wo(e){var t=e;function n(o){t=o}function r(o){return yn(St(o),t)}return{set:n,is:r}}function Ho(e,t){var n=Mt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Uo(e,t,n){var r=e.state,o=n.breakpoints||{},a=n.reducedMotion||{},i=gr(),s=[];function l(){var u=n.mediaQuery==="min";ft(o).sort(function(d,A){return u?+d-+A:+A-+d}).forEach(function(d){c(o[d],"("+(u?"min":"max")+"-width:"+d+"px)")}),c(a,On),w()}function p(u){u&&i.destroy()}function c(u,d){var A=matchMedia(d);i.bind(A,"change",w),s.push([u,A])}function w(){var u=r.is(Ot),d=n.direction,A=s.reduce(function(E,g){return Be(E,g[1].matches?g[0]:{})},{});Vn(n),b(A),n.destroy?e.destroy(n.destroy==="completely"):u?(p(!0),e.mount()):d!==n.direction&&e.refresh()}function v(u){matchMedia(On).matches&&(u?Be(n,a):Vn(n,ft(a)))}function b(u,d,A){Be(n,u),d&&Be(Object.getPrototypeOf(n),u),(A||!r.is(et))&&e.emit(he,n)}return{setup:l,destroy:p,reduce:v,set:b}}var Wt="Arrow",Ht=Wt+"Left",Ut=Wt+"Right",Ir=Wt+"Up",$r=Wt+"Down",Fn="rtl",Gt="ttb",Kt={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ir,Ut],ArrowRight:[$r,Ht]};function Go(e,t,n){function r(a,i,s){s=s||n.direction;var l=s===Fn&&!i?1:s===Gt?0:-1;return Kt[a]&&Kt[a][l]||a.replace(/width|left|right/i,function(p,c){var w=Kt[p.toLowerCase()][l]||p;return c>0?w.charAt(0).toUpperCase()+w.slice(1):w})}function o(a){return a*(n.direction===Fn?1:-1)}return{resolve:r,orient:o}}var ke="role",nt="tabindex",Yo="disabled",we="aria-",Et=we+"controls",Lr=we+"current",Dn=we+"selected",_e=we+"label",Tn=we+"labelledby",Rr=we+"hidden",In=we+"orientation",vt=we+"roledescription",zn=we+"live",Mn=we+"busy",Wn=we+"atomic",$n=[ke,nt,Yo,Et,Lr,_e,Tn,Rr,In,vt],Te=wt+"__",We="is-",Jt=wt,Hn=Te+"track",qo=Te+"list",Yt=Te+"slide",kr=Yt+"--clone",Xo=Yt+"__container",Ln=Te+"arrows",qt=Te+"arrow",Nr=qt+"--prev",Or=qt+"--next",Xt=Te+"pagination",jr=Xt+"__page",Ko=Te+"progress",Jo=Ko+"__bar",Zo=Te+"toggle",Qo=Te+"spinner",ei=Te+"sr",ti=We+"initialized",Ye=We+"active",Vr=We+"prev",Pr=We+"next",un=We+"visible",pn=We+"loading",Br=We+"focus-in",Fr=We+"overflow",ni=[Ye,un,Vr,Pr,pn,Br,Fr],ri={slide:Yt,clone:kr,arrows:Ln,arrow:qt,prev:Nr,next:Or,pagination:Xt,page:jr,spinner:Qo};function oi(e,t){if(ar(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!gt(n,t);)n=n.parentElement;return n}var ii=5,Un=200,Dr="touchstart mousedown",Zt="touchmove mousemove",Qt="touchend touchcancel mouseup click";function ai(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=e.root,s=n.i18n,l={},p=[],c=[],w=[],v,b,u;function d(){y(),M(),g()}function A(){o(me,E),o(me,d),o(he,g),a(document,Dr+" keydown",function(h){u=h.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Le(i,Br,!!u)})}function E(h){var $=$n.concat("style");Ne(p),Re(i,c),Re(v,w),Ae([v,b],$),Ae(i,h?$:["style",vt])}function g(){Re(i,c),Re(v,w),c=I(Jt),w=I(Hn),Ee(i,c),Ee(v,w),Q(i,_e,n.label),Q(i,Tn,n.labelledby)}function y(){v=P("."+Hn),b=xt(v,"."+qo),ct(v&&b,"A track/list element is missing."),Rt(p,sr(b,"."+Yt+":not(."+kr+")")),Ue({arrows:Ln,pagination:Xt,prev:Nr,next:Or,bar:Jo,toggle:Zo},function(h,$){l[$]=P("."+h)}),mt(l,{root:i,track:v,list:b,slides:p})}function M(){var h=i.id||zo(wt),$=n.role;i.id=h,v.id=v.id||h+"-track",b.id=b.id||h+"-list",!xe(i,ke)&&i.tagName!=="SECTION"&&$&&Q(i,ke,$),Q(i,vt,s.carousel),Q(b,ke,"presentation")}function P(h){var $=pr(i,h);return $&&oi($,"."+Jt)===i?$:void 0}function I(h){return[h+"--"+n.type,h+"--"+n.direction,n.drag&&h+"--draggable",n.isNavigation&&h+"--nav",h===Jt&&Ye]}return mt(l,{setup:d,mount:A,destroy:E})}var it="slide",st="loop",At="fade";function li(e,t,n,r){var o=ue(e),a=o.on,i=o.emit,s=o.bind,l=e.Components,p=e.root,c=e.options,w=c.isNavigation,v=c.updateOnMove,b=c.i18n,u=c.pagination,d=c.slideFocus,A=l.Direction.resolve,E=xe(r,"style"),g=xe(r,_e),y=n>-1,M=xt(r,"."+Xo),P;function I(){y||(r.id=p.id+"-slide"+_n(t+1),Q(r,ke,u?"tabpanel":"group"),Q(r,vt,b.slide),Q(r,_e,g||sn(b.slideLabel,[t+1,e.length]))),h()}function h(){s(r,"click",ae(i,Sn,T)),s(r,"keydown",ae(i,Ar,T)),a([lt,Tr,qe],R),a(xn,k),v&&a(Oe,F)}function $(){P=!0,o.destroy(),Re(r,ni),Ae(r,$n),Q(r,"style",E),Q(r,_e,g||"")}function k(){var C=e.splides.map(function(m){var O=m.splide.Components.Slides.getAt(t);return O?O.slide.id:""}).join(" ");Q(r,_e,sn(b.slideX,(y?n:t)+1)),Q(r,Et,C),Q(r,ke,d?"button":""),d&&Ae(r,vt)}function F(){P||R()}function R(){if(!P){var C=e.index;N(),V(),Le(r,Vr,t===C-1),Le(r,Pr,t===C+1)}}function N(){var C=H();C!==Pn(r,Ye)&&(Le(r,Ye,C),Q(r,Lr,w&&C||""),i(C?fr:mr,T))}function V(){var C=f(),m=!C&&(!H()||y);if(e.state.is([at,bt])||Q(r,Rr,m||""),Q(vn(r,c.focusableNodes||""),nt,m?-1:""),d&&Q(r,nt,m?-1:0),C!==Pn(r,un)&&(Le(r,un,C),i(C?yr:hr,T)),!C&&document.activeElement===r){var O=l.Slides.getAt(e.index);O&&cr(O.slide)}}function W(C,m,O){Ce(O&&M||r,C,m)}function H(){var C=e.index;return C===t||c.cloneStatus&&C===n}function f(){if(e.is(At))return H();var C=be(l.Elements.track),m=be(r),O=A("left",!0),X=A("right",!0);return Vt(C[O])<=ht(m[O])&&Vt(m[X])<=ht(C[X])}function x(C,m){var O=ve(C-t);return!y&&(c.rewind||e.is(st))&&(O=De(O,e.length-O)),O<=m}var T={index:t,slideIndex:n,slide:r,container:M,isClone:y,mount:I,destroy:$,update:R,style:W,isWithin:x};return T}function si(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=r.bind,s=t.Elements,l=s.slides,p=s.list,c=[];function w(){v(),o(me,b),o(me,v)}function v(){l.forEach(function(R,N){d(R,N,-1)})}function b(){P(function(R){R.destroy()}),Ne(c)}function u(){P(function(R){R.update()})}function d(R,N,V){var W=li(e,N,V,R);W.mount(),c.push(W),c.sort(function(H,f){return H.index-f.index})}function A(R){return R?I(function(N){return!N.isClone}):c}function E(R){var N=t.Controller,V=N.toIndex(R),W=N.hasFocus()?1:n.perPage;return I(function(H){return kt(H.index,V,V+W-1)})}function g(R){return I(R)[0]}function y(R,N){Se(R,function(V){if(Fe(V)&&(V=ur(V)),lr(V)){var W=l[N];W?hn(V,W):Ct(p,V),Ee(V,n.classes.slide),$(V,ae(a,ot))}}),a(me)}function M(R){Ge(I(R).map(function(N){return N.slide})),a(me)}function P(R,N){A(N).forEach(R)}function I(R){return c.filter(ar(R)?R:function(N){return Fe(R)?gt(N.slide,R):yn(St(R),N.index)})}function h(R,N,V){P(function(W){W.style(R,N,V)})}function $(R,N){var V=vn(R,"img"),W=V.length;W?V.forEach(function(H){i(H,"load error",function(){--W||N()})}):N()}function k(R){return R?l.length:c.length}function F(){return c.length>n.perPage}return{mount:w,destroy:b,update:u,register:d,get:A,getIn:E,getAt:g,add:y,remove:M,forEach:P,filter:I,style:h,getLength:k,isEnough:F}}function ci(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=r.emit,s=t.Slides,l=t.Direction.resolve,p=t.Elements,c=p.root,w=p.track,v=p.list,b=s.getAt,u=s.style,d,A,E;function g(){y(),a(window,"resize load",Ho(ae(i,ot))),o([he,me],y),o(ot,M)}function y(){d=n.direction===Gt,Ce(c,"maxWidth",He(n.width)),Ce(w,l("paddingLeft"),P(!1)),Ce(w,l("paddingRight"),P(!0)),M(!0)}function M(T){var C=be(c);(T||A.width!==C.width||A.height!==C.height)&&(Ce(w,"height",I()),u(l("marginRight"),He(n.gap)),u("width",$()),u("height",k(),!0),A=C,i(Dt),E!==(E=x())&&(Le(c,Fr,E),i(Mo,E)))}function P(T){var C=n.padding,m=l(T?"right":"left");return C&&He(C[m]||(dt(C)?0:C))||"0px"}function I(){var T="";return d&&(T=h(),ct(T,"height or heightRatio is missing."),T="calc("+T+" - "+P(!1)+" - "+P(!0)+")"),T}function h(){return He(n.height||be(v).width*n.heightRatio)}function $(){return n.autoWidth?null:He(n.fixedWidth)||(d?"":F())}function k(){return He(n.fixedHeight)||(d?n.autoHeight?null:F():h())}function F(){var T=He(n.gap);return"calc((100%"+(T&&" + "+T)+")/"+(n.perPage||1)+(T&&" - "+T)+")"}function R(){return be(v)[l("width")]}function N(T,C){var m=b(T||0);return m?be(m.slide)[l("width")]+(C?0:H()):0}function V(T,C){var m=b(T);if(m){var O=be(m.slide)[l("right")],X=be(v)[l("left")];return ve(O-X)+(C?0:H())}return 0}function W(T){return V(e.length-1)-V(0)+N(0,T)}function H(){var T=b(0);return T&&parseFloat(Ce(T.slide,l("marginRight")))||0}function f(T){return parseFloat(Ce(w,l("padding"+(T?"Right":"Left"))))||0}function x(){return e.is(At)||W(!0)>R()}return{mount:g,resize:M,listSize:R,slideSize:N,sliderSize:W,totalSize:V,getPadding:f,isOverflow:x}}var ui=2;function pi(e,t,n){var r=ue(e),o=r.on,a=t.Elements,i=t.Slides,s=t.Direction.resolve,l=[],p;function c(){o(me,w),o([he,ot],b),(p=A())&&(u(p),t.Layout.resize(!0))}function w(){v(),c()}function v(){Ge(l),Ne(l),r.destroy()}function b(){var E=A();p!==E&&(p<E||!E)&&r.emit(me)}function u(E){var g=i.get().slice(),y=g.length;if(y){for(;g.length<E;)Rt(g,g);Rt(g.slice(-E),g.slice(0,E)).forEach(function(M,P){var I=P<E,h=d(M.slide,P);I?hn(h,g[0].slide):Ct(a.list,h),Rt(l,h),i.register(h,P-E+(I?0:y),M.index)})}}function d(E,g){var y=E.cloneNode(!0);return Ee(y,n.classes.clone),y.id=e.root.id+"-clone"+_n(g+1),y}function A(){var E=n.clones;if(!e.is(st))E=0;else if(_t(E)){var g=n[s("fixedWidth")]&&t.Layout.slideSize(0),y=g&&ht(be(a.track)[s("width")]/g);E=y||n[s("autoWidth")]&&e.length||n.perPage*ui}return E}return{mount:c,destroy:v}}function di(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=e.state.set,s=t.Layout,l=s.slideSize,p=s.getPadding,c=s.totalSize,w=s.listSize,v=s.sliderSize,b=t.Direction,u=b.resolve,d=b.orient,A=t.Elements,E=A.list,g=A.track,y;function M(){y=t.Transition,o([Me,Dt,he,me],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),h(e.index),t.Slides.update())}function I(m,O,X,oe){m!==O&&T(m>X)&&(R(),$(F(W(),m>X),!0)),i(at),a(Oe,O,X,m),y.start(O,function(){i(rt),a(lt,O,X,m),oe&&oe()})}function h(m){$(V(m,!0))}function $(m,O){if(!e.is(At)){var X=O?m:k(m);Ce(E,"transform","translate"+u("X")+"("+X+"px)"),m!==X&&a(Tr)}}function k(m){if(e.is(st)){var O=N(m),X=O>t.Controller.getEnd(),oe=O<0;(oe||X)&&(m=F(m,X))}return m}function F(m,O){var X=m-x(O),oe=v();return m-=d(oe*(ht(ve(X)/oe)||1))*(O?1:-1),m}function R(){$(W(),!0),y.cancel()}function N(m){for(var O=t.Slides.get(),X=0,oe=1/0,re=0;re<O.length;re++){var ye=O[re].index,L=ve(V(ye,!0)-m);if(L<=oe)oe=L,X=ye;else break}return X}function V(m,O){var X=d(c(m-1)-f(m));return O?H(X):X}function W(){var m=u("left");return be(E)[m]-be(g)[m]+d(p(!1))}function H(m){return n.trimSpace&&e.is(it)&&(m=Ze(m,0,d(v(!0)-w()))),m}function f(m){var O=n.focus;return O==="center"?(w()-l(m,!0))/2:+O*l(m)||0}function x(m){return V(m?t.Controller.getEnd():0,!!n.trimSpace)}function T(m){var O=d(F(W(),m));return m?O>=0:O<=E[u("scrollWidth")]-be(g)[u("width")]}function C(m,O){O=_t(O)?W():O;var X=m!==!0&&d(O)<d(x(!1)),oe=m!==!1&&d(O)>d(x(!0));return X||oe}return{mount:M,move:I,jump:h,translate:$,shift:F,cancel:R,toIndex:N,toPosition:V,getPosition:W,getLimit:x,exceededLimit:C,reposition:P}}function gi(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=t.Move,s=i.getPosition,l=i.getLimit,p=i.toPosition,c=t.Slides,w=c.isEnough,v=c.getLength,b=n.omitEnd,u=e.is(st),d=e.is(it),A=ae(W,!1),E=ae(W,!0),g=n.start||0,y,M=g,P,I,h;function $(){k(),o([he,me,Pt],k),o(Dt,F)}function k(){P=v(!0),I=n.perMove,h=n.perPage,y=T();var L=Ze(g,0,b?y:P-1);L!==g&&(g=L,i.reposition())}function F(){y!==T()&&a(Pt)}function R(L,J,ge){if(!ye()){var le=V(L),fe=x(le);fe>-1&&(J||fe!==g)&&(X(fe),i.move(le,fe,M,ge))}}function N(L,J,ge,le){t.Scroll.scroll(L,J,ge,function(){var fe=x(i.toIndex(s()));X(b?De(fe,y):fe),le&&le()})}function V(L){var J=g;if(Fe(L)){var ge=L.match(/([+\-<>])(\d+)?/)||[],le=ge[1],fe=ge[2];le==="+"||le==="-"?J=H(g+ +(""+le+(+fe||1)),g):le===">"?J=fe?C(+fe):A(!0):le==="<"&&(J=E(!0))}else J=u?L:Ze(L,0,y);return J}function W(L,J){var ge=I||(re()?1:h),le=H(g+ge*(L?-1:1),g,!(I||re()));return le===-1&&d&&!dr(s(),l(!L),1)?L?0:y:J?le:x(le)}function H(L,J,ge){if(w()||re()){var le=f(L);le!==L&&(J=L,L=le,ge=!1),L<0||L>y?!I&&(kt(0,L,J,!0)||kt(y,J,L,!0))?L=C(m(L)):u?L=ge?L<0?-(P%h||h):P:L:n.rewind?L=L<0?y:0:L=-1:ge&&L!==J&&(L=C(m(J)+(L<J?-1:1)))}else L=-1;return L}function f(L){if(d&&n.trimSpace==="move"&&L!==g)for(var J=s();J===p(L,!0)&&kt(L,0,e.length-1,!n.rewind);)L<g?--L:++L;return L}function x(L){return u?(L+P)%P||0:L}function T(){for(var L=P-(re()||u&&I?1:h);b&&L-- >0;)if(p(P-1,!0)!==p(L,!0)){L++;break}return Ze(L,0,P-1)}function C(L){return Ze(re()?L:h*L,0,y)}function m(L){return re()?De(L,y):Vt((L>=y?P-1:L)/h)}function O(L){var J=i.toIndex(L);return d?Ze(J,0,y):J}function X(L){L!==g&&(M=g,g=L)}function oe(L){return L?M:g}function re(){return!_t(n.focus)||n.isNavigation}function ye(){return e.state.is([at,bt])&&!!n.waitForTransition}return{mount:$,go:R,scroll:N,getNext:A,getPrev:E,getAdjacent:W,getEnd:T,setIndex:X,getIndex:oe,toIndex:C,toPage:m,toDest:O,hasFocus:re,isBusy:ye}}var fi="http://www.w3.org/2000/svg",mi="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",It=40;function yi(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=r.emit,s=n.classes,l=n.i18n,p=t.Elements,c=t.Controller,w=p.arrows,v=p.track,b=w,u=p.prev,d=p.next,A,E,g={};function y(){P(),o(he,M)}function M(){I(),y()}function P(){var N=n.arrows;N&&!(u&&d)&&k(),u&&d&&(mt(g,{prev:u,next:d}),yt(b,N?"":"none"),Ee(b,E=Ln+"--"+n.direction),N&&(h(),R(),Q([u,d],Et,v.id),i(Sr,u,d)))}function I(){r.destroy(),Re(b,E),A?(Ge(w?[u,d]:b),u=d=null):Ae([u,d],$n)}function h(){o([Me,lt,me,qe,Pt],R),a(d,"click",ae($,">")),a(u,"click",ae($,"<"))}function $(N){c.go(N,!0)}function k(){b=w||tt("div",s.arrows),u=F(!0),d=F(!1),A=!0,Ct(b,[u,d]),!w&&hn(b,v)}function F(N){var V='<button class="'+s.arrow+" "+(N?s.prev:s.next)+'" type="button"><svg xmlns="'+fi+'" viewBox="0 0 '+It+" "+It+'" width="'+It+'" height="'+It+'" focusable="false"><path d="'+(n.arrowPath||mi)+'" />';return ur(V)}function R(){if(u&&d){var N=e.index,V=c.getPrev(),W=c.getNext(),H=V>-1&&N<V?l.last:l.prev,f=W>-1&&N>W?l.first:l.next;u.disabled=V<0,d.disabled=W<0,Q(u,_e,H),Q(d,_e,f),i(Cr,u,d,V,W)}}return{arrows:g,mount:y,destroy:I,update:R}}var hi=bn+"-interval";function vi(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=r.emit,s=Mt(n.interval,e.go.bind(e,">"),h),l=s.isPaused,p=t.Elements,c=t.Elements,w=c.root,v=c.toggle,b=n.autoplay,u,d,A=b==="pause";function E(){b&&(g(),v&&Q(v,Et,p.track.id),A||y(),I())}function g(){n.pauseOnHover&&a(w,"mouseenter mouseleave",function(k){u=k.type==="mouseenter",P()}),n.pauseOnFocus&&a(w,"focusin focusout",function(k){d=k.type==="focusin",P()}),v&&a(v,"click",function(){A?y():M(!0)}),o([Oe,zt,me],s.rewind),o(Oe,$)}function y(){l()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),d=u=A=!1,I(),i(wn))}function M(k){k===void 0&&(k=!0),A=!!k,I(),l()||(s.pause(),i(En))}function P(){A||(u||d?M(!1):y())}function I(){v&&(Le(v,Ye,!A),Q(v,_e,n.i18n[A?"play":"pause"]))}function h(k){var F=p.bar;F&&Ce(F,"width",k*100+"%"),i(Er,k)}function $(k){var F=t.Slides.getAt(k);s.set(F&&+xe(F.slide,hi)||n.interval)}return{mount:E,destroy:s.cancel,play:y,pause:M,isPaused:l}}function bi(e,t,n){var r=ue(e),o=r.on;function a(){n.cover&&(o(An,ae(s,!0)),o([Me,he,me],ae(i,!0)))}function i(l){t.Slides.forEach(function(p){var c=xt(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),yt(p,l?"none":"")}return{mount:a,destroy:ae(i,!1)}}var _i=10,Si=600,Ci=.6,xi=1.5,wi=800;function Ei(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=e.state.set,s=t.Move,l=s.getPosition,p=s.getLimit,c=s.exceededLimit,w=s.translate,v=e.is(it),b,u,d=1;function A(){o(Oe,M),o([he,me],P)}function E(h,$,k,F,R){var N=l();if(M(),k&&(!v||!c())){var V=t.Layout.sliderSize(),W=ln(h)*V*Vt(ve(h)/V)||0;h=s.toPosition(t.Controller.toDest(h%V))+W}var H=dr(N,h,1);d=1,$=H?0:$||jt(ve(h-N)/xi,wi),u=F,b=Mt($,g,ae(y,N,h,R),1),i(bt),a(zt),b.start()}function g(){i(rt),u&&u(),a(qe)}function y(h,$,k,F){var R=l(),N=h+($-h)*I(F),V=(N-R)*d;w(R+V),v&&!k&&c()&&(d*=Ci,ve(V)<_i&&E(p(c(!0)),Si,!1,u,!0))}function M(){b&&b.cancel()}function P(){b&&!b.isPaused()&&(M(),g())}function I(h){var $=n.easingFunc;return $?$(h):1-Math.pow(1-h,4)}return{mount:A,destroy:M,scroll:E,cancel:P}}var Qe={passive:!1,capture:!0};function Ai(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=r.bind,s=r.unbind,l=e.state,p=t.Move,c=t.Scroll,w=t.Controller,v=t.Elements.track,b=t.Media.reduce,u=t.Direction,d=u.resolve,A=u.orient,E=p.getPosition,g=p.exceededLimit,y,M,P,I,h,$=!1,k,F,R;function N(){i(v,Zt,on,Qe),i(v,Qt,on,Qe),i(v,Dr,W,Qe),i(v,"click",x,{capture:!0}),i(v,"dragstart",$e),o([Me,he],V)}function V(){var D=n.drag;Xe(!D),I=D==="free"}function W(D){if(k=!1,!F){var S=fe(D);le(D.target)&&(S||!D.button)&&(w.isBusy()?$e(D,!0):(R=S?v:window,h=l.is([at,bt]),P=null,i(R,Zt,H,Qe),i(R,Qt,f,Qe),p.cancel(),c.cancel(),T(D)))}}function H(D){if(l.is(Lt)||(l.set(Lt),a(vr)),D.cancelable)if(h){p.translate(y+ge(re(D)));var S=ye(D)>Un,U=$!==($=g());(S||U)&&T(D),k=!0,a(br),$e(D)}else O(D)&&(h=m(D),$e(D))}function f(D){l.is(Lt)&&(l.set(rt),a(_r)),h&&(C(D),$e(D)),s(R,Zt,H),s(R,Qt,f),h=!1}function x(D){!F&&k&&$e(D,!0)}function T(D){P=M,M=D,y=E()}function C(D){var S=X(D),U=oe(S),Y=n.rewind&&n.rewindByDrag;b(!1),I?w.scroll(U,0,n.snap):e.is(At)?w.go(A(ln(S))<0?Y?"<":"-":Y?">":"+"):e.is(it)&&$&&Y?w.go(g(!0)?">":"<"):w.go(w.toDest(U),!0),b(!0)}function m(D){var S=n.dragMinThreshold,U=dt(S),Y=U&&S.mouse||0,Z=(U?S.touch:+S)||10;return ve(re(D))>(fe(D)?Z:Y)}function O(D){return ve(re(D))>ve(re(D,!0))}function X(D){if(e.is(st)||!$){var S=ye(D);if(S&&S<Un)return re(D)/S}return 0}function oe(D){return E()+ln(D)*De(ve(D)*(n.flickPower||600),I?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(D,S){return J(D,S)-J(L(D),S)}function ye(D){return an(D)-an(L(D))}function L(D){return M===D&&P||M}function J(D,S){return(fe(D)?D.changedTouches[0]:D)["page"+d(S?"Y":"X")]}function ge(D){return D/($&&e.is(it)?ii:1)}function le(D){var S=n.noDrag;return!gt(D,"."+jr+", ."+qt)&&(!S||!gt(D,S))}function fe(D){return typeof TouchEvent<"u"&&D instanceof TouchEvent}function je(){return h}function Xe(D){F=D}return{mount:N,disable:Xe,isDragging:je}}var Ti={Spacebar:" ",Right:Ut,Left:Ht,Up:Ir,Down:$r};function Rn(e){return e=Fe(e)?e:e.key,Ti[e]||e}var Gn="keydown";function Ii(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=r.unbind,s=e.root,l=t.Direction.resolve,p,c;function w(){v(),o(he,b),o(he,v),o(Oe,d)}function v(){var E=n.keyboard;E&&(p=E==="global"?window:s,a(p,Gn,A))}function b(){i(p,Gn)}function u(E){c=E}function d(){var E=c;c=!0,ir(function(){c=E})}function A(E){if(!c){var g=Rn(E);g===l(Ht)?e.go("<"):g===l(Ut)&&e.go(">")}}return{mount:w,destroy:b,disable:u}}var ut=bn+"-lazy",Nt=ut+"-srcset",$i="["+ut+"], ["+Nt+"]";function Li(e,t,n){var r=ue(e),o=r.on,a=r.off,i=r.bind,s=r.emit,l=n.lazyLoad==="sequential",p=[lt,qe],c=[];function w(){n.lazyLoad&&(v(),o(me,v))}function v(){Ne(c),b(),l?E():(a(p),o(p,u),u())}function b(){t.Slides.forEach(function(g){vn(g.slide,$i).forEach(function(y){var M=xe(y,ut),P=xe(y,Nt);if(M!==y.src||P!==y.srcset){var I=n.classes.spinner,h=y.parentElement,$=xt(h,"."+I)||tt("span",I,h);c.push([y,g,$]),y.src||yt(y,"none")}})})}function u(){c=c.filter(function(g){var y=n.perPage*((n.preloadPages||1)+1)-1;return g[1].isWithin(e.index,y)?d(g):!0}),c.length||a(p)}function d(g){var y=g[0];Ee(g[1].slide,pn),i(y,"load error",ae(A,g)),Q(y,"src",xe(y,ut)),Q(y,"srcset",xe(y,Nt)),Ae(y,ut),Ae(y,Nt)}function A(g,y){var M=g[0],P=g[1];Re(P.slide,pn),y.type!=="error"&&(Ge(g[2]),yt(M,""),s(An,M,P),s(ot)),l&&E()}function E(){c.length&&d(c.shift())}return{mount:w,destroy:ae(Ne,c),check:u}}function Ri(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=r.bind,s=t.Slides,l=t.Elements,p=t.Controller,c=p.hasFocus,w=p.getIndex,v=p.go,b=t.Direction.resolve,u=l.pagination,d=[],A,E;function g(){y(),o([he,me,Pt],g);var F=n.pagination;u&&yt(u,F?"":"none"),F&&(o([Oe,zt,qe],k),M(),k(),a(xr,{list:A,items:d},$(e.index)))}function y(){A&&(Ge(u?ze(A.children):A),Re(A,E),Ne(d),A=null),r.destroy()}function M(){var F=e.length,R=n.classes,N=n.i18n,V=n.perPage,W=c()?p.getEnd()+1:ht(F/V);A=u||tt("ul",R.pagination,l.track.parentElement),Ee(A,E=Xt+"--"+h()),Q(A,ke,"tablist"),Q(A,_e,N.select),Q(A,In,h()===Gt?"vertical":"");for(var H=0;H<W;H++){var f=tt("li",null,A),x=tt("button",{class:R.page,type:"button"},f),T=s.getIn(H).map(function(m){return m.slide.id}),C=!c()&&V>1?N.pageX:N.slideX;i(x,"click",ae(P,H)),n.paginationKeyboard&&i(x,"keydown",ae(I,H)),Q(f,ke,"presentation"),Q(x,ke,"tab"),Q(x,Et,T.join(" ")),Q(x,_e,sn(C,H+1)),Q(x,nt,-1),d.push({li:f,button:x,page:H})}}function P(F){v(">"+F,!0)}function I(F,R){var N=d.length,V=Rn(R),W=h(),H=-1;V===b(Ut,!1,W)?H=++F%N:V===b(Ht,!1,W)?H=(--F+N)%N:V==="Home"?H=0:V==="End"&&(H=N-1);var f=d[H];f&&(cr(f.button),v(">"+H),$e(R,!0))}function h(){return n.paginationDirection||n.direction}function $(F){return d[p.toPage(F)]}function k(){var F=$(w(!0)),R=$(w());if(F){var N=F.button;Re(N,Ye),Ae(N,Dn),Q(N,nt,-1)}if(R){var V=R.button;Ee(V,Ye),Q(V,Dn,!0),Q(V,nt,"")}a(wr,{list:A,items:d},F,R)}return{items:d,mount:g,destroy:y,getAt:$,update:k}}var ki=[" ","Enter"];function Ni(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()}),Ne(a)}function l(){s(),i()}function p(u,d){var A=ue(u);A.on(Oe,function(E,g,y){d.go(d.is(st)?y:E)}),a.push(A)}function c(){var u=ue(e),d=u.on;d(Sn,v),d(Ar,b),d([Me,he],w),a.push(u),u.emit(xn,e.splides)}function w(){Q(t.Elements.list,In,n.direction===Gt?"vertical":"")}function v(u){e.go(u.index)}function b(u,d){yn(ki,Rn(d))&&(v(u),$e(d))}return{setup:ae(t.Media.set,{slideFocus:_t(o)?r:o},!0),mount:i,destroy:s,remount:l}}function Oi(e,t,n){var r=ue(e),o=r.bind,a=0;function i(){n.wheel&&o(t.Elements.track,"wheel",s,Qe)}function s(p){if(p.cancelable){var c=p.deltaY,w=c<0,v=an(p),b=n.wheelMinThreshold||0,u=n.wheelSleep||0;ve(c)>b&&v-a>u&&(e.go(w?"<":">"),a=v),l(w)&&$e(p)}}function l(p){return!n.releaseWheel||e.state.is(at)||t.Controller.getAdjacent(p)!==-1}return{mount:i}}var ji=90;function Vi(e,t,n){var r=ue(e),o=r.on,a=t.Elements.track,i=n.live&&!n.isNavigation,s=tt("span",ei),l=Mt(ji,ae(c,!1));function p(){i&&(v(!t.Autoplay.isPaused()),Q(a,Wn,!0),s.textContent="…",o(wn,ae(v,!0)),o(En,ae(v,!1)),o([lt,qe],ae(c,!0)))}function c(b){Q(a,Mn,b),b?(Ct(a,s),l.start()):(Ge(s),l.cancel())}function w(){Ae(a,[zn,Wn,Mn]),Ge(s)}function v(b){i&&Q(a,zn,b?"off":"polite")}return{mount:p,disable:v,destroy:w}}var Pi=Object.freeze({__proto__:null,Media:Uo,Direction:Go,Elements:ai,Slides:si,Layout:ci,Clones:pi,Move:di,Controller:gi,Arrows:yi,Autoplay:vi,Cover:bi,Scroll:Ei,Drag:Ai,Keyboard:Ii,LazyLoad:Li,Pagination:Ri,Sync:Ni,Wheel:Oi,Live:Vi}),Bi={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"},Fi={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:ri,i18n:Bi,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Di(e,t,n){var r=t.Slides;function o(){ue(e).on([Me,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),ir(l)}return{mount:o,start:i,cancel:on}}function zi(e,t,n){var r=t.Move,o=t.Controller,a=t.Scroll,i=t.Elements.list,s=ae(Ce,i,"transition"),l;function p(){ue(e).bind(i,"transitionend",function(b){b.target===i&&l&&(w(),l())})}function c(b,u){var d=r.toPosition(b,!0),A=r.getPosition(),E=v(b);ve(d-A)>=1&&E>=1?n.useScroll?a.scroll(d,E,!1,u):(s("transform "+E+"ms "+n.easing),r.translate(d,!0),l=u):(r.jump(b),u())}function w(){s(""),a.cancel()}function v(b){var u=n.rewindSpeed;if(e.is(it)&&u){var d=o.getIndex(!0),A=o.getEnd();if(d===0&&b>=A||d>=A&&b===0)return u}return n.speed}return{mount:p,start:c,cancel:w}}var Mi=(function(){function e(n,r){this.event=ue(),this.Components={},this.state=Wo(et),this.splides=[],this._o={},this._E={};var o=Fe(n)?pr(document,n):n;ct(o,o+" is invalid."),this.root=o,r=Be({label:xe(o,_e)||"",labelledby:xe(o,Tn)||""},Fi,e.defaults,r||{});try{Be(r,JSON.parse(xe(o,bn)))}catch{ct(!1,"Invalid JSON")}this._o=Object.create(Be({},r))}var t=e.prototype;return t.mount=function(r,o){var a=this,i=this.state,s=this.Components;ct(i.is([et,Ot]),"Already mounted!"),i.set(et),this._C=s,this._T=o||this._T||(this.is(At)?Di:zi),this._E=r||this._E;var l=mt({},Pi,this._E,{Transition:this._T});return Ue(l,function(p,c){var w=p(a,s,a._o);s[c]=w,w.setup&&w.setup()}),Ue(s,function(p){p.mount&&p.mount()}),this.emit(Me),Ee(this.root,ti),i.set(rt),this.emit(cn),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(rt)&&(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(et)?ue(this).on(cn,this.destroy.bind(this,r)):(Ue(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(Cn),o.destroy(),r&&Ne(this.splides),a.set(Ot)),this},Bo(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})(),kn=Mi;kn.defaults={};kn.STATES=Do;var Yn=[[Me,"onMounted"],[cn,"onReady"],[Oe,"onMove"],[lt,"onMoved"],[Sn,"onClick"],[fr,"onActive"],[mr,"onInactive"],[yr,"onVisible"],[hr,"onHidden"],[me,"onRefresh"],[he,"onUpdated"],[ot,"onResize"],[Dt,"onResized"],[vr,"onDrag"],[br,"onDragging"],[_r,"onDragged"],[zt,"onScroll"],[qe,"onScrolled"],[Cn,"onDestroy"],[Sr,"onArrowsMounted"],[Cr,"onArrowsUpdated"],[xr,"onPaginationMounted"],[wr,"onPaginationUpdated"],[xn,"onNavigationMounted"],[wn,"onAutoplayPlay"],[Er,"onAutoplayPlaying"],[En,"onAutoplayPause"],[An,"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 Wi(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function Hi(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 Hi(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 Ui=({children:e,className:t,...n})=>z.createElement("div",{className:Nn("splide__track",t),...n},z.createElement("ul",{className:"splide__list"},e)),zr=class extends z.Component{constructor(){super(...arguments),this.splideRef=z.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new kn(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();Wi(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 z.createElement(t,{className:Nn("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yn.map(a=>a[1])])},n?z.createElement(Ui,null,r):r)}},Mr=({children:e,className:t,...n})=>z.createElement("li",{className:Nn("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),D=require("react"),ce=require("classnames"),k=require("./useScopedStyles-Bibm8h9Z.js"),ir=require("react-dom");function ar(e){return e.type==="object"&&e.version===1}const lr="ControlSlider-module__wrapper___sHEkd",sr="ControlSlider-module__hoverArrow___A-dOH",cr="ControlSlider-module__sliderItem___QQSkR",ur="ControlSlider-module__sliderImage___9hRl-",pr="ControlSlider-module__arrow___05ghY",dr="ControlSlider-module__arrowVertical___tBfVN",gr="ControlSlider-module__nextArrow___-30Yc",fr="ControlSlider-module__arrowInner___aEra3",mr="ControlSlider-module__arrowIcon___S4ztF",yr="ControlSlider-module__arrowImg___2dwJW",hr="ControlSlider-module__mirror___brd6U",vr="ControlSlider-module__pagination___bicLF",br="ControlSlider-module__paginationInner___bT-P-",Sr="ControlSlider-module__paginationVertical___zYqKw",xr="ControlSlider-module__paginationItem___nTRbk",Cr="ControlSlider-module__dot___p1Qun",_r="ControlSlider-module__activeDot___LHFaj",wr="ControlSlider-module__paginationInsideBottom___R3FWn",$r="ControlSlider-module__paginationInsideTop___V-qb-",Tr="ControlSlider-module__paginationOutsideBottom___14w8D",Ar="ControlSlider-module__paginationOutsideTop___SCLqB",Er="ControlSlider-module__paginationInsideLeft___yOBRZ",Lr="ControlSlider-module__paginationInsideRight___Rtt3o",Ir="ControlSlider-module__paginationOutsideLeft___lahaw",kr="ControlSlider-module__paginationOutsideRight___EtuQa",Rr="ControlSlider-module__imgWrapper___UjEgB",Fr="ControlSlider-module__captionBlock___dJ6-j",Vr="ControlSlider-module__captionTextWrapper___HFlpf",Nr="ControlSlider-module__captionText___uGBVc",Or="ControlSlider-module__active___WZK4G",Br="ControlSlider-module__withPointerEvents___t-18M",jr="ControlSlider-module__topLeftAlignment___zjnGM",Wr="ControlSlider-module__topCenterAlignment___gD1xW",zr="ControlSlider-module__topRightAlignment___NMapS",Mr="ControlSlider-module__middleLeftAlignment___OnUrY",Dr="ControlSlider-module__middleCenterAlignment___Tdkl0",Hr="ControlSlider-module__middleRightAlignment___wEbfX",Pr="ControlSlider-module__bottomLeftAlignment___cTP2-",Ur="ControlSlider-module__bottomCenterAlignment___c54fB",Gr="ControlSlider-module__bottomRightAlignment___kEwrz",Yr="ControlSlider-module__clickOverlay___DZA28",qr="ControlSlider-module__contain___pLyq7",Xr="ControlSlider-module__cover___KdDat",Y={wrapper:lr,hoverArrow:sr,sliderItem:cr,sliderImage:ur,arrow:pr,arrowVertical:dr,nextArrow:gr,arrowInner:fr,arrowIcon:mr,arrowImg:yr,mirror:hr,pagination:vr,paginationInner:br,paginationVertical:Sr,paginationItem:xr,dot:Cr,activeDot:_r,paginationInsideBottom:wr,paginationInsideTop:$r,paginationOutsideBottom:Tr,paginationOutsideTop:Ar,paginationInsideLeft:Er,paginationInsideRight:Lr,paginationOutsideLeft:Ir,paginationOutsideRight:kr,imgWrapper:Rr,captionBlock:Fr,captionTextWrapper:Vr,captionText:Nr,active:Or,withPointerEvents:Br,topLeftAlignment:jr,topCenterAlignment:Wr,topRightAlignment:zr,middleLeftAlignment:Mr,middleCenterAlignment:Dr,middleRightAlignment:Hr,bottomLeftAlignment:Pr,bottomCenterAlignment:Ur,bottomRightAlignment:Gr,clickOverlay:Yr,contain:qr,cover:Xr};function Kr(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Jr(e,t,n){return t&&Kr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Hn="(prefers-reduced-motion: reduce)",lt=1,Zr=2,ut=3,gt=4,Tt=5,Bt=6,Mt=7,Qr={CREATED:lt,MOUNTED:Zr,IDLE:ut,MOVING:gt,SCROLLING:Tt,DRAGGING:Bt,DESTROYED:Mt};function ze(e){e.length=0}function Ye(e,t,n){return Array.prototype.slice.call(e,t,n)}function se(e){return e.bind.apply(e,[null].concat(Ye(arguments,1)))}var mo=setTimeout,dn=function(){};function Pn(e){return requestAnimationFrame(e)}function Gt(e,t){return typeof t===e}function bt(e){return!Cn(e)&&Gt("object",e)}var xn=Array.isArray,yo=se(Gt,"function"),Ue=se(Gt,"string"),At=se(Gt,"undefined");function Cn(e){return e===null}function ho(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Et(e){return xn(e)?e:[e]}function $e(e,t){Et(e).forEach(t)}function _n(e,t){return e.indexOf(t)>-1}function jt(e,t){return e.push.apply(e,Et(t)),e}function Be(e,t,n){e&&$e(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function Fe(e,t){Be(e,Ue(t)?t.split(" "):t,!0)}function Lt(e,t){$e(t,e.appendChild.bind(e))}function wn(e,t){$e(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function St(e,t){return ho(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function vo(e,t){var n=e?Ye(e.children):[];return t?n.filter(function(o){return St(o,t)}):n}function It(e,t){return t?vo(e,t)[0]:e.firstElementChild}var xt=Object.keys;function Je(e,t,n){return e&&(n?xt(e).reverse():xt(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function Ct(e){return Ye(arguments,1).forEach(function(t){Je(t,function(n,o){e[o]=t[o]})}),e}function Pe(e){return Ye(arguments,1).forEach(function(t){Je(t,function(n,o){xn(n)?e[o]=n.slice():bt(n)?e[o]=Pe({},bt(e[o])?e[o]:{},n):e[o]=n})}),e}function Un(e,t){$e(t||xt(e),function(n){delete e[n]})}function Ve(e,t){$e(e,function(n){$e(t,function(o){n&&n.removeAttribute(o)})})}function ee(e,t,n){bt(t)?Je(t,function(o,r){ee(e,r,o)}):$e(e,function(o){Cn(n)||n===""?Ve(o,t):o.setAttribute(t,String(n))})}function st(e,t,n){var o=document.createElement(e);return t&&(Ue(t)?Fe(o,t):ee(o,t)),n&&Lt(n,o),o}function Ee(e,t,n){if(At(n))return getComputedStyle(e)[t];Cn(n)||(e.style[t]=""+n)}function _t(e,t){Ee(e,"display",t)}function bo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Le(e,t){return e.getAttribute(t)}function Gn(e,t){return e&&e.classList.contains(t)}function _e(e){return e.getBoundingClientRect()}function Ze(e){$e(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function So(e){return It(new DOMParser().parseFromString(e,"text/html").body)}function Oe(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function xo(e,t){return e&&e.querySelector(t)}function $n(e,t){return t?Ye(e.querySelectorAll(t)):[]}function je(e,t){Be(e,t,!1)}function gn(e){return e.timeStamp}function Ke(e){return Ue(e)?e:e?e+"px":""}var kt="splide",Tn="data-"+kt;function yt(e,t){if(!e)throw new Error("["+kt+"] "+(t||""))}var Ge=Math.min,Dt=Math.max,Ht=Math.floor,wt=Math.ceil,Ce=Math.abs;function Co(e,t,n){return Ce(e-t)<n}function Wt(e,t,n,o){var r=Ge(t,n),a=Dt(t,n);return o?r<e&&e<a:r<=e&&e<=a}function it(e,t,n){var o=Ge(t,n),r=Dt(t,n);return Ge(Dt(o,e),r)}function fn(e){return+(e>0)-+(e<0)}function mn(e,t){return $e(t,function(n){e=e.replace("%s",""+n)}),e}function An(e){return e<10?"0"+e:""+e}var Yn={};function ei(e){return""+e+An(Yn[e]=(Yn[e]||0)+1)}function _o(){var e=[];function t(i,s,l,d){r(i,s,function(p,_,m){var h="addEventListener"in p,c=h?p.removeEventListener.bind(p,_,l,d):p.removeListener.bind(p,l);h?p.addEventListener(_,l,d):p.addListener(l),e.push([p,_,m,l,c])})}function n(i,s,l){r(i,s,function(d,p,_){e=e.filter(function(m){return m[0]===d&&m[1]===p&&m[2]===_&&(!l||m[3]===l)?(m[4](),!1):!0})})}function o(i,s,l){var d,p=!0;return typeof CustomEvent=="function"?d=new CustomEvent(s,{bubbles:p,detail:l}):(d=document.createEvent("CustomEvent"),d.initCustomEvent(s,p,!1,l)),i.dispatchEvent(d),d}function r(i,s,l){$e(i,function(d){d&&$e(s,function(p){p.split(" ").forEach(function(_){var m=_.split(".");l(d,m[0],m[1])})})})}function a(){e.forEach(function(i){i[4]()}),ze(e)}return{bind:t,unbind:n,dispatch:o,destroy:a}}var qe="mounted",yn="ready",Me="move",ft="moved",En="click",wo="active",$o="inactive",To="visible",Ao="hidden",he="refresh",xe="updated",pt="resize",Yt="resized",Eo="drag",Lo="dragging",Io="dragged",qt="scroll",et="scrolled",ti="overflow",Ln="destroy",ko="arrows:mounted",Ro="arrows:updated",Fo="pagination:mounted",Vo="pagination:updated",In="navigation:mounted",kn="autoplay:play",No="autoplay:playing",Rn="autoplay:pause",Fn="lazyload:loaded",Oo="sk",Bo="sh",Pt="ei";function ue(e){var t=e?e.event.bus:document.createDocumentFragment(),n=_o();function o(a,i){n.bind(t,Et(a).join(" "),function(s){i.apply(i,xn(s.detail)?s.detail:[])})}function r(a){n.dispatch(t,a,Ye(arguments,1))}return e&&e.event.on(Ln,n.destroy),Ct(n,{bus:t,on:o,off:se(n.unbind,t),emit:r})}function Xt(e,t,n,o){var r=Date.now,a,i=0,s,l=!0,d=0;function p(){if(!l){if(i=e?Ge((r()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=r(),o&&++d>=o))return m();s=Pn(p)}}function _($){$||c(),a=r()-($?i*e:0),l=!1,s=Pn(p)}function m(){l=!0}function h(){a=r(),i=0,n&&n(i)}function c(){s&&cancelAnimationFrame(s),i=0,s=0,l=!0}function u($){e=$}function b(){return l}return{start:_,rewind:h,pause:m,cancel:c,set:u,isPaused:b}}function ni(e){var t=e;function n(r){t=r}function o(r){return _n(Et(r),t)}return{set:n,is:o}}function oi(e,t){var n=Xt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ri(e,t,n){var o=e.state,r=n.breakpoints||{},a=n.reducedMotion||{},i=_o(),s=[];function l(){var c=n.mediaQuery==="min";xt(r).sort(function(u,b){return c?+u-+b:+b-+u}).forEach(function(u){p(r[u],"("+(c?"min":"max")+"-width:"+u+"px)")}),p(a,Hn),_()}function d(c){c&&i.destroy()}function p(c,u){var b=matchMedia(u);i.bind(b,"change",_),s.push([c,b])}function _(){var c=o.is(Mt),u=n.direction,b=s.reduce(function($,f){return Pe($,f[1].matches?f[0]:{})},{});Un(n),h(b),n.destroy?e.destroy(n.destroy==="completely"):c?(d(!0),e.mount()):u!==n.direction&&e.refresh()}function m(c){matchMedia(Hn).matches&&(c?Pe(n,a):Un(n,xt(a)))}function h(c,u,b){Pe(n,c),u&&Pe(Object.getPrototypeOf(n),c),(b||!o.is(lt))&&e.emit(xe,n)}return{setup:l,destroy:d,reduce:m,set:h}}var Kt="Arrow",Jt=Kt+"Left",Zt=Kt+"Right",jo=Kt+"Up",Wo=Kt+"Down",qn="rtl",Qt="ttb",rn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[jo,Zt],ArrowRight:[Wo,Jt]};function ii(e,t,n){function o(a,i,s){s=s||n.direction;var l=s===qn&&!i?1:s===Qt?0:-1;return rn[a]&&rn[a][l]||a.replace(/width|left|right/i,function(d,p){var _=rn[d.toLowerCase()][l]||d;return p>0?_.charAt(0).toUpperCase()+_.slice(1):_})}function r(a){return a*(n.direction===qn?1:-1)}return{resolve:o,orient:r}}var We="role",ct="tabindex",ai="disabled",Ie="aria-",Rt=Ie+"controls",zo=Ie+"current",Xn=Ie+"selected",we=Ie+"label",Vn=Ie+"labelledby",Mo=Ie+"hidden",Nn=Ie+"orientation",$t=Ie+"roledescription",Kn=Ie+"live",Jn=Ie+"busy",Zn=Ie+"atomic",On=[We,ct,ai,Rt,zo,we,Vn,Mo,Nn,$t],Ne=kt+"__",Xe="is-",an=kt,Qn=Ne+"track",li=Ne+"list",en=Ne+"slide",Do=en+"--clone",si=en+"__container",Bn=Ne+"arrows",tn=Ne+"arrow",Ho=tn+"--prev",Po=tn+"--next",nn=Ne+"pagination",Uo=nn+"__page",ci=Ne+"progress",ui=ci+"__bar",pi=Ne+"toggle",di=Ne+"spinner",gi=Ne+"sr",fi=Xe+"initialized",Qe=Xe+"active",Go=Xe+"prev",Yo=Xe+"next",hn=Xe+"visible",vn=Xe+"loading",qo=Xe+"focus-in",Xo=Xe+"overflow",mi=[Qe,hn,Go,Yo,vn,qo,Xo],yi={slide:en,clone:Do,arrows:Bn,arrow:tn,prev:Ho,next:Po,pagination:nn,page:Uo,spinner:di};function hi(e,t){if(yo(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!St(n,t);)n=n.parentElement;return n}var vi=5,eo=200,Ko="touchstart mousedown",ln="touchmove mousemove",sn="touchend touchcancel mouseup click";function bi(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=e.root,s=n.i18n,l={},d=[],p=[],_=[],m,h,c;function u(){w(),j(),f()}function b(){r(he,$),r(he,u),r(xe,f),a(document,Ko+" keydown",function(v){c=v.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Be(i,qo,!!c)})}function $(v){var T=On.concat("style");ze(d),je(i,p),je(m,_),Ve([m,h],T),Ve(i,v?T:["style",$t])}function f(){je(i,p),je(m,_),p=E(an),_=E(Qn),Fe(i,p),Fe(m,_),ee(i,we,n.label),ee(i,Vn,n.labelledby)}function w(){m=W("."+Qn),h=It(m,"."+li),yt(m&&h,"A track/list element is missing."),jt(d,vo(h,"."+en+":not(."+Do+")")),Je({arrows:Bn,pagination:nn,prev:Ho,next:Po,bar:ui,toggle:pi},function(v,T){l[T]=W("."+v)}),Ct(l,{root:i,track:m,list:h,slides:d})}function j(){var v=i.id||ei(kt),T=n.role;i.id=v,m.id=m.id||v+"-track",h.id=h.id||v+"-list",!Le(i,We)&&i.tagName!=="SECTION"&&T&&ee(i,We,T),ee(i,$t,s.carousel),ee(h,We,"presentation")}function W(v){var T=xo(i,v);return T&&hi(T,"."+an)===i?T:void 0}function E(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===an&&Qe]}return Ct(l,{setup:u,mount:b,destroy:$})}var dt="slide",mt="loop",Ft="fade";function Si(e,t,n,o){var r=ue(e),a=r.on,i=r.emit,s=r.bind,l=e.Components,d=e.root,p=e.options,_=p.isNavigation,m=p.updateOnMove,h=p.i18n,c=p.pagination,u=p.slideFocus,b=l.Direction.resolve,$=Le(o,"style"),f=Le(o,we),w=n>-1,j=It(o,"."+si),W;function E(){w||(o.id=d.id+"-slide"+An(t+1),ee(o,We,c?"tabpanel":"group"),ee(o,$t,h.slide),ee(o,we,f||mn(h.slideLabel,[t+1,e.length]))),v()}function v(){s(o,"click",se(i,En,x)),s(o,"keydown",se(i,Oo,x)),a([ft,Bo,et],L),a(In,V),m&&a(Me,z)}function T(){W=!0,r.destroy(),je(o,mi),Ve(o,On),ee(o,"style",$),ee(o,we,f||"")}function V(){var A=e.splides.map(function(C){var N=C.splide.Components.Slides.getAt(t);return N?N.slide.id:""}).join(" ");ee(o,we,mn(h.slideX,(w?n:t)+1)),ee(o,Rt,A),ee(o,We,u?"button":""),u&&Ve(o,$t)}function z(){W||L()}function L(){if(!W){var A=e.index;F(),O(),Be(o,Go,t===A-1),Be(o,Yo,t===A+1)}}function F(){var A=H();A!==Gn(o,Qe)&&(Be(o,Qe,A),ee(o,zo,_&&A||""),i(A?wo:$o,x))}function O(){var A=g(),C=!A&&(!H()||w);if(e.state.is([gt,Tt])||ee(o,Mo,C||""),ee($n(o,p.focusableNodes||""),ct,C?-1:""),u&&ee(o,ct,C?-1:0),A!==Gn(o,hn)&&(Be(o,hn,A),i(A?To:Ao,x)),!A&&document.activeElement===o){var N=l.Slides.getAt(e.index);N&&bo(N.slide)}}function U(A,C,N){Ee(N&&j||o,A,C)}function H(){var A=e.index;return A===t||p.cloneStatus&&A===n}function g(){if(e.is(Ft))return H();var A=_e(l.Elements.track),C=_e(o),N=b("left",!0),q=b("right",!0);return Ht(A[N])<=wt(C[N])&&Ht(C[q])<=wt(A[q])}function R(A,C){var N=Ce(A-t);return!w&&(p.rewind||e.is(mt))&&(N=Ge(N,e.length-N)),N<=C}var x={index:t,slideIndex:n,slide:o,container:j,isClone:w,mount:E,destroy:T,update:L,style:U,isWithin:R};return x}function xi(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=o.bind,s=t.Elements,l=s.slides,d=s.list,p=[];function _(){m(),r(he,h),r(he,m)}function m(){l.forEach(function(L,F){u(L,F,-1)})}function h(){W(function(L){L.destroy()}),ze(p)}function c(){W(function(L){L.update()})}function u(L,F,O){var U=Si(e,F,O,L);U.mount(),p.push(U),p.sort(function(H,g){return H.index-g.index})}function b(L){return L?E(function(F){return!F.isClone}):p}function $(L){var F=t.Controller,O=F.toIndex(L),U=F.hasFocus()?1:n.perPage;return E(function(H){return Wt(H.index,O,O+U-1)})}function f(L){return E(L)[0]}function w(L,F){$e(L,function(O){if(Ue(O)&&(O=So(O)),ho(O)){var U=l[F];U?wn(O,U):Lt(d,O),Fe(O,n.classes.slide),T(O,se(a,pt))}}),a(he)}function j(L){Ze(E(L).map(function(F){return F.slide})),a(he)}function W(L,F){b(F).forEach(L)}function E(L){return p.filter(yo(L)?L:function(F){return Ue(L)?St(F.slide,L):_n(Et(L),F.index)})}function v(L,F,O){W(function(U){U.style(L,F,O)})}function T(L,F){var O=$n(L,"img"),U=O.length;U?O.forEach(function(H){i(H,"load error",function(){--U||F()})}):F()}function V(L){return L?l.length:p.length}function z(){return p.length>n.perPage}return{mount:_,destroy:h,update:c,register:u,get:b,getIn:$,getAt:f,add:w,remove:j,forEach:W,filter:E,style:v,getLength:V,isEnough:z}}function Ci(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=o.emit,s=t.Slides,l=t.Direction.resolve,d=t.Elements,p=d.root,_=d.track,m=d.list,h=s.getAt,c=s.style,u,b,$;function f(){w(),a(window,"resize load",oi(se(i,pt))),r([xe,he],w),r(pt,j)}function w(){u=n.direction===Qt,Ee(p,"maxWidth",Ke(n.width)),Ee(_,l("paddingLeft"),W(!1)),Ee(_,l("paddingRight"),W(!0)),j(!0)}function j(x){var A=_e(p);(x||b.width!==A.width||b.height!==A.height)&&(Ee(_,"height",E()),c(l("marginRight"),Ke(n.gap)),c("width",T()),c("height",V(),!0),b=A,i(Yt),$!==($=R())&&(Be(p,Xo,$),i(ti,$)))}function W(x){var A=n.padding,C=l(x?"right":"left");return A&&Ke(A[C]||(bt(A)?0:A))||"0px"}function E(){var x="";return u&&(x=v(),yt(x,"height or heightRatio is missing."),x="calc("+x+" - "+W(!1)+" - "+W(!0)+")"),x}function v(){return Ke(n.height||_e(m).width*n.heightRatio)}function T(){return n.autoWidth?null:Ke(n.fixedWidth)||(u?"":z())}function V(){return Ke(n.fixedHeight)||(u?n.autoHeight?null:z():v())}function z(){var x=Ke(n.gap);return"calc((100%"+(x&&" + "+x)+")/"+(n.perPage||1)+(x&&" - "+x)+")"}function L(){return _e(m)[l("width")]}function F(x,A){var C=h(x||0);return C?_e(C.slide)[l("width")]+(A?0:H()):0}function O(x,A){var C=h(x);if(C){var N=_e(C.slide)[l("right")],q=_e(m)[l("left")];return Ce(N-q)+(A?0:H())}return 0}function U(x){return O(e.length-1)-O(0)+F(0,x)}function H(){var x=h(0);return x&&parseFloat(Ee(x.slide,l("marginRight")))||0}function g(x){return parseFloat(Ee(_,l("padding"+(x?"Right":"Left"))))||0}function R(){return e.is(Ft)||U(!0)>L()}return{mount:f,resize:j,listSize:L,slideSize:F,sliderSize:U,totalSize:O,getPadding:g,isOverflow:R}}var _i=2;function wi(e,t,n){var o=ue(e),r=o.on,a=t.Elements,i=t.Slides,s=t.Direction.resolve,l=[],d;function p(){r(he,_),r([xe,pt],h),(d=b())&&(c(d),t.Layout.resize(!0))}function _(){m(),p()}function m(){Ze(l),ze(l),o.destroy()}function h(){var $=b();d!==$&&(d<$||!$)&&o.emit(he)}function c($){var f=i.get().slice(),w=f.length;if(w){for(;f.length<$;)jt(f,f);jt(f.slice(-$),f.slice(0,$)).forEach(function(j,W){var E=W<$,v=u(j.slide,W);E?wn(v,f[0].slide):Lt(a.list,v),jt(l,v),i.register(v,W-$+(E?0:w),j.index)})}}function u($,f){var w=$.cloneNode(!0);return Fe(w,n.classes.clone),w.id=e.root.id+"-clone"+An(f+1),w}function b(){var $=n.clones;if(!e.is(mt))$=0;else if(At($)){var f=n[s("fixedWidth")]&&t.Layout.slideSize(0),w=f&&wt(_e(a.track)[s("width")]/f);$=w||n[s("autoWidth")]&&e.length||n.perPage*_i}return $}return{mount:p,destroy:m}}function $i(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=e.state.set,s=t.Layout,l=s.slideSize,d=s.getPadding,p=s.totalSize,_=s.listSize,m=s.sliderSize,h=t.Direction,c=h.resolve,u=h.orient,b=t.Elements,$=b.list,f=b.track,w;function j(){w=t.Transition,r([qe,Yt,xe,he],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function E(C,N,q,ie){C!==N&&x(C>q)&&(L(),T(z(U(),C>q),!0)),i(gt),a(Me,N,q,C),w.start(N,function(){i(ut),a(ft,N,q,C),ie&&ie()})}function v(C){T(O(C,!0))}function T(C,N){if(!e.is(Ft)){var q=N?C:V(C);Ee($,"transform","translate"+c("X")+"("+q+"px)"),C!==q&&a(Bo)}}function V(C){if(e.is(mt)){var N=F(C),q=N>t.Controller.getEnd(),ie=N<0;(ie||q)&&(C=z(C,q))}return C}function z(C,N){var q=C-R(N),ie=m();return C-=u(ie*(wt(Ce(q)/ie)||1))*(N?1:-1),C}function L(){T(U(),!0),w.cancel()}function F(C){for(var N=t.Slides.get(),q=0,ie=1/0,Q=0;Q<N.length;Q++){var me=N[Q].index,I=Ce(O(me,!0)-C);if(I<=ie)ie=I,q=me;else break}return q}function O(C,N){var q=u(p(C-1)-g(C));return N?H(q):q}function U(){var C=c("left");return _e($)[C]-_e(f)[C]+u(d(!1))}function H(C){return n.trimSpace&&e.is(dt)&&(C=it(C,0,u(m(!0)-_()))),C}function g(C){var N=n.focus;return N==="center"?(_()-l(C,!0))/2:+N*l(C)||0}function R(C){return O(C?t.Controller.getEnd():0,!!n.trimSpace)}function x(C){var N=u(z(U(),C));return C?N>=0:N<=$[c("scrollWidth")]-_e(f)[c("width")]}function A(C,N){N=At(N)?U():N;var q=C!==!0&&u(N)<u(R(!1)),ie=C!==!1&&u(N)>u(R(!0));return q||ie}return{mount:j,move:E,jump:v,translate:T,shift:z,cancel:L,toIndex:F,toPosition:O,getPosition:U,getLimit:R,exceededLimit:A,reposition:W}}function Ti(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=t.Move,s=i.getPosition,l=i.getLimit,d=i.toPosition,p=t.Slides,_=p.isEnough,m=p.getLength,h=n.omitEnd,c=e.is(mt),u=e.is(dt),b=se(U,!1),$=se(U,!0),f=n.start||0,w,j=f,W,E,v;function T(){V(),r([xe,he,Pt],V),r(Yt,z)}function V(){W=m(!0),E=n.perMove,v=n.perPage,w=x();var I=it(f,0,h?w:W-1);I!==f&&(f=I,i.reposition())}function z(){w!==x()&&a(Pt)}function L(I,K,ye){if(!me()){var ae=O(I),pe=R(ae);pe>-1&&(K||pe!==f)&&(q(pe),i.move(ae,pe,j,ye))}}function F(I,K,ye,ae){t.Scroll.scroll(I,K,ye,function(){var pe=R(i.toIndex(s()));q(h?Ge(pe,w):pe),ae&&ae()})}function O(I){var K=f;if(Ue(I)){var ye=I.match(/([+\-<>])(\d+)?/)||[],ae=ye[1],pe=ye[2];ae==="+"||ae==="-"?K=H(f+ +(""+ae+(+pe||1)),f):ae===">"?K=pe?A(+pe):b(!0):ae==="<"&&(K=$(!0))}else K=c?I:it(I,0,w);return K}function U(I,K){var ye=E||(Q()?1:v),ae=H(f+ye*(I?-1:1),f,!(E||Q()));return ae===-1&&u&&!Co(s(),l(!I),1)?I?0:w:K?ae:R(ae)}function H(I,K,ye){if(_()||Q()){var ae=g(I);ae!==I&&(K=I,I=ae,ye=!1),I<0||I>w?!E&&(Wt(0,I,K,!0)||Wt(w,K,I,!0))?I=A(C(I)):c?I=ye?I<0?-(W%v||v):W:I:n.rewind?I=I<0?w:0:I=-1:ye&&I!==K&&(I=A(C(K)+(I<K?-1:1)))}else I=-1;return I}function g(I){if(u&&n.trimSpace==="move"&&I!==f)for(var K=s();K===d(I,!0)&&Wt(I,0,e.length-1,!n.rewind);)I<f?--I:++I;return I}function R(I){return c?(I+W)%W||0:I}function x(){for(var I=W-(Q()||c&&E?1:v);h&&I-- >0;)if(d(W-1,!0)!==d(I,!0)){I++;break}return it(I,0,W-1)}function A(I){return it(Q()?I:v*I,0,w)}function C(I){return Q()?Ge(I,w):Ht((I>=w?W-1:I)/v)}function N(I){var K=i.toIndex(I);return u?it(K,0,w):K}function q(I){I!==f&&(j=f,f=I)}function ie(I){return I?j:f}function Q(){return!At(n.focus)||n.isNavigation}function me(){return e.state.is([gt,Tt])&&!!n.waitForTransition}return{mount:T,go:L,scroll:F,getNext:b,getPrev:$,getAdjacent:U,getEnd:x,setIndex:q,getIndex:ie,toIndex:A,toPage:C,toDest:N,hasFocus:Q,isBusy:me}}var Ai="http://www.w3.org/2000/svg",Ei="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",Vt=40;function Li(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=o.emit,s=n.classes,l=n.i18n,d=t.Elements,p=t.Controller,_=d.arrows,m=d.track,h=_,c=d.prev,u=d.next,b,$,f={};function w(){W(),r(xe,j)}function j(){E(),w()}function W(){var F=n.arrows;F&&!(c&&u)&&V(),c&&u&&(Ct(f,{prev:c,next:u}),_t(h,F?"":"none"),Fe(h,$=Bn+"--"+n.direction),F&&(v(),L(),ee([c,u],Rt,m.id),i(ko,c,u)))}function E(){o.destroy(),je(h,$),b?(Ze(_?[c,u]:h),c=u=null):Ve([c,u],On)}function v(){r([qe,ft,he,et,Pt],L),a(u,"click",se(T,">")),a(c,"click",se(T,"<"))}function T(F){p.go(F,!0)}function V(){h=_||st("div",s.arrows),c=z(!0),u=z(!1),b=!0,Lt(h,[c,u]),!_&&wn(h,m)}function z(F){var O='<button class="'+s.arrow+" "+(F?s.prev:s.next)+'" type="button"><svg xmlns="'+Ai+'" viewBox="0 0 '+Vt+" "+Vt+'" width="'+Vt+'" height="'+Vt+'" focusable="false"><path d="'+(n.arrowPath||Ei)+'" />';return So(O)}function L(){if(c&&u){var F=e.index,O=p.getPrev(),U=p.getNext(),H=O>-1&&F<O?l.last:l.prev,g=U>-1&&F>U?l.first:l.next;c.disabled=O<0,u.disabled=U<0,ee(c,we,H),ee(u,we,g),i(Ro,c,u,O,U)}}return{arrows:f,mount:w,destroy:E,update:L}}var Ii=Tn+"-interval";function ki(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=o.emit,s=Xt(n.interval,e.go.bind(e,">"),v),l=s.isPaused,d=t.Elements,p=t.Elements,_=p.root,m=p.toggle,h=n.autoplay,c,u,b=h==="pause";function $(){h&&(f(),m&&ee(m,Rt,d.track.id),b||w(),E())}function f(){n.pauseOnHover&&a(_,"mouseenter mouseleave",function(V){c=V.type==="mouseenter",W()}),n.pauseOnFocus&&a(_,"focusin focusout",function(V){u=V.type==="focusin",W()}),m&&a(m,"click",function(){b?w():j(!0)}),r([Me,qt,he],s.rewind),r(Me,T)}function w(){l()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),u=c=b=!1,E(),i(kn))}function j(V){V===void 0&&(V=!0),b=!!V,E(),l()||(s.pause(),i(Rn))}function W(){b||(c||u?j(!1):w())}function E(){m&&(Be(m,Qe,!b),ee(m,we,n.i18n[b?"play":"pause"]))}function v(V){var z=d.bar;z&&Ee(z,"width",V*100+"%"),i(No,V)}function T(V){var z=t.Slides.getAt(V);s.set(z&&+Le(z.slide,Ii)||n.interval)}return{mount:$,destroy:s.cancel,play:w,pause:j,isPaused:l}}function Ri(e,t,n){var o=ue(e),r=o.on;function a(){n.cover&&(r(Fn,se(s,!0)),r([qe,xe,he],se(i,!0)))}function i(l){t.Slides.forEach(function(d){var p=It(d.container||d.slide,"img");p&&p.src&&s(l,p,d)})}function s(l,d,p){p.style("background",l?'center/cover no-repeat url("'+d.src+'")':"",!0),_t(d,l?"none":"")}return{mount:a,destroy:se(i,!1)}}var Fi=10,Vi=600,Ni=.6,Oi=1.5,Bi=800;function ji(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=e.state.set,s=t.Move,l=s.getPosition,d=s.getLimit,p=s.exceededLimit,_=s.translate,m=e.is(dt),h,c,u=1;function b(){r(Me,j),r([xe,he],W)}function $(v,T,V,z,L){var F=l();if(j(),V&&(!m||!p())){var O=t.Layout.sliderSize(),U=fn(v)*O*Ht(Ce(v)/O)||0;v=s.toPosition(t.Controller.toDest(v%O))+U}var H=Co(F,v,1);u=1,T=H?0:T||Dt(Ce(v-F)/Oi,Bi),c=z,h=Xt(T,f,se(w,F,v,L),1),i(Tt),a(qt),h.start()}function f(){i(ut),c&&c(),a(et)}function w(v,T,V,z){var L=l(),F=v+(T-v)*E(z),O=(F-L)*u;_(L+O),m&&!V&&p()&&(u*=Ni,Ce(O)<Fi&&$(d(p(!0)),Vi,!1,c,!0))}function j(){h&&h.cancel()}function W(){h&&!h.isPaused()&&(j(),f())}function E(v){var T=n.easingFunc;return T?T(v):1-Math.pow(1-v,4)}return{mount:b,destroy:j,scroll:$,cancel:W}}var at={passive:!1,capture:!0};function Wi(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=o.bind,s=o.unbind,l=e.state,d=t.Move,p=t.Scroll,_=t.Controller,m=t.Elements.track,h=t.Media.reduce,c=t.Direction,u=c.resolve,b=c.orient,$=d.getPosition,f=d.exceededLimit,w,j,W,E,v,T=!1,V,z,L;function F(){i(m,ln,dn,at),i(m,sn,dn,at),i(m,Ko,U,at),i(m,"click",R,{capture:!0}),i(m,"dragstart",Oe),r([qe,xe],O)}function O(){var M=n.drag;De(!M),E=M==="free"}function U(M){if(V=!1,!z){var y=pe(M);ae(M.target)&&(y||!M.button)&&(_.isBusy()?Oe(M,!0):(L=y?m:window,v=l.is([gt,Tt]),W=null,i(L,ln,H,at),i(L,sn,g,at),d.cancel(),p.cancel(),x(M)))}}function H(M){if(l.is(Bt)||(l.set(Bt),a(Eo)),M.cancelable)if(v){d.translate(w+ye(Q(M)));var y=me(M)>eo,P=T!==(T=f());(y||P)&&x(M),V=!0,a(Lo),Oe(M)}else N(M)&&(v=C(M),Oe(M))}function g(M){l.is(Bt)&&(l.set(ut),a(Io)),v&&(A(M),Oe(M)),s(L,ln,H),s(L,sn,g),v=!1}function R(M){!z&&V&&Oe(M,!0)}function x(M){W=j,j=M,w=$()}function A(M){var y=q(M),P=ie(y),G=n.rewind&&n.rewindByDrag;h(!1),E?_.scroll(P,0,n.snap):e.is(Ft)?_.go(b(fn(y))<0?G?"<":"-":G?">":"+"):e.is(dt)&&T&&G?_.go(f(!0)?">":"<"):_.go(_.toDest(P),!0),h(!0)}function C(M){var y=n.dragMinThreshold,P=bt(y),G=P&&y.mouse||0,J=(P?y.touch:+y)||10;return Ce(Q(M))>(pe(M)?J:G)}function N(M){return Ce(Q(M))>Ce(Q(M,!0))}function q(M){if(e.is(mt)||!T){var y=me(M);if(y&&y<eo)return Q(M)/y}return 0}function ie(M){return $()+fn(M)*Ge(Ce(M)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function Q(M,y){return K(M,y)-K(I(M),y)}function me(M){return gn(M)-gn(I(M))}function I(M){return j===M&&W||j}function K(M,y){return(pe(M)?M.changedTouches[0]:M)["page"+u(y?"Y":"X")]}function ye(M){return M/(T&&e.is(dt)?vi:1)}function ae(M){var y=n.noDrag;return!St(M,"."+Uo+", ."+tn)&&(!y||!St(M,y))}function pe(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function de(){return v}function De(M){z=M}return{mount:F,disable:De,isDragging:de}}var zi={Spacebar:" ",Right:Zt,Left:Jt,Up:jo,Down:Wo};function jn(e){return e=Ue(e)?e:e.key,zi[e]||e}var to="keydown";function Mi(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=o.unbind,s=e.root,l=t.Direction.resolve,d,p;function _(){m(),r(xe,h),r(xe,m),r(Me,u)}function m(){var $=n.keyboard;$&&(d=$==="global"?window:s,a(d,to,b))}function h(){i(d,to)}function c($){p=$}function u(){var $=p;p=!0,mo(function(){p=$})}function b($){if(!p){var f=jn($);f===l(Jt)?e.go("<"):f===l(Zt)&&e.go(">")}}return{mount:_,destroy:h,disable:c}}var ht=Tn+"-lazy",zt=ht+"-srcset",Di="["+ht+"], ["+zt+"]";function Hi(e,t,n){var o=ue(e),r=o.on,a=o.off,i=o.bind,s=o.emit,l=n.lazyLoad==="sequential",d=[ft,et],p=[];function _(){n.lazyLoad&&(m(),r(he,m))}function m(){ze(p),h(),l?$():(a(d),r(d,c),c())}function h(){t.Slides.forEach(function(f){$n(f.slide,Di).forEach(function(w){var j=Le(w,ht),W=Le(w,zt);if(j!==w.src||W!==w.srcset){var E=n.classes.spinner,v=w.parentElement,T=It(v,"."+E)||st("span",E,v);p.push([w,f,T]),w.src||_t(w,"none")}})})}function c(){p=p.filter(function(f){var w=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,w)?u(f):!0}),p.length||a(d)}function u(f){var w=f[0];Fe(f[1].slide,vn),i(w,"load error",se(b,f)),ee(w,"src",Le(w,ht)),ee(w,"srcset",Le(w,zt)),Ve(w,ht),Ve(w,zt)}function b(f,w){var j=f[0],W=f[1];je(W.slide,vn),w.type!=="error"&&(Ze(f[2]),_t(j,""),s(Fn,j,W),s(pt)),l&&$()}function $(){p.length&&u(p.shift())}return{mount:_,destroy:se(ze,p),check:c}}function Pi(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=o.bind,s=t.Slides,l=t.Elements,d=t.Controller,p=d.hasFocus,_=d.getIndex,m=d.go,h=t.Direction.resolve,c=l.pagination,u=[],b,$;function f(){w(),r([xe,he,Pt],f);var z=n.pagination;c&&_t(c,z?"":"none"),z&&(r([Me,qt,et],V),j(),V(),a(Fo,{list:b,items:u},T(e.index)))}function w(){b&&(Ze(c?Ye(b.children):b),je(b,$),ze(u),b=null),o.destroy()}function j(){var z=e.length,L=n.classes,F=n.i18n,O=n.perPage,U=p()?d.getEnd()+1:wt(z/O);b=c||st("ul",L.pagination,l.track.parentElement),Fe(b,$=nn+"--"+v()),ee(b,We,"tablist"),ee(b,we,F.select),ee(b,Nn,v()===Qt?"vertical":"");for(var H=0;H<U;H++){var g=st("li",null,b),R=st("button",{class:L.page,type:"button"},g),x=s.getIn(H).map(function(C){return C.slide.id}),A=!p()&&O>1?F.pageX:F.slideX;i(R,"click",se(W,H)),n.paginationKeyboard&&i(R,"keydown",se(E,H)),ee(g,We,"presentation"),ee(R,We,"tab"),ee(R,Rt,x.join(" ")),ee(R,we,mn(A,H+1)),ee(R,ct,-1),u.push({li:g,button:R,page:H})}}function W(z){m(">"+z,!0)}function E(z,L){var F=u.length,O=jn(L),U=v(),H=-1;O===h(Zt,!1,U)?H=++z%F:O===h(Jt,!1,U)?H=(--z+F)%F:O==="Home"?H=0:O==="End"&&(H=F-1);var g=u[H];g&&(bo(g.button),m(">"+H),Oe(L,!0))}function v(){return n.paginationDirection||n.direction}function T(z){return u[d.toPage(z)]}function V(){var z=T(_(!0)),L=T(_());if(z){var F=z.button;je(F,Qe),Ve(F,Xn),ee(F,ct,-1)}if(L){var O=L.button;Fe(O,Qe),ee(O,Xn,!0),ee(O,ct,"")}a(Vo,{list:b,items:u},z,L)}return{items:u,mount:f,destroy:w,getAt:T,update:V}}var Ui=[" ","Enter"];function Gi(e,t,n){var o=n.isNavigation,r=n.slideFocus,a=[];function i(){e.splides.forEach(function(c){c.isParent||(d(e,c.splide),d(c.splide,e))}),o&&p()}function s(){a.forEach(function(c){c.destroy()}),ze(a)}function l(){s(),i()}function d(c,u){var b=ue(c);b.on(Me,function($,f,w){u.go(u.is(mt)?w:$)}),a.push(b)}function p(){var c=ue(e),u=c.on;u(En,m),u(Oo,h),u([qe,xe],_),a.push(c),c.emit(In,e.splides)}function _(){ee(t.Elements.list,Nn,n.direction===Qt?"vertical":"")}function m(c){e.go(c.index)}function h(c,u){_n(Ui,jn(u))&&(m(c),Oe(u))}return{setup:se(t.Media.set,{slideFocus:At(r)?o:r},!0),mount:i,destroy:s,remount:l}}function Yi(e,t,n){var o=ue(e),r=o.bind,a=0;function i(){n.wheel&&r(t.Elements.track,"wheel",s,at)}function s(d){if(d.cancelable){var p=d.deltaY,_=p<0,m=gn(d),h=n.wheelMinThreshold||0,c=n.wheelSleep||0;Ce(p)>h&&m-a>c&&(e.go(_?"<":">"),a=m),l(_)&&Oe(d)}}function l(d){return!n.releaseWheel||e.state.is(gt)||t.Controller.getAdjacent(d)!==-1}return{mount:i}}var qi=90;function Xi(e,t,n){var o=ue(e),r=o.on,a=t.Elements.track,i=n.live&&!n.isNavigation,s=st("span",gi),l=Xt(qi,se(p,!1));function d(){i&&(m(!t.Autoplay.isPaused()),ee(a,Zn,!0),s.textContent="…",r(kn,se(m,!0)),r(Rn,se(m,!1)),r([ft,et],se(p,!0)))}function p(h){ee(a,Jn,h),h?(Lt(a,s),l.start()):(Ze(s),l.cancel())}function _(){Ve(a,[Kn,Zn,Jn]),Ze(s)}function m(h){i&&ee(a,Kn,h?"off":"polite")}return{mount:d,disable:m,destroy:_}}var Ki=Object.freeze({__proto__:null,Media:ri,Direction:ii,Elements:bi,Slides:xi,Layout:Ci,Clones:wi,Move:$i,Controller:Ti,Arrows:Li,Autoplay:ki,Cover:Ri,Scroll:ji,Drag:Wi,Keyboard:Mi,LazyLoad:Hi,Pagination:Pi,Sync:Gi,Wheel:Yi,Live:Xi}),Ji={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:yi,i18n:Ji,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Qi(e,t,n){var o=t.Slides;function r(){ue(e).on([qe,he],a)}function a(){o.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function i(s,l){o.style("transition","opacity "+n.speed+"ms "+n.easing),mo(l)}return{mount:r,start:i,cancel:dn}}function ea(e,t,n){var o=t.Move,r=t.Controller,a=t.Scroll,i=t.Elements.list,s=se(Ee,i,"transition"),l;function d(){ue(e).bind(i,"transitionend",function(h){h.target===i&&l&&(_(),l())})}function p(h,c){var u=o.toPosition(h,!0),b=o.getPosition(),$=m(h);Ce(u-b)>=1&&$>=1?n.useScroll?a.scroll(u,$,!1,c):(s("transform "+$+"ms "+n.easing),o.translate(u,!0),l=c):(o.jump(h),c())}function _(){s(""),a.cancel()}function m(h){var c=n.rewindSpeed;if(e.is(dt)&&c){var u=r.getIndex(!0),b=r.getEnd();if(u===0&&h>=b||u>=b&&h===0)return c}return n.speed}return{mount:d,start:p,cancel:_}}var ta=(function(){function e(n,o){this.event=ue(),this.Components={},this.state=ni(lt),this.splides=[],this._o={},this._E={};var r=Ue(n)?xo(document,n):n;yt(r,r+" is invalid."),this.root=r,o=Pe({label:Le(r,we)||"",labelledby:Le(r,Vn)||""},Zi,e.defaults,o||{});try{Pe(o,JSON.parse(Le(r,Tn)))}catch{yt(!1,"Invalid JSON")}this._o=Object.create(Pe({},o))}var t=e.prototype;return t.mount=function(o,r){var a=this,i=this.state,s=this.Components;yt(i.is([lt,Mt]),"Already mounted!"),i.set(lt),this._C=s,this._T=r||this._T||(this.is(Ft)?Qi:ea),this._E=o||this._E;var l=Ct({},Ki,this._E,{Transition:this._T});return Je(l,function(d,p){var _=d(a,s,a._o);s[p]=_,_.setup&&_.setup()}),Je(s,function(d){d.mount&&d.mount()}),this.emit(qe),Fe(this.root,fi),i.set(ut),this.emit(yn),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(ut)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,r){return this.event.on(o,r),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var r;return(r=this.event).emit.apply(r,[o].concat(Ye(arguments,1))),this},t.add=function(o,r){return this._C.Slides.add(o,r),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(he),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,a=this.state;return a.is(lt)?ue(this).on(yn,this.destroy.bind(this,o)):(Je(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(Ln),r.destroy(),o&&ze(this.splides),a.set(Mt)),this},Jr(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Wn=ta;Wn.defaults={};Wn.STATES=Qr;var no=[[qe,"onMounted"],[yn,"onReady"],[Me,"onMove"],[ft,"onMoved"],[En,"onClick"],[wo,"onActive"],[$o,"onInactive"],[To,"onVisible"],[Ao,"onHidden"],[he,"onRefresh"],[xe,"onUpdated"],[pt,"onResize"],[Yt,"onResized"],[Eo,"onDrag"],[Lo,"onDragging"],[Io,"onDragged"],[qt,"onScroll"],[et,"onScrolled"],[Ln,"onDestroy"],[ko,"onArrowsMounted"],[Ro,"onArrowsUpdated"],[Fo,"onPaginationMounted"],[Vo,"onPaginationUpdated"],[In,"onNavigationMounted"],[kn,"onAutoplayPlay"],[No,"onAutoplayPlaying"],[Rn,"onAutoplayPause"],[Fn,"onLazyLoadLoaded"]];function zn(...e){return e.filter(Boolean).join(" ")}function Ut(e){return e!==null&&typeof e=="object"}function bn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!bn(n,t[o]));if(Ut(e)&&Ut(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!bn(e[r],t[r]))}return e===t}function na(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function oa(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const r=n[o];if(r!=="__proto__"&&t(e[r],r)===!1)break}}return e}function Sn(e,t){const n=e;return oa(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():Ut(o)?n[r]=Sn(Ut(n[r])?n[r]:{},o):n[r]=o}),n}var ra=({children:e,className:t,...n})=>D.createElement("div",{className:zn("splide__track",t),...n},D.createElement("ul",{className:"splide__list"},e)),Jo=class extends D.Component{constructor(){super(...arguments),this.splideRef=D.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Wn(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Sn({},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&&!bn(this.options,e)&&(this.splide.options=e,this.options=Sn({},e));const t=this.getSlides();na(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){no.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...r)=>{o(e,...r)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:o,...r}=this.props;return D.createElement(t,{className:zn("splide",e),ref:this.splideRef,...this.omit(r,["options",...no.map(a=>a[1])])},n?D.createElement(ra,null,o):o)}},Zo=({children:e,className:t,...n})=>D.createElement("li",{className:zn("splide__slide",t),...n},e);/*!
2
2
  * Splide.js
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const Gi="RichTextRenderer-module__link___BWeZ2",Yi={link:Gi},Wr=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?_.jsx("a",{className:Yi.link,href:r.value,target:r.target,children:t(r.children)},o):_.jsx("span",{style:qi(r),children:r.text},o));return _.jsx(_.Fragment,{children:e.map((n,r)=>{const o=n.children;return _.jsx("div",{children:t(o)},r)})})};function qi(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 Xi="SvgImage-module__svg___q3xE-",Ki="SvgImage-module__img___VsTm-",qn={svg:Xi,img:Ki},pt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r=""})=>{const[o,a]=z.useState(!0);return z.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?_.jsx("img",{src:e,alt:"",className:ce(qn.img,r)}):_.jsx("span",{"data-supports-mask":o,className:ce(qn.svg,r),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},Ji={"top-left":G.topLeftAlignment,"top-center":G.topCenterAlignment,"top-right":G.topRightAlignment,"middle-left":G.middleLeftAlignment,"middle-center":G.middleCenterAlignment,"middle-right":G.middleRightAlignment,"bottom-left":G.bottomLeftAlignment,"bottom-center":G.bottomCenterAlignment,"bottom-right":G.bottomRightAlignment};function Zi({settings:e,content:t,styles:n,isEditor:r}){const[o,a]=z.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:p,wordSpacing:c,fontSizeLineHeight:w,textAppearance:v,color:b}=n.imageCaption,[u,d]=z.useState(void 0),[A,E]=z.useState(null),[g,y]=z.useState(0),[M,P]=z.useState(0),{direction:I,transition:h,controls:$,pagination:k,imageCaption:F,triggers:R}=e,N=z.useRef(h.type),{x:V,y:W}=e.controls.offset,H=f=>{o&&o.go(f)};return z.useEffect(()=>{if(!A)return;const f=new ResizeObserver(x=>{if(!o)return;const[T]=x;d({width:Math.round(T.contentRect.width),height:Math.round(T.contentRect.height)})});return f.observe(A),()=>f.unobserve(A)},[A]),z.useEffect(()=>{!o||N.current===h.type||(P(f=>f+1),N.current=h.type)},[h.type]),_.jsx("div",{className:ce(G.wrapper,{[G.editor]:r}),ref:E,children:_.jsxs("div",{className:G.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:h.backgroundColor&&h.type==="fade in"?h.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&_.jsx("div",{className:ce(G.captionBlock),children:_.jsx("div",{className:G.captionTextWrapper,children:t.map((f,x)=>_.jsx("div",{className:ce(G.captionText,Ji[F.alignment],{[G.withPointerEvents]:x===g&&r,[G.active]:x===g}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":j.scalingValue(i.width,r),letterSpacing:j.scalingValue(l,r),wordSpacing:j.scalingValue(c,r),textAlign:p,fontSize:j.scalingValue(w.fontSize,r),lineHeight:j.scalingValue(w.lineHeight,r),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:b,transitionDuration:h.duration?`${Math.round(parseInt(h.duration)/2)}ms`:"500ms"},children:_.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-hover-color":F.linkHoverColor,"--link-color":F.linkColor,position:"relative",top:j.scalingValue(F.offset.y,r),left:j.scalingValue(F.offset.x,r)},children:_.jsx(Wr,{content:f.imageCaption})})},x))})}),_.jsx(zr,{onMove:f=>{y(f.index)},ref:a,options:{arrows:!1,speed:h.duration?parseInt(h.duration):500,autoplay:R.autoPlay!==null,...R.autoPlay!==null&&{interval:parseInt(R.autoPlay)*1e3},direction:I==="horiz"||h.type==="fade in"?"ltr":"ttb",pagination:!1,drag:R.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:h.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,x)=>_.jsx(Mr,{children:_.jsx("div",{className:G.sliderItem,children:_.jsx("div",{className:G.imgWrapper,children:_.jsx("img",{className:ce(G.sliderImage,{[G.contain]:f.image.objectFit==="contain",[G.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},x))},M),$.isActive&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:ce(G.arrow,{[G.arrowVertical]:I==="vert",[G.hoverArrow]:$.show==="on hover"}),style:{color:$.color,"--arrow-hover-color":$.hover},children:_.jsxs("button",{onClick:()=>{H("-1")},className:G.arrowInner,style:{transform:`translate(${j.scalingValue(V,r)}, ${j.scalingValue(W*(I==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:[$.arrowsImgUrl&&_.jsx(pt,{url:$.arrowsImgUrl,fill:$.color,hoverFill:$.hover,className:ce(G.arrowImg,G.mirror)}),!$.arrowsImgUrl&&_.jsx(Xn,{color:$.color,className:ce(G.arrowIcon,G.arrowImg,G.mirror)})]})}),_.jsx("div",{className:ce(G.arrow,G.nextArrow,{[G.arrowVertical]:I==="vert",[G.hoverArrow]:$.show==="on hover"}),style:{color:$.color,"--arrow-hover-color":$.hover},children:_.jsxs("button",{className:G.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${j.scalingValue(V*(I==="horiz"?-1:1),r)}, ${j.scalingValue(W,r)}) scale(${e.controls.scale/100}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:[$.arrowsImgUrl&&_.jsx(pt,{url:$.arrowsImgUrl,fill:$.color,hoverFill:$.hover,className:G.arrowImg}),!$.arrowsImgUrl&&_.jsx(Xn,{color:$.color,className:ce(G.arrowIcon,G.arrowImg)})]})})]}),R.triggersList.click&&_.jsx("div",{className:G.clickOverlay,onClick:()=>{o&&o.go("+1")}}),k.isActive&&_.jsx("div",{className:ce(G.pagination,{[G.paginationInsideBottom]:k.position==="inside-1"&&I==="horiz",[G.paginationInsideTop]:k.position==="inside-2"&&I==="horiz",[G.paginationOutsideBottom]:k.position==="outside-1"&&I==="horiz",[G.paginationOutsideTop]:k.position==="outside-2"&&I==="horiz",[G.paginationInsideLeft]:k.position==="inside-1"&&I==="vert",[G.paginationInsideRight]:k.position==="inside-2"&&I==="vert",[G.paginationOutsideLeft]:k.position==="outside-1"&&I==="vert",[G.paginationOutsideRight]:k.position==="outside-2"&&I==="vert",[G.paginationVertical]:I==="vert"}),children:_.jsx("div",{className:G.paginationInner,style:{backgroundColor:k.colors[2],transform:`scale(${k.scale/100}) translate(${j.scalingValue(k.offset.x,r)}, ${j.scalingValue(k.offset.y,r)}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:t.map((f,x)=>_.jsx("button",{onClick:()=>{o&&o.go(x)},className:ce(G.paginationItem),children:_.jsx("div",{className:ce(G.dot,{[G.activeDot]:x===g}),style:{backgroundColor:x===g?k.colors[0]:k.colors[1],"--pagination-hover-color":k.hover}})},x))})})]})})}function Xn({color:e,className:t}){return _.jsx("svg",{viewBox:"0 0 10 18",className:t,children:_.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:_.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 Qi={element:Zi,id:"control-slider",name:"Slider",preview:{type:"video",url:"https://cdn.cntrl.site/component-assets/Control-slider-preview.mp4"},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"]}},ea="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ta="ImageRevealSlider-module__image___Qjt-e",na="ImageRevealSlider-module__link___N-iLG",ra="ImageRevealSlider-module__cursor___2U03d",Ke={imageRevealSlider:ea,image:ta,link:na,cursor:ra};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 oa(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 ia({settings:e,content:t,isEditor:n}){const[r,o]=z.useState(null),[a,i]=z.useState([]),[s,l]=z.useState(0),p=z.useRef(0),[c,w]=z.useState({x:0,y:0}),[v,b]=z.useState(1),[u,d]=z.useState("none"),A=z.useRef({x:0,y:0}),[E,g]=z.useState(!1),{sizeType:y,imageWidth:M,randomRangeImageWidth:P}=e.imageSize,{revealPosition:I,visible:h}=e.position,{cursorType:$,target:k,defaultCursorScale:F,defaultCursor:R,hoverCursorScale:N,hoverCursor:V}=e.cursor;z.useEffect(()=>{if(!r)return;const f=(C,m)=>{const O=r.getBoundingClientRect(),X=C-O.left,oe=m-O.top;if(w({x:X,y:oe}),$==="system"){d("none"),b(1);return}const re=X,ye=oe,L=document.elementFromPoint(O.left+re,O.top+ye);if(L&&L.closest("a")){d("none"),b(1);return}const J=Kn(re,ye,a)||k==="area"?{img:V??"none",scale:N}:{img:R??"none",scale:F};d(J.img),b(J.scale)},x=C=>{C.stopPropagation(),A.current={x:C.clientX,y:C.clientY},f(C.clientX,C.clientY)},T=()=>{E&&f(A.current.x,A.current.y)};return r.addEventListener("mousemove",x),window.addEventListener("scroll",T,!0),()=>{r.removeEventListener("mousemove",x),window.removeEventListener("scroll",T,!0)}},[r,E,c,$,k,V,R,N,F,a]),z.useEffect(()=>{E||(d("none"),b(0))},[E]);const W=async(f,x,T,C={})=>{const{width:m,height:O,finalWidth:X}=await oa(f.image.url,y,M,P);let oe=0,re=0;I==="same"?(oe=x/2,re=T/2):(oe=C.x??Math.random()*x,re=C.y??Math.random()*T);const ye=Math.min(Math.max(oe,m/2),x-m/2),L=Math.min(Math.max(re,O/2),T-O/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:ye,y:L,width:X}};z.useEffect(()=>{if(!r||t.length===0)return;const f=r.getBoundingClientRect(),x=f.width,T=f.height,C=[];(async()=>{const O=t[0],X=await W(O,x,T);C.push(X),i(C),l(1)})()},[y,M,P,I,r]),z.useEffect(()=>{h==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[h]);const H=async f=>{if(!r)return;const x=r.getBoundingClientRect(),T=f.clientX-x.left,C=f.clientY-x.top;if(k==="image"&&!Kn(T,C,a))return;let m=0,O=0;I==="on Click"?(m=T,O=C):I==="same"?(m=x.width/2,O=x.height/2):(m=Math.random()*x.width,O=Math.random()*x.height);const X=t[s],oe=await W(X,x.width,x.height,{x:m,y:O});i(re=>h==="all"?[...re,oe]:[oe]),l(re=>re>=t.length-1?0:re+1)};return _.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:Ke.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[a.map(f=>_.jsx("div",{className:Ke.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:k==="area"&&f.link?_.jsx("a",{href:f.link,target:"_blank",className:Ke.link,children:_.jsx("img",{src:f.url,alt:f.name,className:Ke.image},f.id)}):_.jsx("img",{src:f.url,alt:f.name,className:Ke.image},f.id)},f.id)),E&&_.jsx("div",{className:Ke.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const aa={element:ia,id:"control-image-reveal",name:"Click Gallery",preview:{type:"video",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7EQ3WSW43JG5YMC8B2HTPKT.mp4"},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:""}]}}}},la="LightBox-module__hidden___9s-9x",sa="LightBox-module__heroImage___sTxNF",ca="LightBox-module__background___rm9ml",ua="LightBox-module__editor___4ACaY",pa="LightBox-module__contentStyle___Bgnsq",da="LightBox-module__imageStyle___tLIlB",ga="LightBox-module__imgWrapper___LuFUp",fa="LightBox-module__contain___8-yaS",ma="LightBox-module__cover___hNvOG",ya="LightBox-module__caption___b6L2I",ha="LightBox-module__captionTextInner___rCGNH",va="LightBox-module__lightboxSplide___XFuWC",ba="LightBox-module__arrow___iz38X",_a="LightBox-module__arrowVertical___Zfz81",Sa="LightBox-module__nextArrow___zkAQN",Ca="LightBox-module__arrowInner___p48sW",xa="LightBox-module__arrowIcon___3VaFf",wa="LightBox-module__arrowImg___pNV88",Ea="LightBox-module__mirror___pjeXc",Aa="LightBox-module__thumbsWrapper___GB-nU",Ta="LightBox-module__thumbsContainerVertical___wttk5",Ia="LightBox-module__thumbsContainer___osSma",$a="LightBox-module__thumbsAlignStart___MO6tY",La="LightBox-module__thumbsAlignCenter___Q4sUx",Ra="LightBox-module__thumbsAlignEnd___p4y9R",ka="LightBox-module__thumbItem___HvnF3",Na="LightBox-module__closeButton___g2khP",Oa="LightBox-module__fadeIn___0m5GW",ja="LightBox-module__slideInLeft___gPYwC",Va="LightBox-module__slideInRight___S-pPp",Pa="LightBox-module__slideInTop___DFdAj",Ba="LightBox-module__slideInBottom___m27kZ",Fa="LightBox-module__fadeOut___55qBR",Da="LightBox-module__slideOutLeft___NvU7P",za="LightBox-module__slideOutRight___SK7eC",Ma="LightBox-module__slideOutTop___Vgg0z",Wa="LightBox-module__slideOutBottom___nJ0Ef",Ha="LightBox-module__scaleSlide___vZriG",B={hidden:la,heroImage:sa,background:ca,editor:ua,contentStyle:pa,imageStyle:da,imgWrapper:ga,contain:fa,cover:ma,caption:ya,captionTextInner:ha,lightboxSplide:va,arrow:ba,arrowVertical:_a,nextArrow:Sa,arrowInner:Ca,arrowIcon:xa,arrowImg:wa,mirror:Ea,thumbsWrapper:Aa,thumbsContainerVertical:Ta,thumbsContainer:Ia,thumbsAlignStart:$a,thumbsAlignCenter:La,thumbsAlignEnd:Ra,thumbItem:ka,closeButton:Na,fadeIn:Oa,slideInLeft:ja,slideInRight:Va,slideInTop:Pa,slideInBottom:Ba,fadeOut:Fa,slideOutLeft:Da,slideOutRight:za,slideOutTop:Ma,slideOutBottom:Wa,scaleSlide:Ha},$t=(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% + ${j.scalingValue(t.x,n)}), calc(-50% + ${j.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${j.scalingValue(t.x,n)}, calc(-50% + ${j.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${j.scalingValue(t.x,n)}), ${j.scalingValue(t.y,n)})`:r.transform=`translate(${j.scalingValue(t.x,n)}, ${j.scalingValue(t.y,n)})`,r};function Hr(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=Hr(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 w=t.left+n.left,v=t.top+n.top,b=(r-p)/2+w,u=(o-c)/2+v;return{x:b,y:u,width:p,height:c}}function Zn(e){const t=e.getBoundingClientRect(),n=Hr(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 Ua(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 Ga=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:a})=>{const[i,s]=z.useState(!1),{url:l}=e.thumbnailBlock.cover;return z.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),_.jsxs(_.Fragment,{children:[_.jsx("img",{src:l,alt:"Cover",className:B.heroImage,onClick:()=>s(!0)}),_.jsx(Ya,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},Ya=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:s})=>{var D;const[l,p]=z.useState(0),[c,w]=z.useState(0),[v,b]=z.useState(!1),[u,d]=z.useState(!1),[A,E]=z.useState({}),g=z.useRef(null),y=z.useRef(null),M=z.useRef(null),P=z.useRef(!1),I=z.useRef(null),h=z.useRef(null),$=z.useRef(null),k=z.useRef(null),F=z.useRef(!1),R=z.useRef(null),[N,V]=z.useState(!1),{appear:W,triggers:H,slider:f,thumbnail:x,controls:T,area:C,caption:m,layout:O}=o.lightboxBlock,{appearClass:X,backdropAppearClass:oe,backdropDisappearClass:re,disappearClass:ye}=Ua(W.type,W.direction),L=(s==null?void 0:s.itemId)??null;z.useEffect(()=>{const S=()=>{setTimeout(()=>{var Y,Z;(Z=(Y=g.current)==null?void 0:Y.splide)==null||Z.refresh()},16)},U=()=>{w(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",S),window.addEventListener("ArticleEditor.ComponentContent:change",U),()=>{window.removeEventListener("ArticleEditor.Layout:change",S),window.removeEventListener("ArticleEditor.ComponentContent:change",U)}},[]),z.useEffect(()=>{if(!e||!x.isActive){V(!1);return}const S=R.current;if(!S)return;const U=()=>{f.direction==="horiz"?V(S.scrollWidth>S.clientWidth):V(S.scrollHeight>S.clientHeight)};U();const Y=new ResizeObserver(U);return Y.observe(S),()=>Y.disconnect()},[e,x.isActive,n.length,A,f.direction]);const J=z.useCallback(()=>{const S=window.matchMedia("(max-width: 768px)").matches,U=Qn(C.color);S&&!i&&U>.9&&(document.body.style.backgroundColor=""),b(!0),P.current=!0;const Y=Z=>{Z.target===I.current&&Z.animationName&&(I.current&&h.current&&I.current.removeEventListener("animationend",h.current),h.current=null,P.current&&(P.current=!1,t()),b(!1))};I.current&&(h.current=Y,I.current.addEventListener("animationend",Y))},[t,C.color,i]),ge=(S,U,Y)=>{var Z,ie;if(S){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?J():(Z=g.current)==null||Z.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const ee=S.getBoundingClientRect(),K=U-ee.left,q=Y-ee.top,pe=ee.width,te=ee.height;let se;f.direction==="horiz"?se=K<pe/2?"-1":"+1":se=q<te/2?"-1":"+1",(ie=g.current)==null||ie.go(se)}}},le=S=>{if(F.current){F.current=!1;return}const U=n[l],Y=(U==null?void 0:U.image.objectFit)==="cover";let Z,ie;if("changedTouches"in S&&S.changedTouches.length>0)Z=S.changedTouches[0].clientX,ie=S.changedTouches[0].clientY;else if("clientX"in S)Z=S.clientX,ie=S.clientY;else return;let ee;if(Y&&M.current){const K=Zn(M.current);ee=Z>=K.left&&Z<=K.right&&ie>=K.top&&ie<=K.bottom}else{const K=M.current?Jn(M.current):null;if(!K){S.target===S.currentTarget&&J();return}ee=Z>=K.x&&Z<=K.x+K.width&&ie>=K.y&&ie<=K.y+K.height}ee?ge(M.current,Z,ie):J()},fe=S=>{const U=S.target;(U.classList.contains(B.thumbsWrapper)||U.classList.contains(B.thumbsContainer))&&le(S)};z.useEffect(()=>{if(!e)return;const S=U=>{var Y,Z;if(U.key==="Escape"){J();return}if(U.key==="ArrowRight"){p(ie=>(ie+1)%Math.max(n.length,1)),(Y=g.current)==null||Y.go("+1");return}U.key==="ArrowLeft"&&(p(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(Z=g.current)==null||Z.go("-1"))};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}},[e,J,n.length]),z.useEffect(()=>{if(e){if(p(0),w(U=>U+1),P.current=!1,b(!1),d(!1),E({}),!L)return;const S=new CustomEvent("page-overlay",{detail:{itemId:L}});window.dispatchEvent(S)}return()=>{I.current&&h.current&&(I.current.removeEventListener("animationend",h.current),h.current=null),d(!1)}},[e,L]),z.useEffect(()=>{y.current!==null&&y.current!==f.type&&w(S=>S+1),y.current=f.type},[f.type]),z.useEffect(()=>{if(!e)return;const S=document.body.style.overflow,U=window.matchMedia("(max-width: 768px)").matches,Y=Qn(C.color);document.body.style.overflow="hidden",d(!1);const Z=ee=>{ee.target===I.current&&!P.current&&ee.animationName&&(U&&!i&&Y>.9&&(document.body.style.backgroundColor=C.color),d(!0),I.current&&$.current&&I.current.removeEventListener("animationend",$.current),$.current=null)};I.current&&($.current=Z,I.current.addEventListener("animationend",Z));const ie=ee=>{const K=ee.target;K&&(K.closest(`.${B.thumbsWrapper}`)||K.closest(`.${B.thumbsContainer}`))||f.type!=="slide"&&ee.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=S,document.removeEventListener("touchmove",ie),I.current&&$.current&&(I.current.removeEventListener("animationend",$.current),$.current=null),d(!1)}},[e,i,C.color,f.type]),z.useEffect(()=>{if(!e)return;const S=U=>{var Z,ie;if(P.current){U.stopPropagation();return}if(F.current){F.current=!1;return}const Y=U.target;if(!(Y&&(Y.closest(`.${B.thumbsContainer}`)||Y.closest(`.${B.thumbItem}`)))){if(f.type==="slide"&&H.type==="drag"&&((ie=(Z=g.current)==null?void 0:Z.splide)!=null&&ie.root)){const ee=g.current.splide.root;if(Y&&(ee.contains(Y)||ee===Y))return}if(U.touches.length===0&&U.changedTouches.length>0){const ee=n[l],K=(ee==null?void 0:ee.image.objectFit)==="cover",q=U.changedTouches[0];let pe;if(K&&M.current){const te=Zn(M.current);pe=q.clientX>=te.left&&q.clientX<=te.right&&q.clientY>=te.top&&q.clientY<=te.bottom}else{const te=M.current?Jn(M.current):null;if(!te)return;pe=q.clientX>=te.x&&q.clientX<=te.x+te.width&&q.clientY>=te.y&&q.clientY<=te.y+te.height}if(!pe){U.stopPropagation(),P.current=!0;const te=se=>{se.stopPropagation(),se.preventDefault(),document.removeEventListener("click",te,!0)};document.addEventListener("click",te,!0),J()}}}};return document.addEventListener("touchend",S,{passive:!0}),()=>{document.removeEventListener("touchend",S)}},[e,J,l,n]);const je=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&H.type==="drag";z.useEffect(()=>{var se,Ve;if(!e||!je||!((Ve=(se=g.current)==null?void 0:se.splide)!=null&&Ve.root))return;const S=g.current.splide.root,U=30,Y=(ne,de)=>{if(k.current){const Ie=Math.abs(ne-k.current.x),Tt=Math.abs(de-k.current.y);(Ie>0||Tt>0)&&(F.current=!0)}},Z=ne=>{k.current&&(ne.preventDefault(),Y(ne.clientX,ne.clientY))},ie=ne=>{k.current&&ne.touches.length>0&&(ne.preventDefault(),Y(ne.touches[0].clientX,ne.touches[0].clientY))},ee=(ne,de)=>{if(!k.current||!g.current){k.current=null;return}const Ie=Math.abs(ne-k.current.x),Tt=Math.abs(de-k.current.y);Tt>U&&Tt>Ie&&g.current.go(de<k.current.y?"+1":"-1"),k.current=null},K=ne=>{k.current&&ee(ne.clientX,ne.clientY),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("pointermove",Z)},q=ne=>{if(k.current){if(ne.changedTouches.length>0){const de=ne.changedTouches[0];ee(de.clientX,de.clientY)}document.removeEventListener("touchend",q),document.removeEventListener("touchcancel",q),document.removeEventListener("touchmove",ie)}},pe=ne=>{k.current={x:ne.clientX,y:ne.clientY},F.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",K),document.addEventListener("pointercancel",K)},te=ne=>{ne.touches.length>0&&(k.current={x:ne.touches[0].clientX,y:ne.touches[0].clientY},F.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",q),document.addEventListener("touchcancel",q))};return S.addEventListener("pointerdown",pe),S.addEventListener("touchstart",te),()=>{S.removeEventListener("pointerdown",pe),S.removeEventListener("touchstart",te),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",q),document.removeEventListener("touchcancel",q),k.current=null,F.current=!1}},[e,je,c]);const Xe={backgroundColor:C.color,backdropFilter:`blur(${C.blur}px)`,animationDuration:`${parseInt(W.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Ur.createPortal(_.jsxs(_.Fragment,{children:[_.jsx("div",{ref:i?null:I,className:ce(B.background,v?re:oe,{[B.editor]:i},{[B.hidden]:!e}),style:{...Xe,...u&&!i&&!v?{position:"absolute"}:{}}}),_.jsxs("div",{ref:i?I:null,className:ce(B.contentStyle,v?ye:X,{[B.editor]:i},{[B.hidden]:!e}),style:{animationDuration:`${parseInt(W.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[_.jsx(zr,{onMove:S=>p(S.index),ref:g,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"&&!je,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((S,U)=>{const Y=$t(O.position,O.offset,i),Z=`${j.scalingValue(O.padding.top,i)} ${j.scalingValue(O.padding.right,i)} ${j.scalingValue(O.padding.bottom,i)} ${j.scalingValue(O.padding.left,i)}`,ie=f.type==="scale"?(()=>{const{transform:ee,...K}=Y;return{...K,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":ee||"none"}})():{...Y,position:"absolute",padding:Z,boxSizing:"border-box"};return _.jsx(Mr,{children:_.jsx("div",{className:B.imgWrapper,onClick:le,children:_.jsx("img",{ref:U===l?M:null,className:ce(B.imageStyle,{[B.contain]:S.image.objectFit==="contain",[B.cover]:S.image.objectFit==="cover",[B.scaleSlide]:f.type==="scale"}),src:S.image.url,alt:S.image.name??"",style:{...ie,pointerEvents:S.image.objectFit==="contain"?"none":"auto"}})})},U)})},c),T.isActive&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:ce(B.arrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:_.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${j.scalingValue(T.offset.x,i)}, ${j.scalingValue(T.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${T.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var S;return(S=g.current)==null?void 0:S.go("-1")},"aria-label":"Previous",children:[T.arrowsImgUrl&&_.jsx(pt,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:ce(B.arrowImg,B.mirror)}),!T.arrowsImgUrl&&_.jsx(er,{color:T.color,className:ce(B.arrowIcon,B.arrowImg,B.mirror)})]})}),_.jsx("div",{className:ce(B.arrow,B.nextArrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:_.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${j.scalingValue(T.offset.x*(f.direction==="horiz"?-1:1),i)}, ${j.scalingValue(T.offset.y,i)}) scale(${T.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var S;return(S=g.current)==null?void 0:S.go("+1")},"aria-label":"Next",children:[T.arrowsImgUrl&&_.jsx(pt,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:B.arrowImg}),!T.arrowsImgUrl&&_.jsx(er,{color:T.color,className:ce(B.arrowIcon,B.arrowImg)})]})})]}),C.closeIconUrl&&(()=>{const S=$t(C.closeIconAlign,C.closeIconOffset,i),U=`scale(${C.closeIconScale})`,Y=S.transform?`${S.transform} ${U}`:U;return _.jsx("button",{className:B.closeButton,style:{...S,transform:Y},onClick:J,"aria-label":"Close lightbox",children:_.jsx(pt,{url:C.closeIconUrl,fill:C.closeIconColor??"#000000",hoverFill:C.closeIconHover??"#cccccc"})})})(),m&&m.isActive&&r.imageCaption&&((D=n[l])==null?void 0:D.imageCaption)&&(()=>{const{widthSettings:S,fontSettings:U,letterSpacing:Y,textAlign:Z,wordSpacing:ie,fontSizeLineHeight:ee,textAppearance:K,color:q}=r.imageCaption;return _.jsx("div",{className:B.caption,style:{...$t(m.alignment,m.offset,i),fontFamily:U.fontFamily,fontWeight:U.fontWeight,fontStyle:U.fontStyle,width:S.sizing==="auto"?"max-content":j.scalingValue(S.width,i),letterSpacing:j.scalingValue(Y,i),wordSpacing:j.scalingValue(ie,i),textAlign:Z,fontSize:j.scalingValue(ee.fontSize,i),lineHeight:j.scalingValue(ee.lineHeight,i),textTransform:K.textTransform??"none",textDecoration:K.textDecoration??"none",fontVariant:K.fontVariant??"normal",color:q},onClick:pe=>pe.stopPropagation(),children:_.jsx("div",{"data-styles":"imageCaption",className:B.captionTextInner,style:{"--link-color":m.linkColor,"--link-hover-color":m.linkHoverColor},children:_.jsx(Wr,{content:n[l].imageCaption})})})})(),x.isActive&&(()=>{const[S,U]=x.position.split("-"),Y=f.direction==="horiz"?`${S}-left`:x.position,Z=$t(Y,x.offset,i),ie=()=>{if(f.direction==="horiz"){if(U==="left")return"flex-start";if(U==="center")return"center";if(U==="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 _.jsx("div",{ref:R,className:B.thumbsWrapper,onClick:ee=>fe(ee),style:{position:i?"absolute":"fixed",...Z,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:_.jsx("div",{className:ce(B.thumbsContainer,{[B.thumbsContainerVertical]:f.direction==="vert",[B.thumbsAlignStart]:x.align==="start",[B.thumbsAlignCenter]:x.align==="center",[B.thumbsAlignEnd]:x.align==="end"}),style:{gap:j.scalingValue(x.grid.gap,i),justifyContent:N?"flex-start":ie()},children:n.map((ee,K)=>{const q=K===l,pe=A[K],se=x.grid.size*(q?x.activeState.scale:1),Ve=()=>{if(x.fit!=="fit")return{};if(!pe)return f.direction==="horiz"?{height:j.scalingValue(se,i)}:{width:j.scalingValue(se,i)};const ne=pe.width/pe.height;if(f.direction==="horiz"){const de=se,Ie=de*ne;return{width:j.scalingValue(Ie,i),height:j.scalingValue(de,i)}}else{const de=se,Ie=de/ne;return{width:j.scalingValue(de,i),height:j.scalingValue(Ie,i)}}};return _.jsx("button",{className:B.thumbItem,style:{...f.direction==="horiz"&&x.fit!=="fit"?{height:j.scalingValue(se,i)}:{},...f.direction==="vert"&&x.fit!=="fit"?{width:j.scalingValue(se,i)}:{},...x.fit==="cover"?{width:j.scalingValue(se,i),height:j.scalingValue(se,i)}:{},...Ve(),transition:q?"all 0.25s ease-out":"none",opacity:q?x.activeState.opacity/100:x.opacity/100,"--thumb-hover":x.activeState.opacity/100},onClick:ne=>{var de;ne.stopPropagation(),p(K),(de=g.current)==null||de.go(K)},onMouseEnter:()=>{var ne;x.triggers==="hov"&&((ne=g.current)==null||ne.go(K))},children:_.jsx("img",{src:ee.image.url,alt:ee.image.name??"",onLoad:ne=>{const de=ne.currentTarget;de.naturalWidth&&de.naturalHeight&&E(Ie=>({...Ie,[K]:{width:de.naturalWidth,height:de.naturalHeight}}))},style:{objectFit:x.fit==="cover"?"cover":"contain",...x.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...x.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ee.image.name}-${K}`)})})})})()]})]}),document.getElementById(a)):null};function er({color:e,className:t}){return _.jsx("svg",{viewBox:"0 0 10 18",className:t,children:_.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:_.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 qa={element:Ga,id:"lightbox",name:"Lightbox",preview:{type:"video",url:"https://cdn.cntrl.site/component-assets/lightbox.mp4"},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 Je(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xa(e){return`
6
+ */const ia="RichTextRenderer-module__link___BWeZ2",aa={link:ia},Qo=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?S.jsx("a",{className:aa.link,href:o.value,target:o.target,children:t(o.children)},r):S.jsx("span",{style:la(o),children:o.text},r));return S.jsx(S.Fragment,{children:e.map((n,o)=>{const r=n.children;return S.jsx("div",{children:t(r)},o)})})};function la(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 sa="SvgImage-module__svg___q3xE-",ca="SvgImage-module__img___VsTm-",oo={svg:sa,img:ca},vt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o=""})=>{const[r,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")||!r?S.jsx("img",{src:e,alt:"",className:ce(oo.img,o)}):S.jsx("span",{"data-supports-mask":r,className:ce(oo.svg,o),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},ua={"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 pa({settings:e,content:t,styles:n,isEditor:o}){const[r,a]=D.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:d,wordSpacing:p,fontSizeLineHeight:_,textAppearance:m,color:h}=n.imageCaption,[c,u]=D.useState(void 0),[b,$]=D.useState(null),[f,w]=D.useState(0),[j,W]=D.useState(0),{direction:E,transition:v,controls:T,pagination:V,imageCaption:z,triggers:L}=e,F=D.useRef(v.type),{x:O,y:U}=e.controls.offset,H=g=>{r&&r.go(g)};return D.useEffect(()=>{if(!b)return;const g=new ResizeObserver(R=>{if(!r)return;const[x]=R;u({width:Math.round(x.contentRect.width),height:Math.round(x.contentRect.height)})});return g.observe(b),()=>g.unobserve(b)},[b]),D.useEffect(()=>{!r||F.current===v.type||(W(g=>g+1),F.current=v.type)},[v.type]),S.jsx("div",{className:ce(Y.wrapper,{[Y.editor]:o}),ref:$,children:S.jsxs("div",{className:Y.sliderInner,style:{width:c?c.width:"100%",height:c?c.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&S.jsx("div",{className:ce(Y.captionBlock),children:S.jsx("div",{className:Y.captionTextWrapper,children:t.map((g,R)=>S.jsx("div",{className:ce(Y.captionText,ua[z.alignment],{[Y.withPointerEvents]:R===f&&o,[Y.active]:R===f}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":k.scalingValue(i.width,o),letterSpacing:k.scalingValue(l,o),wordSpacing:k.scalingValue(p,o),textAlign:d,fontSize:k.scalingValue(_.fontSize,o),lineHeight:k.scalingValue(_.lineHeight,o),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:S.jsx("div",{"data-styles":"imageCaption",className:Y.captionTextInner,style:{"--link-hover-color":z.linkHoverColor,"--link-color":z.linkColor,position:"relative",top:k.scalingValue(z.offset.y,o),left:k.scalingValue(z.offset.x,o)},children:S.jsx(Qo,{content:g.imageCaption})})},R))})}),S.jsx(Jo,{onMove:g=>{w(g.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:E==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:c?c.width:"100%",height:c?c.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((g,R)=>S.jsx(Zo,{children:S.jsx("div",{className:Y.sliderItem,children:S.jsx("div",{className:Y.imgWrapper,children:S.jsx("img",{className:ce(Y.sliderImage,{[Y.contain]:g.image.objectFit==="contain",[Y.cover]:g.image.objectFit==="cover"}),src:g.image.url,alt:g.image.name??""})})})},R))},j),T.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:ce(Y.arrow,{[Y.arrowVertical]:E==="vert",[Y.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{onClick:()=>{H("-1")},className:Y.arrowInner,style:{transform:`translate(${k.scalingValue(O,o)}, ${k.scalingValue(U*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(vt,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:ce(Y.arrowImg,Y.mirror)}),!T.arrowsImgUrl&&S.jsx(ro,{color:T.color,className:ce(Y.arrowIcon,Y.arrowImg,Y.mirror)})]})}),S.jsx("div",{className:ce(Y.arrow,Y.nextArrow,{[Y.arrowVertical]:E==="vert",[Y.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{className:Y.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${k.scalingValue(O*(E==="horiz"?-1:1),o)}, ${k.scalingValue(U,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(vt,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:Y.arrowImg}),!T.arrowsImgUrl&&S.jsx(ro,{color:T.color,className:ce(Y.arrowIcon,Y.arrowImg)})]})})]}),L.triggersList.click&&S.jsx("div",{className:Y.clickOverlay,onClick:()=>{r&&r.go("+1")}}),V.isActive&&S.jsx("div",{className:ce(Y.pagination,{[Y.paginationInsideBottom]:V.position==="inside-1"&&E==="horiz",[Y.paginationInsideTop]:V.position==="inside-2"&&E==="horiz",[Y.paginationOutsideBottom]:V.position==="outside-1"&&E==="horiz",[Y.paginationOutsideTop]:V.position==="outside-2"&&E==="horiz",[Y.paginationInsideLeft]:V.position==="inside-1"&&E==="vert",[Y.paginationInsideRight]:V.position==="inside-2"&&E==="vert",[Y.paginationOutsideLeft]:V.position==="outside-1"&&E==="vert",[Y.paginationOutsideRight]:V.position==="outside-2"&&E==="vert",[Y.paginationVertical]:E==="vert"}),children:S.jsx("div",{className:Y.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${k.scalingValue(V.offset.x,o)}, ${k.scalingValue(V.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((g,R)=>S.jsx("button",{onClick:()=>{r&&r.go(R)},className:ce(Y.paginationItem),children:S.jsx("div",{className:ce(Y.dot,{[Y.activeDot]:R===f}),style:{backgroundColor:R===f?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},R))})})]})})}function ro({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 da={element:pa,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"]}},ga="ImageRevealSlider-module__imageRevealSlider___UE5Ob",fa="ImageRevealSlider-module__image___Qjt-e",ma="ImageRevealSlider-module__link___N-iLG",ya="ImageRevealSlider-module__cursor___2U03d",ot={imageRevealSlider:ga,image:fa,link:ma,cursor:ya};function io(e,t,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,s=a/2,l=i/2;if(e>=o.x-s&&e<=o.x+s&&t>=o.y-l&&t<=o.y+l)return!0}return!1}function cn(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ha(e,t,n,o){let r,a;if(t==="custom"){r=n;const i=await cn(e);a=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await cn(e);a=i.height/i.width*r}else{const i=await cn(e);r=i.width,a=i.height}return{width:r,height:a,finalWidth:`${r}px`}}function va({settings:e,content:t,isEditor:n}){const[o,r]=D.useState(null),[a,i]=D.useState([]),[s,l]=D.useState(0),d=D.useRef(0),[p,_]=D.useState({x:0,y:0}),[m,h]=D.useState(1),[c,u]=D.useState("none"),b=D.useRef({x:0,y:0}),[$,f]=D.useState(!1),{sizeType:w,imageWidth:j,randomRangeImageWidth:W}=e.imageSize,{revealPosition:E,visible:v}=e.position,{cursorType:T,target:V,defaultCursorScale:z,defaultCursor:L,hoverCursorScale:F,hoverCursor:O}=e.cursor;D.useEffect(()=>{if(!o)return;const g=(A,C)=>{const N=o.getBoundingClientRect(),q=A-N.left,ie=C-N.top;if(_({x:q,y:ie}),T==="system"){u("none"),h(1);return}const Q=q,me=ie,I=document.elementFromPoint(N.left+Q,N.top+me);if(I&&I.closest("a")){u("none"),h(1);return}const K=io(Q,me,a)||V==="area"?{img:O??"none",scale:F}:{img:L??"none",scale:z};u(K.img),h(K.scale)},R=A=>{A.stopPropagation(),b.current={x:A.clientX,y:A.clientY},g(A.clientX,A.clientY)},x=()=>{$&&g(b.current.x,b.current.y)};return o.addEventListener("mousemove",R),window.addEventListener("scroll",x,!0),()=>{o.removeEventListener("mousemove",R),window.removeEventListener("scroll",x,!0)}},[o,$,p,T,V,O,L,F,z,a]),D.useEffect(()=>{$||(u("none"),h(0))},[$]);const U=async(g,R,x,A={})=>{const{width:C,height:N,finalWidth:q}=await ha(g.image.url,w,j,W);let ie=0,Q=0;E==="same"?(ie=R/2,Q=x/2):(ie=A.x??Math.random()*R,Q=A.y??Math.random()*x);const me=Math.min(Math.max(ie,C/2),R-C/2),I=Math.min(Math.max(Q,N/2),x-N/2);return{id:d.current++,url:g.image.url,link:g.link,name:g.image.name,x:me,y:I,width:q}};D.useEffect(()=>{if(!o||t.length===0)return;const g=o.getBoundingClientRect(),R=g.width,x=g.height,A=[];(async()=>{const N=t[0],q=await U(N,R,x);A.push(q),i(A),l(1)})()},[w,j,W,E,o]),D.useEffect(()=>{v==="last One"&&i(g=>g.length>0?[g[g.length-1]]:[])},[v]);const H=async g=>{if(!o)return;const R=o.getBoundingClientRect(),x=g.clientX-R.left,A=g.clientY-R.top;if(V==="image"&&!io(x,A,a))return;let C=0,N=0;E==="on Click"?(C=x,N=A):E==="same"?(C=R.width/2,N=R.height/2):(C=Math.random()*R.width,N=Math.random()*R.height);const q=t[s],ie=await U(q,R.width,R.height,{x:C,y:N});i(Q=>v==="all"?[...Q,ie]:[ie]),l(Q=>Q>=t.length-1?0:Q+1)};return S.jsxs("div",{ref:r,onClick:H,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:ot.imageRevealSlider,style:{cursor:c==="none"?"default":"none"},children:[a.map(g=>S.jsx("div",{className:ot.wrapper,style:{top:`${g.y}px`,left:`${g.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:g.width??"auto",height:"auto",cursor:c==="none"?"default":"none"},children:V==="area"&&g.link?S.jsx("a",{href:g.link,target:"_blank",className:ot.link,children:S.jsx("img",{src:g.url,alt:g.name,className:ot.image},g.id)}):S.jsx("img",{src:g.url,alt:g.name,className:ot.image},g.id)},g.id)),$&&S.jsx("div",{className:ot.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${c}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ba={element:va,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",xa="LightBox-module__heroImage___sTxNF",Ca="LightBox-module__background___rm9ml",_a="LightBox-module__editor___4ACaY",wa="LightBox-module__contentStyle___Bgnsq",$a="LightBox-module__imageStyle___tLIlB",Ta="LightBox-module__imgWrapper___LuFUp",Aa="LightBox-module__contain___8-yaS",Ea="LightBox-module__cover___hNvOG",La="LightBox-module__caption___b6L2I",Ia="LightBox-module__captionTextInner___rCGNH",ka="LightBox-module__lightboxSplide___XFuWC",Ra="LightBox-module__arrow___iz38X",Fa="LightBox-module__arrowVertical___Zfz81",Va="LightBox-module__nextArrow___zkAQN",Na="LightBox-module__arrowInner___p48sW",Oa="LightBox-module__arrowIcon___3VaFf",Ba="LightBox-module__arrowImg___pNV88",ja="LightBox-module__mirror___pjeXc",Wa="LightBox-module__thumbsWrapper___GB-nU",za="LightBox-module__thumbsContainerVertical___wttk5",Ma="LightBox-module__thumbsContainer___osSma",Da="LightBox-module__thumbsAlignStart___MO6tY",Ha="LightBox-module__thumbsAlignCenter___Q4sUx",Pa="LightBox-module__thumbsAlignEnd___p4y9R",Ua="LightBox-module__thumbItem___HvnF3",Ga="LightBox-module__closeButton___g2khP",Ya="LightBox-module__fadeIn___0m5GW",qa="LightBox-module__slideInLeft___gPYwC",Xa="LightBox-module__slideInRight___S-pPp",Ka="LightBox-module__slideInTop___DFdAj",Ja="LightBox-module__slideInBottom___m27kZ",Za="LightBox-module__fadeOut___55qBR",Qa="LightBox-module__slideOutLeft___NvU7P",el="LightBox-module__slideOutRight___SK7eC",tl="LightBox-module__slideOutTop___Vgg0z",nl="LightBox-module__slideOutBottom___nJ0Ef",ol="LightBox-module__scaleSlide___vZriG",B={hidden:Sa,heroImage:xa,background:Ca,editor:_a,contentStyle:wa,imageStyle:$a,imgWrapper:Ta,contain:Aa,cover:Ea,caption:La,captionTextInner:Ia,lightboxSplide:ka,arrow:Ra,arrowVertical:Fa,nextArrow:Va,arrowInner:Na,arrowIcon:Oa,arrowImg:Ba,mirror:ja,thumbsWrapper:Wa,thumbsContainerVertical:za,thumbsContainer:Ma,thumbsAlignStart:Da,thumbsAlignCenter:Ha,thumbsAlignEnd:Pa,thumbItem:Ua,closeButton:Ga,fadeIn:Ya,slideInLeft:qa,slideInRight:Xa,slideInTop:Ka,slideInBottom:Ja,fadeOut:Za,slideOutLeft:Qa,slideOutRight:el,slideOutTop:tl,slideOutBottom:nl,scaleSlide:ol},Nt=(e,t,n)=>{const o={},[r,a]=e.split("-");return r==="top"?(o.top="0",o.bottom="auto"):r==="middle"?(o.top="50%",o.bottom="auto"):r==="bottom"&&(o.top="auto",o.bottom="0"),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% + ${k.scalingValue(t.x,n)}), calc(-50% + ${k.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${k.scalingValue(t.x,n)}, calc(-50% + ${k.scalingValue(t.y,n)}))`:a==="center"?o.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), ${k.scalingValue(t.y,n)})`:o.transform=`translate(${k.scalingValue(t.x,n)}, ${k.scalingValue(t.y,n)})`,o};function er(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 ao(e){const t=e.getBoundingClientRect(),n=er(e),o=Math.max(0,t.width-n.left-n.right),r=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,s=o/r,l=a/i;let d,p;l>s?(d=o,p=o/l):(p=r,d=r*l);const _=t.left+n.left,m=t.top+n.top,h=(o-d)/2+_,c=(r-p)/2+m;return{x:h,y:c,width:d,height:p}}function lo(e){const t=e.getBoundingClientRect(),n=er(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function so(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(r=>parseFloat(r.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function rl(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})(),o=(()=>{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})(),r=(()=>{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:o,backdropDisappearClass:r,disappearClass:a}}const il=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:a})=>{const[i,s]=D.useState(!1),{url:l}=e.thumbnailBlock.cover;return D.useEffect(()=>{r==="close"&&s(!1),r==="open"&&s(!0)},[r]),S.jsxs(S.Fragment,{children:[S.jsx("img",{src:l,alt:"Cover",className:B.heroImage,onClick:()=>s(!0)}),S.jsx(al,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:a})]})},al=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:a,isEditor:i,metadata:s})=>{var M;const[l,d]=D.useState(0),[p,_]=D.useState(0),[m,h]=D.useState(!1),[c,u]=D.useState(!1),[b,$]=D.useState({}),f=D.useRef(null),w=D.useRef(null),j=D.useRef(null),W=D.useRef(!1),E=D.useRef(null),v=D.useRef(null),T=D.useRef(null),V=D.useRef(null),z=D.useRef(!1),L=D.useRef(null),[F,O]=D.useState(!1),{appear:U,triggers:H,slider:g,thumbnail:R,controls:x,area:A,caption:C,layout:N}=r.lightboxBlock,{appearClass:q,backdropAppearClass:ie,backdropDisappearClass:Q,disappearClass:me}=rl(U.type,U.direction),I=(s==null?void 0:s.itemId)??null;D.useEffect(()=>{const y=()=>{setTimeout(()=>{var G,J;(J=(G=f.current)==null?void 0:G.splide)==null||J.refresh()},16)},P=()=>{_(G=>G+1)};return window.addEventListener("ArticleEditor.Layout:change",y),window.addEventListener("ArticleEditor.ComponentContent:change",P),()=>{window.removeEventListener("ArticleEditor.Layout:change",y),window.removeEventListener("ArticleEditor.ComponentContent:change",P)}},[]),D.useEffect(()=>{if(!e||!R.isActive){O(!1);return}const y=L.current;if(!y)return;const P=()=>{g.direction==="horiz"?O(y.scrollWidth>y.clientWidth):O(y.scrollHeight>y.clientHeight)};P();const G=new ResizeObserver(P);return G.observe(y),()=>G.disconnect()},[e,R.isActive,n.length,b,g.direction]);const K=D.useCallback(()=>{const y=window.matchMedia("(max-width: 768px)").matches,P=so(A.color);y&&!i&&P>.9&&(document.body.style.backgroundColor=""),h(!0),W.current=!0;const G=J=>{J.target===E.current&&J.animationName&&(E.current&&v.current&&E.current.removeEventListener("animationend",v.current),v.current=null,W.current&&(W.current=!1,t()),h(!1))};E.current&&(v.current=G,E.current.addEventListener("animationend",G))},[t,A.color,i]),ye=(y,P,G)=>{var J,re;if(y){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?K():(J=f.current)==null||J.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const Z=y.getBoundingClientRect(),X=P-Z.left,oe=G-Z.top,be=Z.width,le=Z.height;let ge;g.direction==="horiz"?ge=X<be/2?"-1":"+1":ge=oe<le/2?"-1":"+1",(re=f.current)==null||re.go(ge)}}},ae=y=>{if(z.current){z.current=!1;return}const P=n[l],G=(P==null?void 0:P.image.objectFit)==="cover";let J,re;if("changedTouches"in y&&y.changedTouches.length>0)J=y.changedTouches[0].clientX,re=y.changedTouches[0].clientY;else if("clientX"in y)J=y.clientX,re=y.clientY;else return;let Z;if(G&&j.current){const X=lo(j.current);Z=J>=X.left&&J<=X.right&&re>=X.top&&re<=X.bottom}else{const X=j.current?ao(j.current):null;if(!X){y.target===y.currentTarget&&K();return}Z=J>=X.x&&J<=X.x+X.width&&re>=X.y&&re<=X.y+X.height}Z?ye(j.current,J,re):K()},pe=y=>{const P=y.target;(P.classList.contains(B.thumbsWrapper)||P.classList.contains(B.thumbsContainer))&&ae(y)};D.useEffect(()=>{if(!e)return;const y=P=>{var G,J;if(P.key==="Escape"){K();return}if(P.key==="ArrowRight"){d(re=>(re+1)%Math.max(n.length,1)),(G=f.current)==null||G.go("+1");return}P.key==="ArrowLeft"&&(d(re=>(re-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=f.current)==null||J.go("-1"))};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y)}},[e,K,n.length]),D.useEffect(()=>{if(e){if(d(0),_(P=>P+1),W.current=!1,h(!1),u(!1),$({}),!I)return;const y=new CustomEvent("page-overlay",{detail:{itemId:I}});window.dispatchEvent(y)}return()=>{E.current&&v.current&&(E.current.removeEventListener("animationend",v.current),v.current=null),u(!1)}},[e,I]),D.useEffect(()=>{w.current!==null&&w.current!==g.type&&_(y=>y+1),w.current=g.type},[g.type]),D.useEffect(()=>{if(!e)return;const y=document.body.style.overflow,P=window.matchMedia("(max-width: 768px)").matches,G=so(A.color);document.body.style.overflow="hidden",u(!1);const J=Z=>{Z.target===E.current&&!W.current&&Z.animationName&&(P&&!i&&G>.9&&(document.body.style.backgroundColor=A.color),u(!0),E.current&&T.current&&E.current.removeEventListener("animationend",T.current),T.current=null)};E.current&&(T.current=J,E.current.addEventListener("animationend",J));const re=Z=>{const X=Z.target;X&&(X.closest(`.${B.thumbsWrapper}`)||X.closest(`.${B.thumbsContainer}`))||g.type!=="slide"&&Z.preventDefault()};return document.addEventListener("touchmove",re,{passive:!1}),()=>{document.body.style.overflow=y,document.removeEventListener("touchmove",re),E.current&&T.current&&(E.current.removeEventListener("animationend",T.current),T.current=null),u(!1)}},[e,i,A.color,g.type]),D.useEffect(()=>{if(!e)return;const y=P=>{var J,re;if(W.current){P.stopPropagation();return}if(z.current){z.current=!1;return}const G=P.target;if(!(G&&(G.closest(`.${B.thumbsContainer}`)||G.closest(`.${B.thumbItem}`)))){if(g.type==="slide"&&H.type==="drag"&&((re=(J=f.current)==null?void 0:J.splide)!=null&&re.root)){const Z=f.current.splide.root;if(G&&(Z.contains(G)||Z===G))return}if(P.touches.length===0&&P.changedTouches.length>0){const Z=n[l],X=(Z==null?void 0:Z.image.objectFit)==="cover",oe=P.changedTouches[0];let be;if(X&&j.current){const le=lo(j.current);be=oe.clientX>=le.left&&oe.clientX<=le.right&&oe.clientY>=le.top&&oe.clientY<=le.bottom}else{const le=j.current?ao(j.current):null;if(!le)return;be=oe.clientX>=le.x&&oe.clientX<=le.x+le.width&&oe.clientY>=le.y&&oe.clientY<=le.y+le.height}if(!be){P.stopPropagation(),W.current=!0;const le=ge=>{ge.stopPropagation(),ge.preventDefault(),document.removeEventListener("click",le,!0)};document.addEventListener("click",le,!0),K()}}}};return document.addEventListener("touchend",y,{passive:!0}),()=>{document.removeEventListener("touchend",y)}},[e,K,l,n]);const de=(g.type==="scale"||g.type==="fade")&&g.direction==="vert"&&H.type==="drag";D.useEffect(()=>{var ge,ke;if(!e||!de||!((ke=(ge=f.current)==null?void 0:ge.splide)!=null&&ke.root))return;const y=f.current.splide.root,P=30,G=(te,ne)=>{if(V.current){const ve=Math.abs(te-V.current.x),Te=Math.abs(ne-V.current.y);(ve>0||Te>0)&&(z.current=!0)}},J=te=>{V.current&&(te.preventDefault(),G(te.clientX,te.clientY))},re=te=>{V.current&&te.touches.length>0&&(te.preventDefault(),G(te.touches[0].clientX,te.touches[0].clientY))},Z=(te,ne)=>{if(!V.current||!f.current){V.current=null;return}const ve=Math.abs(te-V.current.x),Te=Math.abs(ne-V.current.y);Te>P&&Te>ve&&f.current.go(ne<V.current.y?"+1":"-1"),V.current=null},X=te=>{V.current&&Z(te.clientX,te.clientY),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("pointermove",J)},oe=te=>{if(V.current){if(te.changedTouches.length>0){const ne=te.changedTouches[0];Z(ne.clientX,ne.clientY)}document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),document.removeEventListener("touchmove",re)}},be=te=>{V.current={x:te.clientX,y:te.clientY},z.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",X),document.addEventListener("pointercancel",X)},le=te=>{te.touches.length>0&&(V.current={x:te.touches[0].clientX,y:te.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",re,{passive:!1}),document.addEventListener("touchend",oe),document.addEventListener("touchcancel",oe))};return y.addEventListener("pointerdown",be),y.addEventListener("touchstart",le),()=>{y.removeEventListener("pointerdown",be),y.removeEventListener("touchstart",le),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),V.current=null,z.current=!1}},[e,de,p]);const De={backgroundColor:A.color,backdropFilter:`blur(${A.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?ir.createPortal(S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:i?null:E,className:ce(B.background,m?Q:ie,{[B.editor]:i},{[B.hidden]:!e}),style:{...De,...c&&!i&&!m?{position:"absolute"}:{}}}),S.jsxs("div",{ref:i?E:null,className:ce(B.contentStyle,m?me:q,{[B.editor]:i},{[B.hidden]:!e}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[S.jsx(Jo,{onMove:y=>d(y.index),ref:f,className:B.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:H.type==="drag"&&!de,perPage:1,width:"100%",height:"100%",type:g.type==="fade"||g.type==="scale"?"fade":"loop",padding:0,rewind:H.repeat!=="close",start:0},style:{"--splide-speed":g.duration},children:n.map((y,P)=>{const G=Nt(N.position,N.offset,i),J=`${k.scalingValue(N.padding.top,i)} ${k.scalingValue(N.padding.right,i)} ${k.scalingValue(N.padding.bottom,i)} ${k.scalingValue(N.padding.left,i)}`,re=g.type==="scale"?(()=>{const{transform:Z,...X}=G;return{...X,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":Z||"none"}})():{...G,position:"absolute",padding:J,boxSizing:"border-box"};return S.jsx(Zo,{children:S.jsx("div",{className:B.imgWrapper,onClick:ae,children:S.jsx("img",{ref:P===l?j:null,className:ce(B.imageStyle,{[B.contain]:y.image.objectFit==="contain",[B.cover]:y.image.objectFit==="cover",[B.scaleSlide]:g.type==="scale"}),src:y.image.url,alt:y.image.name??"",style:{...re,pointerEvents:y.image.objectFit==="contain"?"none":"auto"}})})},P)})},p),x.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:ce(B.arrow,{[B.arrowVertical]:g.direction==="vert"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(x.offset.x,i)}, ${k.scalingValue(x.offset.y*(g.direction==="horiz"?1:-1),i)}) scale(${x.scale}) rotate(${g.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var y;return(y=f.current)==null?void 0:y.go("-1")},"aria-label":"Previous",children:[x.arrowsImgUrl&&S.jsx(vt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:ce(B.arrowImg,B.mirror)}),!x.arrowsImgUrl&&S.jsx(co,{color:x.color,className:ce(B.arrowIcon,B.arrowImg,B.mirror)})]})}),S.jsx("div",{className:ce(B.arrow,B.nextArrow,{[B.arrowVertical]:g.direction==="vert"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(x.offset.x*(g.direction==="horiz"?-1:1),i)}, ${k.scalingValue(x.offset.y,i)}) scale(${x.scale}) rotate(${g.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var y;return(y=f.current)==null?void 0:y.go("+1")},"aria-label":"Next",children:[x.arrowsImgUrl&&S.jsx(vt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:B.arrowImg}),!x.arrowsImgUrl&&S.jsx(co,{color:x.color,className:ce(B.arrowIcon,B.arrowImg)})]})})]}),A.closeIconUrl&&(()=>{const y=Nt(A.closeIconAlign,A.closeIconOffset,i),P=`scale(${A.closeIconScale})`,G=y.transform?`${y.transform} ${P}`:P;return S.jsx("button",{className:B.closeButton,style:{...y,transform:G},onClick:K,"aria-label":"Close lightbox",children:S.jsx(vt,{url:A.closeIconUrl,fill:A.closeIconColor??"#000000",hoverFill:A.closeIconHover??"#cccccc"})})})(),C&&C.isActive&&o.imageCaption&&((M=n[l])==null?void 0:M.imageCaption)&&(()=>{const{widthSettings:y,fontSettings:P,letterSpacing:G,textAlign:J,wordSpacing:re,fontSizeLineHeight:Z,textAppearance:X,color:oe}=o.imageCaption;return S.jsx("div",{className:B.caption,style:{...Nt(C.alignment,C.offset,i),fontFamily:P.fontFamily,fontWeight:P.fontWeight,fontStyle:P.fontStyle,width:y.sizing==="auto"?"max-content":k.scalingValue(y.width,i),letterSpacing:k.scalingValue(G,i),wordSpacing:k.scalingValue(re,i),textAlign:J,fontSize:k.scalingValue(Z.fontSize,i),lineHeight:k.scalingValue(Z.lineHeight,i),textTransform:X.textTransform??"none",textDecoration:X.textDecoration??"none",fontVariant:X.fontVariant??"normal",color:oe},onClick:be=>be.stopPropagation(),children:S.jsx("div",{"data-styles":"imageCaption",className:B.captionTextInner,style:{"--link-color":C.linkColor,"--link-hover-color":C.linkHoverColor},children:S.jsx(Qo,{content:n[l].imageCaption})})})})(),R.isActive&&(()=>{const[y,P]=R.position.split("-"),G=g.direction==="horiz"?`${y}-left`:R.position,J=Nt(G,R.offset,i),re=()=>{if(g.direction==="horiz"){if(P==="left")return"flex-start";if(P==="center")return"center";if(P==="right")return"flex-end"}else{if(y==="top")return"flex-start";if(y==="middle")return"center";if(y==="bottom")return"flex-end"}return"flex-start"};return S.jsx("div",{ref:L,className:B.thumbsWrapper,onClick:Z=>pe(Z),style:{position:i?"absolute":"fixed",...J,...g.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:S.jsx("div",{className:ce(B.thumbsContainer,{[B.thumbsContainerVertical]:g.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:F?"flex-start":re()},children:n.map((Z,X)=>{const oe=X===l,be=b[X],ge=R.grid.size*(oe?R.activeState.scale:1),ke=()=>{if(R.fit!=="fit")return{};if(!be)return g.direction==="horiz"?{height:k.scalingValue(ge,i)}:{width:k.scalingValue(ge,i)};const te=be.width/be.height;if(g.direction==="horiz"){const ne=ge,ve=ne*te;return{width:k.scalingValue(ve,i),height:k.scalingValue(ne,i)}}else{const ne=ge,ve=ne/te;return{width:k.scalingValue(ne,i),height:k.scalingValue(ve,i)}}};return S.jsx("button",{className:B.thumbItem,style:{...g.direction==="horiz"&&R.fit!=="fit"?{height:k.scalingValue(ge,i)}:{},...g.direction==="vert"&&R.fit!=="fit"?{width:k.scalingValue(ge,i)}:{},...R.fit==="cover"?{width:k.scalingValue(ge,i),height:k.scalingValue(ge,i)}:{},...ke(),transition:oe?"all 0.25s ease-out":"none",opacity:oe?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:te=>{var ne;te.stopPropagation(),d(X),(ne=f.current)==null||ne.go(X)},onMouseEnter:()=>{var te;R.triggers==="hov"&&((te=f.current)==null||te.go(X))},children:S.jsx("img",{src:Z.image.url,alt:Z.image.name??"",onLoad:te=>{const ne=te.currentTarget;ne.naturalWidth&&ne.naturalHeight&&$(ve=>({...ve,[X]:{width:ne.naturalWidth,height:ne.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Z.image.name}-${X}`)})})})})()]})]}),document.getElementById(a)):null};function co({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 ll={element:il,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 rt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sl(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  width: 100%;
11
- min-height: ${Je(48)};
11
+ min-height: ${rt(48)};
12
+ }
13
+ .${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
14
+ .${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
15
+ outline: none;
12
16
  }
13
17
  .${e}-form {
14
18
  display: flex;
@@ -28,7 +32,7 @@
28
32
  min-width: 0;
29
33
  }
30
34
  .${e}-field-group.${e}-labeled {
31
- gap: ${Je(4)};
35
+ gap: ${rt(4)};
32
36
  }
33
37
  .${e}-field-label {
34
38
  white-space: nowrap;
@@ -42,10 +46,12 @@
42
46
  background-color: var(--${e}-input-color);
43
47
  color: var(--${e}-input-text-color);
44
48
  border-color: var(--${e}-input-border-color);
49
+ transition: color 250, border-color 250ms, background-color 250ms, outline 250ms;
45
50
  }
46
51
  .${e}-input::placeholder {
47
52
  color: var(--${e}-placeholder-color);
48
53
  opacity: 1;
54
+ transition: color 250ms, opacity 250ms;
49
55
  }
50
56
  .${e}-input:hover {
51
57
  background-color: var(--${e}-hover-input-color, var(--${e}-input-color));
@@ -58,6 +64,7 @@
58
64
  border-color: var(--${e}-hover-input-border-color, var(--${e}-input-border-color));
59
65
  }
60
66
  .${e}-input:focus,
67
+ .${e}-input:focus-visible,
61
68
  .${e}-wrapper.${e}-state-focus .${e}-input {
62
69
  background-color: var(--${e}-focus-input-color, var(--${e}-input-color));
63
70
  color: var(--${e}-focus-input-text-color, var(--${e}-input-text-color));
@@ -76,7 +83,6 @@
76
83
  }
77
84
  .${e}-input[data-field-type="textarea"] {
78
85
  resize: vertical;
79
- min-height: 60px;
80
86
  }
81
87
  .${e}-input:disabled {
82
88
  background: #f5f5f5;
@@ -85,9 +91,11 @@
85
91
  .${e}-button {
86
92
  cursor: pointer;
87
93
  white-space: nowrap;
94
+ outline: none;
88
95
  background-color: var(--${e}-button-color);
89
96
  color: var(--${e}-button-text-color);
90
97
  border-color: var(--${e}-button-border-color);
98
+ transition: color 250ms, background-color 250ms, border-color 250ms;
91
99
  }
92
100
  .${e}-button:hover {
93
101
  background-color: var(--${e}-hover-button-color, var(--${e}-button-color));
@@ -99,30 +107,38 @@
99
107
  color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
100
108
  border-color: var(--${e}-hover-button-border-color, var(--${e}-button-border-color));
101
109
  }
110
+ .${e}-button:focus,
111
+ .${e}-button:focus-visible,
112
+ .${e}-wrapper.${e}-state-focus .${e}-button {
113
+ background-color: var(--${e}-focus-button-color, var(--${e}-button-color));
114
+ color: var(--${e}-focus-button-text-color, var(--${e}-button-text-color));
115
+ border-color: var(--${e}-focus-button-border-color, var(--${e}-button-border-color));
116
+ }
117
+ .${e}-input:focus-visible,
118
+ .${e}-wrapper.${e}-state-focus .${e}-input {
119
+ outline: 1px solid var(--${e}-focus-input-border-color, var(--${e}-input-border-color));
120
+ }
121
+ .${e}-button:focus-visible,
122
+ .${e}-wrapper.${e}-state-focus .${e}-button {
123
+ outline: 1px solid var(--${e}-focus-button-border-color, var(--${e}-button-border-color));
124
+ }
102
125
  .${e}-success {
103
- margin-top: ${Je(8)};
104
- font-size: ${Je(14)};
126
+ margin-top: ${rt(8)};
127
+ font-size: ${rt(14)};
105
128
  color: var(--${e}-success-success-color, var(--${e}-success-color));
106
129
  }
107
130
  .${e}-error {
108
- margin-top: ${Je(8)};
109
- font-size: ${Je(14)};
131
+ margin-top: ${rt(8)};
132
+ font-size: ${rt(14)};
110
133
  color: var(--${e}-error-error-color, var(--${e}-error-color));
111
134
  }
112
135
  .${e}-overlay-anchor {
113
136
  position: relative;
114
137
  height: auto;
115
138
  }
116
- .${e}-gap-spacer {
117
- flex: 0 0 auto;
118
- align-self: stretch;
119
- }
120
- .${e}-fields-gap-spacer {
121
- flex: 0 0 auto;
122
- }
123
- `}function Ka({settings:e,isEditor:t,metadata:n,activeEvent:r}){const{prefix:o}=j.useScopedStyles(),{type:a="A",fieldsToShow:i=2,fields:s=[],buttonLabel:l="Sign up",input:p,button:c,gap:w=.008,fieldsGap:v=.008,label:b,buttonCorners:u,buttonStroke:d,inputCorners:A,inputStroke:E,buttonPadding:g,inputPadding:y,inputColor:M,inputTextColor:P,inputBorderColor:I,placeholderColor:h,buttonColor:$,buttonTextColor:k,buttonBorderColor:F,labelTextColor:R,successColor:N,errorColor:V,fontFamily:W,successMessage:H,errorMessage:f,stateOverrides:x}=e,T=a==="B",C=s.slice(0,Math.min(i,s.length)),m=p?tn({...p,fontSettings:{...p.fontSettings,fontFamily:W}},t):void 0,O={...m,borderStyle:"solid",borderRadius:j.scalingValue(A??0,t),borderWidth:j.scalingValue(E??0,t),paddingTop:j.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:j.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:j.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:j.scalingValue((y==null?void 0:y.left)??0,t)},X=c?tn({...c,fontSettings:{...c.fontSettings,fontFamily:W}},t):void 0,oe=b?tn({...b,fontSettings:{...b.fontSettings,fontFamily:W}},t):void 0,re=Za(o,{inputColor:M,inputTextColor:P,inputBorderColor:I,placeholderColor:h,buttonColor:$,buttonTextColor:k,buttonBorderColor:F,labelTextColor:R,successColor:N,errorColor:V},x),[ye,L]=z.useState(()=>Object.fromEntries(C.map(q=>[q.name,""]))),[J,ge]=z.useState("idle"),[le,fe]=z.useState(null),je=r==="success"?"success":r==="error"?"error":J,Xe=r==="error"?f:le,D=r==="filled"?Object.fromEntries(C.map(q=>[q.name,"Filled"])):ye,S=r&&r!=="default"?`${o}-state-${r}`:"",U=n==null?void 0:n.apiBase,Y=n==null?void 0:n.projectId,Z=n==null?void 0:n.pluginConfigId,ie=!!(U&&Y&&Z),ee=(q,pe)=>{L(te=>({...te,[q]:pe}))},K=async q=>{q.preventDefault();const pe=Object.fromEntries(C.map(te=>{var se;return[te.name,((se=ye[te.name])==null?void 0:se.trim())??""]}).filter(([,te])=>te));if(!(!ie||Object.keys(pe).length===0)){ge("submitting"),fe(null);try{const te=`${U}/projects/${Y}/forms/${Z}/submit`,se=await fetch(te,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...pe,pageUrl:typeof window<"u"?window.location.href:""})});if(!se.ok){const Ve=await se.text();throw new Error(Ve||`Request failed: ${se.status}`)}ge("success"),L(Object.fromEntries(C.map(Ve=>[Ve.name,""])))}catch(te){ge("error"),fe(te instanceof Error?te.message:"Something went wrong")}}};return _.jsxs("div",{className:`${o}-wrapper ${S}`.trim(),style:re,children:[_.jsx("style",{children:Xa(o)}),_.jsxs("form",{onSubmit:K,className:`${o}-form`,children:[_.jsx("div",{className:`${o}-fields`,children:C.map((q,pe)=>_.jsxs(z.Fragment,{children:[_.jsxs("div",{className:`${o}-field-group${T?` ${o}-labeled`:""}`,children:[T&&_.jsx("span",{className:`${o}-field-label`,style:oe?{...oe,lineHeight:oe.fontSize}:void 0,children:q.label||q.name}),q.type==="textarea"?_.jsx("textarea",{name:q.name,autoComplete:"off",value:D[q.name]??"",onChange:te=>ee(q.name,te.target.value),placeholder:q.placeholder,className:`${o}-input`,style:O,rows:1,"data-field-type":"textarea"}):_.jsx("input",{type:q.type==="phone"?"tel":q.type==="email"?"email":"text",name:q.name,autoComplete:"off",value:D[q.name]??"",onChange:te=>ee(q.name,te.target.value),placeholder:q.placeholder,required:q.type==="email",className:`${o}-input`,style:O})]}),pe<C.length-1&&_.jsx("div",{"data-axis":"y",className:`${o}-overlay-anchor ${o}-fields-gap-spacer`,"data-controls":"settings.fieldsGap",style:{height:j.scalingValue(v,t),width:"100%"}})]},pe))}),_.jsx("div",{"data-axis":"y",className:`${o}-overlay-anchor ${o}-gap-spacer`,"data-controls":"settings.gap",style:{height:j.scalingValue(w,t),width:"100%"}}),_.jsx("div",{className:`${o}-overlay-anchor`,children:_.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:j.scalingValue(u??0,t),borderWidth:j.scalingValue(d??0,t),paddingTop:j.scalingValue((g==null?void 0:g.top)??0,t),paddingRight:j.scalingValue((g==null?void 0:g.right)??0,t),paddingBottom:j.scalingValue((g==null?void 0:g.bottom)??0,t),paddingLeft:j.scalingValue((g==null?void 0:g.left)??0,t),...X},children:_.jsx("span",{className:`${o}-overlay-anchor`,children:J==="submitting"?"...":l})})})]}),je==="success"&&_.jsx("p",{className:`${o}-success`,style:{...m,lineHeight:m==null?void 0:m.fontSize},children:H}),je==="error"&&_.jsx("p",{className:`${o}-error`,style:{...m,lineHeight:m==null?void 0:m.fontSize},role:"alert",children:Xe??f})]})}const tr={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"},Ja=["hover","focus","filled","success","error"];function Za(e,t,n){const r={};for(const[o,a]of Object.entries(tr))r[`--${e}-${a}`]=t[o];if(n)for(const o of Ja){const a=n[o];if(a)for(const[i,s]of Object.entries(tr)){const l=a[i];l!==void 0&&(r[`--${e}-${o}-${s}`]=l)}}return r}function tn(e,t){var n,r,o;return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:j.scalingValue(e.letterSpacing,t),wordSpacing:j.scalingValue(e.wordSpacing,t),fontSize:j.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?j.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(o=e.textAppearance)==null?void 0:o.fontVariant}}const Qa=`import React, { useState } from 'react';
139
+ `}function cl({settings:e,isEditor:t,metadata:n,activeEvent:o}){const{prefix:r}=k.useScopedStyles(),{type:a="A",fieldsToShow:i=2,fields:s=[],buttonLabel:l,gap:d=.008,fieldsGap:p=.008,buttonCorners:_,buttonStroke:m,inputCorners:h,inputStroke:c,buttonPadding:u,inputPadding:b,inputColor:$,inputTextColor:f,inputBorderColor:w,placeholderColor:j,buttonColor:W,buttonTextColor:E,buttonBorderColor:v,labelTextColor:T,successColor:V,errorColor:z,fontFamily:L,inputFontSettings:F,inputFontSize:O,inputLineHeight:U,inputLetterSpacing:H,inputWordSpacing:g,inputTextAppearance:R,buttonFontSettings:x,buttonFontSize:A,buttonLineHeight:C,buttonLetterSpacing:N,buttonWordSpacing:q,buttonTextAppearance:ie,labelFontSettings:Q,labelFontSize:me,labelLineHeight:I,labelLetterSpacing:K,labelWordSpacing:ye,labelTextAppearance:ae,successMessage:pe,errorMessage:de,stateOverrides:De}=e,M=a==="B",y=s.slice(0,Math.min(i,s.length)),P={fontSettings:{fontFamily:L,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:O??.01,lineHeight:U,letterSpacing:H??0,wordSpacing:g??0,textAppearance:R},G=un(P,t),J=k.scalingValue(c??0,t),re={...G,borderStyle:"solid",borderRadius:a==="C"?0:k.scalingValue(h??0,t),borderWidth:a==="C"?void 0:J,borderTopWidth:a==="C"?0:void 0,borderRightWidth:a==="C"?0:void 0,borderBottomWidth:a==="C"?J:void 0,borderLeftWidth:a==="C"?0:void 0,paddingTop:k.scalingValue((b==null?void 0:b.top)??0,t),paddingRight:k.scalingValue((b==null?void 0:b.right)??0,t),paddingBottom:k.scalingValue((b==null?void 0:b.bottom)??0,t),paddingLeft:k.scalingValue((b==null?void 0:b.left)??0,t)},Z={fontSettings:{fontFamily:L,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:A??.01,lineHeight:C,letterSpacing:N??0,wordSpacing:q??0,textAppearance:ie},X=un(Z,t),oe=k.scalingValue(m??0,t),be={fontSettings:{fontFamily:L,fontWeight:(Q==null?void 0:Q.fontWeight)??400,fontStyle:(Q==null?void 0:Q.fontStyle)??"normal"},fontSize:me??.01,lineHeight:I,letterSpacing:K??0,wordSpacing:ye??0,textAppearance:ae},le=un(be,t),ge=pl(r,{inputColor:$,inputTextColor:f,inputBorderColor:w,placeholderColor:j!=null&&j.trim()?j:"#cccccc",buttonColor:W,buttonTextColor:E,buttonBorderColor:v,labelTextColor:T,successColor:V,errorColor:z},De),[ke,te]=D.useState(()=>Object.fromEntries(y.map(fe=>[fe.name,""]))),[ne,ve]=D.useState("idle"),[Te,Se]=D.useState(null),Re=o==="success"?"success":o==="error"?"error":ne,tr=o==="error"?de:Te,on=o==="filled"?Object.fromEntries(y.map(fe=>[fe.name,"Filled"])):ke,nr=Re==="error"?k.getFormFieldValidationError(y,on):null,or=o&&o!=="default"?`${r}-state-${o}`:"",Mn=n==null?void 0:n.submitUrl,Dn=(fe,tt)=>{te(He=>({...He,[fe]:tt}))},rr=async fe=>{fe.preventDefault();const tt=Object.fromEntries(y.map(Ae=>{var nt;return[Ae.name,((nt=ke[Ae.name])==null?void 0:nt.trim())??""]}).filter(([,Ae])=>Ae));if(!Mn||Object.keys(tt).length===0)return;const He=k.getFormFieldValidationError(y,ke);if(He){ve("error"),Se(He);return}ve("submitting"),Se(null);try{const Ae=await fetch(Mn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tt)});if(!Ae.ok){const nt=await Ae.text();throw new Error(nt||`Request failed: ${Ae.status}`)}ve("success"),te(Object.fromEntries(y.map(nt=>[nt.name,""])))}catch(Ae){ve("error"),Se(Ae instanceof Error?Ae.message:"Something went wrong")}};return S.jsxs("div",{className:`${r}-wrapper ${r}-type-${a} ${or}`.trim(),style:ge,children:[S.jsx("style",{children:sl(r)}),S.jsxs("form",{onSubmit:rr,className:`${r}-form`,style:{gap:k.scalingValue(d,t)},children:[S.jsx("div",{className:`${r}-fields`,style:{gap:k.scalingValue(p,t)},children:y.map((fe,tt)=>S.jsxs("div",{className:`${r}-field-group${M?` ${r}-labeled`:""}`,children:[M&&S.jsx("span",{className:`${r}-field-label`,style:le?{...le,lineHeight:le.fontSize}:void 0,children:fe.label||fe.name}),fe.type==="textarea"?S.jsx("textarea",{name:fe.name,autoComplete:"off",value:on[fe.name]??"",onChange:He=>Dn(fe.name,He.target.value),placeholder:fe.placeholder,className:`${r}-input`,style:re,rows:1,"data-field-type":"textarea"}):S.jsx("input",{type:fe.type==="phone"?"tel":fe.type==="email"?"email":"text",name:fe.name,autoComplete:"off",value:on[fe.name]??"",onChange:He=>Dn(fe.name,He.target.value),placeholder:fe.placeholder,required:fe.type==="email",className:`${r}-input`,style:re})]},tt))}),S.jsx("div",{className:`${r}-overlay-anchor`,children:S.jsx("button",{type:"submit",className:`${r}-button`,style:{borderStyle:"solid",borderRadius:a==="C"?0:k.scalingValue(_??0,t),borderWidth:a==="C"?void 0:oe,borderTopWidth:a==="C"?0:void 0,borderRightWidth:a==="C"?0:void 0,borderBottomWidth:a==="C"?oe:void 0,borderLeftWidth:a==="C"?0:void 0,paddingTop:k.scalingValue((u==null?void 0:u.top)??0,t),paddingRight:k.scalingValue((u==null?void 0:u.right)??0,t),paddingBottom:k.scalingValue((u==null?void 0:u.bottom)??0,t),paddingLeft:k.scalingValue((u==null?void 0:u.left)??0,t),...X},children:S.jsx("span",{className:`${r}-overlay-anchor`,children:ne==="submitting"?"...":l})})})]}),Re==="success"&&S.jsx("p",{className:`${r}-success`,style:{...G,lineHeight:G==null?void 0:G.fontSize},children:pe}),Re==="error"&&S.jsx("p",{className:`${r}-error`,style:{...G,lineHeight:G==null?void 0:G.fontSize},role:"alert",children:nr??tr??de})]})}const uo={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"},ul=["hover","focus","filled","success","error"];function pl(e,t,n){const o={};for(const[r,a]of Object.entries(uo))o[`--${e}-${a}`]=t[r];if(n)for(const r of ul){const a=n[r];if(a)for(const[i,s]of Object.entries(uo)){const l=a[i];l!==void 0&&(o[`--${e}-${r}-${s}`]=l)}}return o}function un(e,t){var n,o,r;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),lineHeight:e.lineHeight!==void 0?k.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(r=e.textAppearance)==null?void 0:r.fontVariant}}const dl=`import React, { useState } from 'react';
124
140
  import { CommonComponentProps } from '../props';
125
- import { scalingValue, useScopedStyles } from '../utils/index';
141
+ import { getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
126
142
 
127
143
  function sv(px: number): string {
128
144
  return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
@@ -136,6 +152,10 @@ function getCSS(P: string): string {
136
152
  width: 100%;
137
153
  min-height: \${sv(48)};
138
154
  }
155
+ .\${P}-wrapper.\${P}-type-C .\${P}-input:focus-visible,
156
+ .\${P}-wrapper.\${P}-type-C .\${P}-button:focus-visible {
157
+ outline: none;
158
+ }
139
159
  .\${P}-form {
140
160
  display: flex;
141
161
  flex-direction: column;
@@ -168,10 +188,12 @@ function getCSS(P: string): string {
168
188
  background-color: var(--\${P}-input-color);
169
189
  color: var(--\${P}-input-text-color);
170
190
  border-color: var(--\${P}-input-border-color);
191
+ transition: color 250, border-color 250ms, background-color 250ms, outline 250ms;
171
192
  }
172
193
  .\${P}-input::placeholder {
173
194
  color: var(--\${P}-placeholder-color);
174
195
  opacity: 1;
196
+ transition: color 250ms, opacity 250ms;
175
197
  }
176
198
  .\${P}-input:hover {
177
199
  background-color: var(--\${P}-hover-input-color, var(--\${P}-input-color));
@@ -184,6 +206,7 @@ function getCSS(P: string): string {
184
206
  border-color: var(--\${P}-hover-input-border-color, var(--\${P}-input-border-color));
185
207
  }
186
208
  .\${P}-input:focus,
209
+ .\${P}-input:focus-visible,
187
210
  .\${P}-wrapper.\${P}-state-focus .\${P}-input {
188
211
  background-color: var(--\${P}-focus-input-color, var(--\${P}-input-color));
189
212
  color: var(--\${P}-focus-input-text-color, var(--\${P}-input-text-color));
@@ -202,7 +225,6 @@ function getCSS(P: string): string {
202
225
  }
203
226
  .\${P}-input[data-field-type="textarea"] {
204
227
  resize: vertical;
205
- min-height: 60px;
206
228
  }
207
229
  .\${P}-input:disabled {
208
230
  background: #f5f5f5;
@@ -211,9 +233,11 @@ function getCSS(P: string): string {
211
233
  .\${P}-button {
212
234
  cursor: pointer;
213
235
  white-space: nowrap;
236
+ outline: none;
214
237
  background-color: var(--\${P}-button-color);
215
238
  color: var(--\${P}-button-text-color);
216
239
  border-color: var(--\${P}-button-border-color);
240
+ transition: color 250ms, background-color 250ms, border-color 250ms;
217
241
  }
218
242
  .\${P}-button:hover {
219
243
  background-color: var(--\${P}-hover-button-color, var(--\${P}-button-color));
@@ -225,6 +249,21 @@ function getCSS(P: string): string {
225
249
  color: var(--\${P}-hover-button-text-color, var(--\${P}-button-text-color));
226
250
  border-color: var(--\${P}-hover-button-border-color, var(--\${P}-button-border-color));
227
251
  }
252
+ .\${P}-button:focus,
253
+ .\${P}-button:focus-visible,
254
+ .\${P}-wrapper.\${P}-state-focus .\${P}-button {
255
+ background-color: var(--\${P}-focus-button-color, var(--\${P}-button-color));
256
+ color: var(--\${P}-focus-button-text-color, var(--\${P}-button-text-color));
257
+ border-color: var(--\${P}-focus-button-border-color, var(--\${P}-button-border-color));
258
+ }
259
+ .\${P}-input:focus-visible,
260
+ .\${P}-wrapper.\${P}-state-focus .\${P}-input {
261
+ outline: 1px solid var(--\${P}-focus-input-border-color, var(--\${P}-input-border-color));
262
+ }
263
+ .\${P}-button:focus-visible,
264
+ .\${P}-wrapper.\${P}-state-focus .\${P}-button {
265
+ outline: 1px solid var(--\${P}-focus-button-border-color, var(--\${P}-button-border-color));
266
+ }
228
267
  .\${P}-success {
229
268
  margin-top: \${sv(8)};
230
269
  font-size: \${sv(14)};
@@ -239,13 +278,6 @@ function getCSS(P: string): string {
239
278
  position: relative;
240
279
  height: auto;
241
280
  }
242
- .\${P}-gap-spacer {
243
- flex: 0 0 auto;
244
- align-self: stretch;
245
- }
246
- .\${P}-fields-gap-spacer {
247
- flex: 0 0 auto;
248
- }
249
281
  \`;
250
282
  }
251
283
 
@@ -263,12 +295,9 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
263
295
  type = 'A',
264
296
  fieldsToShow = 2,
265
297
  fields = [],
266
- buttonLabel = 'Sign up',
267
- input: inputTextStyle,
268
- button: buttonTextStyle,
298
+ buttonLabel,
269
299
  gap = 0.008,
270
300
  fieldsGap = 0.008,
271
- label: labelTextStyle,
272
301
  buttonCorners,
273
302
  buttonStroke,
274
303
  inputCorners,
@@ -286,6 +315,24 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
286
315
  successColor,
287
316
  errorColor,
288
317
  fontFamily,
318
+ inputFontSettings,
319
+ inputFontSize,
320
+ inputLineHeight,
321
+ inputLetterSpacing,
322
+ inputWordSpacing,
323
+ inputTextAppearance,
324
+ buttonFontSettings,
325
+ buttonFontSize,
326
+ buttonLineHeight,
327
+ buttonLetterSpacing,
328
+ buttonWordSpacing,
329
+ buttonTextAppearance,
330
+ labelFontSettings,
331
+ labelFontSize,
332
+ labelLineHeight,
333
+ labelLetterSpacing,
334
+ labelWordSpacing,
335
+ labelTextAppearance,
289
336
  successMessage,
290
337
  errorMessage: errorMessageText,
291
338
  stateOverrides,
@@ -293,48 +340,79 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
293
340
 
294
341
  const showLabels = type === 'B';
295
342
  const visibleFields = fields.slice(0, Math.min(fieldsToShow, fields.length));
296
- const inputCss = inputTextStyle
297
- ? textStylesToCss(
298
- {
299
- ...inputTextStyle,
300
- fontSettings: { ...inputTextStyle.fontSettings, fontFamily },
301
- },
302
- isEditor,
303
- )
304
- : undefined;
343
+
344
+ const resolvedInputTextStyle: TextStyles = {
345
+ fontSettings: {
346
+ fontFamily,
347
+ fontWeight: inputFontSettings?.fontWeight ?? 400,
348
+ fontStyle: inputFontSettings?.fontStyle ?? 'normal',
349
+ },
350
+ fontSize: inputFontSize ?? 0.01,
351
+ lineHeight: inputLineHeight,
352
+ letterSpacing: inputLetterSpacing ?? 0,
353
+ wordSpacing: inputWordSpacing ?? 0,
354
+ textAppearance: inputTextAppearance,
355
+ color: inputTextColor,
356
+ };
357
+ const inputCss = textStylesToCss(resolvedInputTextStyle, isEditor);
358
+ const strokeForInput = scalingValue(inputStroke ?? 0, isEditor);
305
359
  const inputFieldCss = {
306
360
  ...inputCss,
307
361
  borderStyle: 'solid',
308
- borderRadius: scalingValue(inputCorners ?? 0, isEditor),
309
- borderWidth: scalingValue(inputStroke ?? 0, isEditor),
362
+ borderRadius: type === 'C' ? 0 : scalingValue(inputCorners ?? 0, isEditor),
363
+ borderWidth: type === 'C' ? undefined : strokeForInput,
364
+ borderTopWidth: type === 'C' ? 0 : undefined,
365
+ borderRightWidth: type === 'C' ? 0 : undefined,
366
+ borderBottomWidth: type === 'C' ? strokeForInput : undefined,
367
+ borderLeftWidth: type === 'C' ? 0 : undefined,
310
368
  paddingTop: scalingValue(inputPadding?.top ?? 0, isEditor),
311
369
  paddingRight: scalingValue(inputPadding?.right ?? 0, isEditor),
312
370
  paddingBottom: scalingValue(inputPadding?.bottom ?? 0, isEditor),
313
371
  paddingLeft: scalingValue(inputPadding?.left ?? 0, isEditor),
314
372
  } as React.CSSProperties;
315
- const buttonTextCss = buttonTextStyle
316
- ? textStylesToCss(
317
- {
318
- ...buttonTextStyle,
319
- fontSettings: { ...buttonTextStyle.fontSettings, fontFamily },
320
- },
321
- isEditor,
322
- )
323
- : undefined;
324
- const labelTextCss = labelTextStyle
325
- ? textStylesToCss(
326
- {
327
- ...labelTextStyle,
328
- fontSettings: { ...labelTextStyle.fontSettings, fontFamily },
329
- },
330
- isEditor,
331
- )
332
- : undefined;
373
+
374
+ const resolvedButtonTextStyle: TextStyles = {
375
+ fontSettings: {
376
+ fontFamily,
377
+ fontWeight: buttonFontSettings?.fontWeight ?? 400,
378
+ fontStyle: buttonFontSettings?.fontStyle ?? 'normal',
379
+ },
380
+ fontSize: buttonFontSize ?? 0.01,
381
+ lineHeight: buttonLineHeight,
382
+ letterSpacing: buttonLetterSpacing ?? 0,
383
+ wordSpacing: buttonWordSpacing ?? 0,
384
+ textAppearance: buttonTextAppearance,
385
+ color: buttonTextColor,
386
+ };
387
+ const buttonTextCss = textStylesToCss(resolvedButtonTextStyle, isEditor);
388
+ const strokeForButton = scalingValue(buttonStroke ?? 0, isEditor);
389
+
390
+ const resolvedLabelTextStyle: TextStyles = {
391
+ fontSettings: {
392
+ fontFamily,
393
+ fontWeight: labelFontSettings?.fontWeight ?? 400,
394
+ fontStyle: labelFontSettings?.fontStyle ?? 'normal',
395
+ },
396
+ fontSize: labelFontSize ?? 0.01,
397
+ lineHeight: labelLineHeight,
398
+ letterSpacing: labelLetterSpacing ?? 0,
399
+ wordSpacing: labelWordSpacing ?? 0,
400
+ textAppearance: labelTextAppearance,
401
+ color: labelTextColor,
402
+ };
403
+ const labelTextCss = textStylesToCss(resolvedLabelTextStyle, isEditor);
333
404
 
334
405
  const colorVars = buildColorVars(P, {
335
- inputColor, inputTextColor, inputBorderColor, placeholderColor,
336
- buttonColor, buttonTextColor, buttonBorderColor,
337
- labelTextColor, successColor, errorColor,
406
+ inputColor,
407
+ inputTextColor,
408
+ inputBorderColor,
409
+ placeholderColor: placeholderColor?.trim() ? placeholderColor : '#cccccc',
410
+ buttonColor,
411
+ buttonTextColor,
412
+ buttonBorderColor,
413
+ labelTextColor,
414
+ successColor,
415
+ errorColor,
338
416
  }, stateOverrides);
339
417
 
340
418
  const [fieldValues, setFieldValues] = useState<Record<string, string>>(() =>
@@ -350,13 +428,13 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
350
428
  const displayValues = activeEvent === 'filled'
351
429
  ? Object.fromEntries(visibleFields.map((f) => [f.name, 'Filled']))
352
430
  : fieldValues;
431
+ const validationErrorMessage =
432
+ displayStatus === 'error'
433
+ ? getFormFieldValidationError(visibleFields, displayValues)
434
+ : null;
353
435
  const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
354
436
 
355
- const apiBase = metadata?.apiBase as string | undefined;
356
- const projectId = metadata?.projectId as string | undefined;
357
- const configId = metadata?.pluginConfigId as string | undefined;
358
- const canSubmit = Boolean(apiBase && projectId && configId);
359
-
437
+ const submitUrl = metadata?.submitUrl as string | undefined;
360
438
  const handleFieldChange = (name: string, value: string) => {
361
439
  setFieldValues((prev) => ({ ...prev, [name]: value }));
362
440
  };
@@ -366,20 +444,23 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
366
444
  const payload = Object.fromEntries(
367
445
  visibleFields.map((f) => [f.name, fieldValues[f.name]?.trim() ?? '']).filter(([, v]) => v)
368
446
  );
369
- if (!canSubmit || Object.keys(payload).length === 0) return;
447
+ if (!submitUrl || Object.keys(payload).length === 0) return;
448
+
449
+ const validationError = getFormFieldValidationError(visibleFields, fieldValues);
450
+ if (validationError) {
451
+ setStatus('error');
452
+ setErrorMessage(validationError);
453
+ return;
454
+ }
370
455
 
371
456
  setStatus('submitting');
372
457
  setErrorMessage(null);
373
458
 
374
459
  try {
375
- const url = \`\${apiBase}/projects/\${projectId}/forms/\${configId}/submit\`;
376
- const res = await fetch(url, {
460
+ const res = await fetch(submitUrl, {
377
461
  method: 'POST',
378
462
  headers: { 'Content-Type': 'application/json' },
379
- body: JSON.stringify({
380
- ...payload,
381
- pageUrl: typeof window !== 'undefined' ? window.location.href : '',
382
- }),
463
+ body: JSON.stringify(payload),
383
464
  });
384
465
  if (!res.ok) {
385
466
  const text = await res.text();
@@ -395,72 +476,64 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
395
476
  };
396
477
 
397
478
  return (
398
- <div className={\`\${P}-wrapper \${stateClass}\`.trim()} style={colorVars}>
479
+ <div className={\`\${P}-wrapper \${P}-type-\${type} \${stateClass}\`.trim()} style={colorVars}>
399
480
  <style>{getCSS(P)}</style>
400
481
  <form
401
482
  onSubmit={handleSubmit}
402
483
  className={\`\${P}-form\`}
484
+ style={{ gap: scalingValue(gap, isEditor) }}
403
485
  >
404
- <div className={\`\${P}-fields\`}>
486
+ <div
487
+ className={\`\${P}-fields\`}
488
+ style={{ gap: scalingValue(fieldsGap, isEditor) }}
489
+ >
405
490
  {visibleFields.map((field, index) => (
406
- <React.Fragment key={index}>
407
- <div className={\`\${P}-field-group\${showLabels ? \` \${P}-labeled\` : ''}\`}>
408
- {showLabels && (
409
- <span className={\`\${P}-field-label\`} style={labelTextCss ? { ...labelTextCss, lineHeight: labelTextCss.fontSize } : undefined}>
410
- {field.label || field.name}
411
- </span>
412
- )}
413
- {field.type === 'textarea' ? (
414
- <textarea
415
- name={field.name}
416
- autoComplete="off"
417
- value={displayValues[field.name] ?? ''}
418
- onChange={(e) => handleFieldChange(field.name, e.target.value)}
419
- placeholder={field.placeholder}
420
- className={\`\${P}-input\`}
421
- style={inputFieldCss}
422
- rows={1}
423
- data-field-type="textarea"
424
- />
425
- ) : (
426
- <input
427
- type={field.type === 'phone' ? 'tel' : field.type === 'email' ? 'email' : 'text'}
428
- name={field.name}
429
- autoComplete="off"
430
- value={displayValues[field.name] ?? ''}
431
- onChange={(e) => handleFieldChange(field.name, e.target.value)}
432
- placeholder={field.placeholder}
433
- required={field.type === 'email'}
434
- className={\`\${P}-input\`}
435
- style={inputFieldCss}
436
- />
437
- )}
438
- </div>
439
- {index < visibleFields.length - 1 && (
440
- <div
441
- data-axis="y"
442
- className={\`\${P}-overlay-anchor \${P}-fields-gap-spacer\`}
443
- data-controls="settings.fieldsGap"
444
- style={{ height: scalingValue(fieldsGap, isEditor), width: '100%' }}
491
+ <div key={index} className={\`\${P}-field-group\${showLabels ? \` \${P}-labeled\` : ''}\`}>
492
+ {showLabels && (
493
+ <span className={\`\${P}-field-label\`} style={labelTextCss ? { ...labelTextCss, lineHeight: labelTextCss.fontSize } : undefined}>
494
+ {field.label || field.name}
495
+ </span>
496
+ )}
497
+ {field.type === 'textarea' ? (
498
+ <textarea
499
+ name={field.name}
500
+ autoComplete="off"
501
+ value={displayValues[field.name] ?? ''}
502
+ onChange={(e) => handleFieldChange(field.name, e.target.value)}
503
+ placeholder={field.placeholder}
504
+ className={\`\${P}-input\`}
505
+ style={inputFieldCss}
506
+ rows={1}
507
+ data-field-type="textarea"
508
+ />
509
+ ) : (
510
+ <input
511
+ type={field.type === 'phone' ? 'tel' : field.type === 'email' ? 'email' : 'text'}
512
+ name={field.name}
513
+ autoComplete="off"
514
+ value={displayValues[field.name] ?? ''}
515
+ onChange={(e) => handleFieldChange(field.name, e.target.value)}
516
+ placeholder={field.placeholder}
517
+ required={field.type === 'email'}
518
+ className={\`\${P}-input\`}
519
+ style={inputFieldCss}
445
520
  />
446
521
  )}
447
- </React.Fragment>
522
+ </div>
448
523
  ))}
449
524
  </div>
450
- <div
451
- data-axis="y"
452
- className={\`\${P}-overlay-anchor \${P}-gap-spacer\`}
453
- data-controls="settings.gap"
454
- style={{ height: scalingValue(gap, isEditor), width: '100%' }}
455
- />
456
525
  <div className={\`\${P}-overlay-anchor\`}>
457
526
  <button
458
527
  type="submit"
459
528
  className={\`\${P}-button\`}
460
529
  style={{
461
530
  borderStyle: 'solid',
462
- borderRadius: scalingValue(buttonCorners ?? 0, isEditor),
463
- borderWidth: scalingValue(buttonStroke ?? 0, isEditor),
531
+ borderRadius: type === 'C' ? 0 : scalingValue(buttonCorners ?? 0, isEditor),
532
+ borderWidth: type === 'C' ? undefined : strokeForButton,
533
+ borderTopWidth: type === 'C' ? 0 : undefined,
534
+ borderRightWidth: type === 'C' ? 0 : undefined,
535
+ borderBottomWidth: type === 'C' ? strokeForButton : undefined,
536
+ borderLeftWidth: type === 'C' ? 0 : undefined,
464
537
  paddingTop: scalingValue(buttonPadding?.top ?? 0, isEditor),
465
538
  paddingRight: scalingValue(buttonPadding?.right ?? 0, isEditor),
466
539
  paddingBottom: scalingValue(buttonPadding?.bottom ?? 0, isEditor),
@@ -488,7 +561,7 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
488
561
  style={{ ...inputCss, lineHeight: inputCss?.fontSize }}
489
562
  role="alert"
490
563
  >
491
- {displayError ?? errorMessageText}
564
+ {validationErrorMessage ?? displayError ?? errorMessageText}
492
565
  </p>
493
566
  )}
494
567
  </div>
@@ -544,16 +617,31 @@ type ColorKeys =
544
617
  type StateColorOverrides = Partial<Record<ColorKeys, string>>;
545
618
 
546
619
  type FormSettings = {
547
- type: 'A' | 'B';
620
+ type: 'A' | 'B' | 'C';
548
621
  fontFamily: string;
549
622
  fieldsToShow: number;
550
623
  fields: FormFieldItem[];
551
624
  buttonLabel?: string;
552
- input?: TextStyles;
553
- button?: TextStyles;
554
625
  gap?: number;
555
626
  fieldsGap?: number;
556
- label?: TextStyles;
627
+ inputFontSettings?: { fontWeight: number; fontStyle: string };
628
+ inputFontSize?: number;
629
+ inputLineHeight?: number;
630
+ inputLetterSpacing?: number;
631
+ inputWordSpacing?: number;
632
+ inputTextAppearance?: TextStyles['textAppearance'];
633
+ buttonFontSettings?: { fontWeight: number; fontStyle: string };
634
+ buttonFontSize?: number;
635
+ buttonLineHeight?: number;
636
+ buttonLetterSpacing?: number;
637
+ buttonWordSpacing?: number;
638
+ buttonTextAppearance?: TextStyles['textAppearance'];
639
+ labelFontSettings?: { fontWeight: number; fontStyle: string };
640
+ labelFontSize?: number;
641
+ labelLineHeight?: number;
642
+ labelLetterSpacing?: number;
643
+ labelWordSpacing?: number;
644
+ labelTextAppearance?: TextStyles['textAppearance'];
557
645
  buttonCorners?: number;
558
646
  buttonStroke?: number;
559
647
  inputCorners?: number;
@@ -628,4 +716,167 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
628
716
  fontVariant: textStyles.textAppearance?.fontVariant
629
717
  };
630
718
  }
631
- `,el=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Email is required"},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Name is required"},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Company is required"},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Phone is required"},{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"}],nn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}},tl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],rn=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},lineHeight:.01,letterSpacing:0,wordSpacing:0,fontSize:.01,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),nl={type:"object",version:1,settings:{sizing:"auto",properties:{fieldsToShow:{type:"number",scope:"layout",title:"Fields",display:{type:"number"},min:1,max:8},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"}}}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},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:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"layout",title:"Input Border 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"}},buttonBorderColor:{type:"string",scope:"layout",title:"Button Border Color",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"layout",title:"Label 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"}},stateOverrides:{type:"object",scope:"layout"},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},input:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]},button:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]},label:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}},defaults:{fieldsToShow:2,fields:el,type:"A",gap:.008,fieldsGap:.008,buttonStroke:.001,buttonCorners:0,inputStroke:.001,inputCorners:0,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputColor:"#000000",inputTextColor:"#999999",inputBorderColor:"#cccccc",buttonColor:"#666666",buttonTextColor:"#ffffff",buttonBorderColor:"#cccccc",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{},fontFamily:"Arial",input:rn(400),button:rn(700),label:rn(400),successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","fieldsToShow"]},"type",{type:"group",title:"BUTTON",items:[{type:"row",items:[{type:"accordion",title:"",options:{Input:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"Padding",items:["inputPadding"]}],Button:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"Padding",items:["buttonPadding"]}]}}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"accordion",title:"",options:{Input:["input"],Button:["button"]}}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...tl],panelIds:["general","typeStyle"],stateItems:{default:["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonColor","buttonTextColor","buttonBorderColor"],focus:["inputColor","inputTextColor","inputBorderColor"],filled:["inputColor","inputTextColor","inputBorderColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},rl={element:Ka,id:"form",name:"Form",version:1,defaultSize:{width:400,height:42},schema:nl,sourceCode:Qa},ol="OnelinerForm-module__wrapper___BCMAA",il="OnelinerForm-module__form___ED-dE",al="OnelinerForm-module__input___Dylt7",ll="OnelinerForm-module__submitBtn___aHZXa",sl="OnelinerForm-module__success___KhwKm",cl="OnelinerForm-module__error___c8WbI",ul="OnelinerForm-module__overlayAnchor___zxYKj",Pe={wrapper:ol,form:il,input:al,submitBtn:ll,success:sl,error:cl,overlayAnchor:ul};function pl({settings:e,isEditor:t,metadata:n}){const{fields:r=[{name:"email",type:"email",placeholder:"Your email"}],buttonLabel:o="Submit",input:a,button:i,height:s,corners:l,stroke:p,strokeColor:c,inputColor:w,placeholderColor:v,buttonColor:b,successColor:u,errorColor:d,fieldsToShow:A,inputPadding:E,buttonPadding:g}=e,[y,M]=z.useState({}),[P,I]=z.useState("idle"),[h,$]=z.useState(null),k=n==null?void 0:n.apiBase,F=n==null?void 0:n.projectId,R=!!(k&&F),N=a?nr(a,t):void 0,V=i?nr(i,t):void 0,W={borderRadius:j.scalingValue(l,t),borderWidth:j.scalingValue(p,t),borderStyle:"solid",borderColor:c},H={borderLeftWidth:j.scalingValue(p,t),borderLeftStyle:"solid",borderLeftColor:c},f=async x=>{x.preventDefault();const T=Object.values(y).join("").trim();if(!(!R||!T)){I("submitting"),$(null);try{const C=await fetch(`${k}/projects/${F}/forms/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r.map(m=>({[m.name]:T})),pageUrl:typeof window<"u"?window.location.href:""})});if(!C.ok){const m=await C.text();throw new Error(m||`Request failed: ${C.status}`)}I("success"),M({})}catch(C){I("error"),$(C instanceof Error?C.message:"Something went wrong")}}};return _.jsxs("div",{className:Pe.wrapper,children:[_.jsxs("form",{onSubmit:f,className:Pe.form,style:{...W,height:j.scalingValue(s,t)},children:[_.jsx("div",{className:Pe.overlayAnchor,style:{flex:1,minWidth:0,backgroundColor:w},children:r.slice(0,A).map(x=>_.jsx("input",{type:x.type==="email"?"email":x.type==="phone"?"tel":"text",name:x.name,autoComplete:"off",value:y[x.name]||"",onChange:T=>M(C=>({...C,[x.name]:T.target.value})),placeholder:x.placeholder,required:x.type==="email",className:Pe.input,style:{...N,paddingRight:j.scalingValue(E.right,t),paddingLeft:j.scalingValue(E.left,t),"--placeholder-color":v}},x.name))}),_.jsx("div",{className:Pe.overlayAnchor,children:_.jsx("button",{type:"submit",className:Pe.submitBtn,style:{...V,...H,backgroundColor:b,paddingRight:j.scalingValue(g.right,t),paddingLeft:j.scalingValue(g.left,t)},children:P==="submitting"?"...":o})})]}),P==="success"&&_.jsx("p",{className:Pe.success,style:{color:u},children:"Thanks for subscribing!"}),P==="error"&&h&&_.jsx("p",{className:Pe.error,style:{color:d},role:"alert",children:h})]})}function nr(e,t){return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:j.scalingValue(e.letterSpacing,t),wordSpacing:j.scalingValue(e.wordSpacing,t),fontSize:j.scalingValue(e.fontSize,t),color:e.color}}const dl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Email is required"},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Name is required"},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Company is required"},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Phone is required"}],rr={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"}}},gl=["strokeColor","inputColor","placeholderColor","buttonColor"],or=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,fontSize:.01,lineHeight:.01,color:"#111111"}),fl={type:"object",version:1,settings:{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"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",properties:{right:{type:"number",display:{type:"range-control"},min:0,max:100},left:{type:"number",display:{type:"range-control"},min:0,max:100}}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",properties:{right:{type:"number",display:{type:"range-control"},min:0,max:100},left:{type:"number",display:{type:"range-control"},min:0,max:100}}},height:{type:"number",scope:"layout",title:"Height",display:{type:"range-control"},min:0,max:100},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"}},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"}},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"}},input:{type:"object",scope:"layout",title:"Input",properties:rr,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]},button:{type:"object",scope:"layout",title:"Button",properties:rr,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]}},defaults:{fields:dl,fieldsToShow:1,buttonLabel:"Submit",fontFamily:"Arial",inputPadding:{right:.01,left:.01},buttonPadding:{right:.01,left:.01},height:.028,corners:.05,stroke:.001,strokeColor:"#cccccc",inputColor:"#ffffff",placeholderColor:"#cccccc",buttonColor:"#cccccc",errorColor:"#ef4444",successColor:"#22c55e",input:or(400),button:or(400)}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","fieldsToShow"]},{type:"group",title:"BUTTON",items:[{type:"row",items:[{type:"group",title:"",items:["height","corners","stroke",{type:"accordion",title:"",options:{"Input Padding":["inputPadding"],"Button Padding":["buttonPadding"]}}]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"accordion",title:"",options:{Input:["input"],Button:["button"]}}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...gl],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","placeholderColor","buttonColor"],hover:["strokeColor","inputColor","buttonColor"],focus:["strokeColor","inputColor","buttonColor"],filled:["strokeColor","inputColor","buttonColor"],success:["strokeColor","inputColor","buttonColor"],error:["strokeColor","inputColor","buttonColor"]}}},ml={element:pl,id:"oneliner-form",name:"Oneliner",version:1,defaultSize:{width:"50%",height:60},schema:fl},yl=[Qi,aa,qa,rl,ml];exports.components=yl;exports.isSchemaV1=Gr;
719
+ `,gl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],pn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},fl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],ml={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:8},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:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"layout",title:"Input Border 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"}},buttonBorderColor:{type:"string",scope:"layout",title:"Button Border Color",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"layout",title:"Label Color",display:{type:"palette-color-picker",visible:!1}},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"}},stateOverrides:{type:"object",scope:"layout"},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...pn.fontSettings,scope:"layout",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...pn.fontSettings,scope:"layout",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...pn.fontSettings,scope:"layout",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}}},defaults:{fieldsToShow:2,fields:gl,type:"A",inputColor:"#FFFFFF",inputTextColor:"#999999",inputBorderColor:"#0A00F8",placeholderColor:"#0A00F8",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{},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"},buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:.0026,buttonCorners:.192,inputStroke:.0026,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.0373,inputLineHeight:.0373,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:.001,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01}},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}}]},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:"row",title:"Button",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:"Input",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"Button",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"Label",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...fl],panelIds:["general","typeStyle"],stateItems:{default:["inputColor","inputBorderColor","placeholderColor","placeholderTextColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor"],filled:["inputColor","inputTextColor","inputBorderColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},yl={element:cl,id:"form",name:"Newsletter Stacked",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:400,height:42},schema:ml,sourceCode:dl};function Ot(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function hl(e){return`
720
+ .${e}-wrapper {
721
+ display: flex;
722
+ flex-direction: column;
723
+ width: 100%;
724
+ height: 100%;
725
+ align-items: stretch;
726
+ justify-content: center;
727
+ }
728
+ .${e}-form {
729
+ display: flex;
730
+ width: 100%;
731
+ align-items: stretch;
732
+ overflow: hidden;
733
+ border-color: var(--${e}-stroke-color);
734
+ transition: border-color 250ms;
735
+ }
736
+ .${e}-form:hover {
737
+ border-color: var(--${e}-hover-stroke-color, var(--${e}-stroke-color));
738
+ }
739
+ .${e}-form:focus-within {
740
+ border-color: var(--${e}-focus-stroke-color, var(--${e}-stroke-color));
741
+ }
742
+ .${e}-wrapper.${e}-state-hover .${e}-form {
743
+ border-color: var(--${e}-hover-stroke-color, var(--${e}-stroke-color));
744
+ }
745
+ .${e}-wrapper.${e}-state-focus .${e}-form {
746
+ border-color: var(--${e}-focus-stroke-color, var(--${e}-stroke-color));
747
+ }
748
+ .${e}-wrapper.${e}-state-filled .${e}-form {
749
+ border-color: var(--${e}-filled-stroke-color, var(--${e}-stroke-color));
750
+ }
751
+ .${e}-inputWrap {
752
+ position: relative;
753
+ display: flex;
754
+ align-items: center;
755
+ flex: 1;
756
+ min-width: 0;
757
+ background-color: var(--${e}-input-color);
758
+ transition: background-color 250ms;
759
+ }
760
+ .${e}-inputWrap:hover,
761
+ .${e}-wrapper.${e}-state-hover .${e}-inputWrap {
762
+ background-color: var(--${e}-hover-input-color, var(--${e}-input-color));
763
+ }
764
+ .${e}-inputWrap:focus-within,
765
+ .${e}-wrapper.${e}-state-focus .${e}-inputWrap {
766
+ background-color: var(--${e}-focus-input-color, var(--${e}-input-color));
767
+ }
768
+ .${e}-wrapper.${e}-state-filled .${e}-inputWrap {
769
+ background-color: var(--${e}-filled-input-color, var(--${e}-input-color));
770
+ }
771
+ .${e}-input {
772
+ flex: 1;
773
+ min-width: 0;
774
+ background: transparent;
775
+ border: none;
776
+ outline: none;
777
+ color: var(--${e}-input-text-color);
778
+ transition: color 250ms, background-color 250ms, border-color 250ms;
779
+ }
780
+ .${e}-input:hover {
781
+ color: var(--${e}-hover-input-text-color, var(--${e}-input-text-color));
782
+ }
783
+ .${e}-inputWrap:hover .${e}-input,
784
+ .${e}-wrapper.${e}-state-hover .${e}-input {
785
+ color: var(--${e}-hover-input-text-color, var(--${e}-input-text-color));
786
+ }
787
+ .${e}-input:focus,
788
+ .${e}-wrapper.${e}-state-focus .${e}-input {
789
+ color: var(--${e}-focus-input-text-color, var(--${e}-input-text-color));
790
+ }
791
+ .${e}-wrapper.${e}-state-filled .${e}-input {
792
+ color: var(--${e}-filled-input-text-color, var(--${e}-input-text-color));
793
+ }
794
+ .${e}-input::placeholder {
795
+ color: var(--${e}-placeholder-color);
796
+ opacity: 1;
797
+ transition: color 250ms, opacity 250ms;
798
+ }
799
+ .${e}-inputWrap:hover .${e}-input::placeholder,
800
+ .${e}-wrapper.${e}-state-hover .${e}-input::placeholder {
801
+ color: var(--${e}-hover-placeholder-color, var(--${e}-placeholder-color));
802
+ }
803
+ .${e}-inputWrap:focus-within .${e}-input::placeholder,
804
+ .${e}-wrapper.${e}-state-focus .${e}-input::placeholder {
805
+ color: var(--${e}-focus-placeholder-color, var(--${e}-placeholder-color));
806
+ }
807
+ .${e}-wrapper.${e}-state-filled .${e}-input::placeholder {
808
+ color: var(--${e}-filled-placeholder-color, var(--${e}-placeholder-color));
809
+ }
810
+ .${e}-submitBtn {
811
+ box-sizing: border-box;
812
+ height: 100%;
813
+ display: flex;
814
+ align-items: center;
815
+ justify-content: center;
816
+ border: none;
817
+ cursor: pointer;
818
+ white-space: nowrap;
819
+ background-color: var(--${e}-button-color);
820
+ color: var(--${e}-button-text-color);
821
+ border-left-style: solid;
822
+ border-left-color: var(--${e}-stroke-color);
823
+ transition: color 250ms, background-color 250ms, border-color 250ms;
824
+ }
825
+ .${e}-submitBtn img {
826
+ display: block;
827
+ box-sizing: border-box;
828
+ flex: 0 1 auto;
829
+ min-width: 0;
830
+ height: 100%;
831
+ width: auto;
832
+ max-width: 100%;
833
+ max-height: 100%;
834
+ object-fit: contain;
835
+ }
836
+ .${e}-submitBtn svg {
837
+ display: block;
838
+ box-sizing: border-box;
839
+ flex: 0 1 auto;
840
+ min-width: 0;
841
+ height: 100%;
842
+ width: auto;
843
+ max-width: 100%;
844
+ max-height: 100%;
845
+ }
846
+ .${e}-submitBtn:hover,
847
+ .${e}-wrapper.${e}-state-hover .${e}-submitBtn {
848
+ background-color: var(--${e}-hover-button-color, var(--${e}-button-color));
849
+ color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
850
+ border-left-color: var(--${e}-hover-stroke-color, var(--${e}-stroke-color));
851
+ }
852
+ .${e}-submitBtn:focus,
853
+ .${e}-wrapper.${e}-state-focus .${e}-submitBtn {
854
+ background-color: var(--${e}-focus-button-color, var(--${e}-button-color));
855
+ color: var(--${e}-focus-button-text-color, var(--${e}-button-text-color));
856
+ border-left-color: var(--${e}-focus-stroke-color, var(--${e}-stroke-color));
857
+ }
858
+ .${e}-wrapper.${e}-state-filled .${e}-submitBtn {
859
+ background-color: var(--${e}-filled-button-color, var(--${e}-button-color));
860
+ color: var(--${e}-filled-button-text-color, var(--${e}-button-text-color));
861
+ border-left-color: var(--${e}-filled-stroke-color, var(--${e}-stroke-color));
862
+ }
863
+ .${e}-wrapper.${e}-state-success .${e}-input,
864
+ .${e}-wrapper.${e}-state-success .${e}-submitBtn {
865
+ pointer-events: none;
866
+ }
867
+ .${e}-overlayAnchor {
868
+ position: relative;
869
+ display: flex;
870
+ align-items: center;
871
+ }
872
+ .${e}-success {
873
+ margin-top: ${Ot(8)};
874
+ font-size: ${Ot(14)};
875
+ color: var(--${e}-success-success-color, var(--${e}-success-color));
876
+ }
877
+ .${e}-error {
878
+ margin-top: ${Ot(8)};
879
+ font-size: ${Ot(14)};
880
+ color: var(--${e}-error-error-color, var(--${e}-error-color));
881
+ }
882
+ `}const vl=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:r}=k.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,submitButtonContent:s,buttonLabel:l,buttonIcon:d,fieldsToShow:p=1,fontFamily:_,input:m,button:h,inputFontSettings:c,inputFontSize:u,inputLineHeight:b,inputLetterSpacing:$,inputWordSpacing:f,inputTextAppearance:w,buttonFontSettings:j,buttonFontSize:W,buttonLineHeight:E,buttonLetterSpacing:v,buttonWordSpacing:T,buttonTextAppearance:V,minHeight:z,corners:L,stroke:F,stateOverrides:O,inputPadding:U,buttonPadding:H,successMessage:g="Thanks for subscribing!",errorMessage:R="Please, fill all required fields."}=e,x=a.slice(0,Math.min(p,a.length)),[A,C]=D.useState(()=>Object.fromEntries(x.map(ne=>[ne.name,""]))),[N,q]=D.useState("idle"),[ie,Q]=D.useState(null),me=o==="success"?"success":o==="error"?"error":N,I=o==="error"?R:ie,K=o==="filled"?Object.fromEntries(x.map(ne=>[ne.name,"Filled"])):A,ye=me==="error"?k.getFormFieldValidationError(x,K):null,ae=o&&o!=="default"?`${r}-state-${o}`:"",pe=n==null?void 0:n.submitUrl,de=i,De=(de==null?void 0:de.mode)==="Icon"||(de==null?void 0:de.mode)==="Label"?de.mode:s==="Icon"?"Icon":"Label",M=de===void 0?l:de.label!==void 0?de.label:l,y=de===void 0?d:de.icon!==void 0?de.icon:d,P=M??"",G=y??"",J=De==="Icon",re=P||"Submit",Z=c||u!==void 0||b!==void 0||$!==void 0||f!==void 0||w!==void 0?{fontSettings:{fontFamily:_,fontWeight:(c==null?void 0:c.fontWeight)??400,fontStyle:(c==null?void 0:c.fontStyle)??"normal"},fontSize:u??.01,lineHeight:b,letterSpacing:$??0,wordSpacing:f??0,textAppearance:w,color:e.inputTextColor??"#111111"}:m?{...m,fontSettings:{...m.fontSettings,fontFamily:_??m.fontSettings.fontFamily},color:e.inputTextColor??m.color??"#111111"}:void 0,X=j||W!==void 0||E!==void 0||v!==void 0||T!==void 0||V!==void 0?{fontSettings:{fontFamily:_,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:W??.01,lineHeight:E,letterSpacing:v??0,wordSpacing:T??0,textAppearance:V,color:e.buttonTextColor??"#ffffff"}:h?{...h,fontSettings:{...h.fontSettings,fontFamily:_??h.fontSettings.fontFamily},color:e.buttonTextColor??h.color??"#ffffff"}:void 0,oe=Z?go(Z,t):void 0,be=X?go(X,t):void 0,le=Sl(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(Z==null?void 0:Z.color)??"#111111",buttonTextColor:e.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},O),ge={borderRadius:k.scalingValue(L,t),borderWidth:k.scalingValue(F,t),borderStyle:"solid"},ke={borderLeftWidth:k.scalingValue(F,t)},te=async ne=>{ne.preventDefault();const ve=Object.fromEntries(x.map(Se=>{var Re;return[Se.name,((Re=A[Se.name])==null?void 0:Re.trim())??""]}).filter(([,Se])=>Se));if(!pe||Object.keys(ve).length===0)return;const Te=k.getFormFieldValidationError(x,A);if(Te){q("error"),Q(Te);return}q("submitting"),Q(null);try{const Se=await fetch(pe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ve)});if(!Se.ok){const Re=await Se.text();throw new Error(Re||`Request failed: ${Se.status}`)}q("success"),C(Object.fromEntries(x.map(Re=>[Re.name,""])))}catch(Se){q("error"),Q(Se instanceof Error?Se.message:"Something went wrong")}};return S.jsxs("div",{className:`${r}-wrapper ${ae}`.trim(),style:le,children:[S.jsx("style",{children:hl(r)}),S.jsxs("form",{onSubmit:te,className:`${r}-form`,style:{...ge,height:k.scalingValue(z,t),minHeight:k.scalingValue(z,t)},children:[S.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:x.map(ne=>S.jsx("input",{type:ne.type==="email"?"email":ne.type==="phone"?"tel":"text",name:ne.name,autoComplete:"off",value:K[ne.name]??"",onChange:ve=>C(Te=>({...Te,[ne.name]:ve.target.value})),placeholder:ne.placeholder,required:ne.type==="email",className:`${r}-input`,style:{...oe,paddingRight:k.scalingValue(U.right,t),paddingLeft:k.scalingValue(U.left,t),paddingTop:k.scalingValue(U.top,t),paddingBottom:k.scalingValue(U.bottom,t)}},ne.name))}),S.jsx("div",{className:`${r}-overlayAnchor`,children:S.jsx("button",{type:"submit",className:`${r}-submitBtn`,"aria-label":re,style:{...be,...ke,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"?"...":J?G?S.jsx("img",{src:G,alt:"",draggable:!1}):null:P})})]}),me==="success"&&S.jsx("p",{className:`${r}-success`,style:{...oe,lineHeight:oe==null?void 0:oe.fontSize},children:g}),me==="error"&&S.jsx("p",{className:`${r}-error`,style:{...oe,lineHeight:oe==null?void 0:oe.fontSize},role:"alert",children:ye??I??R})]})},po={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"},bl=["hover","focus","filled","success","error"];function Sl(e,t,n){const o={};for(const[r,a]of Object.entries(po))o[`--${e}-${a}`]=t[r];if(n)for(const r of bl){const a=n[r];if(a)for(const[i,s]of Object.entries(po)){const l=a[i];l!==void 0&&(o[`--${e}-${r}-${s}`]=l)}}return o}function go(e,t){var n,o,r;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),lineHeight:e.lineHeight!==void 0?k.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(r=e.textAppearance)==null?void 0:r.fontVariant}}const 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."}],fo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Cl=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],_l={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"},inputFontSettings:{...fo.fontSettings,scope:"layout",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:{...fo.fontSettings,scope:"layout",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"}}},defaults:{fields:xl,fieldsToShow:1,buttonContent:{mode:"Icon",label:"Submit",icon:"https://cdn.cntrl.site/component-assets/arrow.svg"},fontFamily:"Arial",inputPadding:{right:.01,left:.01,top:.01,bottom:.01},buttonPadding:{right:.01,left:.01,top:.005,bottom:.005},minHeight:.028,corners:.05,stroke:.001,strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#0A00F8",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputFontSize:.01,inputLineHeight:.01,inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonFontSize:.01,buttonLineHeight:.01,buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},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:"Input",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"Button",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...Cl],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],hover:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],focus:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],filled:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},wl={element:vl,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:_l},$l=[da,ba,ll,yl,wl];exports.components=$l;exports.isSchemaV1=ar;