@cntrl-site/components 0.1.34 → 1.0.0

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