@cntrl-site/components 1.0.1-alpha.3 → 1.0.1-alpha.4

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,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),W=require("react"),ge=require("classnames"),R=require("./useScopedStyles-Bibm8h9Z.js"),Gr=require("react-dom");function Yr(e){return e.type==="object"&&e.version===1}const qr="ControlSlider-module__wrapper___sHEkd",Xr="ControlSlider-module__hoverArrow___A-dOH",Kr="ControlSlider-module__sliderItem___QQSkR",Jr="ControlSlider-module__sliderImage___9hRl-",Zr="ControlSlider-module__arrow___05ghY",Qr="ControlSlider-module__arrowVertical___tBfVN",eo="ControlSlider-module__nextArrow___-30Yc",to="ControlSlider-module__arrowInner___aEra3",no="ControlSlider-module__arrowIcon___S4ztF",ro="ControlSlider-module__arrowImg___2dwJW",oo="ControlSlider-module__mirror___brd6U",io="ControlSlider-module__pagination___bicLF",ao="ControlSlider-module__paginationInner___bT-P-",lo="ControlSlider-module__paginationVertical___zYqKw",so="ControlSlider-module__paginationItem___nTRbk",co="ControlSlider-module__dot___p1Qun",uo="ControlSlider-module__activeDot___LHFaj",po="ControlSlider-module__paginationInsideBottom___R3FWn",go="ControlSlider-module__paginationInsideTop___V-qb-",fo="ControlSlider-module__paginationOutsideBottom___14w8D",mo="ControlSlider-module__paginationOutsideTop___SCLqB",ho="ControlSlider-module__paginationInsideLeft___yOBRZ",yo="ControlSlider-module__paginationInsideRight___Rtt3o",vo="ControlSlider-module__paginationOutsideLeft___lahaw",bo="ControlSlider-module__paginationOutsideRight___EtuQa",xo="ControlSlider-module__imgWrapper___UjEgB",So="ControlSlider-module__captionBlock___dJ6-j",Co="ControlSlider-module__captionTextWrapper___HFlpf",_o="ControlSlider-module__captionText___uGBVc",wo="ControlSlider-module__active___WZK4G",$o="ControlSlider-module__withPointerEvents___t-18M",Eo="ControlSlider-module__topLeftAlignment___zjnGM",To="ControlSlider-module__topCenterAlignment___gD1xW",Ao="ControlSlider-module__topRightAlignment___NMapS",Io="ControlSlider-module__middleLeftAlignment___OnUrY",Lo="ControlSlider-module__middleCenterAlignment___Tdkl0",ko="ControlSlider-module__middleRightAlignment___wEbfX",Ro="ControlSlider-module__bottomLeftAlignment___cTP2-",No="ControlSlider-module__bottomCenterAlignment___c54fB",Vo="ControlSlider-module__bottomRightAlignment___kEwrz",jo="ControlSlider-module__clickOverlay___DZA28",Oo="ControlSlider-module__contain___pLyq7",Fo="ControlSlider-module__cover___KdDat",G={wrapper:qr,hoverArrow:Xr,sliderItem:Kr,sliderImage:Jr,arrow:Zr,arrowVertical:Qr,nextArrow:eo,arrowInner:to,arrowIcon:no,arrowImg:ro,mirror:oo,pagination:io,paginationInner:ao,paginationVertical:lo,paginationItem:so,dot:co,activeDot:uo,paginationInsideBottom:po,paginationInsideTop:go,paginationOutsideBottom:fo,paginationOutsideTop:mo,paginationInsideLeft:ho,paginationInsideRight:yo,paginationOutsideLeft:vo,paginationOutsideRight:bo,imgWrapper:xo,captionBlock:So,captionTextWrapper:Co,captionText:_o,active:wo,withPointerEvents:$o,topLeftAlignment:Eo,topCenterAlignment:To,topRightAlignment:Ao,middleLeftAlignment:Io,middleCenterAlignment:Lo,middleRightAlignment:ko,bottomLeftAlignment:Ro,bottomCenterAlignment:No,bottomRightAlignment:Vo,clickOverlay:jo,contain:Oo,cover:Fo};function Bo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mo(e,t,n){return t&&Bo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Vn="(prefers-reduced-motion: reduce)",Qe=1,zo=2,nt=3,it=4,vt=5,Lt=6,Vt=7,Do={CREATED:Qe,MOUNTED:zo,IDLE:nt,MOVING:it,SCROLLING:vt,DRAGGING:Lt,DESTROYED:Vt};function je(e){e.length=0}function De(e,t,n){return Array.prototype.slice.call(e,t,n)}function se(e){return e.bind.apply(e,[null].concat(De(arguments,1)))}var ar=setTimeout,on=function(){};function jn(e){return requestAnimationFrame(e)}function Mt(e,t){return typeof t===e}function pt(e){return!mn(e)&&Mt("object",e)}var fn=Array.isArray,lr=se(Mt,"function"),Me=se(Mt,"string"),bt=se(Mt,"undefined");function mn(e){return e===null}function sr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function xt(e){return fn(e)?e:[e]}function Ce(e,t){xt(e).forEach(t)}function hn(e,t){return e.indexOf(t)>-1}function kt(e,t){return e.push.apply(e,xt(t)),e}function Re(e,t,n){e&&Ce(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Te(e,t){Re(e,Me(t)?t.split(" "):t,!0)}function St(e,t){Ce(t,e.appendChild.bind(e))}function yn(e,t){Ce(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function dt(e,t){return sr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function cr(e,t){var n=e?De(e.children):[];return t?n.filter(function(r){return dt(r,t)}):n}function Ct(e,t){return t?cr(e,t)[0]:e.firstElementChild}var gt=Object.keys;function Ue(e,t,n){return e&&(n?gt(e).reverse():gt(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function ft(e){return De(arguments,1).forEach(function(t){Ue(t,function(n,r){e[r]=t[r]})}),e}function Be(e){return De(arguments,1).forEach(function(t){Ue(t,function(n,r){fn(n)?e[r]=n.slice():pt(n)?e[r]=Be({},pt(e[r])?e[r]:{},n):e[r]=n})}),e}function On(e,t){Ce(t||gt(e),function(n){delete e[n]})}function Ae(e,t){Ce(e,function(n){Ce(t,function(r){n&&n.removeAttribute(r)})})}function te(e,t,n){pt(t)?Ue(t,function(r,o){te(e,o,r)}):Ce(e,function(r){mn(n)||n===""?Ae(r,t):r.setAttribute(t,String(n))})}function et(e,t,n){var r=document.createElement(e);return t&&(Me(t)?Te(r,t):te(r,t)),n&&St(n,r),r}function we(e,t,n){if(bt(n))return getComputedStyle(e)[t];mn(n)||(e.style[t]=""+n)}function mt(e,t){we(e,"display",t)}function ur(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function $e(e,t){return e.getAttribute(t)}function Fn(e,t){return e&&e.classList.contains(t)}function xe(e){return e.getBoundingClientRect()}function Ge(e){Ce(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function pr(e){return Ct(new DOMParser().parseFromString(e,"text/html").body)}function ke(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function dr(e,t){return e&&e.querySelector(t)}function vn(e,t){return t?De(e.querySelectorAll(t)):[]}function Ne(e,t){Re(e,t,!1)}function an(e){return e.timeStamp}function He(e){return Me(e)?e:e?e+"px":""}var _t="splide",bn="data-"+_t;function st(e,t){if(!e)throw new Error("["+_t+"] "+(t||""))}var ze=Math.min,jt=Math.max,Ot=Math.floor,ht=Math.ceil,be=Math.abs;function gr(e,t,n){return be(e-t)<n}function Rt(e,t,n,r){var o=ze(t,n),a=jt(t,n);return r?o<e&&e<a:o<=e&&e<=a}function Je(e,t,n){var r=ze(t,n),o=jt(t,n);return ze(jt(r,e),o)}function ln(e){return+(e>0)-+(e<0)}function sn(e,t){return Ce(t,function(n){e=e.replace("%s",""+n)}),e}function xn(e){return e<10?"0"+e:""+e}var Bn={};function Wo(e){return""+e+xn(Bn[e]=(Bn[e]||0)+1)}function fr(){var e=[];function t(i,s,l,p){o(i,s,function(c,_,m){var h="addEventListener"in c,u=h?c.removeEventListener.bind(c,_,l,p):c.removeListener.bind(c,l);h?c.addEventListener(_,l,p):c.addListener(l),e.push([c,_,m,l,u])})}function n(i,s,l){o(i,s,function(p,c,_){e=e.filter(function(m){return m[0]===p&&m[1]===c&&m[2]===_&&(!l||m[3]===l)?(m[4](),!1):!0})})}function r(i,s,l){var p,c=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:c,detail:l}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,c,!1,l)),i.dispatchEvent(p),p}function o(i,s,l){Ce(i,function(p){p&&Ce(s,function(c){c.split(" ").forEach(function(_){var m=_.split(".");l(p,m[0],m[1])})})})}function a(){e.forEach(function(i){i[4]()}),je(e)}return{bind:t,unbind:n,dispatch:r,destroy:a}}var We="mounted",cn="ready",Oe="move",at="moved",Sn="click",mr="active",hr="inactive",yr="visible",vr="hidden",he="refresh",ye="updated",rt="resize",zt="resized",br="drag",xr="dragging",Sr="dragged",Dt="scroll",qe="scrolled",Po="overflow",Cn="destroy",Cr="arrows:mounted",_r="arrows:updated",wr="pagination:mounted",$r="pagination:updated",_n="navigation:mounted",wn="autoplay:play",Er="autoplay:playing",$n="autoplay:pause",En="lazyload:loaded",Tr="sk",Ar="sh",Ft="ei";function fe(e){var t=e?e.event.bus:document.createDocumentFragment(),n=fr();function r(a,i){n.bind(t,xt(a).join(" "),function(s){i.apply(i,fn(s.detail)?s.detail:[])})}function o(a){n.dispatch(t,a,De(arguments,1))}return e&&e.event.on(Cn,n.destroy),ft(n,{bus:t,on:r,off:se(n.unbind,t),emit:o})}function Wt(e,t,n,r){var o=Date.now,a,i=0,s,l=!0,p=0;function c(){if(!l){if(i=e?ze((o()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=o(),r&&++p>=r))return m();s=jn(c)}}function _(T){T||u(),a=o()-(T?i*e:0),l=!1,s=jn(c)}function m(){l=!0}function h(){a=o(),i=0,n&&n(i)}function u(){s&&cancelAnimationFrame(s),i=0,s=0,l=!0}function g(T){e=T}function w(){return l}return{start:_,rewind:h,pause:m,cancel:u,set:g,isPaused:w}}function Ho(e){var t=e;function n(o){t=o}function r(o){return hn(xt(o),t)}return{set:n,is:r}}function Uo(e,t){var n=Wt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Go(e,t,n){var r=e.state,o=n.breakpoints||{},a=n.reducedMotion||{},i=fr(),s=[];function l(){var u=n.mediaQuery==="min";gt(o).sort(function(g,w){return u?+g-+w:+w-+g}).forEach(function(g){c(o[g],"("+(u?"min":"max")+"-width:"+g+"px)")}),c(a,Vn),_()}function p(u){u&&i.destroy()}function c(u,g){var w=matchMedia(g);i.bind(w,"change",_),s.push([u,w])}function _(){var u=r.is(Vt),g=n.direction,w=s.reduce(function(T,d){return Be(T,d[1].matches?d[0]:{})},{});On(n),h(w),n.destroy?e.destroy(n.destroy==="completely"):u?(p(!0),e.mount()):g!==n.direction&&e.refresh()}function m(u){matchMedia(Vn).matches&&(u?Be(n,a):On(n,gt(a)))}function h(u,g,w){Be(n,u),g&&Be(Object.getPrototypeOf(n),u),(w||!r.is(Qe))&&e.emit(ye,n)}return{setup:l,destroy:p,reduce:m,set:h}}var Pt="Arrow",Ht=Pt+"Left",Ut=Pt+"Right",Ir=Pt+"Up",Lr=Pt+"Down",Mn="rtl",Gt="ttb",Kt={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ir,Ut],ArrowRight:[Lr,Ht]};function Yo(e,t,n){function r(a,i,s){s=s||n.direction;var l=s===Mn&&!i?1:s===Gt?0:-1;return Kt[a]&&Kt[a][l]||a.replace(/width|left|right/i,function(p,c){var _=Kt[p.toLowerCase()][l]||p;return c>0?_.charAt(0).toUpperCase()+_.slice(1):_})}function o(a){return a*(n.direction===Mn?1:-1)}return{resolve:r,orient:o}}var Ve="role",tt="tabindex",qo="disabled",Ee="aria-",wt=Ee+"controls",kr=Ee+"current",zn=Ee+"selected",Se=Ee+"label",Tn=Ee+"labelledby",Rr=Ee+"hidden",An=Ee+"orientation",yt=Ee+"roledescription",Dn=Ee+"live",Wn=Ee+"busy",Pn=Ee+"atomic",In=[Ve,tt,qo,wt,kr,Se,Tn,Rr,An,yt],Ie=_t+"__",Pe="is-",Jt=_t,Hn=Ie+"track",Xo=Ie+"list",Yt=Ie+"slide",Nr=Yt+"--clone",Ko=Yt+"__container",Ln=Ie+"arrows",qt=Ie+"arrow",Vr=qt+"--prev",jr=qt+"--next",Xt=Ie+"pagination",Or=Xt+"__page",Jo=Ie+"progress",Zo=Jo+"__bar",Qo=Ie+"toggle",ei=Ie+"spinner",ti=Ie+"sr",ni=Pe+"initialized",Ye=Pe+"active",Fr=Pe+"prev",Br=Pe+"next",un=Pe+"visible",pn=Pe+"loading",Mr=Pe+"focus-in",zr=Pe+"overflow",ri=[Ye,un,Fr,Br,pn,Mr,zr],oi={slide:Yt,clone:Nr,arrows:Ln,arrow:qt,prev:Vr,next:jr,pagination:Xt,page:Or,spinner:ei};function ii(e,t){if(lr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!dt(n,t);)n=n.parentElement;return n}var ai=5,Un=200,Dr="touchstart mousedown",Zt="touchmove mousemove",Qt="touchend touchcancel mouseup click";function li(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=e.root,s=n.i18n,l={},p=[],c=[],_=[],m,h,u;function g(){y(),P(),d()}function w(){o(he,T),o(he,g),o(ye,d),a(document,Dr+" keydown",function(v){u=v.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Re(i,Mr,!!u)})}function T(v){var I=In.concat("style");je(p),Ne(i,c),Ne(m,_),Ae([m,h],I),Ae(i,v?I:["style",yt])}function d(){Ne(i,c),Ne(m,_),c=$(Jt),_=$(Hn),Te(i,c),Te(m,_),te(i,Se,n.label),te(i,Tn,n.labelledby)}function y(){m=M("."+Hn),h=Ct(m,"."+Xo),st(m&&h,"A track/list element is missing."),kt(p,cr(h,"."+Yt+":not(."+Nr+")")),Ue({arrows:Ln,pagination:Xt,prev:Vr,next:jr,bar:Zo,toggle:Qo},function(v,I){l[I]=M("."+v)}),ft(l,{root:i,track:m,list:h,slides:p})}function P(){var v=i.id||Wo(_t),I=n.role;i.id=v,m.id=m.id||v+"-track",h.id=h.id||v+"-list",!$e(i,Ve)&&i.tagName!=="SECTION"&&I&&te(i,Ve,I),te(i,yt,s.carousel),te(h,Ve,"presentation")}function M(v){var I=dr(i,v);return I&&ii(I,"."+Jt)===i?I:void 0}function $(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===Jt&&Ye]}return ft(l,{setup:g,mount:w,destroy:T})}var ot="slide",lt="loop",$t="fade";function si(e,t,n,r){var o=fe(e),a=o.on,i=o.emit,s=o.bind,l=e.Components,p=e.root,c=e.options,_=c.isNavigation,m=c.updateOnMove,h=c.i18n,u=c.pagination,g=c.slideFocus,w=l.Direction.resolve,T=$e(r,"style"),d=$e(r,Se),y=n>-1,P=Ct(r,"."+Ko),M;function $(){y||(r.id=p.id+"-slide"+xn(t+1),te(r,Ve,u?"tabpanel":"group"),te(r,yt,h.slide),te(r,Se,d||sn(h.slideLabel,[t+1,e.length]))),v()}function v(){s(r,"click",se(i,Sn,L)),s(r,"keydown",se(i,Tr,L)),a([at,Ar,qe],k),a(_n,V),m&&a(Oe,z)}function I(){M=!0,o.destroy(),Ne(r,ri),Ae(r,In),te(r,"style",T),te(r,Se,d||"")}function V(){var C=e.splides.map(function(x){var E=x.splide.Components.Slides.getAt(t);return E?E.slide.id:""}).join(" ");te(r,Se,sn(h.slideX,(y?n:t)+1)),te(r,wt,C),te(r,Ve,g?"button":""),g&&Ae(r,yt)}function z(){M||k()}function k(){if(!M){var C=e.index;j(),O(),Re(r,Fr,t===C-1),Re(r,Br,t===C+1)}}function j(){var C=H();C!==Fn(r,Ye)&&(Re(r,Ye,C),te(r,kr,_&&C||""),i(C?mr:hr,L))}function O(){var C=f(),x=!C&&(!H()||y);if(e.state.is([it,vt])||te(r,Rr,x||""),te(vn(r,c.focusableNodes||""),tt,x?-1:""),g&&te(r,tt,x?-1:0),C!==Fn(r,un)&&(Re(r,un,C),i(C?yr:vr,L)),!C&&document.activeElement===r){var E=l.Slides.getAt(e.index);E&&ur(E.slide)}}function U(C,x,E){we(E&&P||r,C,x)}function H(){var C=e.index;return C===t||c.cloneStatus&&C===n}function f(){if(e.is($t))return H();var C=xe(l.Elements.track),x=xe(r),E=w("left",!0),q=w("right",!0);return Ot(C[E])<=ht(x[E])&&Ot(x[q])<=ht(C[q])}function N(C,x){var E=be(C-t);return!y&&(c.rewind||e.is(lt))&&(E=ze(E,e.length-E)),E<=x}var L={index:t,slideIndex:n,slide:r,container:P,isClone:y,mount:$,destroy:I,update:k,style:U,isWithin:N};return L}function ci(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=r.bind,s=t.Elements,l=s.slides,p=s.list,c=[];function _(){m(),o(he,h),o(he,m)}function m(){l.forEach(function(k,j){g(k,j,-1)})}function h(){M(function(k){k.destroy()}),je(c)}function u(){M(function(k){k.update()})}function g(k,j,O){var U=si(e,j,O,k);U.mount(),c.push(U),c.sort(function(H,f){return H.index-f.index})}function w(k){return k?$(function(j){return!j.isClone}):c}function T(k){var j=t.Controller,O=j.toIndex(k),U=j.hasFocus()?1:n.perPage;return $(function(H){return Rt(H.index,O,O+U-1)})}function d(k){return $(k)[0]}function y(k,j){Ce(k,function(O){if(Me(O)&&(O=pr(O)),sr(O)){var U=l[j];U?yn(O,U):St(p,O),Te(O,n.classes.slide),I(O,se(a,rt))}}),a(he)}function P(k){Ge($(k).map(function(j){return j.slide})),a(he)}function M(k,j){w(j).forEach(k)}function $(k){return c.filter(lr(k)?k:function(j){return Me(k)?dt(j.slide,k):hn(xt(k),j.index)})}function v(k,j,O){M(function(U){U.style(k,j,O)})}function I(k,j){var O=vn(k,"img"),U=O.length;U?O.forEach(function(H){i(H,"load error",function(){--U||j()})}):j()}function V(k){return k?l.length:c.length}function z(){return c.length>n.perPage}return{mount:_,destroy:h,update:u,register:g,get:w,getIn:T,getAt:d,add:y,remove:P,forEach:M,filter:$,style:v,getLength:V,isEnough:z}}function ui(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=r.emit,s=t.Slides,l=t.Direction.resolve,p=t.Elements,c=p.root,_=p.track,m=p.list,h=s.getAt,u=s.style,g,w,T;function d(){y(),a(window,"resize load",Uo(se(i,rt))),o([ye,he],y),o(rt,P)}function y(){g=n.direction===Gt,we(c,"maxWidth",He(n.width)),we(_,l("paddingLeft"),M(!1)),we(_,l("paddingRight"),M(!0)),P(!0)}function P(L){var C=xe(c);(L||w.width!==C.width||w.height!==C.height)&&(we(_,"height",$()),u(l("marginRight"),He(n.gap)),u("width",I()),u("height",V(),!0),w=C,i(zt),T!==(T=N())&&(Re(c,zr,T),i(Po,T)))}function M(L){var C=n.padding,x=l(L?"right":"left");return C&&He(C[x]||(pt(C)?0:C))||"0px"}function $(){var L="";return g&&(L=v(),st(L,"height or heightRatio is missing."),L="calc("+L+" - "+M(!1)+" - "+M(!0)+")"),L}function v(){return He(n.height||xe(m).width*n.heightRatio)}function I(){return n.autoWidth?null:He(n.fixedWidth)||(g?"":z())}function V(){return He(n.fixedHeight)||(g?n.autoHeight?null:z():v())}function z(){var L=He(n.gap);return"calc((100%"+(L&&" + "+L)+")/"+(n.perPage||1)+(L&&" - "+L)+")"}function k(){return xe(m)[l("width")]}function j(L,C){var x=h(L||0);return x?xe(x.slide)[l("width")]+(C?0:H()):0}function O(L,C){var x=h(L);if(x){var E=xe(x.slide)[l("right")],q=xe(m)[l("left")];return be(E-q)+(C?0:H())}return 0}function U(L){return O(e.length-1)-O(0)+j(0,L)}function H(){var L=h(0);return L&&parseFloat(we(L.slide,l("marginRight")))||0}function f(L){return parseFloat(we(_,l("padding"+(L?"Right":"Left"))))||0}function N(){return e.is($t)||U(!0)>k()}return{mount:d,resize:P,listSize:k,slideSize:j,sliderSize:U,totalSize:O,getPadding:f,isOverflow:N}}var pi=2;function di(e,t,n){var r=fe(e),o=r.on,a=t.Elements,i=t.Slides,s=t.Direction.resolve,l=[],p;function c(){o(he,_),o([ye,rt],h),(p=w())&&(u(p),t.Layout.resize(!0))}function _(){m(),c()}function m(){Ge(l),je(l),r.destroy()}function h(){var T=w();p!==T&&(p<T||!T)&&r.emit(he)}function u(T){var d=i.get().slice(),y=d.length;if(y){for(;d.length<T;)kt(d,d);kt(d.slice(-T),d.slice(0,T)).forEach(function(P,M){var $=M<T,v=g(P.slide,M);$?yn(v,d[0].slide):St(a.list,v),kt(l,v),i.register(v,M-T+($?0:y),P.index)})}}function g(T,d){var y=T.cloneNode(!0);return Te(y,n.classes.clone),y.id=e.root.id+"-clone"+xn(d+1),y}function w(){var T=n.clones;if(!e.is(lt))T=0;else if(bt(T)){var d=n[s("fixedWidth")]&&t.Layout.slideSize(0),y=d&&ht(xe(a.track)[s("width")]/d);T=y||n[s("autoWidth")]&&e.length||n.perPage*pi}return T}return{mount:c,destroy:m}}function gi(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=e.state.set,s=t.Layout,l=s.slideSize,p=s.getPadding,c=s.totalSize,_=s.listSize,m=s.sliderSize,h=t.Direction,u=h.resolve,g=h.orient,w=t.Elements,T=w.list,d=w.track,y;function P(){y=t.Transition,o([We,zt,ye,he],M)}function M(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function $(x,E,q,ie){x!==E&&L(x>q)&&(k(),I(z(U(),x>q),!0)),i(it),a(Oe,E,q,x),y.start(E,function(){i(nt),a(at,E,q,x),ie&&ie()})}function v(x){I(O(x,!0))}function I(x,E){if(!e.is($t)){var q=E?x:V(x);we(T,"transform","translate"+u("X")+"("+q+"px)"),x!==q&&a(Ar)}}function V(x){if(e.is(lt)){var E=j(x),q=E>t.Controller.getEnd(),ie=E<0;(ie||q)&&(x=z(x,q))}return x}function z(x,E){var q=x-N(E),ie=m();return x-=g(ie*(ht(be(q)/ie)||1))*(E?1:-1),x}function k(){I(U(),!0),y.cancel()}function j(x){for(var E=t.Slides.get(),q=0,ie=1/0,re=0;re<E.length;re++){var me=E[re].index,A=be(O(me,!0)-x);if(A<=ie)ie=A,q=me;else break}return q}function O(x,E){var q=g(c(x-1)-f(x));return E?H(q):q}function U(){var x=u("left");return xe(T)[x]-xe(d)[x]+g(p(!1))}function H(x){return n.trimSpace&&e.is(ot)&&(x=Je(x,0,g(m(!0)-_()))),x}function f(x){var E=n.focus;return E==="center"?(_()-l(x,!0))/2:+E*l(x)||0}function N(x){return O(x?t.Controller.getEnd():0,!!n.trimSpace)}function L(x){var E=g(z(U(),x));return x?E>=0:E<=T[u("scrollWidth")]-xe(d)[u("width")]}function C(x,E){E=bt(E)?U():E;var q=x!==!0&&g(E)<g(N(!1)),ie=x!==!1&&g(E)>g(N(!0));return q||ie}return{mount:P,move:$,jump:v,translate:I,shift:z,cancel:k,toIndex:j,toPosition:O,getPosition:U,getLimit:N,exceededLimit:C,reposition:M}}function fi(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=t.Move,s=i.getPosition,l=i.getLimit,p=i.toPosition,c=t.Slides,_=c.isEnough,m=c.getLength,h=n.omitEnd,u=e.is(lt),g=e.is(ot),w=se(U,!1),T=se(U,!0),d=n.start||0,y,P=d,M,$,v;function I(){V(),o([ye,he,Ft],V),o(zt,z)}function V(){M=m(!0),$=n.perMove,v=n.perPage,y=L();var A=Je(d,0,h?y:M-1);A!==d&&(d=A,i.reposition())}function z(){y!==L()&&a(Ft)}function k(A,Z,pe){if(!me()){var oe=O(A),de=N(oe);de>-1&&(Z||de!==d)&&(q(de),i.move(oe,de,P,pe))}}function j(A,Z,pe,oe){t.Scroll.scroll(A,Z,pe,function(){var de=N(i.toIndex(s()));q(h?ze(de,y):de),oe&&oe()})}function O(A){var Z=d;if(Me(A)){var pe=A.match(/([+\-<>])(\d+)?/)||[],oe=pe[1],de=pe[2];oe==="+"||oe==="-"?Z=H(d+ +(""+oe+(+de||1)),d):oe===">"?Z=de?C(+de):w(!0):oe==="<"&&(Z=T(!0))}else Z=u?A:Je(A,0,y);return Z}function U(A,Z){var pe=$||(re()?1:v),oe=H(d+pe*(A?-1:1),d,!($||re()));return oe===-1&&g&&!gr(s(),l(!A),1)?A?0:y:Z?oe:N(oe)}function H(A,Z,pe){if(_()||re()){var oe=f(A);oe!==A&&(Z=A,A=oe,pe=!1),A<0||A>y?!$&&(Rt(0,A,Z,!0)||Rt(y,Z,A,!0))?A=C(x(A)):u?A=pe?A<0?-(M%v||v):M:A:n.rewind?A=A<0?y:0:A=-1:pe&&A!==Z&&(A=C(x(Z)+(A<Z?-1:1)))}else A=-1;return A}function f(A){if(g&&n.trimSpace==="move"&&A!==d)for(var Z=s();Z===p(A,!0)&&Rt(A,0,e.length-1,!n.rewind);)A<d?--A:++A;return A}function N(A){return u?(A+M)%M||0:A}function L(){for(var A=M-(re()||u&&$?1:v);h&&A-- >0;)if(p(M-1,!0)!==p(A,!0)){A++;break}return Je(A,0,M-1)}function C(A){return Je(re()?A:v*A,0,y)}function x(A){return re()?ze(A,y):Ot((A>=y?M-1:A)/v)}function E(A){var Z=i.toIndex(A);return g?Je(Z,0,y):Z}function q(A){A!==d&&(P=d,d=A)}function ie(A){return A?P:d}function re(){return!bt(n.focus)||n.isNavigation}function me(){return e.state.is([it,vt])&&!!n.waitForTransition}return{mount:I,go:k,scroll:j,getNext:w,getPrev:T,getAdjacent:U,getEnd:L,setIndex:q,getIndex:ie,toIndex:C,toPage:x,toDest:E,hasFocus:re,isBusy:me}}var mi="http://www.w3.org/2000/svg",hi="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",Tt=40;function yi(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=r.emit,s=n.classes,l=n.i18n,p=t.Elements,c=t.Controller,_=p.arrows,m=p.track,h=_,u=p.prev,g=p.next,w,T,d={};function y(){M(),o(ye,P)}function P(){$(),y()}function M(){var j=n.arrows;j&&!(u&&g)&&V(),u&&g&&(ft(d,{prev:u,next:g}),mt(h,j?"":"none"),Te(h,T=Ln+"--"+n.direction),j&&(v(),k(),te([u,g],wt,m.id),i(Cr,u,g)))}function $(){r.destroy(),Ne(h,T),w?(Ge(_?[u,g]:h),u=g=null):Ae([u,g],In)}function v(){o([We,at,he,qe,Ft],k),a(g,"click",se(I,">")),a(u,"click",se(I,"<"))}function I(j){c.go(j,!0)}function V(){h=_||et("div",s.arrows),u=z(!0),g=z(!1),w=!0,St(h,[u,g]),!_&&yn(h,m)}function z(j){var O='<button class="'+s.arrow+" "+(j?s.prev:s.next)+'" type="button"><svg xmlns="'+mi+'" viewBox="0 0 '+Tt+" "+Tt+'" width="'+Tt+'" height="'+Tt+'" focusable="false"><path d="'+(n.arrowPath||hi)+'" />';return pr(O)}function k(){if(u&&g){var j=e.index,O=c.getPrev(),U=c.getNext(),H=O>-1&&j<O?l.last:l.prev,f=U>-1&&j>U?l.first:l.next;u.disabled=O<0,g.disabled=U<0,te(u,Se,H),te(g,Se,f),i(_r,u,g,O,U)}}return{arrows:d,mount:y,destroy:$,update:k}}var vi=bn+"-interval";function bi(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=r.emit,s=Wt(n.interval,e.go.bind(e,">"),v),l=s.isPaused,p=t.Elements,c=t.Elements,_=c.root,m=c.toggle,h=n.autoplay,u,g,w=h==="pause";function T(){h&&(d(),m&&te(m,wt,p.track.id),w||y(),$())}function d(){n.pauseOnHover&&a(_,"mouseenter mouseleave",function(V){u=V.type==="mouseenter",M()}),n.pauseOnFocus&&a(_,"focusin focusout",function(V){g=V.type==="focusin",M()}),m&&a(m,"click",function(){w?y():P(!0)}),o([Oe,Dt,he],s.rewind),o(Oe,I)}function y(){l()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),g=u=w=!1,$(),i(wn))}function P(V){V===void 0&&(V=!0),w=!!V,$(),l()||(s.pause(),i($n))}function M(){w||(u||g?P(!1):y())}function $(){m&&(Re(m,Ye,!w),te(m,Se,n.i18n[w?"play":"pause"]))}function v(V){var z=p.bar;z&&we(z,"width",V*100+"%"),i(Er,V)}function I(V){var z=t.Slides.getAt(V);s.set(z&&+$e(z.slide,vi)||n.interval)}return{mount:T,destroy:s.cancel,play:y,pause:P,isPaused:l}}function xi(e,t,n){var r=fe(e),o=r.on;function a(){n.cover&&(o(En,se(s,!0)),o([We,ye,he],se(i,!0)))}function i(l){t.Slides.forEach(function(p){var c=Ct(p.container||p.slide,"img");c&&c.src&&s(l,c,p)})}function s(l,p,c){c.style("background",l?'center/cover no-repeat url("'+p.src+'")':"",!0),mt(p,l?"none":"")}return{mount:a,destroy:se(i,!1)}}var Si=10,Ci=600,_i=.6,wi=1.5,$i=800;function Ei(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=e.state.set,s=t.Move,l=s.getPosition,p=s.getLimit,c=s.exceededLimit,_=s.translate,m=e.is(ot),h,u,g=1;function w(){o(Oe,P),o([ye,he],M)}function T(v,I,V,z,k){var j=l();if(P(),V&&(!m||!c())){var O=t.Layout.sliderSize(),U=ln(v)*O*Ot(be(v)/O)||0;v=s.toPosition(t.Controller.toDest(v%O))+U}var H=gr(j,v,1);g=1,I=H?0:I||jt(be(v-j)/wi,$i),u=z,h=Wt(I,d,se(y,j,v,k),1),i(vt),a(Dt),h.start()}function d(){i(nt),u&&u(),a(qe)}function y(v,I,V,z){var k=l(),j=v+(I-v)*$(z),O=(j-k)*g;_(k+O),m&&!V&&c()&&(g*=_i,be(O)<Si&&T(p(c(!0)),Ci,!1,u,!0))}function P(){h&&h.cancel()}function M(){h&&!h.isPaused()&&(P(),d())}function $(v){var I=n.easingFunc;return I?I(v):1-Math.pow(1-v,4)}return{mount:w,destroy:P,scroll:T,cancel:M}}var Ze={passive:!1,capture:!0};function Ti(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=r.bind,s=r.unbind,l=e.state,p=t.Move,c=t.Scroll,_=t.Controller,m=t.Elements.track,h=t.Media.reduce,u=t.Direction,g=u.resolve,w=u.orient,T=p.getPosition,d=p.exceededLimit,y,P,M,$,v,I=!1,V,z,k;function j(){i(m,Zt,on,Ze),i(m,Qt,on,Ze),i(m,Dr,U,Ze),i(m,"click",N,{capture:!0}),i(m,"dragstart",ke),o([We,ye],O)}function O(){var D=n.drag;Fe(!D),$=D==="free"}function U(D){if(V=!1,!z){var S=de(D);oe(D.target)&&(S||!D.button)&&(_.isBusy()?ke(D,!0):(k=S?m:window,v=l.is([it,vt]),M=null,i(k,Zt,H,Ze),i(k,Qt,f,Ze),p.cancel(),c.cancel(),L(D)))}}function H(D){if(l.is(Lt)||(l.set(Lt),a(br)),D.cancelable)if(v){p.translate(y+pe(re(D)));var S=me(D)>Un,F=I!==(I=d());(S||F)&&L(D),V=!0,a(xr),ke(D)}else E(D)&&(v=x(D),ke(D))}function f(D){l.is(Lt)&&(l.set(nt),a(Sr)),v&&(C(D),ke(D)),s(k,Zt,H),s(k,Qt,f),v=!1}function N(D){!z&&V&&ke(D,!0)}function L(D){M=P,P=D,y=T()}function C(D){var S=q(D),F=ie(S),Y=n.rewind&&n.rewindByDrag;h(!1),$?_.scroll(F,0,n.snap):e.is($t)?_.go(w(ln(S))<0?Y?"<":"-":Y?">":"+"):e.is(ot)&&I&&Y?_.go(d(!0)?">":"<"):_.go(_.toDest(F),!0),h(!0)}function x(D){var S=n.dragMinThreshold,F=pt(S),Y=F&&S.mouse||0,X=(F?S.touch:+S)||10;return be(re(D))>(de(D)?X:Y)}function E(D){return be(re(D))>be(re(D,!0))}function q(D){if(e.is(lt)||!I){var S=me(D);if(S&&S<Un)return re(D)/S}return 0}function ie(D){return T()+ln(D)*ze(be(D)*(n.flickPower||600),$?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(D,S){return Z(D,S)-Z(A(D),S)}function me(D){return an(D)-an(A(D))}function A(D){return P===D&&M||P}function Z(D,S){return(de(D)?D.changedTouches[0]:D)["page"+g(S?"Y":"X")]}function pe(D){return D/(I&&e.is(ot)?ai:1)}function oe(D){var S=n.noDrag;return!dt(D,"."+Or+", ."+qt)&&(!S||!dt(D,S))}function de(D){return typeof TouchEvent<"u"&&D instanceof TouchEvent}function _e(){return v}function Fe(D){z=D}return{mount:j,disable:Fe,isDragging:_e}}var Ai={Spacebar:" ",Right:Ut,Left:Ht,Up:Ir,Down:Lr};function kn(e){return e=Me(e)?e:e.key,Ai[e]||e}var Gn="keydown";function Ii(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=r.unbind,s=e.root,l=t.Direction.resolve,p,c;function _(){m(),o(ye,h),o(ye,m),o(Oe,g)}function m(){var T=n.keyboard;T&&(p=T==="global"?window:s,a(p,Gn,w))}function h(){i(p,Gn)}function u(T){c=T}function g(){var T=c;c=!0,ar(function(){c=T})}function w(T){if(!c){var d=kn(T);d===l(Ht)?e.go("<"):d===l(Ut)&&e.go(">")}}return{mount:_,destroy:h,disable:u}}var ct=bn+"-lazy",Nt=ct+"-srcset",Li="["+ct+"], ["+Nt+"]";function ki(e,t,n){var r=fe(e),o=r.on,a=r.off,i=r.bind,s=r.emit,l=n.lazyLoad==="sequential",p=[at,qe],c=[];function _(){n.lazyLoad&&(m(),o(he,m))}function m(){je(c),h(),l?T():(a(p),o(p,u),u())}function h(){t.Slides.forEach(function(d){vn(d.slide,Li).forEach(function(y){var P=$e(y,ct),M=$e(y,Nt);if(P!==y.src||M!==y.srcset){var $=n.classes.spinner,v=y.parentElement,I=Ct(v,"."+$)||et("span",$,v);c.push([y,d,I]),y.src||mt(y,"none")}})})}function u(){c=c.filter(function(d){var y=n.perPage*((n.preloadPages||1)+1)-1;return d[1].isWithin(e.index,y)?g(d):!0}),c.length||a(p)}function g(d){var y=d[0];Te(d[1].slide,pn),i(y,"load error",se(w,d)),te(y,"src",$e(y,ct)),te(y,"srcset",$e(y,Nt)),Ae(y,ct),Ae(y,Nt)}function w(d,y){var P=d[0],M=d[1];Ne(M.slide,pn),y.type!=="error"&&(Ge(d[2]),mt(P,""),s(En,P,M),s(rt)),l&&T()}function T(){c.length&&g(c.shift())}return{mount:_,destroy:se(je,c),check:u}}function Ri(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=r.bind,s=t.Slides,l=t.Elements,p=t.Controller,c=p.hasFocus,_=p.getIndex,m=p.go,h=t.Direction.resolve,u=l.pagination,g=[],w,T;function d(){y(),o([ye,he,Ft],d);var z=n.pagination;u&&mt(u,z?"":"none"),z&&(o([Oe,Dt,qe],V),P(),V(),a(wr,{list:w,items:g},I(e.index)))}function y(){w&&(Ge(u?De(w.children):w),Ne(w,T),je(g),w=null),r.destroy()}function P(){var z=e.length,k=n.classes,j=n.i18n,O=n.perPage,U=c()?p.getEnd()+1:ht(z/O);w=u||et("ul",k.pagination,l.track.parentElement),Te(w,T=Xt+"--"+v()),te(w,Ve,"tablist"),te(w,Se,j.select),te(w,An,v()===Gt?"vertical":"");for(var H=0;H<U;H++){var f=et("li",null,w),N=et("button",{class:k.page,type:"button"},f),L=s.getIn(H).map(function(x){return x.slide.id}),C=!c()&&O>1?j.pageX:j.slideX;i(N,"click",se(M,H)),n.paginationKeyboard&&i(N,"keydown",se($,H)),te(f,Ve,"presentation"),te(N,Ve,"tab"),te(N,wt,L.join(" ")),te(N,Se,sn(C,H+1)),te(N,tt,-1),g.push({li:f,button:N,page:H})}}function M(z){m(">"+z,!0)}function $(z,k){var j=g.length,O=kn(k),U=v(),H=-1;O===h(Ut,!1,U)?H=++z%j:O===h(Ht,!1,U)?H=(--z+j)%j:O==="Home"?H=0:O==="End"&&(H=j-1);var f=g[H];f&&(ur(f.button),m(">"+H),ke(k,!0))}function v(){return n.paginationDirection||n.direction}function I(z){return g[p.toPage(z)]}function V(){var z=I(_(!0)),k=I(_());if(z){var j=z.button;Ne(j,Ye),Ae(j,zn),te(j,tt,-1)}if(k){var O=k.button;Te(O,Ye),te(O,zn,!0),te(O,tt,"")}a($r,{list:w,items:g},z,k)}return{items:g,mount:d,destroy:y,getAt:I,update:V}}var Ni=[" ","Enter"];function Vi(e,t,n){var r=n.isNavigation,o=n.slideFocus,a=[];function i(){e.splides.forEach(function(u){u.isParent||(p(e,u.splide),p(u.splide,e))}),r&&c()}function s(){a.forEach(function(u){u.destroy()}),je(a)}function l(){s(),i()}function p(u,g){var w=fe(u);w.on(Oe,function(T,d,y){g.go(g.is(lt)?y:T)}),a.push(w)}function c(){var u=fe(e),g=u.on;g(Sn,m),g(Tr,h),g([We,ye],_),a.push(u),u.emit(_n,e.splides)}function _(){te(t.Elements.list,An,n.direction===Gt?"vertical":"")}function m(u){e.go(u.index)}function h(u,g){hn(Ni,kn(g))&&(m(u),ke(g))}return{setup:se(t.Media.set,{slideFocus:bt(o)?r:o},!0),mount:i,destroy:s,remount:l}}function ji(e,t,n){var r=fe(e),o=r.bind,a=0;function i(){n.wheel&&o(t.Elements.track,"wheel",s,Ze)}function s(p){if(p.cancelable){var c=p.deltaY,_=c<0,m=an(p),h=n.wheelMinThreshold||0,u=n.wheelSleep||0;be(c)>h&&m-a>u&&(e.go(_?"<":">"),a=m),l(_)&&ke(p)}}function l(p){return!n.releaseWheel||e.state.is(it)||t.Controller.getAdjacent(p)!==-1}return{mount:i}}var Oi=90;function Fi(e,t,n){var r=fe(e),o=r.on,a=t.Elements.track,i=n.live&&!n.isNavigation,s=et("span",ti),l=Wt(Oi,se(c,!1));function p(){i&&(m(!t.Autoplay.isPaused()),te(a,Pn,!0),s.textContent="…",o(wn,se(m,!0)),o($n,se(m,!1)),o([at,qe],se(c,!0)))}function c(h){te(a,Wn,h),h?(St(a,s),l.start()):(Ge(s),l.cancel())}function _(){Ae(a,[Dn,Pn,Wn]),Ge(s)}function m(h){i&&te(a,Dn,h?"off":"polite")}return{mount:p,disable:m,destroy:_}}var Bi=Object.freeze({__proto__:null,Media:Go,Direction:Yo,Elements:li,Slides:ci,Layout:ui,Clones:di,Move:gi,Controller:fi,Arrows:yi,Autoplay:bi,Cover:xi,Scroll:Ei,Drag:Ti,Keyboard:Ii,LazyLoad:ki,Pagination:Ri,Sync:Vi,Wheel:ji,Live:Fi}),Mi={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},zi={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:oi,i18n:Mi,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Di(e,t,n){var r=t.Slides;function o(){fe(e).on([We,he],a)}function a(){r.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function i(s,l){r.style("transition","opacity "+n.speed+"ms "+n.easing),ar(l)}return{mount:o,start:i,cancel:on}}function Wi(e,t,n){var r=t.Move,o=t.Controller,a=t.Scroll,i=t.Elements.list,s=se(we,i,"transition"),l;function p(){fe(e).bind(i,"transitionend",function(h){h.target===i&&l&&(_(),l())})}function c(h,u){var g=r.toPosition(h,!0),w=r.getPosition(),T=m(h);be(g-w)>=1&&T>=1?n.useScroll?a.scroll(g,T,!1,u):(s("transform "+T+"ms "+n.easing),r.translate(g,!0),l=u):(r.jump(h),u())}function _(){s(""),a.cancel()}function m(h){var u=n.rewindSpeed;if(e.is(ot)&&u){var g=o.getIndex(!0),w=o.getEnd();if(g===0&&h>=w||g>=w&&h===0)return u}return n.speed}return{mount:p,start:c,cancel:_}}var Pi=(function(){function e(n,r){this.event=fe(),this.Components={},this.state=Ho(Qe),this.splides=[],this._o={},this._E={};var o=Me(n)?dr(document,n):n;st(o,o+" is invalid."),this.root=o,r=Be({label:$e(o,Se)||"",labelledby:$e(o,Tn)||""},zi,e.defaults,r||{});try{Be(r,JSON.parse($e(o,bn)))}catch{st(!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;st(i.is([Qe,Vt]),"Already mounted!"),i.set(Qe),this._C=s,this._T=o||this._T||(this.is($t)?Di:Wi),this._E=r||this._E;var l=ft({},Bi,this._E,{Transition:this._T});return Ue(l,function(p,c){var _=p(a,s,a._o);s[c]=_,_.setup&&_.setup()}),Ue(s,function(p){p.mount&&p.mount()}),this.emit(We),Te(this.root,ni),i.set(nt),this.emit(cn),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(nt)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(De(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(he),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,a=this.state;return a.is(Qe)?fe(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&&je(this.splides),a.set(Vt)),this},Mo(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Rn=Pi;Rn.defaults={};Rn.STATES=Do;var Yn=[[We,"onMounted"],[cn,"onReady"],[Oe,"onMove"],[at,"onMoved"],[Sn,"onClick"],[mr,"onActive"],[hr,"onInactive"],[yr,"onVisible"],[vr,"onHidden"],[he,"onRefresh"],[ye,"onUpdated"],[rt,"onResize"],[zt,"onResized"],[br,"onDrag"],[xr,"onDragging"],[Sr,"onDragged"],[Dt,"onScroll"],[qe,"onScrolled"],[Cn,"onDestroy"],[Cr,"onArrowsMounted"],[_r,"onArrowsUpdated"],[wr,"onPaginationMounted"],[$r,"onPaginationUpdated"],[_n,"onNavigationMounted"],[wn,"onAutoplayPlay"],[Er,"onAutoplayPlaying"],[$n,"onAutoplayPause"],[En,"onLazyLoadLoaded"]];function Nn(...e){return e.filter(Boolean).join(" ")}function Bt(e){return e!==null&&typeof e=="object"}function dn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!dn(n,t[r]));if(Bt(e)&&Bt(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!dn(e[o],t[o]))}return e===t}function Hi(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function Ui(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function gn(e,t){const n=e;return Ui(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Bt(r)?n[o]=gn(Bt(n[o])?n[o]:{},r):n[o]=r}),n}var Gi=({children:e,className:t,...n})=>W.createElement("div",{className:Nn("splide__track",t),...n},W.createElement("ul",{className:"splide__list"},e)),Wr=class extends W.Component{constructor(){super(...arguments),this.splideRef=W.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Rn(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=gn({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!dn(this.options,e)&&(this.splide.options=e,this.options=gn({},e));const t=this.getSlides();Hi(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){Yn.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:r,...o}=this.props;return W.createElement(t,{className:Nn("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yn.map(a=>a[1])])},n?W.createElement(Gi,null,r):r)}},Pr=({children:e,className:t,...n})=>W.createElement("li",{className:Nn("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),W=require("react"),ge=require("classnames"),R=require("./useScopedStyles-Bibm8h9Z.js"),Gr=require("react-dom");function Yr(e){return e.type==="object"&&e.version===1}const qr="ControlSlider-module__wrapper___sHEkd",Xr="ControlSlider-module__hoverArrow___A-dOH",Kr="ControlSlider-module__sliderItem___QQSkR",Jr="ControlSlider-module__sliderImage___9hRl-",Zr="ControlSlider-module__arrow___05ghY",Qr="ControlSlider-module__arrowVertical___tBfVN",eo="ControlSlider-module__nextArrow___-30Yc",to="ControlSlider-module__arrowInner___aEra3",no="ControlSlider-module__arrowIcon___S4ztF",ro="ControlSlider-module__arrowImg___2dwJW",oo="ControlSlider-module__mirror___brd6U",io="ControlSlider-module__pagination___bicLF",ao="ControlSlider-module__paginationInner___bT-P-",lo="ControlSlider-module__paginationVertical___zYqKw",so="ControlSlider-module__paginationItem___nTRbk",co="ControlSlider-module__dot___p1Qun",uo="ControlSlider-module__activeDot___LHFaj",po="ControlSlider-module__paginationInsideBottom___R3FWn",go="ControlSlider-module__paginationInsideTop___V-qb-",fo="ControlSlider-module__paginationOutsideBottom___14w8D",mo="ControlSlider-module__paginationOutsideTop___SCLqB",yo="ControlSlider-module__paginationInsideLeft___yOBRZ",vo="ControlSlider-module__paginationInsideRight___Rtt3o",ho="ControlSlider-module__paginationOutsideLeft___lahaw",bo="ControlSlider-module__paginationOutsideRight___EtuQa",xo="ControlSlider-module__imgWrapper___UjEgB",Co="ControlSlider-module__captionBlock___dJ6-j",So="ControlSlider-module__captionTextWrapper___HFlpf",_o="ControlSlider-module__captionText___uGBVc",wo="ControlSlider-module__active___WZK4G",$o="ControlSlider-module__withPointerEvents___t-18M",Eo="ControlSlider-module__topLeftAlignment___zjnGM",To="ControlSlider-module__topCenterAlignment___gD1xW",Ao="ControlSlider-module__topRightAlignment___NMapS",Io="ControlSlider-module__middleLeftAlignment___OnUrY",Lo="ControlSlider-module__middleCenterAlignment___Tdkl0",ko="ControlSlider-module__middleRightAlignment___wEbfX",Ro="ControlSlider-module__bottomLeftAlignment___cTP2-",No="ControlSlider-module__bottomCenterAlignment___c54fB",Vo="ControlSlider-module__bottomRightAlignment___kEwrz",Oo="ControlSlider-module__clickOverlay___DZA28",jo="ControlSlider-module__contain___pLyq7",Bo="ControlSlider-module__cover___KdDat",G={wrapper:qr,hoverArrow:Xr,sliderItem:Kr,sliderImage:Jr,arrow:Zr,arrowVertical:Qr,nextArrow:eo,arrowInner:to,arrowIcon:no,arrowImg:ro,mirror:oo,pagination:io,paginationInner:ao,paginationVertical:lo,paginationItem:so,dot:co,activeDot:uo,paginationInsideBottom:po,paginationInsideTop:go,paginationOutsideBottom:fo,paginationOutsideTop:mo,paginationInsideLeft:yo,paginationInsideRight:vo,paginationOutsideLeft:ho,paginationOutsideRight:bo,imgWrapper:xo,captionBlock:Co,captionTextWrapper:So,captionText:_o,active:wo,withPointerEvents:$o,topLeftAlignment:Eo,topCenterAlignment:To,topRightAlignment:Ao,middleLeftAlignment:Io,middleCenterAlignment:Lo,middleRightAlignment:ko,bottomLeftAlignment:Ro,bottomCenterAlignment:No,bottomRightAlignment:Vo,clickOverlay:Oo,contain:jo,cover:Bo};function Fo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mo(e,t,n){return t&&Fo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Vn="(prefers-reduced-motion: reduce)",Qe=1,zo=2,nt=3,it=4,ht=5,Lt=6,Vt=7,Do={CREATED:Qe,MOUNTED:zo,IDLE:nt,MOVING:it,SCROLLING:ht,DRAGGING:Lt,DESTROYED:Vt};function Oe(e){e.length=0}function De(e,t,n){return Array.prototype.slice.call(e,t,n)}function se(e){return e.bind.apply(e,[null].concat(De(arguments,1)))}var ar=setTimeout,on=function(){};function On(e){return requestAnimationFrame(e)}function Mt(e,t){return typeof t===e}function pt(e){return!mn(e)&&Mt("object",e)}var fn=Array.isArray,lr=se(Mt,"function"),Me=se(Mt,"string"),bt=se(Mt,"undefined");function mn(e){return e===null}function sr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function xt(e){return fn(e)?e:[e]}function Se(e,t){xt(e).forEach(t)}function yn(e,t){return e.indexOf(t)>-1}function kt(e,t){return e.push.apply(e,xt(t)),e}function Re(e,t,n){e&&Se(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Te(e,t){Re(e,Me(t)?t.split(" "):t,!0)}function Ct(e,t){Se(t,e.appendChild.bind(e))}function vn(e,t){Se(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function dt(e,t){return sr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function cr(e,t){var n=e?De(e.children):[];return t?n.filter(function(r){return dt(r,t)}):n}function St(e,t){return t?cr(e,t)[0]:e.firstElementChild}var gt=Object.keys;function Ue(e,t,n){return e&&(n?gt(e).reverse():gt(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function ft(e){return De(arguments,1).forEach(function(t){Ue(t,function(n,r){e[r]=t[r]})}),e}function Fe(e){return De(arguments,1).forEach(function(t){Ue(t,function(n,r){fn(n)?e[r]=n.slice():pt(n)?e[r]=Fe({},pt(e[r])?e[r]:{},n):e[r]=n})}),e}function jn(e,t){Se(t||gt(e),function(n){delete e[n]})}function Ae(e,t){Se(e,function(n){Se(t,function(r){n&&n.removeAttribute(r)})})}function te(e,t,n){pt(t)?Ue(t,function(r,o){te(e,o,r)}):Se(e,function(r){mn(n)||n===""?Ae(r,t):r.setAttribute(t,String(n))})}function et(e,t,n){var r=document.createElement(e);return t&&(Me(t)?Te(r,t):te(r,t)),n&&Ct(n,r),r}function we(e,t,n){if(bt(n))return getComputedStyle(e)[t];mn(n)||(e.style[t]=""+n)}function mt(e,t){we(e,"display",t)}function ur(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function $e(e,t){return e.getAttribute(t)}function Bn(e,t){return e&&e.classList.contains(t)}function xe(e){return e.getBoundingClientRect()}function Ge(e){Se(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function pr(e){return St(new DOMParser().parseFromString(e,"text/html").body)}function ke(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function dr(e,t){return e&&e.querySelector(t)}function hn(e,t){return t?De(e.querySelectorAll(t)):[]}function Ne(e,t){Re(e,t,!1)}function an(e){return e.timeStamp}function He(e){return Me(e)?e:e?e+"px":""}var _t="splide",bn="data-"+_t;function st(e,t){if(!e)throw new Error("["+_t+"] "+(t||""))}var ze=Math.min,Ot=Math.max,jt=Math.floor,yt=Math.ceil,be=Math.abs;function gr(e,t,n){return be(e-t)<n}function Rt(e,t,n,r){var o=ze(t,n),a=Ot(t,n);return r?o<e&&e<a:o<=e&&e<=a}function Je(e,t,n){var r=ze(t,n),o=Ot(t,n);return ze(Ot(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 xn(e){return e<10?"0"+e:""+e}var Fn={};function Wo(e){return""+e+xn(Fn[e]=(Fn[e]||0)+1)}function fr(){var e=[];function t(i,s,l,p){o(i,s,function(c,_,m){var y="addEventListener"in c,u=y?c.removeEventListener.bind(c,_,l,p):c.removeListener.bind(c,l);y?c.addEventListener(_,l,p):c.addListener(l),e.push([c,_,m,l,u])})}function n(i,s,l){o(i,s,function(p,c,_){e=e.filter(function(m){return m[0]===p&&m[1]===c&&m[2]===_&&(!l||m[3]===l)?(m[4](),!1):!0})})}function r(i,s,l){var p,c=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:c,detail:l}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,c,!1,l)),i.dispatchEvent(p),p}function o(i,s,l){Se(i,function(p){p&&Se(s,function(c){c.split(" ").forEach(function(_){var m=_.split(".");l(p,m[0],m[1])})})})}function a(){e.forEach(function(i){i[4]()}),Oe(e)}return{bind:t,unbind:n,dispatch:r,destroy:a}}var We="mounted",cn="ready",je="move",at="moved",Cn="click",mr="active",yr="inactive",vr="visible",hr="hidden",ye="refresh",ve="updated",rt="resize",zt="resized",br="drag",xr="dragging",Cr="dragged",Dt="scroll",qe="scrolled",Po="overflow",Sn="destroy",Sr="arrows:mounted",_r="arrows:updated",wr="pagination:mounted",$r="pagination:updated",_n="navigation:mounted",wn="autoplay:play",Er="autoplay:playing",$n="autoplay:pause",En="lazyload:loaded",Tr="sk",Ar="sh",Bt="ei";function fe(e){var t=e?e.event.bus:document.createDocumentFragment(),n=fr();function r(a,i){n.bind(t,xt(a).join(" "),function(s){i.apply(i,fn(s.detail)?s.detail:[])})}function o(a){n.dispatch(t,a,De(arguments,1))}return e&&e.event.on(Sn,n.destroy),ft(n,{bus:t,on:r,off:se(n.unbind,t),emit:o})}function Wt(e,t,n,r){var o=Date.now,a,i=0,s,l=!0,p=0;function c(){if(!l){if(i=e?ze((o()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=o(),r&&++p>=r))return m();s=On(c)}}function _(T){T||u(),a=o()-(T?i*e:0),l=!1,s=On(c)}function m(){l=!0}function y(){a=o(),i=0,n&&n(i)}function u(){s&&cancelAnimationFrame(s),i=0,s=0,l=!0}function g(T){e=T}function w(){return l}return{start:_,rewind:y,pause:m,cancel:u,set:g,isPaused:w}}function Ho(e){var t=e;function n(o){t=o}function r(o){return yn(xt(o),t)}return{set:n,is:r}}function Uo(e,t){var n=Wt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Go(e,t,n){var r=e.state,o=n.breakpoints||{},a=n.reducedMotion||{},i=fr(),s=[];function l(){var u=n.mediaQuery==="min";gt(o).sort(function(g,w){return u?+g-+w:+w-+g}).forEach(function(g){c(o[g],"("+(u?"min":"max")+"-width:"+g+"px)")}),c(a,Vn),_()}function p(u){u&&i.destroy()}function c(u,g){var w=matchMedia(g);i.bind(w,"change",_),s.push([u,w])}function _(){var u=r.is(Vt),g=n.direction,w=s.reduce(function(T,d){return Fe(T,d[1].matches?d[0]:{})},{});jn(n),y(w),n.destroy?e.destroy(n.destroy==="completely"):u?(p(!0),e.mount()):g!==n.direction&&e.refresh()}function m(u){matchMedia(Vn).matches&&(u?Fe(n,a):jn(n,gt(a)))}function y(u,g,w){Fe(n,u),g&&Fe(Object.getPrototypeOf(n),u),(w||!r.is(Qe))&&e.emit(ve,n)}return{setup:l,destroy:p,reduce:m,set:y}}var Pt="Arrow",Ht=Pt+"Left",Ut=Pt+"Right",Ir=Pt+"Up",Lr=Pt+"Down",Mn="rtl",Gt="ttb",Kt={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ir,Ut],ArrowRight:[Lr,Ht]};function Yo(e,t,n){function r(a,i,s){s=s||n.direction;var l=s===Mn&&!i?1:s===Gt?0:-1;return Kt[a]&&Kt[a][l]||a.replace(/width|left|right/i,function(p,c){var _=Kt[p.toLowerCase()][l]||p;return c>0?_.charAt(0).toUpperCase()+_.slice(1):_})}function o(a){return a*(n.direction===Mn?1:-1)}return{resolve:r,orient:o}}var Ve="role",tt="tabindex",qo="disabled",Ee="aria-",wt=Ee+"controls",kr=Ee+"current",zn=Ee+"selected",Ce=Ee+"label",Tn=Ee+"labelledby",Rr=Ee+"hidden",An=Ee+"orientation",vt=Ee+"roledescription",Dn=Ee+"live",Wn=Ee+"busy",Pn=Ee+"atomic",In=[Ve,tt,qo,wt,kr,Ce,Tn,Rr,An,vt],Ie=_t+"__",Pe="is-",Jt=_t,Hn=Ie+"track",Xo=Ie+"list",Yt=Ie+"slide",Nr=Yt+"--clone",Ko=Yt+"__container",Ln=Ie+"arrows",qt=Ie+"arrow",Vr=qt+"--prev",Or=qt+"--next",Xt=Ie+"pagination",jr=Xt+"__page",Jo=Ie+"progress",Zo=Jo+"__bar",Qo=Ie+"toggle",ei=Ie+"spinner",ti=Ie+"sr",ni=Pe+"initialized",Ye=Pe+"active",Br=Pe+"prev",Fr=Pe+"next",un=Pe+"visible",pn=Pe+"loading",Mr=Pe+"focus-in",zr=Pe+"overflow",ri=[Ye,un,Br,Fr,pn,Mr,zr],oi={slide:Yt,clone:Nr,arrows:Ln,arrow:qt,prev:Vr,next:Or,pagination:Xt,page:jr,spinner:ei};function ii(e,t){if(lr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!dt(n,t);)n=n.parentElement;return n}var ai=5,Un=200,Dr="touchstart mousedown",Zt="touchmove mousemove",Qt="touchend touchcancel mouseup click";function li(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=e.root,s=n.i18n,l={},p=[],c=[],_=[],m,y,u;function g(){h(),P(),d()}function w(){o(ye,T),o(ye,g),o(ve,d),a(document,Dr+" keydown",function(v){u=v.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Re(i,Mr,!!u)})}function T(v){var I=In.concat("style");Oe(p),Ne(i,c),Ne(m,_),Ae([m,y],I),Ae(i,v?I:["style",vt])}function d(){Ne(i,c),Ne(m,_),c=$(Jt),_=$(Hn),Te(i,c),Te(m,_),te(i,Ce,n.label),te(i,Tn,n.labelledby)}function h(){m=M("."+Hn),y=St(m,"."+Xo),st(m&&y,"A track/list element is missing."),kt(p,cr(y,"."+Yt+":not(."+Nr+")")),Ue({arrows:Ln,pagination:Xt,prev:Vr,next:Or,bar:Zo,toggle:Qo},function(v,I){l[I]=M("."+v)}),ft(l,{root:i,track:m,list:y,slides:p})}function P(){var v=i.id||Wo(_t),I=n.role;i.id=v,m.id=m.id||v+"-track",y.id=y.id||v+"-list",!$e(i,Ve)&&i.tagName!=="SECTION"&&I&&te(i,Ve,I),te(i,vt,s.carousel),te(y,Ve,"presentation")}function M(v){var I=dr(i,v);return I&&ii(I,"."+Jt)===i?I:void 0}function $(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===Jt&&Ye]}return ft(l,{setup:g,mount:w,destroy:T})}var ot="slide",lt="loop",$t="fade";function si(e,t,n,r){var o=fe(e),a=o.on,i=o.emit,s=o.bind,l=e.Components,p=e.root,c=e.options,_=c.isNavigation,m=c.updateOnMove,y=c.i18n,u=c.pagination,g=c.slideFocus,w=l.Direction.resolve,T=$e(r,"style"),d=$e(r,Ce),h=n>-1,P=St(r,"."+Ko),M;function $(){h||(r.id=p.id+"-slide"+xn(t+1),te(r,Ve,u?"tabpanel":"group"),te(r,vt,y.slide),te(r,Ce,d||sn(y.slideLabel,[t+1,e.length]))),v()}function v(){s(r,"click",se(i,Cn,L)),s(r,"keydown",se(i,Tr,L)),a([at,Ar,qe],k),a(_n,V),m&&a(je,z)}function I(){M=!0,o.destroy(),Ne(r,ri),Ae(r,In),te(r,"style",T),te(r,Ce,d||"")}function V(){var S=e.splides.map(function(b){var E=b.splide.Components.Slides.getAt(t);return E?E.slide.id:""}).join(" ");te(r,Ce,sn(y.slideX,(h?n:t)+1)),te(r,wt,S),te(r,Ve,g?"button":""),g&&Ae(r,vt)}function z(){M||k()}function k(){if(!M){var S=e.index;O(),j(),Re(r,Br,t===S-1),Re(r,Fr,t===S+1)}}function O(){var S=H();S!==Bn(r,Ye)&&(Re(r,Ye,S),te(r,kr,_&&S||""),i(S?mr:yr,L))}function j(){var S=f(),b=!S&&(!H()||h);if(e.state.is([it,ht])||te(r,Rr,b||""),te(hn(r,c.focusableNodes||""),tt,b?-1:""),g&&te(r,tt,b?-1:0),S!==Bn(r,un)&&(Re(r,un,S),i(S?vr:hr,L)),!S&&document.activeElement===r){var E=l.Slides.getAt(e.index);E&&ur(E.slide)}}function U(S,b,E){we(E&&P||r,S,b)}function H(){var S=e.index;return S===t||c.cloneStatus&&S===n}function f(){if(e.is($t))return H();var S=xe(l.Elements.track),b=xe(r),E=w("left",!0),q=w("right",!0);return jt(S[E])<=yt(b[E])&&jt(b[q])<=yt(S[q])}function N(S,b){var E=be(S-t);return!h&&(c.rewind||e.is(lt))&&(E=ze(E,e.length-E)),E<=b}var L={index:t,slideIndex:n,slide:r,container:P,isClone:h,mount:$,destroy:I,update:k,style:U,isWithin:N};return L}function ci(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=r.bind,s=t.Elements,l=s.slides,p=s.list,c=[];function _(){m(),o(ye,y),o(ye,m)}function m(){l.forEach(function(k,O){g(k,O,-1)})}function y(){M(function(k){k.destroy()}),Oe(c)}function u(){M(function(k){k.update()})}function g(k,O,j){var U=si(e,O,j,k);U.mount(),c.push(U),c.sort(function(H,f){return H.index-f.index})}function w(k){return k?$(function(O){return!O.isClone}):c}function T(k){var O=t.Controller,j=O.toIndex(k),U=O.hasFocus()?1:n.perPage;return $(function(H){return Rt(H.index,j,j+U-1)})}function d(k){return $(k)[0]}function h(k,O){Se(k,function(j){if(Me(j)&&(j=pr(j)),sr(j)){var U=l[O];U?vn(j,U):Ct(p,j),Te(j,n.classes.slide),I(j,se(a,rt))}}),a(ye)}function P(k){Ge($(k).map(function(O){return O.slide})),a(ye)}function M(k,O){w(O).forEach(k)}function $(k){return c.filter(lr(k)?k:function(O){return Me(k)?dt(O.slide,k):yn(xt(k),O.index)})}function v(k,O,j){M(function(U){U.style(k,O,j)})}function I(k,O){var j=hn(k,"img"),U=j.length;U?j.forEach(function(H){i(H,"load error",function(){--U||O()})}):O()}function V(k){return k?l.length:c.length}function z(){return c.length>n.perPage}return{mount:_,destroy:y,update:u,register:g,get:w,getIn:T,getAt:d,add:h,remove:P,forEach:M,filter:$,style:v,getLength:V,isEnough:z}}function ui(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=r.emit,s=t.Slides,l=t.Direction.resolve,p=t.Elements,c=p.root,_=p.track,m=p.list,y=s.getAt,u=s.style,g,w,T;function d(){h(),a(window,"resize load",Uo(se(i,rt))),o([ve,ye],h),o(rt,P)}function h(){g=n.direction===Gt,we(c,"maxWidth",He(n.width)),we(_,l("paddingLeft"),M(!1)),we(_,l("paddingRight"),M(!0)),P(!0)}function P(L){var S=xe(c);(L||w.width!==S.width||w.height!==S.height)&&(we(_,"height",$()),u(l("marginRight"),He(n.gap)),u("width",I()),u("height",V(),!0),w=S,i(zt),T!==(T=N())&&(Re(c,zr,T),i(Po,T)))}function M(L){var S=n.padding,b=l(L?"right":"left");return S&&He(S[b]||(pt(S)?0:S))||"0px"}function $(){var L="";return g&&(L=v(),st(L,"height or heightRatio is missing."),L="calc("+L+" - "+M(!1)+" - "+M(!0)+")"),L}function v(){return He(n.height||xe(m).width*n.heightRatio)}function I(){return n.autoWidth?null:He(n.fixedWidth)||(g?"":z())}function V(){return He(n.fixedHeight)||(g?n.autoHeight?null:z():v())}function z(){var L=He(n.gap);return"calc((100%"+(L&&" + "+L)+")/"+(n.perPage||1)+(L&&" - "+L)+")"}function k(){return xe(m)[l("width")]}function O(L,S){var b=y(L||0);return b?xe(b.slide)[l("width")]+(S?0:H()):0}function j(L,S){var b=y(L);if(b){var E=xe(b.slide)[l("right")],q=xe(m)[l("left")];return be(E-q)+(S?0:H())}return 0}function U(L){return j(e.length-1)-j(0)+O(0,L)}function H(){var L=y(0);return L&&parseFloat(we(L.slide,l("marginRight")))||0}function f(L){return parseFloat(we(_,l("padding"+(L?"Right":"Left"))))||0}function N(){return e.is($t)||U(!0)>k()}return{mount:d,resize:P,listSize:k,slideSize:O,sliderSize:U,totalSize:j,getPadding:f,isOverflow:N}}var pi=2;function di(e,t,n){var r=fe(e),o=r.on,a=t.Elements,i=t.Slides,s=t.Direction.resolve,l=[],p;function c(){o(ye,_),o([ve,rt],y),(p=w())&&(u(p),t.Layout.resize(!0))}function _(){m(),c()}function m(){Ge(l),Oe(l),r.destroy()}function y(){var T=w();p!==T&&(p<T||!T)&&r.emit(ye)}function u(T){var d=i.get().slice(),h=d.length;if(h){for(;d.length<T;)kt(d,d);kt(d.slice(-T),d.slice(0,T)).forEach(function(P,M){var $=M<T,v=g(P.slide,M);$?vn(v,d[0].slide):Ct(a.list,v),kt(l,v),i.register(v,M-T+($?0:h),P.index)})}}function g(T,d){var h=T.cloneNode(!0);return Te(h,n.classes.clone),h.id=e.root.id+"-clone"+xn(d+1),h}function w(){var T=n.clones;if(!e.is(lt))T=0;else if(bt(T)){var d=n[s("fixedWidth")]&&t.Layout.slideSize(0),h=d&&yt(xe(a.track)[s("width")]/d);T=h||n[s("autoWidth")]&&e.length||n.perPage*pi}return T}return{mount:c,destroy:m}}function gi(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=e.state.set,s=t.Layout,l=s.slideSize,p=s.getPadding,c=s.totalSize,_=s.listSize,m=s.sliderSize,y=t.Direction,u=y.resolve,g=y.orient,w=t.Elements,T=w.list,d=w.track,h;function P(){h=t.Transition,o([We,zt,ve,ye],M)}function M(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function $(b,E,q,ie){b!==E&&L(b>q)&&(k(),I(z(U(),b>q),!0)),i(it),a(je,E,q,b),h.start(E,function(){i(nt),a(at,E,q,b),ie&&ie()})}function v(b){I(j(b,!0))}function I(b,E){if(!e.is($t)){var q=E?b:V(b);we(T,"transform","translate"+u("X")+"("+q+"px)"),b!==q&&a(Ar)}}function V(b){if(e.is(lt)){var E=O(b),q=E>t.Controller.getEnd(),ie=E<0;(ie||q)&&(b=z(b,q))}return b}function z(b,E){var q=b-N(E),ie=m();return b-=g(ie*(yt(be(q)/ie)||1))*(E?1:-1),b}function k(){I(U(),!0),h.cancel()}function O(b){for(var E=t.Slides.get(),q=0,ie=1/0,re=0;re<E.length;re++){var me=E[re].index,A=be(j(me,!0)-b);if(A<=ie)ie=A,q=me;else break}return q}function j(b,E){var q=g(c(b-1)-f(b));return E?H(q):q}function U(){var b=u("left");return xe(T)[b]-xe(d)[b]+g(p(!1))}function H(b){return n.trimSpace&&e.is(ot)&&(b=Je(b,0,g(m(!0)-_()))),b}function f(b){var E=n.focus;return E==="center"?(_()-l(b,!0))/2:+E*l(b)||0}function N(b){return j(b?t.Controller.getEnd():0,!!n.trimSpace)}function L(b){var E=g(z(U(),b));return b?E>=0:E<=T[u("scrollWidth")]-xe(d)[u("width")]}function S(b,E){E=bt(E)?U():E;var q=b!==!0&&g(E)<g(N(!1)),ie=b!==!1&&g(E)>g(N(!0));return q||ie}return{mount:P,move:$,jump:v,translate:I,shift:z,cancel:k,toIndex:O,toPosition:j,getPosition:U,getLimit:N,exceededLimit:S,reposition:M}}function fi(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=t.Move,s=i.getPosition,l=i.getLimit,p=i.toPosition,c=t.Slides,_=c.isEnough,m=c.getLength,y=n.omitEnd,u=e.is(lt),g=e.is(ot),w=se(U,!1),T=se(U,!0),d=n.start||0,h,P=d,M,$,v;function I(){V(),o([ve,ye,Bt],V),o(zt,z)}function V(){M=m(!0),$=n.perMove,v=n.perPage,h=L();var A=Je(d,0,y?h:M-1);A!==d&&(d=A,i.reposition())}function z(){h!==L()&&a(Bt)}function k(A,Z,pe){if(!me()){var oe=j(A),de=N(oe);de>-1&&(Z||de!==d)&&(q(de),i.move(oe,de,P,pe))}}function O(A,Z,pe,oe){t.Scroll.scroll(A,Z,pe,function(){var de=N(i.toIndex(s()));q(y?ze(de,h):de),oe&&oe()})}function j(A){var Z=d;if(Me(A)){var pe=A.match(/([+\-<>])(\d+)?/)||[],oe=pe[1],de=pe[2];oe==="+"||oe==="-"?Z=H(d+ +(""+oe+(+de||1)),d):oe===">"?Z=de?S(+de):w(!0):oe==="<"&&(Z=T(!0))}else Z=u?A:Je(A,0,h);return Z}function U(A,Z){var pe=$||(re()?1:v),oe=H(d+pe*(A?-1:1),d,!($||re()));return oe===-1&&g&&!gr(s(),l(!A),1)?A?0:h:Z?oe:N(oe)}function H(A,Z,pe){if(_()||re()){var oe=f(A);oe!==A&&(Z=A,A=oe,pe=!1),A<0||A>h?!$&&(Rt(0,A,Z,!0)||Rt(h,Z,A,!0))?A=S(b(A)):u?A=pe?A<0?-(M%v||v):M:A:n.rewind?A=A<0?h:0:A=-1:pe&&A!==Z&&(A=S(b(Z)+(A<Z?-1:1)))}else A=-1;return A}function f(A){if(g&&n.trimSpace==="move"&&A!==d)for(var Z=s();Z===p(A,!0)&&Rt(A,0,e.length-1,!n.rewind);)A<d?--A:++A;return A}function N(A){return u?(A+M)%M||0:A}function L(){for(var A=M-(re()||u&&$?1:v);y&&A-- >0;)if(p(M-1,!0)!==p(A,!0)){A++;break}return Je(A,0,M-1)}function S(A){return Je(re()?A:v*A,0,h)}function b(A){return re()?ze(A,h):jt((A>=h?M-1:A)/v)}function E(A){var Z=i.toIndex(A);return g?Je(Z,0,h):Z}function q(A){A!==d&&(P=d,d=A)}function ie(A){return A?P:d}function re(){return!bt(n.focus)||n.isNavigation}function me(){return e.state.is([it,ht])&&!!n.waitForTransition}return{mount:I,go:k,scroll:O,getNext:w,getPrev:T,getAdjacent:U,getEnd:L,setIndex:q,getIndex:ie,toIndex:S,toPage:b,toDest:E,hasFocus:re,isBusy:me}}var mi="http://www.w3.org/2000/svg",yi="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",Tt=40;function vi(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=r.emit,s=n.classes,l=n.i18n,p=t.Elements,c=t.Controller,_=p.arrows,m=p.track,y=_,u=p.prev,g=p.next,w,T,d={};function h(){M(),o(ve,P)}function P(){$(),h()}function M(){var O=n.arrows;O&&!(u&&g)&&V(),u&&g&&(ft(d,{prev:u,next:g}),mt(y,O?"":"none"),Te(y,T=Ln+"--"+n.direction),O&&(v(),k(),te([u,g],wt,m.id),i(Sr,u,g)))}function $(){r.destroy(),Ne(y,T),w?(Ge(_?[u,g]:y),u=g=null):Ae([u,g],In)}function v(){o([We,at,ye,qe,Bt],k),a(g,"click",se(I,">")),a(u,"click",se(I,"<"))}function I(O){c.go(O,!0)}function V(){y=_||et("div",s.arrows),u=z(!0),g=z(!1),w=!0,Ct(y,[u,g]),!_&&vn(y,m)}function z(O){var j='<button class="'+s.arrow+" "+(O?s.prev:s.next)+'" type="button"><svg xmlns="'+mi+'" viewBox="0 0 '+Tt+" "+Tt+'" width="'+Tt+'" height="'+Tt+'" focusable="false"><path d="'+(n.arrowPath||yi)+'" />';return pr(j)}function k(){if(u&&g){var O=e.index,j=c.getPrev(),U=c.getNext(),H=j>-1&&O<j?l.last:l.prev,f=U>-1&&O>U?l.first:l.next;u.disabled=j<0,g.disabled=U<0,te(u,Ce,H),te(g,Ce,f),i(_r,u,g,j,U)}}return{arrows:d,mount:h,destroy:$,update:k}}var hi=bn+"-interval";function bi(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=r.emit,s=Wt(n.interval,e.go.bind(e,">"),v),l=s.isPaused,p=t.Elements,c=t.Elements,_=c.root,m=c.toggle,y=n.autoplay,u,g,w=y==="pause";function T(){y&&(d(),m&&te(m,wt,p.track.id),w||h(),$())}function d(){n.pauseOnHover&&a(_,"mouseenter mouseleave",function(V){u=V.type==="mouseenter",M()}),n.pauseOnFocus&&a(_,"focusin focusout",function(V){g=V.type==="focusin",M()}),m&&a(m,"click",function(){w?h():P(!0)}),o([je,Dt,ye],s.rewind),o(je,I)}function h(){l()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),g=u=w=!1,$(),i(wn))}function P(V){V===void 0&&(V=!0),w=!!V,$(),l()||(s.pause(),i($n))}function M(){w||(u||g?P(!1):h())}function $(){m&&(Re(m,Ye,!w),te(m,Ce,n.i18n[w?"play":"pause"]))}function v(V){var z=p.bar;z&&we(z,"width",V*100+"%"),i(Er,V)}function I(V){var z=t.Slides.getAt(V);s.set(z&&+$e(z.slide,hi)||n.interval)}return{mount:T,destroy:s.cancel,play:h,pause:P,isPaused:l}}function xi(e,t,n){var r=fe(e),o=r.on;function a(){n.cover&&(o(En,se(s,!0)),o([We,ve,ye],se(i,!0)))}function i(l){t.Slides.forEach(function(p){var c=St(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),mt(p,l?"none":"")}return{mount:a,destroy:se(i,!1)}}var Ci=10,Si=600,_i=.6,wi=1.5,$i=800;function Ei(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=e.state.set,s=t.Move,l=s.getPosition,p=s.getLimit,c=s.exceededLimit,_=s.translate,m=e.is(ot),y,u,g=1;function w(){o(je,P),o([ve,ye],M)}function T(v,I,V,z,k){var O=l();if(P(),V&&(!m||!c())){var j=t.Layout.sliderSize(),U=ln(v)*j*jt(be(v)/j)||0;v=s.toPosition(t.Controller.toDest(v%j))+U}var H=gr(O,v,1);g=1,I=H?0:I||Ot(be(v-O)/wi,$i),u=z,y=Wt(I,d,se(h,O,v,k),1),i(ht),a(Dt),y.start()}function d(){i(nt),u&&u(),a(qe)}function h(v,I,V,z){var k=l(),O=v+(I-v)*$(z),j=(O-k)*g;_(k+j),m&&!V&&c()&&(g*=_i,be(j)<Ci&&T(p(c(!0)),Si,!1,u,!0))}function P(){y&&y.cancel()}function M(){y&&!y.isPaused()&&(P(),d())}function $(v){var I=n.easingFunc;return I?I(v):1-Math.pow(1-v,4)}return{mount:w,destroy:P,scroll:T,cancel:M}}var Ze={passive:!1,capture:!0};function Ti(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=r.bind,s=r.unbind,l=e.state,p=t.Move,c=t.Scroll,_=t.Controller,m=t.Elements.track,y=t.Media.reduce,u=t.Direction,g=u.resolve,w=u.orient,T=p.getPosition,d=p.exceededLimit,h,P,M,$,v,I=!1,V,z,k;function O(){i(m,Zt,on,Ze),i(m,Qt,on,Ze),i(m,Dr,U,Ze),i(m,"click",N,{capture:!0}),i(m,"dragstart",ke),o([We,ve],j)}function j(){var D=n.drag;Be(!D),$=D==="free"}function U(D){if(V=!1,!z){var x=de(D);oe(D.target)&&(x||!D.button)&&(_.isBusy()?ke(D,!0):(k=x?m:window,v=l.is([it,ht]),M=null,i(k,Zt,H,Ze),i(k,Qt,f,Ze),p.cancel(),c.cancel(),L(D)))}}function H(D){if(l.is(Lt)||(l.set(Lt),a(br)),D.cancelable)if(v){p.translate(h+pe(re(D)));var x=me(D)>Un,B=I!==(I=d());(x||B)&&L(D),V=!0,a(xr),ke(D)}else E(D)&&(v=b(D),ke(D))}function f(D){l.is(Lt)&&(l.set(nt),a(Cr)),v&&(S(D),ke(D)),s(k,Zt,H),s(k,Qt,f),v=!1}function N(D){!z&&V&&ke(D,!0)}function L(D){M=P,P=D,h=T()}function S(D){var x=q(D),B=ie(x),Y=n.rewind&&n.rewindByDrag;y(!1),$?_.scroll(B,0,n.snap):e.is($t)?_.go(w(ln(x))<0?Y?"<":"-":Y?">":"+"):e.is(ot)&&I&&Y?_.go(d(!0)?">":"<"):_.go(_.toDest(B),!0),y(!0)}function b(D){var x=n.dragMinThreshold,B=pt(x),Y=B&&x.mouse||0,X=(B?x.touch:+x)||10;return be(re(D))>(de(D)?X:Y)}function E(D){return be(re(D))>be(re(D,!0))}function q(D){if(e.is(lt)||!I){var x=me(D);if(x&&x<Un)return re(D)/x}return 0}function ie(D){return T()+ln(D)*ze(be(D)*(n.flickPower||600),$?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(D,x){return Z(D,x)-Z(A(D),x)}function me(D){return an(D)-an(A(D))}function A(D){return P===D&&M||P}function Z(D,x){return(de(D)?D.changedTouches[0]:D)["page"+g(x?"Y":"X")]}function pe(D){return D/(I&&e.is(ot)?ai:1)}function oe(D){var x=n.noDrag;return!dt(D,"."+jr+", ."+qt)&&(!x||!dt(D,x))}function de(D){return typeof TouchEvent<"u"&&D instanceof TouchEvent}function _e(){return v}function Be(D){z=D}return{mount:O,disable:Be,isDragging:_e}}var Ai={Spacebar:" ",Right:Ut,Left:Ht,Up:Ir,Down:Lr};function kn(e){return e=Me(e)?e:e.key,Ai[e]||e}var Gn="keydown";function Ii(e,t,n){var r=fe(e),o=r.on,a=r.bind,i=r.unbind,s=e.root,l=t.Direction.resolve,p,c;function _(){m(),o(ve,y),o(ve,m),o(je,g)}function m(){var T=n.keyboard;T&&(p=T==="global"?window:s,a(p,Gn,w))}function y(){i(p,Gn)}function u(T){c=T}function g(){var T=c;c=!0,ar(function(){c=T})}function w(T){if(!c){var d=kn(T);d===l(Ht)?e.go("<"):d===l(Ut)&&e.go(">")}}return{mount:_,destroy:y,disable:u}}var ct=bn+"-lazy",Nt=ct+"-srcset",Li="["+ct+"], ["+Nt+"]";function ki(e,t,n){var r=fe(e),o=r.on,a=r.off,i=r.bind,s=r.emit,l=n.lazyLoad==="sequential",p=[at,qe],c=[];function _(){n.lazyLoad&&(m(),o(ye,m))}function m(){Oe(c),y(),l?T():(a(p),o(p,u),u())}function y(){t.Slides.forEach(function(d){hn(d.slide,Li).forEach(function(h){var P=$e(h,ct),M=$e(h,Nt);if(P!==h.src||M!==h.srcset){var $=n.classes.spinner,v=h.parentElement,I=St(v,"."+$)||et("span",$,v);c.push([h,d,I]),h.src||mt(h,"none")}})})}function u(){c=c.filter(function(d){var h=n.perPage*((n.preloadPages||1)+1)-1;return d[1].isWithin(e.index,h)?g(d):!0}),c.length||a(p)}function g(d){var h=d[0];Te(d[1].slide,pn),i(h,"load error",se(w,d)),te(h,"src",$e(h,ct)),te(h,"srcset",$e(h,Nt)),Ae(h,ct),Ae(h,Nt)}function w(d,h){var P=d[0],M=d[1];Ne(M.slide,pn),h.type!=="error"&&(Ge(d[2]),mt(P,""),s(En,P,M),s(rt)),l&&T()}function T(){c.length&&g(c.shift())}return{mount:_,destroy:se(Oe,c),check:u}}function Ri(e,t,n){var r=fe(e),o=r.on,a=r.emit,i=r.bind,s=t.Slides,l=t.Elements,p=t.Controller,c=p.hasFocus,_=p.getIndex,m=p.go,y=t.Direction.resolve,u=l.pagination,g=[],w,T;function d(){h(),o([ve,ye,Bt],d);var z=n.pagination;u&&mt(u,z?"":"none"),z&&(o([je,Dt,qe],V),P(),V(),a(wr,{list:w,items:g},I(e.index)))}function h(){w&&(Ge(u?De(w.children):w),Ne(w,T),Oe(g),w=null),r.destroy()}function P(){var z=e.length,k=n.classes,O=n.i18n,j=n.perPage,U=c()?p.getEnd()+1:yt(z/j);w=u||et("ul",k.pagination,l.track.parentElement),Te(w,T=Xt+"--"+v()),te(w,Ve,"tablist"),te(w,Ce,O.select),te(w,An,v()===Gt?"vertical":"");for(var H=0;H<U;H++){var f=et("li",null,w),N=et("button",{class:k.page,type:"button"},f),L=s.getIn(H).map(function(b){return b.slide.id}),S=!c()&&j>1?O.pageX:O.slideX;i(N,"click",se(M,H)),n.paginationKeyboard&&i(N,"keydown",se($,H)),te(f,Ve,"presentation"),te(N,Ve,"tab"),te(N,wt,L.join(" ")),te(N,Ce,sn(S,H+1)),te(N,tt,-1),g.push({li:f,button:N,page:H})}}function M(z){m(">"+z,!0)}function $(z,k){var O=g.length,j=kn(k),U=v(),H=-1;j===y(Ut,!1,U)?H=++z%O:j===y(Ht,!1,U)?H=(--z+O)%O:j==="Home"?H=0:j==="End"&&(H=O-1);var f=g[H];f&&(ur(f.button),m(">"+H),ke(k,!0))}function v(){return n.paginationDirection||n.direction}function I(z){return g[p.toPage(z)]}function V(){var z=I(_(!0)),k=I(_());if(z){var O=z.button;Ne(O,Ye),Ae(O,zn),te(O,tt,-1)}if(k){var j=k.button;Te(j,Ye),te(j,zn,!0),te(j,tt,"")}a($r,{list:w,items:g},z,k)}return{items:g,mount:d,destroy:h,getAt:I,update:V}}var Ni=[" ","Enter"];function Vi(e,t,n){var r=n.isNavigation,o=n.slideFocus,a=[];function i(){e.splides.forEach(function(u){u.isParent||(p(e,u.splide),p(u.splide,e))}),r&&c()}function s(){a.forEach(function(u){u.destroy()}),Oe(a)}function l(){s(),i()}function p(u,g){var w=fe(u);w.on(je,function(T,d,h){g.go(g.is(lt)?h:T)}),a.push(w)}function c(){var u=fe(e),g=u.on;g(Cn,m),g(Tr,y),g([We,ve],_),a.push(u),u.emit(_n,e.splides)}function _(){te(t.Elements.list,An,n.direction===Gt?"vertical":"")}function m(u){e.go(u.index)}function y(u,g){yn(Ni,kn(g))&&(m(u),ke(g))}return{setup:se(t.Media.set,{slideFocus:bt(o)?r:o},!0),mount:i,destroy:s,remount:l}}function Oi(e,t,n){var r=fe(e),o=r.bind,a=0;function i(){n.wheel&&o(t.Elements.track,"wheel",s,Ze)}function s(p){if(p.cancelable){var c=p.deltaY,_=c<0,m=an(p),y=n.wheelMinThreshold||0,u=n.wheelSleep||0;be(c)>y&&m-a>u&&(e.go(_?"<":">"),a=m),l(_)&&ke(p)}}function l(p){return!n.releaseWheel||e.state.is(it)||t.Controller.getAdjacent(p)!==-1}return{mount:i}}var ji=90;function Bi(e,t,n){var r=fe(e),o=r.on,a=t.Elements.track,i=n.live&&!n.isNavigation,s=et("span",ti),l=Wt(ji,se(c,!1));function p(){i&&(m(!t.Autoplay.isPaused()),te(a,Pn,!0),s.textContent="…",o(wn,se(m,!0)),o($n,se(m,!1)),o([at,qe],se(c,!0)))}function c(y){te(a,Wn,y),y?(Ct(a,s),l.start()):(Ge(s),l.cancel())}function _(){Ae(a,[Dn,Pn,Wn]),Ge(s)}function m(y){i&&te(a,Dn,y?"off":"polite")}return{mount:p,disable:m,destroy:_}}var Fi=Object.freeze({__proto__:null,Media:Go,Direction:Yo,Elements:li,Slides:ci,Layout:ui,Clones:di,Move:gi,Controller:fi,Arrows:vi,Autoplay:bi,Cover:xi,Scroll:Ei,Drag:Ti,Keyboard:Ii,LazyLoad:ki,Pagination:Ri,Sync:Vi,Wheel:Oi,Live:Bi}),Mi={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},zi={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:oi,i18n:Mi,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Di(e,t,n){var r=t.Slides;function o(){fe(e).on([We,ye],a)}function a(){r.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function i(s,l){r.style("transition","opacity "+n.speed+"ms "+n.easing),ar(l)}return{mount:o,start:i,cancel:on}}function Wi(e,t,n){var r=t.Move,o=t.Controller,a=t.Scroll,i=t.Elements.list,s=se(we,i,"transition"),l;function p(){fe(e).bind(i,"transitionend",function(y){y.target===i&&l&&(_(),l())})}function c(y,u){var g=r.toPosition(y,!0),w=r.getPosition(),T=m(y);be(g-w)>=1&&T>=1?n.useScroll?a.scroll(g,T,!1,u):(s("transform "+T+"ms "+n.easing),r.translate(g,!0),l=u):(r.jump(y),u())}function _(){s(""),a.cancel()}function m(y){var u=n.rewindSpeed;if(e.is(ot)&&u){var g=o.getIndex(!0),w=o.getEnd();if(g===0&&y>=w||g>=w&&y===0)return u}return n.speed}return{mount:p,start:c,cancel:_}}var Pi=(function(){function e(n,r){this.event=fe(),this.Components={},this.state=Ho(Qe),this.splides=[],this._o={},this._E={};var o=Me(n)?dr(document,n):n;st(o,o+" is invalid."),this.root=o,r=Fe({label:$e(o,Ce)||"",labelledby:$e(o,Tn)||""},zi,e.defaults,r||{});try{Fe(r,JSON.parse($e(o,bn)))}catch{st(!1,"Invalid JSON")}this._o=Object.create(Fe({},r))}var t=e.prototype;return t.mount=function(r,o){var a=this,i=this.state,s=this.Components;st(i.is([Qe,Vt]),"Already mounted!"),i.set(Qe),this._C=s,this._T=o||this._T||(this.is($t)?Di:Wi),this._E=r||this._E;var l=ft({},Fi,this._E,{Transition:this._T});return Ue(l,function(p,c){var _=p(a,s,a._o);s[c]=_,_.setup&&_.setup()}),Ue(s,function(p){p.mount&&p.mount()}),this.emit(We),Te(this.root,ni),i.set(nt),this.emit(cn),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(nt)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(De(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(ye),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,a=this.state;return a.is(Qe)?fe(this).on(cn,this.destroy.bind(this,r)):(Ue(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(Sn),o.destroy(),r&&Oe(this.splides),a.set(Vt)),this},Mo(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Rn=Pi;Rn.defaults={};Rn.STATES=Do;var Yn=[[We,"onMounted"],[cn,"onReady"],[je,"onMove"],[at,"onMoved"],[Cn,"onClick"],[mr,"onActive"],[yr,"onInactive"],[vr,"onVisible"],[hr,"onHidden"],[ye,"onRefresh"],[ve,"onUpdated"],[rt,"onResize"],[zt,"onResized"],[br,"onDrag"],[xr,"onDragging"],[Cr,"onDragged"],[Dt,"onScroll"],[qe,"onScrolled"],[Sn,"onDestroy"],[Sr,"onArrowsMounted"],[_r,"onArrowsUpdated"],[wr,"onPaginationMounted"],[$r,"onPaginationUpdated"],[_n,"onNavigationMounted"],[wn,"onAutoplayPlay"],[Er,"onAutoplayPlaying"],[$n,"onAutoplayPause"],[En,"onLazyLoadLoaded"]];function Nn(...e){return e.filter(Boolean).join(" ")}function Ft(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(Ft(e)&&Ft(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!dn(e[o],t[o]))}return e===t}function Hi(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function Ui(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function gn(e,t){const n=e;return Ui(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Ft(r)?n[o]=gn(Ft(n[o])?n[o]:{},r):n[o]=r}),n}var Gi=({children:e,className:t,...n})=>W.createElement("div",{className:Nn("splide__track",t),...n},W.createElement("ul",{className:"splide__list"},e)),Wr=class extends W.Component{constructor(){super(...arguments),this.splideRef=W.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Rn(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=gn({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!dn(this.options,e)&&(this.splide.options=e,this.options=gn({},e));const t=this.getSlides();Hi(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){Yn.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:r,...o}=this.props;return W.createElement(t,{className:Nn("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yn.map(a=>a[1])])},n?W.createElement(Gi,null,r):r)}},Pr=({children:e,className:t,...n})=>W.createElement("li",{className:Nn("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 Yi="RichTextRenderer-module__link___BWeZ2",qi={link:Yi},Hr=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?b.jsx("a",{className:qi.link,href:r.value,target:r.target,children:t(r.children)},o):b.jsx("span",{style:Xi(r),children:r.text},o));return b.jsx(b.Fragment,{children:e.map((n,r)=>{const o=n.children;return b.jsx("div",{children:t(o)},r)})})};function Xi(e){return{...e.fontFamily&&{fontFamily:e.fontFamily},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const Ki="SvgImage-module__svg___q3xE-",Ji="SvgImage-module__img___VsTm-",qn={svg:Ki,img:Ji},ut=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r=""})=>{const[o,a]=W.useState(!0);return W.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?b.jsx("img",{src:e,alt:"",className:ge(qn.img,r)}):b.jsx("span",{"data-supports-mask":o,className:ge(qn.svg,r),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},Zi={"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 Qi({settings:e,content:t,styles:n,isEditor:r}){const[o,a]=W.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:p,wordSpacing:c,fontSizeLineHeight:_,textAppearance:m,color:h}=n.imageCaption,[u,g]=W.useState(void 0),[w,T]=W.useState(null),[d,y]=W.useState(0),[P,M]=W.useState(0),{direction:$,transition:v,controls:I,pagination:V,imageCaption:z,triggers:k}=e,j=W.useRef(v.type),{x:O,y:U}=e.controls.offset,H=f=>{o&&o.go(f)};return W.useEffect(()=>{if(!w)return;const f=new ResizeObserver(N=>{if(!o)return;const[L]=N;g({width:Math.round(L.contentRect.width),height:Math.round(L.contentRect.height)})});return f.observe(w),()=>f.unobserve(w)},[w]),W.useEffect(()=>{!o||j.current===v.type||(M(f=>f+1),j.current=v.type)},[v.type]),b.jsx("div",{className:ge(G.wrapper,{[G.editor]:r}),ref:T,children:b.jsxs("div",{className:G.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&b.jsx("div",{className:ge(G.captionBlock),children:b.jsx("div",{className:G.captionTextWrapper,children:t.map((f,N)=>b.jsx("div",{className:ge(G.captionText,Zi[z.alignment],{[G.withPointerEvents]:N===d&&r,[G.active]:N===d}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":R.scalingValue(i.width,r),letterSpacing:R.scalingValue(l,r),wordSpacing:R.scalingValue(c,r),textAlign:p,fontSize:R.scalingValue(_.fontSize,r),lineHeight:R.scalingValue(_.lineHeight,r),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:b.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-hover-color":z.linkHoverColor,"--link-color":z.linkColor,position:"relative",top:R.scalingValue(z.offset.y,r),left:R.scalingValue(z.offset.x,r)},children:b.jsx(Hr,{content:f.imageCaption})})},N))})}),b.jsx(Wr,{onMove:f=>{y(f.index)},ref:a,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:k.autoPlay!==null,...k.autoPlay!==null&&{interval:parseInt(k.autoPlay)*1e3},direction:$==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:k.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,N)=>b.jsx(Pr,{children:b.jsx("div",{className:G.sliderItem,children:b.jsx("div",{className:G.imgWrapper,children:b.jsx("img",{className:ge(G.sliderImage,{[G.contain]:f.image.objectFit==="contain",[G.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},N))},P),I.isActive&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ge(G.arrow,{[G.arrowVertical]:$==="vert",[G.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:b.jsxs("button",{onClick:()=>{H("-1")},className:G.arrowInner,style:{transform:`translate(${R.scalingValue(O,r)}, ${R.scalingValue(U*($==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${$==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&b.jsx(ut,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ge(G.arrowImg,G.mirror)}),!I.arrowsImgUrl&&b.jsx(Xn,{color:I.color,className:ge(G.arrowIcon,G.arrowImg,G.mirror)})]})}),b.jsx("div",{className:ge(G.arrow,G.nextArrow,{[G.arrowVertical]:$==="vert",[G.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:b.jsxs("button",{className:G.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${R.scalingValue(O*($==="horiz"?-1:1),r)}, ${R.scalingValue(U,r)}) scale(${e.controls.scale/100}) rotate(${$==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&b.jsx(ut,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:G.arrowImg}),!I.arrowsImgUrl&&b.jsx(Xn,{color:I.color,className:ge(G.arrowIcon,G.arrowImg)})]})})]}),k.triggersList.click&&b.jsx("div",{className:G.clickOverlay,onClick:()=>{o&&o.go("+1")}}),V.isActive&&b.jsx("div",{className:ge(G.pagination,{[G.paginationInsideBottom]:V.position==="inside-1"&&$==="horiz",[G.paginationInsideTop]:V.position==="inside-2"&&$==="horiz",[G.paginationOutsideBottom]:V.position==="outside-1"&&$==="horiz",[G.paginationOutsideTop]:V.position==="outside-2"&&$==="horiz",[G.paginationInsideLeft]:V.position==="inside-1"&&$==="vert",[G.paginationInsideRight]:V.position==="inside-2"&&$==="vert",[G.paginationOutsideLeft]:V.position==="outside-1"&&$==="vert",[G.paginationOutsideRight]:V.position==="outside-2"&&$==="vert",[G.paginationVertical]:$==="vert"}),children:b.jsx("div",{className:G.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${R.scalingValue(V.offset.x,r)}, ${R.scalingValue(V.offset.y,r)}) rotate(${$==="horiz"?"0deg":"90deg"})`},children:t.map((f,N)=>b.jsx("button",{onClick:()=>{o&&o.go(N)},className:ge(G.paginationItem),children:b.jsx("div",{className:ge(G.dot,{[G.activeDot]:N===d}),style:{backgroundColor:N===d?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},N))})})]})})}function Xn({color:e,className:t}){return b.jsx("svg",{viewBox:"0 0 10 18",className:t,children:b.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:b.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const ea={element:Qi,id:"control-slider",name:"Slider",preview:{type:"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"]}},ta="ImageRevealSlider-module__imageRevealSlider___UE5Ob",na="ImageRevealSlider-module__image___Qjt-e",ra="ImageRevealSlider-module__link___N-iLG",oa="ImageRevealSlider-module__cursor___2U03d",Xe={imageRevealSlider:ta,image:na,link:ra,cursor:oa};function Kn(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const a=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*a,s=a/2,l=i/2;if(e>=r.x-s&&e<=r.x+s&&t>=r.y-l&&t<=r.y+l)return!0}return!1}function en(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ia(e,t,n,r){let o,a;if(t==="custom"){o=n;const i=await en(e);a=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await en(e);a=i.height/i.width*o}else{const i=await en(e);o=i.width,a=i.height}return{width:o,height:a,finalWidth:`${o}px`}}function aa({settings:e,content:t,isEditor:n}){const[r,o]=W.useState(null),[a,i]=W.useState([]),[s,l]=W.useState(0),p=W.useRef(0),[c,_]=W.useState({x:0,y:0}),[m,h]=W.useState(1),[u,g]=W.useState("none"),w=W.useRef({x:0,y:0}),[T,d]=W.useState(!1),{sizeType:y,imageWidth:P,randomRangeImageWidth:M}=e.imageSize,{revealPosition:$,visible:v}=e.position,{cursorType:I,target:V,defaultCursorScale:z,defaultCursor:k,hoverCursorScale:j,hoverCursor:O}=e.cursor;W.useEffect(()=>{if(!r)return;const f=(C,x)=>{const E=r.getBoundingClientRect(),q=C-E.left,ie=x-E.top;if(_({x:q,y:ie}),I==="system"){g("none"),h(1);return}const re=q,me=ie,A=document.elementFromPoint(E.left+re,E.top+me);if(A&&A.closest("a")){g("none"),h(1);return}const Z=Kn(re,me,a)||V==="area"?{img:O??"none",scale:j}:{img:k??"none",scale:z};g(Z.img),h(Z.scale)},N=C=>{C.stopPropagation(),w.current={x:C.clientX,y:C.clientY},f(C.clientX,C.clientY)},L=()=>{T&&f(w.current.x,w.current.y)};return r.addEventListener("mousemove",N),window.addEventListener("scroll",L,!0),()=>{r.removeEventListener("mousemove",N),window.removeEventListener("scroll",L,!0)}},[r,T,c,I,V,O,k,j,z,a]),W.useEffect(()=>{T||(g("none"),h(0))},[T]);const U=async(f,N,L,C={})=>{const{width:x,height:E,finalWidth:q}=await ia(f.image.url,y,P,M);let ie=0,re=0;$==="same"?(ie=N/2,re=L/2):(ie=C.x??Math.random()*N,re=C.y??Math.random()*L);const me=Math.min(Math.max(ie,x/2),N-x/2),A=Math.min(Math.max(re,E/2),L-E/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:me,y:A,width:q}};W.useEffect(()=>{if(!r||t.length===0)return;const f=r.getBoundingClientRect(),N=f.width,L=f.height,C=[];(async()=>{const E=t[0],q=await U(E,N,L);C.push(q),i(C),l(1)})()},[y,P,M,$,r]),W.useEffect(()=>{v==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[v]);const H=async f=>{if(!r)return;const N=r.getBoundingClientRect(),L=f.clientX-N.left,C=f.clientY-N.top;if(V==="image"&&!Kn(L,C,a))return;let x=0,E=0;$==="on Click"?(x=L,E=C):$==="same"?(x=N.width/2,E=N.height/2):(x=Math.random()*N.width,E=Math.random()*N.height);const q=t[s],ie=await U(q,N.width,N.height,{x,y:E});i(re=>v==="all"?[...re,ie]:[ie]),l(re=>re>=t.length-1?0:re+1)};return b.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:Xe.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[a.map(f=>b.jsx("div",{className:Xe.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:V==="area"&&f.link?b.jsx("a",{href:f.link,target:"_blank",className:Xe.link,children:b.jsx("img",{src:f.url,alt:f.name,className:Xe.image},f.id)}):b.jsx("img",{src:f.url,alt:f.name,className:Xe.image},f.id)},f.id)),T&&b.jsx("div",{className:Xe.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const la={element:aa,id:"control-image-reveal",name:"Click Gallery",preview:{type:"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:""}]}}}},sa="LightBox-module__hidden___9s-9x",ca="LightBox-module__heroImage___sTxNF",ua="LightBox-module__background___rm9ml",pa="LightBox-module__editor___4ACaY",da="LightBox-module__contentStyle___Bgnsq",ga="LightBox-module__imageStyle___tLIlB",fa="LightBox-module__imgWrapper___LuFUp",ma="LightBox-module__contain___8-yaS",ha="LightBox-module__cover___hNvOG",ya="LightBox-module__caption___b6L2I",va="LightBox-module__captionTextInner___rCGNH",ba="LightBox-module__lightboxSplide___XFuWC",xa="LightBox-module__arrow___iz38X",Sa="LightBox-module__arrowVertical___Zfz81",Ca="LightBox-module__nextArrow___zkAQN",_a="LightBox-module__arrowInner___p48sW",wa="LightBox-module__arrowIcon___3VaFf",$a="LightBox-module__arrowImg___pNV88",Ea="LightBox-module__mirror___pjeXc",Ta="LightBox-module__thumbsWrapper___GB-nU",Aa="LightBox-module__thumbsContainerVertical___wttk5",Ia="LightBox-module__thumbsContainer___osSma",La="LightBox-module__thumbsAlignStart___MO6tY",ka="LightBox-module__thumbsAlignCenter___Q4sUx",Ra="LightBox-module__thumbsAlignEnd___p4y9R",Na="LightBox-module__thumbItem___HvnF3",Va="LightBox-module__closeButton___g2khP",ja="LightBox-module__fadeIn___0m5GW",Oa="LightBox-module__slideInLeft___gPYwC",Fa="LightBox-module__slideInRight___S-pPp",Ba="LightBox-module__slideInTop___DFdAj",Ma="LightBox-module__slideInBottom___m27kZ",za="LightBox-module__fadeOut___55qBR",Da="LightBox-module__slideOutLeft___NvU7P",Wa="LightBox-module__slideOutRight___SK7eC",Pa="LightBox-module__slideOutTop___Vgg0z",Ha="LightBox-module__slideOutBottom___nJ0Ef",Ua="LightBox-module__scaleSlide___vZriG",B={hidden:sa,heroImage:ca,background:ua,editor:pa,contentStyle:da,imageStyle:ga,imgWrapper:fa,contain:ma,cover:ha,caption:ya,captionTextInner:va,lightboxSplide:ba,arrow:xa,arrowVertical:Sa,nextArrow:Ca,arrowInner:_a,arrowIcon:wa,arrowImg:$a,mirror:Ea,thumbsWrapper:Ta,thumbsContainerVertical:Aa,thumbsContainer:Ia,thumbsAlignStart:La,thumbsAlignCenter:ka,thumbsAlignEnd:Ra,thumbItem:Na,closeButton:Va,fadeIn:ja,slideInLeft:Oa,slideInRight:Fa,slideInTop:Ba,slideInBottom:Ma,fadeOut:za,slideOutLeft:Da,slideOutRight:Wa,slideOutTop:Pa,slideOutBottom:Ha,scaleSlide:Ua},At=(e,t,n)=>{const r={},[o,a]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),o==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${R.scalingValue(t.x,n)}), calc(-50% + ${R.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${R.scalingValue(t.x,n)}, calc(-50% + ${R.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${R.scalingValue(t.x,n)}), ${R.scalingValue(t.y,n)})`:r.transform=`translate(${R.scalingValue(t.x,n)}, ${R.scalingValue(t.y,n)})`,r};function Ur(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Jn(e){const t=e.getBoundingClientRect(),n=Ur(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,s=r/o,l=a/i;let p,c;l>s?(p=r,c=r/l):(c=o,p=o*l);const _=t.left+n.left,m=t.top+n.top,h=(r-p)/2+_,u=(o-c)/2+m;return{x:h,y:u,width:p,height:c}}function Zn(e){const t=e.getBoundingClientRect(),n=Ur(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qn(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ga(e,t){const n=(()=>{if(e==="fade in")return B.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return B.fadeIn;if(e==="slide in")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return B.fadeOut;if(e==="slide in")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})(),a=(()=>{if(e==="fade in")return B.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:a}}const Ya=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:a})=>{const[i,s]=W.useState(!1),{url:l}=e.thumbnailBlock.cover;return W.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),b.jsxs(b.Fragment,{children:[b.jsx("img",{src:l,alt:"Cover",className:B.heroImage,onClick:()=>s(!0)}),b.jsx(qa,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},qa=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:s})=>{var D;const[l,p]=W.useState(0),[c,_]=W.useState(0),[m,h]=W.useState(!1),[u,g]=W.useState(!1),[w,T]=W.useState({}),d=W.useRef(null),y=W.useRef(null),P=W.useRef(null),M=W.useRef(!1),$=W.useRef(null),v=W.useRef(null),I=W.useRef(null),V=W.useRef(null),z=W.useRef(!1),k=W.useRef(null),[j,O]=W.useState(!1),{appear:U,triggers:H,slider:f,thumbnail:N,controls:L,area:C,caption:x,layout:E}=o.lightboxBlock,{appearClass:q,backdropAppearClass:ie,backdropDisappearClass:re,disappearClass:me}=Ga(U.type,U.direction),A=(s==null?void 0:s.itemId)??null;W.useEffect(()=>{const S=()=>{setTimeout(()=>{var Y,X;(X=(Y=d.current)==null?void 0:Y.splide)==null||X.refresh()},16)},F=()=>{_(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",S),window.addEventListener("ArticleEditor.ComponentContent:change",F),()=>{window.removeEventListener("ArticleEditor.Layout:change",S),window.removeEventListener("ArticleEditor.ComponentContent:change",F)}},[]),W.useEffect(()=>{if(!e||!N.isActive){O(!1);return}const S=k.current;if(!S)return;const F=()=>{f.direction==="horiz"?O(S.scrollWidth>S.clientWidth):O(S.scrollHeight>S.clientHeight)};F();const Y=new ResizeObserver(F);return Y.observe(S),()=>Y.disconnect()},[e,N.isActive,n.length,w,f.direction]);const Z=W.useCallback(()=>{const S=window.matchMedia("(max-width: 768px)").matches,F=Qn(C.color);S&&!i&&F>.9&&(document.body.style.backgroundColor=""),h(!0),M.current=!0;const Y=X=>{X.target===$.current&&X.animationName&&($.current&&v.current&&$.current.removeEventListener("animationend",v.current),v.current=null,M.current&&(M.current=!1,t()),h(!1))};$.current&&(v.current=Y,$.current.addEventListener("animationend",Y))},[t,C.color,i]),pe=(S,F,Y)=>{var X,Q;if(S){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?Z():(X=d.current)==null||X.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const K=S.getBoundingClientRect(),J=F-K.left,ce=Y-K.top,ne=K.width,ae=K.height;let le;f.direction==="horiz"?le=J<ne/2?"-1":"+1":le=ce<ae/2?"-1":"+1",(Q=d.current)==null||Q.go(le)}}},oe=S=>{if(z.current){z.current=!1;return}const F=n[l],Y=(F==null?void 0:F.image.objectFit)==="cover";let X,Q;if("changedTouches"in S&&S.changedTouches.length>0)X=S.changedTouches[0].clientX,Q=S.changedTouches[0].clientY;else if("clientX"in S)X=S.clientX,Q=S.clientY;else return;let K;if(Y&&P.current){const J=Zn(P.current);K=X>=J.left&&X<=J.right&&Q>=J.top&&Q<=J.bottom}else{const J=P.current?Jn(P.current):null;if(!J){S.target===S.currentTarget&&Z();return}K=X>=J.x&&X<=J.x+J.width&&Q>=J.y&&Q<=J.y+J.height}K?pe(P.current,X,Q):Z()},de=S=>{const F=S.target;(F.classList.contains(B.thumbsWrapper)||F.classList.contains(B.thumbsContainer))&&oe(S)};W.useEffect(()=>{if(!e)return;const S=F=>{var Y,X;if(F.key==="Escape"){Z();return}if(F.key==="ArrowRight"){p(Q=>(Q+1)%Math.max(n.length,1)),(Y=d.current)==null||Y.go("+1");return}F.key==="ArrowLeft"&&(p(Q=>(Q-1+Math.max(n.length,1))%Math.max(n.length,1)),(X=d.current)==null||X.go("-1"))};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}},[e,Z,n.length]),W.useEffect(()=>{if(e){if(p(0),_(F=>F+1),M.current=!1,h(!1),g(!1),T({}),!A)return;const S=new CustomEvent("page-overlay",{detail:{itemId:A}});window.dispatchEvent(S)}return()=>{$.current&&v.current&&($.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,A]),W.useEffect(()=>{y.current!==null&&y.current!==f.type&&_(S=>S+1),y.current=f.type},[f.type]),W.useEffect(()=>{if(!e)return;const S=document.body.style.overflow,F=window.matchMedia("(max-width: 768px)").matches,Y=Qn(C.color);document.body.style.overflow="hidden",g(!1);const X=K=>{K.target===$.current&&!M.current&&K.animationName&&(F&&!i&&Y>.9&&(document.body.style.backgroundColor=C.color),g(!0),$.current&&I.current&&$.current.removeEventListener("animationend",I.current),I.current=null)};$.current&&(I.current=X,$.current.addEventListener("animationend",X));const Q=K=>{const J=K.target;J&&(J.closest(`.${B.thumbsWrapper}`)||J.closest(`.${B.thumbsContainer}`))||f.type!=="slide"&&K.preventDefault()};return document.addEventListener("touchmove",Q,{passive:!1}),()=>{document.body.style.overflow=S,document.removeEventListener("touchmove",Q),$.current&&I.current&&($.current.removeEventListener("animationend",I.current),I.current=null),g(!1)}},[e,i,C.color,f.type]),W.useEffect(()=>{if(!e)return;const S=F=>{var X,Q;if(M.current){F.stopPropagation();return}if(z.current){z.current=!1;return}const Y=F.target;if(!(Y&&(Y.closest(`.${B.thumbsContainer}`)||Y.closest(`.${B.thumbItem}`)))){if(f.type==="slide"&&H.type==="drag"&&((Q=(X=d.current)==null?void 0:X.splide)!=null&&Q.root)){const K=d.current.splide.root;if(Y&&(K.contains(Y)||K===Y))return}if(F.touches.length===0&&F.changedTouches.length>0){const K=n[l],J=(K==null?void 0:K.image.objectFit)==="cover",ce=F.changedTouches[0];let ne;if(J&&P.current){const ae=Zn(P.current);ne=ce.clientX>=ae.left&&ce.clientX<=ae.right&&ce.clientY>=ae.top&&ce.clientY<=ae.bottom}else{const ae=P.current?Jn(P.current):null;if(!ae)return;ne=ce.clientX>=ae.x&&ce.clientX<=ae.x+ae.width&&ce.clientY>=ae.y&&ce.clientY<=ae.y+ae.height}if(!ne){F.stopPropagation(),M.current=!0;const ae=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",ae,!0)};document.addEventListener("click",ae,!0),Z()}}}};return document.addEventListener("touchend",S,{passive:!0}),()=>{document.removeEventListener("touchend",S)}},[e,Z,l,n]);const _e=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&H.type==="drag";W.useEffect(()=>{var le,ve;if(!e||!_e||!((ve=(le=d.current)==null?void 0:le.splide)!=null&&ve.root))return;const S=d.current.splide.root,F=30,Y=(ee,ue)=>{if(V.current){const Le=Math.abs(ee-V.current.x),Et=Math.abs(ue-V.current.y);(Le>0||Et>0)&&(z.current=!0)}},X=ee=>{V.current&&(ee.preventDefault(),Y(ee.clientX,ee.clientY))},Q=ee=>{V.current&&ee.touches.length>0&&(ee.preventDefault(),Y(ee.touches[0].clientX,ee.touches[0].clientY))},K=(ee,ue)=>{if(!V.current||!d.current){V.current=null;return}const Le=Math.abs(ee-V.current.x),Et=Math.abs(ue-V.current.y);Et>F&&Et>Le&&d.current.go(ue<V.current.y?"+1":"-1"),V.current=null},J=ee=>{V.current&&K(ee.clientX,ee.clientY),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("pointermove",X)},ce=ee=>{if(V.current){if(ee.changedTouches.length>0){const ue=ee.changedTouches[0];K(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),document.removeEventListener("touchmove",Q)}},ne=ee=>{V.current={x:ee.clientX,y:ee.clientY},z.current=!1,document.addEventListener("pointermove",X,{passive:!1}),document.addEventListener("pointerup",J),document.addEventListener("pointercancel",J)},ae=ee=>{ee.touches.length>0&&(V.current={x:ee.touches[0].clientX,y:ee.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",Q,{passive:!1}),document.addEventListener("touchend",ce),document.addEventListener("touchcancel",ce))};return S.addEventListener("pointerdown",ne),S.addEventListener("touchstart",ae),()=>{S.removeEventListener("pointerdown",ne),S.removeEventListener("touchstart",ae),document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("touchmove",Q),document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),V.current=null,z.current=!1}},[e,_e,c]);const Fe={backgroundColor:C.color,backdropFilter:`blur(${C.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Gr.createPortal(b.jsxs(b.Fragment,{children:[b.jsx("div",{ref:i?null:$,className:ge(B.background,m?re:ie,{[B.editor]:i},{[B.hidden]:!e}),style:{...Fe,...u&&!i&&!m?{position:"absolute"}:{}}}),b.jsxs("div",{ref:i?$:null,className:ge(B.contentStyle,m?me:q,{[B.editor]:i},{[B.hidden]:!e}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[b.jsx(Wr,{onMove:S=>p(S.index),ref:d,className:B.lightboxSplide,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,direction:f.direction==="horiz"||f.type==="fade"||f.type==="scale"?"ltr":"ttb",pagination:!1,drag:H.type==="drag"&&!_e,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,F)=>{const Y=At(E.position,E.offset,i),X=`${R.scalingValue(E.padding.top,i)} ${R.scalingValue(E.padding.right,i)} ${R.scalingValue(E.padding.bottom,i)} ${R.scalingValue(E.padding.left,i)}`,Q=f.type==="scale"?(()=>{const{transform:K,...J}=Y;return{...J,position:"absolute",padding:X,boxSizing:"border-box","--position-transform":K||"none"}})():{...Y,position:"absolute",padding:X,boxSizing:"border-box"};return b.jsx(Pr,{children:b.jsx("div",{className:B.imgWrapper,onClick:oe,children:b.jsx("img",{ref:F===l?P:null,className:ge(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:{...Q,pointerEvents:S.image.objectFit==="contain"?"none":"auto"}})})},F)})},c),L.isActive&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ge(B.arrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:b.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${R.scalingValue(L.offset.x,i)}, ${R.scalingValue(L.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${L.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var S;return(S=d.current)==null?void 0:S.go("-1")},"aria-label":"Previous",children:[L.arrowsImgUrl&&b.jsx(ut,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:ge(B.arrowImg,B.mirror)}),!L.arrowsImgUrl&&b.jsx(er,{color:L.color,className:ge(B.arrowIcon,B.arrowImg,B.mirror)})]})}),b.jsx("div",{className:ge(B.arrow,B.nextArrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:b.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${R.scalingValue(L.offset.x*(f.direction==="horiz"?-1:1),i)}, ${R.scalingValue(L.offset.y,i)}) scale(${L.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var S;return(S=d.current)==null?void 0:S.go("+1")},"aria-label":"Next",children:[L.arrowsImgUrl&&b.jsx(ut,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:B.arrowImg}),!L.arrowsImgUrl&&b.jsx(er,{color:L.color,className:ge(B.arrowIcon,B.arrowImg)})]})})]}),C.closeIconUrl&&(()=>{const S=At(C.closeIconAlign,C.closeIconOffset,i),F=`scale(${C.closeIconScale})`,Y=S.transform?`${S.transform} ${F}`:F;return b.jsx("button",{className:B.closeButton,style:{...S,transform:Y},onClick:Z,"aria-label":"Close lightbox",children:b.jsx(ut,{url:C.closeIconUrl,fill:C.closeIconColor??"#000000",hoverFill:C.closeIconHover??"#cccccc"})})})(),x&&x.isActive&&r.imageCaption&&((D=n[l])==null?void 0:D.imageCaption)&&(()=>{const{widthSettings:S,fontSettings:F,letterSpacing:Y,textAlign:X,wordSpacing:Q,fontSizeLineHeight:K,textAppearance:J,color:ce}=r.imageCaption;return b.jsx("div",{className:B.caption,style:{...At(x.alignment,x.offset,i),fontFamily:F.fontFamily,fontWeight:F.fontWeight,fontStyle:F.fontStyle,width:S.sizing==="auto"?"max-content":R.scalingValue(S.width,i),letterSpacing:R.scalingValue(Y,i),wordSpacing:R.scalingValue(Q,i),textAlign:X,fontSize:R.scalingValue(K.fontSize,i),lineHeight:R.scalingValue(K.lineHeight,i),textTransform:J.textTransform??"none",textDecoration:J.textDecoration??"none",fontVariant:J.fontVariant??"normal",color:ce},onClick:ne=>ne.stopPropagation(),children:b.jsx("div",{"data-styles":"imageCaption",className:B.captionTextInner,style:{"--link-color":x.linkColor,"--link-hover-color":x.linkHoverColor},children:b.jsx(Hr,{content:n[l].imageCaption})})})})(),N.isActive&&(()=>{const[S,F]=N.position.split("-"),Y=f.direction==="horiz"?`${S}-left`:N.position,X=At(Y,N.offset,i),Q=()=>{if(f.direction==="horiz"){if(F==="left")return"flex-start";if(F==="center")return"center";if(F==="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 b.jsx("div",{ref:k,className:B.thumbsWrapper,onClick:K=>de(K),style:{position:i?"absolute":"fixed",...X,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:b.jsx("div",{className:ge(B.thumbsContainer,{[B.thumbsContainerVertical]:f.direction==="vert",[B.thumbsAlignStart]:N.align==="start",[B.thumbsAlignCenter]:N.align==="center",[B.thumbsAlignEnd]:N.align==="end"}),style:{gap:R.scalingValue(N.grid.gap,i),justifyContent:j?"flex-start":Q()},children:n.map((K,J)=>{const ce=J===l,ne=w[J],le=N.grid.size*(ce?N.activeState.scale:1),ve=()=>{if(N.fit!=="fit")return{};if(!ne)return f.direction==="horiz"?{height:R.scalingValue(le,i)}:{width:R.scalingValue(le,i)};const ee=ne.width/ne.height;if(f.direction==="horiz"){const ue=le,Le=ue*ee;return{width:R.scalingValue(Le,i),height:R.scalingValue(ue,i)}}else{const ue=le,Le=ue/ee;return{width:R.scalingValue(ue,i),height:R.scalingValue(Le,i)}}};return b.jsx("button",{className:B.thumbItem,style:{...f.direction==="horiz"&&N.fit!=="fit"?{height:R.scalingValue(le,i)}:{},...f.direction==="vert"&&N.fit!=="fit"?{width:R.scalingValue(le,i)}:{},...N.fit==="cover"?{width:R.scalingValue(le,i),height:R.scalingValue(le,i)}:{},...ve(),transition:ce?"all 0.25s ease-out":"none",opacity:ce?N.activeState.opacity/100:N.opacity/100,"--thumb-hover":N.activeState.opacity/100},onClick:ee=>{var ue;ee.stopPropagation(),p(J),(ue=d.current)==null||ue.go(J)},onMouseEnter:()=>{var ee;N.triggers==="hov"&&((ee=d.current)==null||ee.go(J))},children:b.jsx("img",{src:K.image.url,alt:K.image.name??"",onLoad:ee=>{const ue=ee.currentTarget;ue.naturalWidth&&ue.naturalHeight&&T(Le=>({...Le,[J]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:N.fit==="cover"?"cover":"contain",...N.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...N.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${K.image.name}-${J}`)})})})})()]})]}),document.getElementById(a)):null};function er({color:e,className:t}){return b.jsx("svg",{viewBox:"0 0 10 18",className:t,children:b.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:b.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Xa={element:Ya,id:"lightbox",name:"Lightbox",preview:{type:"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 Ke(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ka(e){return`
6
+ */const Yi="RichTextRenderer-module__link___BWeZ2",qi={link:Yi},Hr=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?C.jsx("a",{className:qi.link,href:r.value,target:r.target,children:t(r.children)},o):C.jsx("span",{style:Xi(r),children:r.text},o));return C.jsx(C.Fragment,{children:e.map((n,r)=>{const o=n.children;return C.jsx("div",{children:t(o)},r)})})};function Xi(e){return{...e.fontFamily&&{fontFamily:e.fontFamily},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const Ki="SvgImage-module__svg___q3xE-",Ji="SvgImage-module__img___VsTm-",qn={svg:Ki,img:Ji},ut=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r=""})=>{const[o,a]=W.useState(!0);return W.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?C.jsx("img",{src:e,alt:"",className:ge(qn.img,r)}):C.jsx("span",{"data-supports-mask":o,className:ge(qn.svg,r),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},Zi={"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 Qi({settings:e,content:t,styles:n,isEditor:r}){const[o,a]=W.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:p,wordSpacing:c,fontSizeLineHeight:_,textAppearance:m,color:y}=n.imageCaption,[u,g]=W.useState(void 0),[w,T]=W.useState(null),[d,h]=W.useState(0),[P,M]=W.useState(0),{direction:$,transition:v,controls:I,pagination:V,imageCaption:z,triggers:k}=e,O=W.useRef(v.type),{x:j,y:U}=e.controls.offset,H=f=>{o&&o.go(f)};return W.useEffect(()=>{if(!w)return;const f=new ResizeObserver(N=>{if(!o)return;const[L]=N;g({width:Math.round(L.contentRect.width),height:Math.round(L.contentRect.height)})});return f.observe(w),()=>f.unobserve(w)},[w]),W.useEffect(()=>{!o||O.current===v.type||(M(f=>f+1),O.current=v.type)},[v.type]),C.jsx("div",{className:ge(G.wrapper,{[G.editor]:r}),ref:T,children:C.jsxs("div",{className:G.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&C.jsx("div",{className:ge(G.captionBlock),children:C.jsx("div",{className:G.captionTextWrapper,children:t.map((f,N)=>C.jsx("div",{className:ge(G.captionText,Zi[z.alignment],{[G.withPointerEvents]:N===d&&r,[G.active]:N===d}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":R.scalingValue(i.width,r),letterSpacing:R.scalingValue(l,r),wordSpacing:R.scalingValue(c,r),textAlign:p,fontSize:R.scalingValue(_.fontSize,r),lineHeight:R.scalingValue(_.lineHeight,r),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:y,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:C.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-hover-color":z.linkHoverColor,"--link-color":z.linkColor,position:"relative",top:R.scalingValue(z.offset.y,r),left:R.scalingValue(z.offset.x,r)},children:C.jsx(Hr,{content:f.imageCaption})})},N))})}),C.jsx(Wr,{onMove:f=>{h(f.index)},ref:a,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:k.autoPlay!==null,...k.autoPlay!==null&&{interval:parseInt(k.autoPlay)*1e3},direction:$==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:k.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,N)=>C.jsx(Pr,{children:C.jsx("div",{className:G.sliderItem,children:C.jsx("div",{className:G.imgWrapper,children:C.jsx("img",{className:ge(G.sliderImage,{[G.contain]:f.image.objectFit==="contain",[G.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},N))},P),I.isActive&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:ge(G.arrow,{[G.arrowVertical]:$==="vert",[G.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:C.jsxs("button",{onClick:()=>{H("-1")},className:G.arrowInner,style:{transform:`translate(${R.scalingValue(j,r)}, ${R.scalingValue(U*($==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${$==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&C.jsx(ut,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ge(G.arrowImg,G.mirror)}),!I.arrowsImgUrl&&C.jsx(Xn,{color:I.color,className:ge(G.arrowIcon,G.arrowImg,G.mirror)})]})}),C.jsx("div",{className:ge(G.arrow,G.nextArrow,{[G.arrowVertical]:$==="vert",[G.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:C.jsxs("button",{className:G.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${R.scalingValue(j*($==="horiz"?-1:1),r)}, ${R.scalingValue(U,r)}) scale(${e.controls.scale/100}) rotate(${$==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&C.jsx(ut,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:G.arrowImg}),!I.arrowsImgUrl&&C.jsx(Xn,{color:I.color,className:ge(G.arrowIcon,G.arrowImg)})]})})]}),k.triggersList.click&&C.jsx("div",{className:G.clickOverlay,onClick:()=>{o&&o.go("+1")}}),V.isActive&&C.jsx("div",{className:ge(G.pagination,{[G.paginationInsideBottom]:V.position==="inside-1"&&$==="horiz",[G.paginationInsideTop]:V.position==="inside-2"&&$==="horiz",[G.paginationOutsideBottom]:V.position==="outside-1"&&$==="horiz",[G.paginationOutsideTop]:V.position==="outside-2"&&$==="horiz",[G.paginationInsideLeft]:V.position==="inside-1"&&$==="vert",[G.paginationInsideRight]:V.position==="inside-2"&&$==="vert",[G.paginationOutsideLeft]:V.position==="outside-1"&&$==="vert",[G.paginationOutsideRight]:V.position==="outside-2"&&$==="vert",[G.paginationVertical]:$==="vert"}),children:C.jsx("div",{className:G.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${R.scalingValue(V.offset.x,r)}, ${R.scalingValue(V.offset.y,r)}) rotate(${$==="horiz"?"0deg":"90deg"})`},children:t.map((f,N)=>C.jsx("button",{onClick:()=>{o&&o.go(N)},className:ge(G.paginationItem),children:C.jsx("div",{className:ge(G.dot,{[G.activeDot]:N===d}),style:{backgroundColor:N===d?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},N))})})]})})}function Xn({color:e,className:t}){return C.jsx("svg",{viewBox:"0 0 10 18",className:t,children:C.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:C.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const ea={element:Qi,id:"control-slider",name:"Slider",preview:{type:"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"]}},ta="ImageRevealSlider-module__imageRevealSlider___UE5Ob",na="ImageRevealSlider-module__image___Qjt-e",ra="ImageRevealSlider-module__link___N-iLG",oa="ImageRevealSlider-module__cursor___2U03d",Xe={imageRevealSlider:ta,image:na,link:ra,cursor:oa};function Kn(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const a=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*a,s=a/2,l=i/2;if(e>=r.x-s&&e<=r.x+s&&t>=r.y-l&&t<=r.y+l)return!0}return!1}function en(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ia(e,t,n,r){let o,a;if(t==="custom"){o=n;const i=await en(e);a=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await en(e);a=i.height/i.width*o}else{const i=await en(e);o=i.width,a=i.height}return{width:o,height:a,finalWidth:`${o}px`}}function aa({settings:e,content:t,isEditor:n}){const[r,o]=W.useState(null),[a,i]=W.useState([]),[s,l]=W.useState(0),p=W.useRef(0),[c,_]=W.useState({x:0,y:0}),[m,y]=W.useState(1),[u,g]=W.useState("none"),w=W.useRef({x:0,y:0}),[T,d]=W.useState(!1),{sizeType:h,imageWidth:P,randomRangeImageWidth:M}=e.imageSize,{revealPosition:$,visible:v}=e.position,{cursorType:I,target:V,defaultCursorScale:z,defaultCursor:k,hoverCursorScale:O,hoverCursor:j}=e.cursor;W.useEffect(()=>{if(!r)return;const f=(S,b)=>{const E=r.getBoundingClientRect(),q=S-E.left,ie=b-E.top;if(_({x:q,y:ie}),I==="system"){g("none"),y(1);return}const re=q,me=ie,A=document.elementFromPoint(E.left+re,E.top+me);if(A&&A.closest("a")){g("none"),y(1);return}const Z=Kn(re,me,a)||V==="area"?{img:j??"none",scale:O}:{img:k??"none",scale:z};g(Z.img),y(Z.scale)},N=S=>{S.stopPropagation(),w.current={x:S.clientX,y:S.clientY},f(S.clientX,S.clientY)},L=()=>{T&&f(w.current.x,w.current.y)};return r.addEventListener("mousemove",N),window.addEventListener("scroll",L,!0),()=>{r.removeEventListener("mousemove",N),window.removeEventListener("scroll",L,!0)}},[r,T,c,I,V,j,k,O,z,a]),W.useEffect(()=>{T||(g("none"),y(0))},[T]);const U=async(f,N,L,S={})=>{const{width:b,height:E,finalWidth:q}=await ia(f.image.url,h,P,M);let ie=0,re=0;$==="same"?(ie=N/2,re=L/2):(ie=S.x??Math.random()*N,re=S.y??Math.random()*L);const me=Math.min(Math.max(ie,b/2),N-b/2),A=Math.min(Math.max(re,E/2),L-E/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:me,y:A,width:q}};W.useEffect(()=>{if(!r||t.length===0)return;const f=r.getBoundingClientRect(),N=f.width,L=f.height,S=[];(async()=>{const E=t[0],q=await U(E,N,L);S.push(q),i(S),l(1)})()},[h,P,M,$,r]),W.useEffect(()=>{v==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[v]);const H=async f=>{if(!r)return;const N=r.getBoundingClientRect(),L=f.clientX-N.left,S=f.clientY-N.top;if(V==="image"&&!Kn(L,S,a))return;let b=0,E=0;$==="on Click"?(b=L,E=S):$==="same"?(b=N.width/2,E=N.height/2):(b=Math.random()*N.width,E=Math.random()*N.height);const q=t[s],ie=await U(q,N.width,N.height,{x:b,y:E});i(re=>v==="all"?[...re,ie]:[ie]),l(re=>re>=t.length-1?0:re+1)};return C.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:Xe.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[a.map(f=>C.jsx("div",{className:Xe.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:V==="area"&&f.link?C.jsx("a",{href:f.link,target:"_blank",className:Xe.link,children:C.jsx("img",{src:f.url,alt:f.name,className:Xe.image},f.id)}):C.jsx("img",{src:f.url,alt:f.name,className:Xe.image},f.id)},f.id)),T&&C.jsx("div",{className:Xe.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const la={element:aa,id:"control-image-reveal",name:"Click Gallery",preview:{type:"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:""}]}}}},sa="LightBox-module__hidden___9s-9x",ca="LightBox-module__heroImage___sTxNF",ua="LightBox-module__background___rm9ml",pa="LightBox-module__editor___4ACaY",da="LightBox-module__contentStyle___Bgnsq",ga="LightBox-module__imageStyle___tLIlB",fa="LightBox-module__imgWrapper___LuFUp",ma="LightBox-module__contain___8-yaS",ya="LightBox-module__cover___hNvOG",va="LightBox-module__caption___b6L2I",ha="LightBox-module__captionTextInner___rCGNH",ba="LightBox-module__lightboxSplide___XFuWC",xa="LightBox-module__arrow___iz38X",Ca="LightBox-module__arrowVertical___Zfz81",Sa="LightBox-module__nextArrow___zkAQN",_a="LightBox-module__arrowInner___p48sW",wa="LightBox-module__arrowIcon___3VaFf",$a="LightBox-module__arrowImg___pNV88",Ea="LightBox-module__mirror___pjeXc",Ta="LightBox-module__thumbsWrapper___GB-nU",Aa="LightBox-module__thumbsContainerVertical___wttk5",Ia="LightBox-module__thumbsContainer___osSma",La="LightBox-module__thumbsAlignStart___MO6tY",ka="LightBox-module__thumbsAlignCenter___Q4sUx",Ra="LightBox-module__thumbsAlignEnd___p4y9R",Na="LightBox-module__thumbItem___HvnF3",Va="LightBox-module__closeButton___g2khP",Oa="LightBox-module__fadeIn___0m5GW",ja="LightBox-module__slideInLeft___gPYwC",Ba="LightBox-module__slideInRight___S-pPp",Fa="LightBox-module__slideInTop___DFdAj",Ma="LightBox-module__slideInBottom___m27kZ",za="LightBox-module__fadeOut___55qBR",Da="LightBox-module__slideOutLeft___NvU7P",Wa="LightBox-module__slideOutRight___SK7eC",Pa="LightBox-module__slideOutTop___Vgg0z",Ha="LightBox-module__slideOutBottom___nJ0Ef",Ua="LightBox-module__scaleSlide___vZriG",F={hidden:sa,heroImage:ca,background:ua,editor:pa,contentStyle:da,imageStyle:ga,imgWrapper:fa,contain:ma,cover:ya,caption:va,captionTextInner:ha,lightboxSplide:ba,arrow:xa,arrowVertical:Ca,nextArrow:Sa,arrowInner:_a,arrowIcon:wa,arrowImg:$a,mirror:Ea,thumbsWrapper:Ta,thumbsContainerVertical:Aa,thumbsContainer:Ia,thumbsAlignStart:La,thumbsAlignCenter:ka,thumbsAlignEnd:Ra,thumbItem:Na,closeButton:Va,fadeIn:Oa,slideInLeft:ja,slideInRight:Ba,slideInTop:Fa,slideInBottom:Ma,fadeOut:za,slideOutLeft:Da,slideOutRight:Wa,slideOutTop:Pa,slideOutBottom:Ha,scaleSlide:Ua},At=(e,t,n)=>{const r={},[o,a]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),o==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${R.scalingValue(t.x,n)}), calc(-50% + ${R.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${R.scalingValue(t.x,n)}, calc(-50% + ${R.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${R.scalingValue(t.x,n)}), ${R.scalingValue(t.y,n)})`:r.transform=`translate(${R.scalingValue(t.x,n)}, ${R.scalingValue(t.y,n)})`,r};function Ur(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Jn(e){const t=e.getBoundingClientRect(),n=Ur(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,s=r/o,l=a/i;let p,c;l>s?(p=r,c=r/l):(c=o,p=o*l);const _=t.left+n.left,m=t.top+n.top,y=(r-p)/2+_,u=(o-c)/2+m;return{x:y,y:u,width:p,height:c}}function Zn(e){const t=e.getBoundingClientRect(),n=Ur(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qn(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ga(e,t){const n=(()=>{if(e==="fade in")return F.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return F.slideInLeft;case"right":return F.slideInRight;case"top":return F.slideInTop;case"bottom":return F.slideInBottom;default:return F.slideInRight}return F.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return F.fadeIn;if(e==="slide in")switch(t){case"left":return F.slideInLeft;case"right":return F.slideInRight;case"top":return F.slideInTop;case"bottom":return F.slideInBottom;default:return F.slideInRight}return F.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return F.fadeOut;if(e==="slide in")switch(t){case"left":return F.slideOutLeft;case"right":return F.slideOutRight;case"top":return F.slideOutTop;case"bottom":return F.slideOutBottom;default:return F.slideOutRight}return F.fadeOut})(),a=(()=>{if(e==="fade in")return F.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return F.slideOutLeft;case"right":return F.slideOutRight;case"top":return F.slideOutTop;case"bottom":return F.slideOutBottom;default:return F.slideOutRight}return F.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:a}}const Ya=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:a})=>{const[i,s]=W.useState(!1),{url:l}=e.thumbnailBlock.cover;return W.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),C.jsxs(C.Fragment,{children:[C.jsx("img",{src:l,alt:"Cover",className:F.heroImage,onClick:()=>s(!0)}),C.jsx(qa,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},qa=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:s})=>{var D;const[l,p]=W.useState(0),[c,_]=W.useState(0),[m,y]=W.useState(!1),[u,g]=W.useState(!1),[w,T]=W.useState({}),d=W.useRef(null),h=W.useRef(null),P=W.useRef(null),M=W.useRef(!1),$=W.useRef(null),v=W.useRef(null),I=W.useRef(null),V=W.useRef(null),z=W.useRef(!1),k=W.useRef(null),[O,j]=W.useState(!1),{appear:U,triggers:H,slider:f,thumbnail:N,controls:L,area:S,caption:b,layout:E}=o.lightboxBlock,{appearClass:q,backdropAppearClass:ie,backdropDisappearClass:re,disappearClass:me}=Ga(U.type,U.direction),A=(s==null?void 0:s.itemId)??null;W.useEffect(()=>{const x=()=>{setTimeout(()=>{var Y,X;(X=(Y=d.current)==null?void 0:Y.splide)==null||X.refresh()},16)},B=()=>{_(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",x),window.addEventListener("ArticleEditor.ComponentContent:change",B),()=>{window.removeEventListener("ArticleEditor.Layout:change",x),window.removeEventListener("ArticleEditor.ComponentContent:change",B)}},[]),W.useEffect(()=>{if(!e||!N.isActive){j(!1);return}const x=k.current;if(!x)return;const B=()=>{f.direction==="horiz"?j(x.scrollWidth>x.clientWidth):j(x.scrollHeight>x.clientHeight)};B();const Y=new ResizeObserver(B);return Y.observe(x),()=>Y.disconnect()},[e,N.isActive,n.length,w,f.direction]);const Z=W.useCallback(()=>{const x=window.matchMedia("(max-width: 768px)").matches,B=Qn(S.color);x&&!i&&B>.9&&(document.body.style.backgroundColor=""),y(!0),M.current=!0;const Y=X=>{X.target===$.current&&X.animationName&&($.current&&v.current&&$.current.removeEventListener("animationend",v.current),v.current=null,M.current&&(M.current=!1,t()),y(!1))};$.current&&(v.current=Y,$.current.addEventListener("animationend",Y))},[t,S.color,i]),pe=(x,B,Y)=>{var X,Q;if(x){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?Z():(X=d.current)==null||X.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const K=x.getBoundingClientRect(),J=B-K.left,ce=Y-K.top,ne=K.width,ae=K.height;let le;f.direction==="horiz"?le=J<ne/2?"-1":"+1":le=ce<ae/2?"-1":"+1",(Q=d.current)==null||Q.go(le)}}},oe=x=>{if(z.current){z.current=!1;return}const B=n[l],Y=(B==null?void 0:B.image.objectFit)==="cover";let X,Q;if("changedTouches"in x&&x.changedTouches.length>0)X=x.changedTouches[0].clientX,Q=x.changedTouches[0].clientY;else if("clientX"in x)X=x.clientX,Q=x.clientY;else return;let K;if(Y&&P.current){const J=Zn(P.current);K=X>=J.left&&X<=J.right&&Q>=J.top&&Q<=J.bottom}else{const J=P.current?Jn(P.current):null;if(!J){x.target===x.currentTarget&&Z();return}K=X>=J.x&&X<=J.x+J.width&&Q>=J.y&&Q<=J.y+J.height}K?pe(P.current,X,Q):Z()},de=x=>{const B=x.target;(B.classList.contains(F.thumbsWrapper)||B.classList.contains(F.thumbsContainer))&&oe(x)};W.useEffect(()=>{if(!e)return;const x=B=>{var Y,X;if(B.key==="Escape"){Z();return}if(B.key==="ArrowRight"){p(Q=>(Q+1)%Math.max(n.length,1)),(Y=d.current)==null||Y.go("+1");return}B.key==="ArrowLeft"&&(p(Q=>(Q-1+Math.max(n.length,1))%Math.max(n.length,1)),(X=d.current)==null||X.go("-1"))};return window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x)}},[e,Z,n.length]),W.useEffect(()=>{if(e){if(p(0),_(B=>B+1),M.current=!1,y(!1),g(!1),T({}),!A)return;const x=new CustomEvent("page-overlay",{detail:{itemId:A}});window.dispatchEvent(x)}return()=>{$.current&&v.current&&($.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,A]),W.useEffect(()=>{h.current!==null&&h.current!==f.type&&_(x=>x+1),h.current=f.type},[f.type]),W.useEffect(()=>{if(!e)return;const x=document.body.style.overflow,B=window.matchMedia("(max-width: 768px)").matches,Y=Qn(S.color);document.body.style.overflow="hidden",g(!1);const X=K=>{K.target===$.current&&!M.current&&K.animationName&&(B&&!i&&Y>.9&&(document.body.style.backgroundColor=S.color),g(!0),$.current&&I.current&&$.current.removeEventListener("animationend",I.current),I.current=null)};$.current&&(I.current=X,$.current.addEventListener("animationend",X));const Q=K=>{const J=K.target;J&&(J.closest(`.${F.thumbsWrapper}`)||J.closest(`.${F.thumbsContainer}`))||f.type!=="slide"&&K.preventDefault()};return document.addEventListener("touchmove",Q,{passive:!1}),()=>{document.body.style.overflow=x,document.removeEventListener("touchmove",Q),$.current&&I.current&&($.current.removeEventListener("animationend",I.current),I.current=null),g(!1)}},[e,i,S.color,f.type]),W.useEffect(()=>{if(!e)return;const x=B=>{var X,Q;if(M.current){B.stopPropagation();return}if(z.current){z.current=!1;return}const Y=B.target;if(!(Y&&(Y.closest(`.${F.thumbsContainer}`)||Y.closest(`.${F.thumbItem}`)))){if(f.type==="slide"&&H.type==="drag"&&((Q=(X=d.current)==null?void 0:X.splide)!=null&&Q.root)){const K=d.current.splide.root;if(Y&&(K.contains(Y)||K===Y))return}if(B.touches.length===0&&B.changedTouches.length>0){const K=n[l],J=(K==null?void 0:K.image.objectFit)==="cover",ce=B.changedTouches[0];let ne;if(J&&P.current){const ae=Zn(P.current);ne=ce.clientX>=ae.left&&ce.clientX<=ae.right&&ce.clientY>=ae.top&&ce.clientY<=ae.bottom}else{const ae=P.current?Jn(P.current):null;if(!ae)return;ne=ce.clientX>=ae.x&&ce.clientX<=ae.x+ae.width&&ce.clientY>=ae.y&&ce.clientY<=ae.y+ae.height}if(!ne){B.stopPropagation(),M.current=!0;const ae=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",ae,!0)};document.addEventListener("click",ae,!0),Z()}}}};return document.addEventListener("touchend",x,{passive:!0}),()=>{document.removeEventListener("touchend",x)}},[e,Z,l,n]);const _e=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&H.type==="drag";W.useEffect(()=>{var le,he;if(!e||!_e||!((he=(le=d.current)==null?void 0:le.splide)!=null&&he.root))return;const x=d.current.splide.root,B=30,Y=(ee,ue)=>{if(V.current){const Le=Math.abs(ee-V.current.x),Et=Math.abs(ue-V.current.y);(Le>0||Et>0)&&(z.current=!0)}},X=ee=>{V.current&&(ee.preventDefault(),Y(ee.clientX,ee.clientY))},Q=ee=>{V.current&&ee.touches.length>0&&(ee.preventDefault(),Y(ee.touches[0].clientX,ee.touches[0].clientY))},K=(ee,ue)=>{if(!V.current||!d.current){V.current=null;return}const Le=Math.abs(ee-V.current.x),Et=Math.abs(ue-V.current.y);Et>B&&Et>Le&&d.current.go(ue<V.current.y?"+1":"-1"),V.current=null},J=ee=>{V.current&&K(ee.clientX,ee.clientY),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("pointermove",X)},ce=ee=>{if(V.current){if(ee.changedTouches.length>0){const ue=ee.changedTouches[0];K(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),document.removeEventListener("touchmove",Q)}},ne=ee=>{V.current={x:ee.clientX,y:ee.clientY},z.current=!1,document.addEventListener("pointermove",X,{passive:!1}),document.addEventListener("pointerup",J),document.addEventListener("pointercancel",J)},ae=ee=>{ee.touches.length>0&&(V.current={x:ee.touches[0].clientX,y:ee.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",Q,{passive:!1}),document.addEventListener("touchend",ce),document.addEventListener("touchcancel",ce))};return x.addEventListener("pointerdown",ne),x.addEventListener("touchstart",ae),()=>{x.removeEventListener("pointerdown",ne),x.removeEventListener("touchstart",ae),document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("touchmove",Q),document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),V.current=null,z.current=!1}},[e,_e,c]);const Be={backgroundColor:S.color,backdropFilter:`blur(${S.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Gr.createPortal(C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:i?null:$,className:ge(F.background,m?re:ie,{[F.editor]:i},{[F.hidden]:!e}),style:{...Be,...u&&!i&&!m?{position:"absolute"}:{}}}),C.jsxs("div",{ref:i?$:null,className:ge(F.contentStyle,m?me:q,{[F.editor]:i},{[F.hidden]:!e}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[C.jsx(Wr,{onMove:x=>p(x.index),ref:d,className:F.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"&&!_e,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:H.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((x,B)=>{const Y=At(E.position,E.offset,i),X=`${R.scalingValue(E.padding.top,i)} ${R.scalingValue(E.padding.right,i)} ${R.scalingValue(E.padding.bottom,i)} ${R.scalingValue(E.padding.left,i)}`,Q=f.type==="scale"?(()=>{const{transform:K,...J}=Y;return{...J,position:"absolute",padding:X,boxSizing:"border-box","--position-transform":K||"none"}})():{...Y,position:"absolute",padding:X,boxSizing:"border-box"};return C.jsx(Pr,{children:C.jsx("div",{className:F.imgWrapper,onClick:oe,children:C.jsx("img",{ref:B===l?P:null,className:ge(F.imageStyle,{[F.contain]:x.image.objectFit==="contain",[F.cover]:x.image.objectFit==="cover",[F.scaleSlide]:f.type==="scale"}),src:x.image.url,alt:x.image.name??"",style:{...Q,pointerEvents:x.image.objectFit==="contain"?"none":"auto"}})})},B)})},c),L.isActive&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:ge(F.arrow,{[F.arrowVertical]:f.direction==="vert"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:C.jsxs("button",{className:F.arrowInner,style:{transform:`translate(${R.scalingValue(L.offset.x,i)}, ${R.scalingValue(L.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${L.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=d.current)==null?void 0:x.go("-1")},"aria-label":"Previous",children:[L.arrowsImgUrl&&C.jsx(ut,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:ge(F.arrowImg,F.mirror)}),!L.arrowsImgUrl&&C.jsx(er,{color:L.color,className:ge(F.arrowIcon,F.arrowImg,F.mirror)})]})}),C.jsx("div",{className:ge(F.arrow,F.nextArrow,{[F.arrowVertical]:f.direction==="vert"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:C.jsxs("button",{className:F.arrowInner,style:{transform:`translate(${R.scalingValue(L.offset.x*(f.direction==="horiz"?-1:1),i)}, ${R.scalingValue(L.offset.y,i)}) scale(${L.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=d.current)==null?void 0:x.go("+1")},"aria-label":"Next",children:[L.arrowsImgUrl&&C.jsx(ut,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:F.arrowImg}),!L.arrowsImgUrl&&C.jsx(er,{color:L.color,className:ge(F.arrowIcon,F.arrowImg)})]})})]}),S.closeIconUrl&&(()=>{const x=At(S.closeIconAlign,S.closeIconOffset,i),B=`scale(${S.closeIconScale})`,Y=x.transform?`${x.transform} ${B}`:B;return C.jsx("button",{className:F.closeButton,style:{...x,transform:Y},onClick:Z,"aria-label":"Close lightbox",children:C.jsx(ut,{url:S.closeIconUrl,fill:S.closeIconColor??"#000000",hoverFill:S.closeIconHover??"#cccccc"})})})(),b&&b.isActive&&r.imageCaption&&((D=n[l])==null?void 0:D.imageCaption)&&(()=>{const{widthSettings:x,fontSettings:B,letterSpacing:Y,textAlign:X,wordSpacing:Q,fontSizeLineHeight:K,textAppearance:J,color:ce}=r.imageCaption;return C.jsx("div",{className:F.caption,style:{...At(b.alignment,b.offset,i),fontFamily:B.fontFamily,fontWeight:B.fontWeight,fontStyle:B.fontStyle,width:x.sizing==="auto"?"max-content":R.scalingValue(x.width,i),letterSpacing:R.scalingValue(Y,i),wordSpacing:R.scalingValue(Q,i),textAlign:X,fontSize:R.scalingValue(K.fontSize,i),lineHeight:R.scalingValue(K.lineHeight,i),textTransform:J.textTransform??"none",textDecoration:J.textDecoration??"none",fontVariant:J.fontVariant??"normal",color:ce},onClick:ne=>ne.stopPropagation(),children:C.jsx("div",{"data-styles":"imageCaption",className:F.captionTextInner,style:{"--link-color":b.linkColor,"--link-hover-color":b.linkHoverColor},children:C.jsx(Hr,{content:n[l].imageCaption})})})})(),N.isActive&&(()=>{const[x,B]=N.position.split("-"),Y=f.direction==="horiz"?`${x}-left`:N.position,X=At(Y,N.offset,i),Q=()=>{if(f.direction==="horiz"){if(B==="left")return"flex-start";if(B==="center")return"center";if(B==="right")return"flex-end"}else{if(x==="top")return"flex-start";if(x==="middle")return"center";if(x==="bottom")return"flex-end"}return"flex-start"};return C.jsx("div",{ref:k,className:F.thumbsWrapper,onClick:K=>de(K),style:{position:i?"absolute":"fixed",...X,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:C.jsx("div",{className:ge(F.thumbsContainer,{[F.thumbsContainerVertical]:f.direction==="vert",[F.thumbsAlignStart]:N.align==="start",[F.thumbsAlignCenter]:N.align==="center",[F.thumbsAlignEnd]:N.align==="end"}),style:{gap:R.scalingValue(N.grid.gap,i),justifyContent:O?"flex-start":Q()},children:n.map((K,J)=>{const ce=J===l,ne=w[J],le=N.grid.size*(ce?N.activeState.scale:1),he=()=>{if(N.fit!=="fit")return{};if(!ne)return f.direction==="horiz"?{height:R.scalingValue(le,i)}:{width:R.scalingValue(le,i)};const ee=ne.width/ne.height;if(f.direction==="horiz"){const ue=le,Le=ue*ee;return{width:R.scalingValue(Le,i),height:R.scalingValue(ue,i)}}else{const ue=le,Le=ue/ee;return{width:R.scalingValue(ue,i),height:R.scalingValue(Le,i)}}};return C.jsx("button",{className:F.thumbItem,style:{...f.direction==="horiz"&&N.fit!=="fit"?{height:R.scalingValue(le,i)}:{},...f.direction==="vert"&&N.fit!=="fit"?{width:R.scalingValue(le,i)}:{},...N.fit==="cover"?{width:R.scalingValue(le,i),height:R.scalingValue(le,i)}:{},...he(),transition:ce?"all 0.25s ease-out":"none",opacity:ce?N.activeState.opacity/100:N.opacity/100,"--thumb-hover":N.activeState.opacity/100},onClick:ee=>{var ue;ee.stopPropagation(),p(J),(ue=d.current)==null||ue.go(J)},onMouseEnter:()=>{var ee;N.triggers==="hov"&&((ee=d.current)==null||ee.go(J))},children:C.jsx("img",{src:K.image.url,alt:K.image.name??"",onLoad:ee=>{const ue=ee.currentTarget;ue.naturalWidth&&ue.naturalHeight&&T(Le=>({...Le,[J]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:N.fit==="cover"?"cover":"contain",...N.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...N.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${K.image.name}-${J}`)})})})})()]})]}),document.getElementById(a)):null};function er({color:e,className:t}){return C.jsx("svg",{viewBox:"0 0 10 18",className:t,children:C.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:C.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Xa={element:Ya,id:"lightbox",name:"Lightbox",preview:{type:"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 Ke(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ka(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
@@ -133,14 +133,7 @@
133
133
  position: relative;
134
134
  height: auto;
135
135
  }
136
- .${e}-gap-spacer {
137
- flex: 0 0 auto;
138
- align-self: stretch;
139
- }
140
- .${e}-fields-gap-spacer {
141
- flex: 0 0 auto;
142
- }
143
- `}function Ja({settings:e,isEditor:t,metadata:n,activeEvent:r}){const{prefix:o}=R.useScopedStyles(),{type:a="A",fieldsToShow:i=2,fields:s=[],buttonLabel:l="Sign up",input:p,button:c,gap:_=.008,fieldsGap:m=.008,label:h,buttonCorners:u,buttonStroke:g,inputCorners:w,inputStroke:T,buttonPadding:d,inputPadding:y,inputColor:P,inputTextColor:M,inputBorderColor:$,placeholderColor:v,buttonColor:I,buttonTextColor:V,buttonBorderColor:z,labelTextColor:k,successColor:j,errorColor:O,fontFamily:U,successMessage:H,errorMessage:f,stateOverrides:N}=e,L=a==="B",C=s.slice(0,Math.min(i,s.length)),x=p?tn({...p,fontSettings:{...p.fontSettings,fontFamily:U}},t):void 0,E={...x,borderStyle:"solid",borderRadius:R.scalingValue(w??0,t),borderWidth:R.scalingValue(T??0,t),paddingTop:R.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:R.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:R.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:R.scalingValue((y==null?void 0:y.left)??0,t)},q=c?tn({...c,fontSettings:{...c.fontSettings,fontFamily:U}},t):void 0,ie=h?tn({...h,fontSettings:{...h.fontSettings,fontFamily:U}},t):void 0,re=Qa(o,{inputColor:P,inputTextColor:M,inputBorderColor:$,placeholderColor:v,buttonColor:I,buttonTextColor:V,buttonBorderColor:z,labelTextColor:k,successColor:j,errorColor:O},N),[me,A]=W.useState(()=>Object.fromEntries(C.map(ne=>[ne.name,""]))),[Z,pe]=W.useState("idle"),[oe,de]=W.useState(null),_e=r==="success"?"success":r==="error"?"error":Z,Fe=r==="error"?f:oe,D=r==="filled"?Object.fromEntries(C.map(ne=>[ne.name,"Filled"])):me,S=_e==="error"?R.getFormFieldValidationError(C,D):null,F=r&&r!=="default"?`${o}-state-${r}`:"",Y=n==null?void 0:n.apiBase,X=n==null?void 0:n.projectId,Q=n==null?void 0:n.pluginConfigId,K=!!(Y&&X&&Q),J=(ne,ae)=>{A(le=>({...le,[ne]:ae}))},ce=async ne=>{ne.preventDefault();const ae=Object.fromEntries(C.map(ve=>{var ee;return[ve.name,((ee=me[ve.name])==null?void 0:ee.trim())??""]}).filter(([,ve])=>ve));if(!K||Object.keys(ae).length===0)return;const le=R.getFormFieldValidationError(C,me);if(le){pe("error"),de(le);return}pe("submitting"),de(null);try{const ve=`${Y}/projects/${X}/forms/${Q}/submit`,ee=await fetch(ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...ae,pageUrl:typeof window<"u"?window.location.href:""})});if(!ee.ok){const ue=await ee.text();throw new Error(ue||`Request failed: ${ee.status}`)}pe("success"),A(Object.fromEntries(C.map(ue=>[ue.name,""])))}catch(ve){pe("error"),de(ve instanceof Error?ve.message:"Something went wrong")}};return b.jsxs("div",{className:`${o}-wrapper ${F}`.trim(),style:re,children:[b.jsx("style",{children:Ka(o)}),b.jsxs("form",{onSubmit:ce,className:`${o}-form`,children:[b.jsx("div",{className:`${o}-fields`,children:C.map((ne,ae)=>b.jsxs(W.Fragment,{children:[b.jsxs("div",{className:`${o}-field-group${L?` ${o}-labeled`:""}`,children:[L&&b.jsx("span",{className:`${o}-field-label`,style:ie?{...ie,lineHeight:ie.fontSize}:void 0,children:ne.label||ne.name}),ne.type==="textarea"?b.jsx("textarea",{name:ne.name,autoComplete:"off",value:D[ne.name]??"",onChange:le=>J(ne.name,le.target.value),placeholder:ne.placeholder,className:`${o}-input`,style:E,rows:1,"data-field-type":"textarea"}):b.jsx("input",{type:ne.type==="phone"?"tel":ne.type==="email"?"email":"text",name:ne.name,autoComplete:"off",value:D[ne.name]??"",onChange:le=>J(ne.name,le.target.value),placeholder:ne.placeholder,required:ne.type==="email",className:`${o}-input`,style:E})]}),ae<C.length-1&&b.jsx("div",{"data-axis":"y",className:`${o}-overlay-anchor ${o}-fields-gap-spacer`,"data-controls":"settings.fieldsGap",style:{height:R.scalingValue(m,t),width:"100%"}})]},ae))}),b.jsx("div",{"data-axis":"y",className:`${o}-overlay-anchor ${o}-gap-spacer`,"data-controls":"settings.gap",style:{height:R.scalingValue(_,t),width:"100%"}}),b.jsx("div",{className:`${o}-overlay-anchor`,children:b.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:R.scalingValue(u??0,t),borderWidth:R.scalingValue(g??0,t),paddingTop:R.scalingValue((d==null?void 0:d.top)??0,t),paddingRight:R.scalingValue((d==null?void 0:d.right)??0,t),paddingBottom:R.scalingValue((d==null?void 0:d.bottom)??0,t),paddingLeft:R.scalingValue((d==null?void 0:d.left)??0,t),...q},children:b.jsx("span",{className:`${o}-overlay-anchor`,children:Z==="submitting"?"...":l})})})]}),_e==="success"&&b.jsx("p",{className:`${o}-success`,style:{...x,lineHeight:x==null?void 0:x.fontSize},children:H}),_e==="error"&&b.jsx("p",{className:`${o}-error`,style:{...x,lineHeight:x==null?void 0:x.fontSize},role:"alert",children:S??Fe??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"},Za=["hover","focus","filled","success","error"];function Qa(e,t,n){const r={};for(const[o,a]of Object.entries(tr))r[`--${e}-${a}`]=t[o];if(n)for(const o of Za){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:R.scalingValue(e.letterSpacing,t),wordSpacing:R.scalingValue(e.wordSpacing,t),fontSize:R.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?R.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 el=`import React, { useState } from 'react';
136
+ `}function Ja({settings:e,isEditor:t,metadata:n,activeEvent:r}){const{prefix:o}=R.useScopedStyles(),{type:a="A",fieldsToShow:i=2,fields:s=[],buttonLabel:l="Sign up",input:p,button:c,gap:_=.008,fieldsGap:m=.008,label:y,buttonCorners:u,buttonStroke:g,inputCorners:w,inputStroke:T,buttonPadding:d,inputPadding:h,inputColor:P,inputTextColor:M,inputBorderColor:$,placeholderColor:v,buttonColor:I,buttonTextColor:V,buttonBorderColor:z,labelTextColor:k,successColor:O,errorColor:j,fontFamily:U,successMessage:H,errorMessage:f,stateOverrides:N}=e,L=a==="B",S=s.slice(0,Math.min(i,s.length)),b=p?tn({...p,fontSettings:{...p.fontSettings,fontFamily:U}},t):void 0,E={...b,borderStyle:"solid",borderRadius:R.scalingValue(w??0,t),borderWidth:R.scalingValue(T??0,t),paddingTop:R.scalingValue((h==null?void 0:h.top)??0,t),paddingRight:R.scalingValue((h==null?void 0:h.right)??0,t),paddingBottom:R.scalingValue((h==null?void 0:h.bottom)??0,t),paddingLeft:R.scalingValue((h==null?void 0:h.left)??0,t)},q=c?tn({...c,fontSettings:{...c.fontSettings,fontFamily:U}},t):void 0,ie=y?tn({...y,fontSettings:{...y.fontSettings,fontFamily:U}},t):void 0,re=Qa(o,{inputColor:P,inputTextColor:M,inputBorderColor:$,placeholderColor:v!=null&&v.trim()?v:"#cccccc",buttonColor:I,buttonTextColor:V,buttonBorderColor:z,labelTextColor:k,successColor:O,errorColor:j},N),[me,A]=W.useState(()=>Object.fromEntries(S.map(ne=>[ne.name,""]))),[Z,pe]=W.useState("idle"),[oe,de]=W.useState(null),_e=r==="success"?"success":r==="error"?"error":Z,Be=r==="error"?f:oe,D=r==="filled"?Object.fromEntries(S.map(ne=>[ne.name,"Filled"])):me,x=_e==="error"?R.getFormFieldValidationError(S,D):null,B=r&&r!=="default"?`${o}-state-${r}`:"",Y=n==null?void 0:n.apiBase,X=n==null?void 0:n.projectId,Q=n==null?void 0:n.pluginConfigId,K=!!(Y&&X&&Q),J=(ne,ae)=>{A(le=>({...le,[ne]:ae}))},ce=async ne=>{ne.preventDefault();const ae=Object.fromEntries(S.map(he=>{var ee;return[he.name,((ee=me[he.name])==null?void 0:ee.trim())??""]}).filter(([,he])=>he));if(!K||Object.keys(ae).length===0)return;const le=R.getFormFieldValidationError(S,me);if(le){pe("error"),de(le);return}pe("submitting"),de(null);try{const he=`${Y}/projects/${X}/forms/${Q}/submit`,ee=await fetch(he,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...ae,pageUrl:typeof window<"u"?window.location.href:""})});if(!ee.ok){const ue=await ee.text();throw new Error(ue||`Request failed: ${ee.status}`)}pe("success"),A(Object.fromEntries(S.map(ue=>[ue.name,""])))}catch(he){pe("error"),de(he instanceof Error?he.message:"Something went wrong")}};return C.jsxs("div",{className:`${o}-wrapper ${B}`.trim(),style:re,children:[C.jsx("style",{children:Ka(o)}),C.jsxs("form",{onSubmit:ce,className:`${o}-form`,style:{gap:R.scalingValue(_,t)},children:[C.jsx("div",{className:`${o}-fields`,style:{gap:R.scalingValue(m,t)},children:S.map((ne,ae)=>C.jsxs("div",{className:`${o}-field-group${L?` ${o}-labeled`:""}`,children:[L&&C.jsx("span",{className:`${o}-field-label`,style:ie?{...ie,lineHeight:ie.fontSize}:void 0,children:ne.label||ne.name}),ne.type==="textarea"?C.jsx("textarea",{name:ne.name,autoComplete:"off",value:D[ne.name]??"",onChange:le=>J(ne.name,le.target.value),placeholder:ne.placeholder,className:`${o}-input`,style:E,rows:1,"data-field-type":"textarea"}):C.jsx("input",{type:ne.type==="phone"?"tel":ne.type==="email"?"email":"text",name:ne.name,autoComplete:"off",value:D[ne.name]??"",onChange:le=>J(ne.name,le.target.value),placeholder:ne.placeholder,required:ne.type==="email",className:`${o}-input`,style:E})]},ae))}),C.jsx("div",{className:`${o}-overlay-anchor`,children:C.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:R.scalingValue(u??0,t),borderWidth:R.scalingValue(g??0,t),paddingTop:R.scalingValue((d==null?void 0:d.top)??0,t),paddingRight:R.scalingValue((d==null?void 0:d.right)??0,t),paddingBottom:R.scalingValue((d==null?void 0:d.bottom)??0,t),paddingLeft:R.scalingValue((d==null?void 0:d.left)??0,t),...q},children:C.jsx("span",{className:`${o}-overlay-anchor`,children:Z==="submitting"?"...":l})})})]}),_e==="success"&&C.jsx("p",{className:`${o}-success`,style:{...b,lineHeight:b==null?void 0:b.fontSize},children:H}),_e==="error"&&C.jsx("p",{className:`${o}-error`,style:{...b,lineHeight:b==null?void 0:b.fontSize},role:"alert",children:x??Be??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"},Za=["hover","focus","filled","success","error"];function Qa(e,t,n){const r={};for(const[o,a]of Object.entries(tr))r[`--${e}-${a}`]=t[o];if(n)for(const o of Za){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:R.scalingValue(e.letterSpacing,t),wordSpacing:R.scalingValue(e.wordSpacing,t),fontSize:R.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?R.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 el=`import React, { useState } from 'react';
144
137
  import { CommonComponentProps } from '../props';
145
138
  import { getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
146
139
 
@@ -279,13 +272,6 @@ function getCSS(P: string): string {
279
272
  position: relative;
280
273
  height: auto;
281
274
  }
282
- .\${P}-gap-spacer {
283
- flex: 0 0 auto;
284
- align-self: stretch;
285
- }
286
- .\${P}-fields-gap-spacer {
287
- flex: 0 0 auto;
288
- }
289
275
  \`;
290
276
  }
291
277
 
@@ -372,9 +358,16 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
372
358
  : undefined;
373
359
 
374
360
  const colorVars = buildColorVars(P, {
375
- inputColor, inputTextColor, inputBorderColor, placeholderColor,
376
- buttonColor, buttonTextColor, buttonBorderColor,
377
- labelTextColor, successColor, errorColor,
361
+ inputColor,
362
+ inputTextColor,
363
+ inputBorderColor,
364
+ placeholderColor: placeholderColor?.trim() ? placeholderColor : '#cccccc',
365
+ buttonColor,
366
+ buttonTextColor,
367
+ buttonBorderColor,
368
+ labelTextColor,
369
+ successColor,
370
+ errorColor,
378
371
  }, stateOverrides);
379
372
 
380
373
  const [fieldValues, setFieldValues] = useState<Record<string, string>>(() =>
@@ -451,59 +444,47 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
451
444
  <form
452
445
  onSubmit={handleSubmit}
453
446
  className={\`\${P}-form\`}
447
+ style={{ gap: scalingValue(gap, isEditor) }}
454
448
  >
455
- <div className={\`\${P}-fields\`}>
449
+ <div
450
+ className={\`\${P}-fields\`}
451
+ style={{ gap: scalingValue(fieldsGap, isEditor) }}
452
+ >
456
453
  {visibleFields.map((field, index) => (
457
- <React.Fragment key={index}>
458
- <div className={\`\${P}-field-group\${showLabels ? \` \${P}-labeled\` : ''}\`}>
459
- {showLabels && (
460
- <span className={\`\${P}-field-label\`} style={labelTextCss ? { ...labelTextCss, lineHeight: labelTextCss.fontSize } : undefined}>
461
- {field.label || field.name}
462
- </span>
463
- )}
464
- {field.type === 'textarea' ? (
465
- <textarea
466
- name={field.name}
467
- autoComplete="off"
468
- value={displayValues[field.name] ?? ''}
469
- onChange={(e) => handleFieldChange(field.name, e.target.value)}
470
- placeholder={field.placeholder}
471
- className={\`\${P}-input\`}
472
- style={inputFieldCss}
473
- rows={1}
474
- data-field-type="textarea"
475
- />
476
- ) : (
477
- <input
478
- type={field.type === 'phone' ? 'tel' : field.type === 'email' ? 'email' : 'text'}
479
- name={field.name}
480
- autoComplete="off"
481
- value={displayValues[field.name] ?? ''}
482
- onChange={(e) => handleFieldChange(field.name, e.target.value)}
483
- placeholder={field.placeholder}
484
- required={field.type === 'email'}
485
- className={\`\${P}-input\`}
486
- style={inputFieldCss}
487
- />
488
- )}
489
- </div>
490
- {index < visibleFields.length - 1 && (
491
- <div
492
- data-axis="y"
493
- className={\`\${P}-overlay-anchor \${P}-fields-gap-spacer\`}
494
- data-controls="settings.fieldsGap"
495
- style={{ height: scalingValue(fieldsGap, isEditor), width: '100%' }}
454
+ <div key={index} className={\`\${P}-field-group\${showLabels ? \` \${P}-labeled\` : ''}\`}>
455
+ {showLabels && (
456
+ <span className={\`\${P}-field-label\`} style={labelTextCss ? { ...labelTextCss, lineHeight: labelTextCss.fontSize } : undefined}>
457
+ {field.label || field.name}
458
+ </span>
459
+ )}
460
+ {field.type === 'textarea' ? (
461
+ <textarea
462
+ name={field.name}
463
+ autoComplete="off"
464
+ value={displayValues[field.name] ?? ''}
465
+ onChange={(e) => handleFieldChange(field.name, e.target.value)}
466
+ placeholder={field.placeholder}
467
+ className={\`\${P}-input\`}
468
+ style={inputFieldCss}
469
+ rows={1}
470
+ data-field-type="textarea"
471
+ />
472
+ ) : (
473
+ <input
474
+ type={field.type === 'phone' ? 'tel' : field.type === 'email' ? 'email' : 'text'}
475
+ name={field.name}
476
+ autoComplete="off"
477
+ value={displayValues[field.name] ?? ''}
478
+ onChange={(e) => handleFieldChange(field.name, e.target.value)}
479
+ placeholder={field.placeholder}
480
+ required={field.type === 'email'}
481
+ className={\`\${P}-input\`}
482
+ style={inputFieldCss}
496
483
  />
497
484
  )}
498
- </React.Fragment>
485
+ </div>
499
486
  ))}
500
487
  </div>
501
- <div
502
- data-axis="y"
503
- className={\`\${P}-overlay-anchor \${P}-gap-spacer\`}
504
- data-controls="settings.gap"
505
- style={{ height: scalingValue(gap, isEditor), width: '100%' }}
506
- />
507
488
  <div className={\`\${P}-overlay-anchor\`}>
508
489
  <button
509
490
  type="submit"
@@ -679,7 +660,7 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
679
660
  fontVariant: textStyles.textAppearance?.fontVariant
680
661
  };
681
662
  }
682
- `,tl=[{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"}],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"]}}}},nl=["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"}}),rl={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:tl,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:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"Padding",items:["inputPadding"]}]},{type:"row",title:"Button",items:[{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:"row",title:"Input",items:["input"]},{type:"row",title:"Button",items:["button"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...nl],panelIds:["general","typeStyle"],stateItems:{default:["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonColor","buttonTextColor","buttonBorderColor"],focus:["inputColor","inputTextColor","inputBorderColor","buttonColor","buttonTextColor","buttonBorderColor"],filled:["inputColor","inputTextColor","inputBorderColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},ol={element:Ja,id:"form",name:"Form",version:1,defaultSize:{width:400,height:42},schema:rl,sourceCode:el};function It(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function il(e){return`
663
+ `,tl=[{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"}],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"]}}}},nl=["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"}}),rl={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",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"}},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:tl,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",placeholderColor:"#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."},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}}]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"Padding",items:["inputPadding"]}]},{type:"row",title:"Button",items:[{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:"row",title:"Input",items:["input"]},{type:"row",title:"Button",items:["button"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...nl],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"]},ol={element:Ja,id:"form",name:"Form",version:1,defaultSize:{width:400,height:42},schema:rl,sourceCode:el};function It(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function il(e){return`
683
664
  .${e}-wrapper {
684
665
  display: flex;
685
666
  flex-direction: column;
@@ -808,4 +789,4 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
808
789
  font-size: ${It(14)};
809
790
  color: var(--${e}-error-error-color, var(--${e}-error-color));
810
791
  }
811
- `}const al=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=R.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,submitButtonContent:s,buttonLabel:l,buttonIcon:p,fieldsToShow:c=1,fontFamily:_,input:m,button:h,height:u,corners:g,stroke:w,stateOverrides:T,inputPadding:d,buttonPadding:y,successMessage:P="Thanks for subscribing!",errorMessage:M="Please, fill all required fields."}=e,$=a.slice(0,Math.min(c,a.length)),[v,I]=W.useState(()=>Object.fromEntries($.map(F=>[F.name,""]))),[V,z]=W.useState("idle"),[k,j]=W.useState(null),O=r==="success"?"success":r==="error"?"error":V,U=r==="error"?M:k,H=r==="filled"?Object.fromEntries($.map(F=>[F.name,"Filled"])):v,f=O==="error"?R.getFormFieldValidationError($,H):null,N=r&&r!=="default"?`${o}-state-${r}`:"",L=n==null?void 0:n.apiBase,C=n==null?void 0:n.projectId,x=!!(L&&C),E=i,q=(E==null?void 0:E.mode)==="Icon"||(E==null?void 0:E.mode)==="Label"?E.mode:s==="Icon"?"Icon":"Label",ie=E===void 0?l:E.label!==void 0?E.label:l,re=E===void 0?p:E.icon!==void 0?E.icon:p,me=ie??"",A=re??"",Z=q==="Icon",pe=me||"Submit",oe=m?rr({...m,fontSettings:{...m.fontSettings,fontFamily:_??m.fontSettings.fontFamily}},t):void 0,de=h?rr({...h,fontSettings:{...h.fontSettings,fontFamily:_??h.fontSettings.fontFamily}},t):void 0,_e=sl(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(m==null?void 0:m.color)??"#111111",buttonTextColor:e.buttonTextColor??(h==null?void 0:h.color)??"#ffffff"},T),Fe={borderRadius:R.scalingValue(g,t),borderWidth:R.scalingValue(w,t),borderStyle:"solid",borderColor:`var(--${o}-stroke-color)`},D={borderLeftWidth:R.scalingValue(w,t)},S=async F=>{F.preventDefault();const Y=$.map(Q=>{var K;return((K=v[Q.name])==null?void 0:K.trim())??""}).join("");if(!x||!Y)return;const X=R.getFormFieldValidationError($,v);if(X){z("error"),j(X);return}z("submitting"),j(null);try{const Q=await fetch(`${L}/projects/${C}/forms/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a.map(K=>({[K.name]:Y})),pageUrl:typeof window<"u"?window.location.href:""})});if(!Q.ok){const K=await Q.text();throw new Error(K||`Request failed: ${Q.status}`)}z("success"),I({})}catch(Q){z("error"),j(Q instanceof Error?Q.message:"Something went wrong")}};return b.jsxs("div",{className:`${o}-wrapper ${N}`.trim(),style:_e,children:[b.jsx("style",{children:il(o)}),b.jsxs("form",{onSubmit:S,className:`${o}-form`,style:{...Fe,height:R.scalingValue(u,t)},children:[b.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:$.map(F=>b.jsx("input",{type:F.type==="email"?"email":F.type==="phone"?"tel":"text",name:F.name,autoComplete:"off",value:H[F.name]??"",onChange:Y=>I(X=>({...X,[F.name]:Y.target.value})),placeholder:F.placeholder,required:F.type==="email",className:`${o}-input`,style:{...oe,paddingRight:R.scalingValue(d.right,t),paddingLeft:R.scalingValue(d.left,t),paddingTop:R.scalingValue(d.top,t),paddingBottom:R.scalingValue(d.bottom,t)}},F.name))}),b.jsx("div",{className:`${o}-overlayAnchor`,children:b.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":pe,style:{...de,...D,paddingRight:R.scalingValue(y.right,t),paddingLeft:R.scalingValue(y.left,t),paddingTop:R.scalingValue(y.top,t),paddingBottom:R.scalingValue(y.bottom,t)},children:V==="submitting"?"...":Z?A?b.jsx("img",{src:A,alt:"",draggable:!1}):null:me})})]}),O==="success"&&b.jsx("p",{className:`${o}-success`,style:{...oe,lineHeight:oe==null?void 0:oe.fontSize},children:P}),O==="error"&&b.jsx("p",{className:`${o}-error`,style:{...oe,lineHeight:oe==null?void 0:oe.fontSize},role:"alert",children:f??U??M})]})},nr={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},ll=["hover","focus","filled","success","error"];function sl(e,t,n){const r={};for(const[o,a]of Object.entries(nr))r[`--${e}-${a}`]=t[o];if(n)for(const o of ll){const a=n[o];if(a)for(const[i,s]of Object.entries(nr)){const l=a[i];l!==void 0&&(r[`--${e}-${o}-${s}`]=l)}}return r}function rr(e,t){return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:R.scalingValue(e.letterSpacing,t),wordSpacing:R.scalingValue(e.wordSpacing,t),fontSize:R.scalingValue(e.fontSize,t)}}const cl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],or={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},color:{type:"string",title:"Text Color",display:{type:"palette-color-picker"}}},ul=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],ir=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,fontSize:.01,lineHeight:.01,color:"#111111"}),pl={type:"object",version:1,settings:{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"}},height:{type:"number",scope:"layout",title:"minHeight",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"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"layout"},input:{type:"object",scope:"layout",title:"Input",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]},button:{type:"object",scope:"layout",title:"Button",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]}},defaults:{fields:cl,fieldsToShow:1,buttonContent:{mode:"Label",label:"Submit",icon:null},fontFamily:"Arial",inputPadding:{right:.01,left:.01,top:.01,bottom:.01},buttonPadding:{right:.01,left:.01,top:.01,bottom:.01},height:.028,corners:.05,stroke:.001,strokeColor:"#cccccc",inputColor:"#ffffff",inputTextColor:"#999999",placeholderColor:"#cccccc",buttonColor:"#cccccc",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{},input:ir(400),button:ir(400)}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","fieldsToShow"]},{type:"row",items:["height","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonContent"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"row",title:"Input",items:["input"]},{type:"row",title:"Button",items:["button"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...ul],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],hover:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],focus:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],filled:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},states:["default","hover","focus","filled","success","error"]},dl={element:al,id:"oneliner-form",name:"Oneliner",version:1,defaultSize:{width:"50%",height:60},schema:pl},gl=[ea,la,Xa,ol,dl];exports.components=gl;exports.isSchemaV1=Yr;
792
+ `}const al=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=R.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,submitButtonContent:s,buttonLabel:l,buttonIcon:p,fieldsToShow:c=1,fontFamily:_,input:m,button:y,height:u,corners:g,stroke:w,stateOverrides:T,inputPadding:d,buttonPadding:h,successMessage:P="Thanks for subscribing!",errorMessage:M="Please, fill all required fields."}=e,$=a.slice(0,Math.min(c,a.length)),[v,I]=W.useState(()=>Object.fromEntries($.map(B=>[B.name,""]))),[V,z]=W.useState("idle"),[k,O]=W.useState(null),j=r==="success"?"success":r==="error"?"error":V,U=r==="error"?M:k,H=r==="filled"?Object.fromEntries($.map(B=>[B.name,"Filled"])):v,f=j==="error"?R.getFormFieldValidationError($,H):null,N=r&&r!=="default"?`${o}-state-${r}`:"",L=n==null?void 0:n.apiBase,S=n==null?void 0:n.projectId,b=!!(L&&S),E=i,q=(E==null?void 0:E.mode)==="Icon"||(E==null?void 0:E.mode)==="Label"?E.mode:s==="Icon"?"Icon":"Label",ie=E===void 0?l:E.label!==void 0?E.label:l,re=E===void 0?p:E.icon!==void 0?E.icon:p,me=ie??"",A=re??"",Z=q==="Icon",pe=me||"Submit",oe=m?rr({...m,fontSettings:{...m.fontSettings,fontFamily:_??m.fontSettings.fontFamily}},t):void 0,de=y?rr({...y,fontSettings:{...y.fontSettings,fontFamily:_??y.fontSettings.fontFamily}},t):void 0,_e=sl(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(m==null?void 0:m.color)??"#111111",buttonTextColor:e.buttonTextColor??(y==null?void 0:y.color)??"#ffffff"},T),Be={borderRadius:R.scalingValue(g,t),borderWidth:R.scalingValue(w,t),borderStyle:"solid",borderColor:`var(--${o}-stroke-color)`},D={borderLeftWidth:R.scalingValue(w,t)},x=async B=>{B.preventDefault();const Y=$.map(Q=>{var K;return((K=v[Q.name])==null?void 0:K.trim())??""}).join("");if(!b||!Y)return;const X=R.getFormFieldValidationError($,v);if(X){z("error"),O(X);return}z("submitting"),O(null);try{const Q=await fetch(`${L}/projects/${S}/forms/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a.map(K=>({[K.name]:Y})),pageUrl:typeof window<"u"?window.location.href:""})});if(!Q.ok){const K=await Q.text();throw new Error(K||`Request failed: ${Q.status}`)}z("success"),I({})}catch(Q){z("error"),O(Q instanceof Error?Q.message:"Something went wrong")}};return C.jsxs("div",{className:`${o}-wrapper ${N}`.trim(),style:_e,children:[C.jsx("style",{children:il(o)}),C.jsxs("form",{onSubmit:x,className:`${o}-form`,style:{...Be,height:R.scalingValue(u,t)},children:[C.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:$.map(B=>C.jsx("input",{type:B.type==="email"?"email":B.type==="phone"?"tel":"text",name:B.name,autoComplete:"off",value:H[B.name]??"",onChange:Y=>I(X=>({...X,[B.name]:Y.target.value})),placeholder:B.placeholder,required:B.type==="email",className:`${o}-input`,style:{...oe,paddingRight:R.scalingValue(d.right,t),paddingLeft:R.scalingValue(d.left,t),paddingTop:R.scalingValue(d.top,t),paddingBottom:R.scalingValue(d.bottom,t)}},B.name))}),C.jsx("div",{className:`${o}-overlayAnchor`,children:C.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":pe,style:{...de,...D,paddingRight:R.scalingValue(h.right,t),paddingLeft:R.scalingValue(h.left,t),paddingTop:R.scalingValue(h.top,t),paddingBottom:R.scalingValue(h.bottom,t)},children:V==="submitting"?"...":Z?A?C.jsx("img",{src:A,alt:"",draggable:!1}):null:me})})]}),j==="success"&&C.jsx("p",{className:`${o}-success`,style:{...oe,lineHeight:oe==null?void 0:oe.fontSize},children:P}),j==="error"&&C.jsx("p",{className:`${o}-error`,style:{...oe,lineHeight:oe==null?void 0:oe.fontSize},role:"alert",children:f??U??M})]})},nr={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},ll=["hover","focus","filled","success","error"];function sl(e,t,n){const r={};for(const[o,a]of Object.entries(nr))r[`--${e}-${a}`]=t[o];if(n)for(const o of ll){const a=n[o];if(a)for(const[i,s]of Object.entries(nr)){const l=a[i];l!==void 0&&(r[`--${e}-${o}-${s}`]=l)}}return r}function rr(e,t){return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:R.scalingValue(e.letterSpacing,t),wordSpacing:R.scalingValue(e.wordSpacing,t),fontSize:R.scalingValue(e.fontSize,t)}}const cl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],or={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},color:{type:"string",title:"Text Color",display:{type:"palette-color-picker"}}},ul=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],ir=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,fontSize:.01,lineHeight:.01,color:"#111111"}),pl={type:"object",version:1,settings:{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"}},height:{type:"number",scope:"layout",title:"minHeight",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"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"layout"},input:{type:"object",scope:"layout",title:"Input",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]},button:{type:"object",scope:"layout",title:"Button",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]}},defaults:{fields:cl,fieldsToShow:1,buttonContent:{mode:"Label",label:"Submit",icon:null},fontFamily:"Arial",inputPadding:{right:.01,left:.01,top:.01,bottom:.01},buttonPadding:{right:.01,left:.01,top:.01,bottom:.01},height:.028,corners:.05,stroke:.001,strokeColor:"#cccccc",inputColor:"#ffffff",inputTextColor:"#999999",placeholderColor:"#cccccc",buttonColor:"#cccccc",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{},input:ir(400),button:ir(400)}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","fieldsToShow"]},{type:"row",items:["height","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonContent"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"row",title:"Input",items:["input"]},{type:"row",title:"Button",items:["button"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...ul],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],hover:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],focus:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],filled:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},states:["default","hover","focus","filled","success","error"]},dl={element:al,id:"oneliner-form",name:"Oneliner",version:1,defaultSize:{width:"50%",height:60},schema:pl},gl=[ea,la,Xa,ol,dl];exports.components=gl;exports.isSchemaV1=Yr;