@cntrl-site/components 1.0.65-alpha.4 → 1.0.65-alpha.5
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 +65 -47
- package/dist/index.mjs +4290 -4252
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),pt=require("classnames"),W=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function vu(e){return e.type==="object"&&e.version===1}const xu="ControlSlider-module__wrapper___sHEkd",bu="ControlSlider-module__hoverArrow___A-dOH",wu="ControlSlider-module__sliderItem___QQSkR",Su="ControlSlider-module__sliderImage___9hRl-",Cu="ControlSlider-module__arrow___05ghY",$u="ControlSlider-module__arrowVertical___tBfVN",Tu="ControlSlider-module__nextArrow___-30Yc",Iu="ControlSlider-module__arrowInner___aEra3",Ru="ControlSlider-module__arrowIcon___S4ztF",Lu="ControlSlider-module__arrowImg___2dwJW",Pu="ControlSlider-module__mirror___brd6U",Eu="ControlSlider-module__pagination___bicLF",Mu="ControlSlider-module__paginationInner___bT-P-",ku="ControlSlider-module__paginationVertical___zYqKw",Au="ControlSlider-module__paginationItem___nTRbk",Fu="ControlSlider-module__dot___p1Qun",_u="ControlSlider-module__activeDot___LHFaj",Nu="ControlSlider-module__paginationInsideBottom___R3FWn",Wu="ControlSlider-module__paginationInsideTop___V-qb-",Hu="ControlSlider-module__paginationOutsideBottom___14w8D",Du="ControlSlider-module__paginationOutsideTop___SCLqB",Ou="ControlSlider-module__paginationInsideLeft___yOBRZ",Bu="ControlSlider-module__paginationInsideRight___Rtt3o",zu="ControlSlider-module__paginationOutsideLeft___lahaw",ju="ControlSlider-module__paginationOutsideRight___EtuQa",Vu="ControlSlider-module__imgWrapper___UjEgB",Gu="ControlSlider-module__captionBlock___dJ6-j",Xu="ControlSlider-module__captionTextWrapper___HFlpf",qu="ControlSlider-module__captionText___uGBVc",Yu="ControlSlider-module__active___WZK4G",Uu="ControlSlider-module__withPointerEvents___t-18M",Ku="ControlSlider-module__topLeftAlignment___zjnGM",Zu="ControlSlider-module__topCenterAlignment___gD1xW",Ju="ControlSlider-module__topRightAlignment___NMapS",Qu="ControlSlider-module__middleLeftAlignment___OnUrY",ep="ControlSlider-module__middleCenterAlignment___Tdkl0",tp="ControlSlider-module__middleRightAlignment___wEbfX",np="ControlSlider-module__bottomLeftAlignment___cTP2-",ip="ControlSlider-module__bottomCenterAlignment___c54fB",op="ControlSlider-module__bottomRightAlignment___kEwrz",rp="ControlSlider-module__clickOverlay___DZA28",ap="ControlSlider-module__contain___pLyq7",sp="ControlSlider-module__cover___KdDat",dt={wrapper:xu,hoverArrow:bu,sliderItem:wu,sliderImage:Su,arrow:Cu,arrowVertical:$u,nextArrow:Tu,arrowInner:Iu,arrowIcon:Ru,arrowImg:Lu,mirror:Pu,pagination:Eu,paginationInner:Mu,paginationVertical:ku,paginationItem:Au,dot:Fu,activeDot:_u,paginationInsideBottom:Nu,paginationInsideTop:Wu,paginationOutsideBottom:Hu,paginationOutsideTop:Du,paginationInsideLeft:Ou,paginationInsideRight:Bu,paginationOutsideLeft:zu,paginationOutsideRight:ju,imgWrapper:Vu,captionBlock:Gu,captionTextWrapper:Xu,captionText:qu,active:Yu,withPointerEvents:Uu,topLeftAlignment:Ku,topCenterAlignment:Zu,topRightAlignment:Ju,middleLeftAlignment:Qu,middleCenterAlignment:ep,middleRightAlignment:tp,bottomLeftAlignment:np,bottomCenterAlignment:ip,bottomRightAlignment:op,clickOverlay:rp,contain:ap,cover:sp};function lp(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function cp(e,t,n){return t&&lp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Js="(prefers-reduced-motion: reduce)",Bi=1,dp=2,qi=3,ao=4,Vo=5,Sr=6,Mr=7,up={CREATED:Bi,MOUNTED:dp,IDLE:qi,MOVING:ao,SCROLLING:Vo,DRAGGING:Sr,DESTROYED:Mr};function On(e){e.length=0}function ri(e,t,n){return Array.prototype.slice.call(e,t,n)}function Yt(e){return e.bind.apply(e,[null].concat(ri(arguments,1)))}var _c=setTimeout,Xa=function(){};function Qs(e){return requestAnimationFrame(e)}function Xr(e,t){return typeof t===e}function Po(e){return!ys(e)&&Xr("object",e)}var fs=Array.isArray,Nc=Yt(Xr,"function"),ti=Yt(Xr,"string"),Go=Yt(Xr,"undefined");function ys(e){return e===null}function Wc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Xo(e){return fs(e)?e:[e]}function xn(e,t){Xo(e).forEach(t)}function vs(e,t){return e.indexOf(t)>-1}function Cr(e,t){return e.push.apply(e,Xo(t)),e}function _n(e,t,n){e&&xn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function En(e,t){_n(e,ti(t)?t.split(" "):t,!0)}function qo(e,t){xn(t,e.appendChild.bind(e))}function xs(e,t){xn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Eo(e,t){return Wc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Hc(e,t){var n=e?ri(e.children):[];return t?n.filter(function(i){return Eo(i,t)}):n}function Yo(e,t){return t?Hc(e,t)[0]:e.firstElementChild}var Mo=Object.keys;function Ci(e,t,n){return e&&(n?Mo(e).reverse():Mo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ko(e){return ri(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function Yn(e){return ri(arguments,1).forEach(function(t){Ci(t,function(n,i){fs(n)?e[i]=n.slice():Po(n)?e[i]=Yn({},Po(e[i])?e[i]:{},n):e[i]=n})}),e}function el(e,t){xn(t||Mo(e),function(n){delete e[n]})}function Mn(e,t){xn(e,function(n){xn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Po(t)?Ci(t,function(i,o){$t(e,o,i)}):xn(e,function(i){ys(n)||n===""?Mn(i,t):i.setAttribute(t,String(n))})}function ji(e,t,n){var i=document.createElement(e);return t&&(ti(t)?En(i,t):$t(i,t)),n&&qo(n,i),i}function wn(e,t,n){if(Go(n))return getComputedStyle(e)[t];ys(n)||(e.style[t]=""+n)}function Ao(e,t){wn(e,"display",t)}function Dc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function tl(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function Ti(e){xn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Oc(e){return Yo(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Bc(e,t){return e&&e.querySelector(t)}function bs(e,t){return t?ri(e.querySelectorAll(t)):[]}function Nn(e,t){_n(e,t,!1)}function qa(e){return e.timeStamp}function ui(e){return ti(e)?e:e?e+"px":""}var Uo="splide",ws="data-"+Uo;function To(e,t){if(!e)throw new Error("["+Uo+"] "+(t||""))}var ni=Math.min,kr=Math.max,Ar=Math.floor,Fo=Math.ceil,dn=Math.abs;function zc(e,t,n){return dn(e-t)<n}function $r(e,t,n,i){var o=ni(t,n),r=kr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Wi(e,t,n){var i=ni(t,n),o=kr(t,n);return ni(kr(i,e),o)}function Ya(e){return+(e>0)-+(e<0)}function Ua(e,t){return xn(t,function(n){e=e.replace("%s",""+n)}),e}function Ss(e){return e<10?"0"+e:""+e}var nl={};function pp(e){return""+e+Ss(nl[e]=(nl[e]||0)+1)}function jc(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,w){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);m?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===v&&(!c||w[3]===c)?(w[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){xn(l,function(u){u&&xn(d,function(p){p.split(" ").forEach(function(v){var w=v.split(".");c(u,w[0],w[1])})})})}function r(){e.forEach(function(l){l[4]()}),On(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ai="mounted",Ka="ready",Bn="move",so="moved",Cs="click",Vc="active",Gc="inactive",Xc="visible",qc="hidden",en="refresh",ln="updated",Yi="resize",qr="resized",Yc="drag",Uc="dragging",Kc="dragged",Yr="scroll",Li="scrolled",mp="overflow",$s="destroy",Zc="arrows:mounted",Jc="arrows:updated",Qc="pagination:mounted",ed="pagination:updated",Ts="navigation:mounted",Is="autoplay:play",td="autoplay:playing",Rs="autoplay:pause",Ls="lazyload:loaded",nd="sk",id="sh",Fr="ei";function Zt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=jc();function i(r,l){n.bind(t,Xo(r).join(" "),function(d){l.apply(l,fs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ri(arguments,1))}return e&&e.event.on($s,n.destroy),ko(n,{bus:t,on:i,off:Yt(n.unbind,t),emit:o})}function Ur(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ni((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return w();d=Qs(p)}}function v(C){C||h(),r=o()-(C?l*e:0),c=!1,d=Qs(p)}function w(){c=!0}function m(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(C){e=C}function x(){return c}return{start:v,rewind:m,pause:w,cancel:h,set:f,isPaused:x}}function gp(e){var t=e;function n(o){t=o}function i(o){return vs(Xo(o),t)}return{set:n,is:i}}function hp(e,t){var n=Ur(0,e,null,1);return function(){n.isPaused()&&n.start()}}function fp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=jc(),d=[];function c(){var h=n.mediaQuery==="min";Mo(o).sort(function(f,x){return h?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,Js),v()}function u(h){h&&l.destroy()}function p(h,f){var x=matchMedia(f);l.bind(x,"change",v),d.push([h,x])}function v(){var h=i.is(Mr),f=n.direction,x=d.reduce(function(C,y){return Yn(C,y[1].matches?y[0]:{})},{});el(n),m(x),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function w(h){matchMedia(Js).matches&&(h?Yn(n,r):el(n,Mo(r)))}function m(h,f,x){Yn(n,h),f&&Yn(Object.getPrototypeOf(n),h),(x||!i.is(Bi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:w,set:m}}var Kr="Arrow",Zr=Kr+"Left",Jr=Kr+"Right",od=Kr+"Up",rd=Kr+"Down",il="rtl",Qr="ttb",pa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[od,Jr],ArrowRight:[rd,Zr]};function yp(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===il&&!l?1:d===Qr?0:-1;return pa[r]&&pa[r][c]||r.replace(/width|left|right/i,function(u,p){var v=pa[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(r){return r*(n.direction===il?1:-1)}return{resolve:i,orient:o}}var Wn="role",Vi="tabindex",vp="disabled",Cn="aria-",Ko=Cn+"controls",ad=Cn+"current",ol=Cn+"selected",yn=Cn+"label",Ps=Cn+"labelledby",sd=Cn+"hidden",Es=Cn+"orientation",_o=Cn+"roledescription",rl=Cn+"live",al=Cn+"busy",sl=Cn+"atomic",Ms=[Wn,Vi,vp,Ko,ad,yn,Ps,sd,Es,_o],kn=Uo+"__",si="is-",ma=Uo,ll=kn+"track",xp=kn+"list",ea=kn+"slide",ld=ea+"--clone",bp=ea+"__container",ks=kn+"arrows",ta=kn+"arrow",cd=ta+"--prev",dd=ta+"--next",na=kn+"pagination",ud=na+"__page",wp=kn+"progress",Sp=wp+"__bar",Cp=kn+"toggle",$p=kn+"spinner",Tp=kn+"sr",Ip=si+"initialized",Ii=si+"active",pd=si+"prev",md=si+"next",Za=si+"visible",Ja=si+"loading",gd=si+"focus-in",hd=si+"overflow",Rp=[Ii,Za,pd,md,Ja,gd,hd],Lp={slide:ea,clone:ld,arrows:ks,arrow:ta,prev:cd,next:dd,pagination:na,page:ud,spinner:$p};function Pp(e,t){if(Nc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Eo(n,t);)n=n.parentElement;return n}var Ep=5,cl=200,fd="touchstart mousedown",ga="touchmove mousemove",ha="touchend touchcancel mouseup click";function Mp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],w,m,h;function f(){S(),B(),y()}function x(){o(en,C),o(en,f),o(ln,y),r(document,fd+" keydown",function(D){h=D.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,gd,!!h)})}function C(D){var T=Ms.concat("style");On(u),Nn(l,p),Nn(w,v),Mn([w,m],T),Mn(l,D?T:["style",_o])}function y(){Nn(l,p),Nn(w,v),p=q(ma),v=q(ll),En(l,p),En(w,v),$t(l,yn,n.label),$t(l,Ps,n.labelledby)}function S(){w=N("."+ll),m=Yo(w,"."+xp),To(w&&m,"A track/list element is missing."),Cr(u,Hc(m,"."+ea+":not(."+ld+")")),Ci({arrows:ks,pagination:na,prev:cd,next:dd,bar:Sp,toggle:Cp},function(D,T){c[T]=N("."+D)}),ko(c,{root:l,track:w,list:m,slides:u})}function B(){var D=l.id||pp(Uo),T=n.role;l.id=D,w.id=w.id||D+"-track",m.id=m.id||D+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&T&&$t(l,Wn,T),$t(l,_o,d.carousel),$t(m,Wn,"presentation")}function N(D){var T=Bc(l,D);return T&&Pp(T,"."+ma)===l?T:void 0}function q(D){return[D+"--"+n.type,D+"--"+n.direction,n.drag&&D+"--draggable",n.isNavigation&&D+"--nav",D===ma&&Ii]}return ko(c,{setup:f,mount:x,destroy:C})}var Ui="slide",lo="loop",Zo="fade";function kp(e,t,n,i){var o=Zt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,w=p.updateOnMove,m=p.i18n,h=p.pagination,f=p.slideFocus,x=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),S=n>-1,B=Yo(i,"."+bp),N;function q(){S||(i.id=u.id+"-slide"+Ss(t+1),$t(i,Wn,h?"tabpanel":"group"),$t(i,_o,m.slide),$t(i,yn,y||Ua(m.slideLabel,[t+1,e.length]))),D()}function D(){d(i,"click",Yt(l,Cs,ie)),d(i,"keydown",Yt(l,nd,ie)),r([so,id,Li],I),r(Ts,H),w&&r(Bn,$)}function T(){N=!0,o.destroy(),Nn(i,Rp),Mn(i,Ms),$t(i,"style",C),$t(i,yn,y||"")}function H(){var L=e.splides.map(function(_){var V=_.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");$t(i,yn,Ua(m.slideX,(S?n:t)+1)),$t(i,Ko,L),$t(i,Wn,f?"button":""),f&&Mn(i,_o)}function $(){N||I()}function I(){if(!N){var L=e.index;P(),E(),_n(i,pd,t===L-1),_n(i,md,t===L+1)}}function P(){var L=z();L!==tl(i,Ii)&&(_n(i,Ii,L),$t(i,ad,v&&L||""),l(L?Vc:Gc,ie))}function E(){var L=F(),_=!L&&(!z()||S);if(e.state.is([ao,Vo])||$t(i,sd,_||""),$t(bs(i,p.focusableNodes||""),Vi,_?-1:""),f&&$t(i,Vi,_?-1:0),L!==tl(i,Za)&&(_n(i,Za,L),l(L?Xc:qc,ie)),!L&&document.activeElement===i){var V=c.Slides.getAt(e.index);V&&Dc(V.slide)}}function g(L,_,V){wn(V&&B||i,L,_)}function z(){var L=e.index;return L===t||p.cloneStatus&&L===n}function F(){if(e.is(Zo))return z();var L=hn(c.Elements.track),_=hn(i),V=x("left",!0),ae=x("right",!0);return Ar(L[V])<=Fo(_[V])&&Ar(_[ae])<=Fo(L[ae])}function X(L,_){var V=dn(L-t);return!S&&(p.rewind||e.is(lo))&&(V=ni(V,e.length-V)),V<=_}var ie={index:t,slideIndex:n,slide:i,container:B,isClone:S,mount:q,destroy:T,update:I,style:g,isWithin:X};return ie}function Ap(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){w(),o(en,m),o(en,w)}function w(){c.forEach(function(I,P){f(I,P,-1)})}function m(){N(function(I){I.destroy()}),On(p)}function h(){N(function(I){I.update()})}function f(I,P,E){var g=kp(e,P,E,I);g.mount(),p.push(g),p.sort(function(z,F){return z.index-F.index})}function x(I){return I?q(function(P){return!P.isClone}):p}function C(I){var P=t.Controller,E=P.toIndex(I),g=P.hasFocus()?1:n.perPage;return q(function(z){return $r(z.index,E,E+g-1)})}function y(I){return q(I)[0]}function S(I,P){xn(I,function(E){if(ti(E)&&(E=Oc(E)),Wc(E)){var g=c[P];g?xs(E,g):qo(u,E),En(E,n.classes.slide),T(E,Yt(r,Yi))}}),r(en)}function B(I){Ti(q(I).map(function(P){return P.slide})),r(en)}function N(I,P){x(P).forEach(I)}function q(I){return p.filter(Nc(I)?I:function(P){return ti(I)?Eo(P.slide,I):vs(Xo(I),P.index)})}function D(I,P,E){N(function(g){g.style(I,P,E)})}function T(I,P){var E=bs(I,"img"),g=E.length;g?E.forEach(function(z){l(z,"load error",function(){--g||P()})}):P()}function H(I){return I?c.length:p.length}function $(){return p.length>n.perPage}return{mount:v,destroy:m,update:h,register:f,get:x,getIn:C,getAt:y,add:S,remove:B,forEach:N,filter:q,style:D,getLength:H,isEnough:$}}function Fp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,w=u.list,m=d.getAt,h=d.style,f,x,C;function y(){S(),r(window,"resize load",hp(Yt(l,Yi))),o([ln,en],S),o(Yi,B)}function S(){f=n.direction===Qr,wn(p,"maxWidth",ui(n.width)),wn(v,c("paddingLeft"),N(!1)),wn(v,c("paddingRight"),N(!0)),B(!0)}function B(ie){var L=hn(p);(ie||x.width!==L.width||x.height!==L.height)&&(wn(v,"height",q()),h(c("marginRight"),ui(n.gap)),h("width",T()),h("height",H(),!0),x=L,l(qr),C!==(C=X())&&(_n(p,hd,C),l(mp,C)))}function N(ie){var L=n.padding,_=c(ie?"right":"left");return L&&ui(L[_]||(Po(L)?0:L))||"0px"}function q(){var ie="";return f&&(ie=D(),To(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+N(!1)+" - "+N(!0)+")"),ie}function D(){return ui(n.height||hn(w).width*n.heightRatio)}function T(){return n.autoWidth?null:ui(n.fixedWidth)||(f?"":$())}function H(){return ui(n.fixedHeight)||(f?n.autoHeight?null:$():D())}function $(){var ie=ui(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function I(){return hn(w)[c("width")]}function P(ie,L){var _=m(ie||0);return _?hn(_.slide)[c("width")]+(L?0:z()):0}function E(ie,L){var _=m(ie);if(_){var V=hn(_.slide)[c("right")],ae=hn(w)[c("left")];return dn(V-ae)+(L?0:z())}return 0}function g(ie){return E(e.length-1)-E(0)+P(0,ie)}function z(){var ie=m(0);return ie&&parseFloat(wn(ie.slide,c("marginRight")))||0}function F(ie){return parseFloat(wn(v,c("padding"+(ie?"Right":"Left"))))||0}function X(){return e.is(Zo)||g(!0)>I()}return{mount:y,resize:B,listSize:I,slideSize:P,sliderSize:g,totalSize:E,getPadding:F,isOverflow:X}}var _p=2;function Np(e,t,n){var i=Zt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,v),o([ln,Yi],m),(u=x())&&(h(u),t.Layout.resize(!0))}function v(){w(),p()}function w(){Ti(c),On(c),i.destroy()}function m(){var C=x();u!==C&&(u<C||!C)&&i.emit(en)}function h(C){var y=l.get().slice(),S=y.length;if(S){for(;y.length<C;)Cr(y,y);Cr(y.slice(-C),y.slice(0,C)).forEach(function(B,N){var q=N<C,D=f(B.slide,N);q?xs(D,y[0].slide):qo(r.list,D),Cr(c,D),l.register(D,N-C+(q?0:S),B.index)})}}function f(C,y){var S=C.cloneNode(!0);return En(S,n.classes.clone),S.id=e.root.id+"-clone"+Ss(y+1),S}function x(){var C=n.clones;if(!e.is(lo))C=0;else if(Go(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=y&&Fo(hn(r.track)[d("width")]/y);C=S||n[d("autoWidth")]&&e.length||n.perPage*_p}return C}return{mount:p,destroy:w}}function Wp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,w=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,x=t.Elements,C=x.list,y=x.track,S;function B(){S=t.Transition,o([ai,qr,ln,en],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),D(e.index),t.Slides.update())}function q(_,V,ae,re){_!==V&&ie(_>ae)&&(I(),T($(g(),_>ae),!0)),l(ao),r(Bn,V,ae,_),S.start(V,function(){l(qi),r(so,V,ae,_),re&&re()})}function D(_){T(E(_,!0))}function T(_,V){if(!e.is(Zo)){var ae=V?_:H(_);wn(C,"transform","translate"+h("X")+"("+ae+"px)"),_!==ae&&r(id)}}function H(_){if(e.is(lo)){var V=P(_),ae=V>t.Controller.getEnd(),re=V<0;(re||ae)&&(_=$(_,ae))}return _}function $(_,V){var ae=_-X(V),re=w();return _-=f(re*(Fo(dn(ae)/re)||1))*(V?1:-1),_}function I(){T(g(),!0),S.cancel()}function P(_){for(var V=t.Slides.get(),ae=0,re=1/0,M=0;M<V.length;M++){var se=V[M].index,j=dn(E(se,!0)-_);if(j<=re)re=j,ae=se;else break}return ae}function E(_,V){var ae=f(p(_-1)-F(_));return V?z(ae):ae}function g(){var _=h("left");return hn(C)[_]-hn(y)[_]+f(u(!1))}function z(_){return n.trimSpace&&e.is(Ui)&&(_=Wi(_,0,f(w(!0)-v()))),_}function F(_){var V=n.focus;return V==="center"?(v()-c(_,!0))/2:+V*c(_)||0}function X(_){return E(_?t.Controller.getEnd():0,!!n.trimSpace)}function ie(_){var V=f($(g(),_));return _?V>=0:V<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(_,V){V=Go(V)?g():V;var ae=_!==!0&&f(V)<f(X(!1)),re=_!==!1&&f(V)>f(X(!0));return ae||re}return{mount:B,move:q,jump:D,translate:T,shift:$,cancel:I,toIndex:P,toPosition:E,getPosition:g,getLimit:X,exceededLimit:L,reposition:N}}function Hp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,w=p.getLength,m=n.omitEnd,h=e.is(lo),f=e.is(Ui),x=Yt(g,!1),C=Yt(g,!0),y=n.start||0,S,B=y,N,q,D;function T(){H(),o([ln,en,Fr],H),o(qr,$)}function H(){N=w(!0),q=n.perMove,D=n.perPage,S=ie();var j=Wi(y,0,m?S:N-1);j!==y&&(y=j,l.reposition())}function $(){S!==ie()&&r(Fr)}function I(j,b,k){if(!se()){var G=E(j),he=X(G);he>-1&&(b||he!==y)&&(ae(he),l.move(G,he,B,k))}}function P(j,b,k,G){t.Scroll.scroll(j,b,k,function(){var he=X(l.toIndex(d()));ae(m?ni(he,S):he),G&&G()})}function E(j){var b=y;if(ti(j)){var k=j.match(/([+\-<>])(\d+)?/)||[],G=k[1],he=k[2];G==="+"||G==="-"?b=z(y+ +(""+G+(+he||1)),y):G===">"?b=he?L(+he):x(!0):G==="<"&&(b=C(!0))}else b=h?j:Wi(j,0,S);return b}function g(j,b){var k=q||(M()?1:D),G=z(y+k*(j?-1:1),y,!(q||M()));return G===-1&&f&&!zc(d(),c(!j),1)?j?0:S:b?G:X(G)}function z(j,b,k){if(v()||M()){var G=F(j);G!==j&&(b=j,j=G,k=!1),j<0||j>S?!q&&($r(0,j,b,!0)||$r(S,b,j,!0))?j=L(_(j)):h?j=k?j<0?-(N%D||D):N:j:n.rewind?j=j<0?S:0:j=-1:k&&j!==b&&(j=L(_(b)+(j<b?-1:1)))}else j=-1;return j}function F(j){if(f&&n.trimSpace==="move"&&j!==y)for(var b=d();b===u(j,!0)&&$r(j,0,e.length-1,!n.rewind);)j<y?--j:++j;return j}function X(j){return h?(j+N)%N||0:j}function ie(){for(var j=N-(M()||h&&q?1:D);m&&j-- >0;)if(u(N-1,!0)!==u(j,!0)){j++;break}return Wi(j,0,N-1)}function L(j){return Wi(M()?j:D*j,0,S)}function _(j){return M()?ni(j,S):Ar((j>=S?N-1:j)/D)}function V(j){var b=l.toIndex(j);return f?Wi(b,0,S):b}function ae(j){j!==y&&(B=y,y=j)}function re(j){return j?B:y}function M(){return!Go(n.focus)||n.isNavigation}function se(){return e.state.is([ao,Vo])&&!!n.waitForTransition}return{mount:T,go:I,scroll:P,getNext:x,getPrev:C,getAdjacent:g,getEnd:ie,setIndex:ae,getIndex:re,toIndex:L,toPage:_,toDest:V,hasFocus:M,isBusy:se}}var Dp="http://www.w3.org/2000/svg",Op="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",rr=40;function Bp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,w=u.track,m=v,h=u.prev,f=u.next,x,C,y={};function S(){N(),o(ln,B)}function B(){q(),S()}function N(){var P=n.arrows;P&&!(h&&f)&&H(),h&&f&&(ko(y,{prev:h,next:f}),Ao(m,P?"":"none"),En(m,C=ks+"--"+n.direction),P&&(D(),I(),$t([h,f],Ko,w.id),l(Zc,h,f)))}function q(){i.destroy(),Nn(m,C),x?(Ti(v?[h,f]:m),h=f=null):Mn([h,f],Ms)}function D(){o([ai,so,en,Li,Fr],I),r(f,"click",Yt(T,">")),r(h,"click",Yt(T,"<"))}function T(P){p.go(P,!0)}function H(){m=v||ji("div",d.arrows),h=$(!0),f=$(!1),x=!0,qo(m,[h,f]),!v&&xs(m,w)}function $(P){var E='<button class="'+d.arrow+" "+(P?d.prev:d.next)+'" type="button"><svg xmlns="'+Dp+'" viewBox="0 0 '+rr+" "+rr+'" width="'+rr+'" height="'+rr+'" focusable="false"><path d="'+(n.arrowPath||Op)+'" />';return Oc(E)}function I(){if(h&&f){var P=e.index,E=p.getPrev(),g=p.getNext(),z=E>-1&&P<E?c.last:c.prev,F=g>-1&&P>g?c.first:c.next;h.disabled=E<0,f.disabled=g<0,$t(h,yn,z),$t(f,yn,F),l(Jc,h,f,E,g)}}return{arrows:y,mount:S,destroy:q,update:I}}var zp=ws+"-interval";function jp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=Ur(n.interval,e.go.bind(e,">"),D),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,w=p.toggle,m=n.autoplay,h,f,x=m==="pause";function C(){m&&(y(),w&&$t(w,Ko,u.track.id),x||S(),q())}function y(){n.pauseOnHover&&r(v,"mouseenter mouseleave",function(H){h=H.type==="mouseenter",N()}),n.pauseOnFocus&&r(v,"focusin focusout",function(H){f=H.type==="focusin",N()}),w&&r(w,"click",function(){x?S():B(!0)}),o([Bn,Yr,en],d.rewind),o(Bn,T)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=x=!1,q(),l(Is))}function B(H){H===void 0&&(H=!0),x=!!H,q(),c()||(d.pause(),l(Rs))}function N(){x||(h||f?B(!1):S())}function q(){w&&(_n(w,Ii,!x),$t(w,yn,n.i18n[x?"play":"pause"]))}function D(H){var $=u.bar;$&&wn($,"width",H*100+"%"),l(td,H)}function T(H){var $=t.Slides.getAt(H);d.set($&&+Sn($.slide,zp)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:B,isPaused:c}}function Vp(e,t,n){var i=Zt(e),o=i.on;function r(){n.cover&&(o(Ls,Yt(d,!0)),o([ai,ln,en],Yt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Yo(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),Ao(u,c?"none":"")}return{mount:r,destroy:Yt(l,!1)}}var Gp=10,Xp=600,qp=.6,Yp=1.5,Up=800;function Kp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,w=e.is(Ui),m,h,f=1;function x(){o(Bn,B),o([ln,en],N)}function C(D,T,H,$,I){var P=c();if(B(),H&&(!w||!p())){var E=t.Layout.sliderSize(),g=Ya(D)*E*Ar(dn(D)/E)||0;D=d.toPosition(t.Controller.toDest(D%E))+g}var z=zc(P,D,1);f=1,T=z?0:T||kr(dn(D-P)/Yp,Up),h=$,m=Ur(T,y,Yt(S,P,D,I),1),l(Vo),r(Yr),m.start()}function y(){l(qi),h&&h(),r(Li)}function S(D,T,H,$){var I=c(),P=D+(T-D)*q($),E=(P-I)*f;v(I+E),w&&!H&&p()&&(f*=qp,dn(E)<Gp&&C(u(p(!0)),Xp,!1,h,!0))}function B(){m&&m.cancel()}function N(){m&&!m.isPaused()&&(B(),y())}function q(D){var T=n.easingFunc;return T?T(D):1-Math.pow(1-D,4)}return{mount:x,destroy:B,scroll:C,cancel:N}}var Hi={passive:!1,capture:!0};function Zp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,w=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,x=h.orient,C=u.getPosition,y=u.exceededLimit,S,B,N,q,D,T=!1,H,$,I;function P(){l(w,ga,Xa,Hi),l(w,ha,Xa,Hi),l(w,fd,g,Hi),l(w,"click",X,{capture:!0}),l(w,"dragstart",Fn),o([ai,ln],E)}function E(){var O=n.drag;ee(!O),q=O==="free"}function g(O){if(H=!1,!$){var Z=he(O);G(O.target)&&(Z||!O.button)&&(v.isBusy()?Fn(O,!0):(I=Z?w:window,D=c.is([ao,Vo]),N=null,l(I,ga,z,Hi),l(I,ha,F,Hi),u.cancel(),p.cancel(),ie(O)))}}function z(O){if(c.is(Sr)||(c.set(Sr),r(Yc)),O.cancelable)if(D){u.translate(S+k(M(O)));var Z=se(O)>cl,te=T!==(T=y());(Z||te)&&ie(O),H=!0,r(Uc),Fn(O)}else V(O)&&(D=_(O),Fn(O))}function F(O){c.is(Sr)&&(c.set(qi),r(Kc)),D&&(L(O),Fn(O)),d(I,ga,z),d(I,ha,F),D=!1}function X(O){!$&&H&&Fn(O,!0)}function ie(O){N=B,B=O,S=C()}function L(O){var Z=ae(O),te=re(Z),Le=n.rewind&&n.rewindByDrag;m(!1),q?v.scroll(te,0,n.snap):e.is(Zo)?v.go(x(Ya(Z))<0?Le?"<":"-":Le?">":"+"):e.is(Ui)&&T&&Le?v.go(y(!0)?">":"<"):v.go(v.toDest(te),!0),m(!0)}function _(O){var Z=n.dragMinThreshold,te=Po(Z),Le=te&&Z.mouse||0,ve=(te?Z.touch:+Z)||10;return dn(M(O))>(he(O)?ve:Le)}function V(O){return dn(M(O))>dn(M(O,!0))}function ae(O){if(e.is(lo)||!T){var Z=se(O);if(Z&&Z<cl)return M(O)/Z}return 0}function re(O){return C()+Ya(O)*ni(dn(O)*(n.flickPower||600),q?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function M(O,Z){return b(O,Z)-b(j(O),Z)}function se(O){return qa(O)-qa(j(O))}function j(O){return B===O&&N||B}function b(O,Z){return(he(O)?O.changedTouches[0]:O)["page"+f(Z?"Y":"X")]}function k(O){return O/(T&&e.is(Ui)?Ep:1)}function G(O){var Z=n.noDrag;return!Eo(O,"."+ud+", ."+ta)&&(!Z||!Eo(O,Z))}function he(O){return typeof TouchEvent<"u"&&O instanceof TouchEvent}function J(){return D}function ee(O){$=O}return{mount:P,disable:ee,isDragging:J}}var Jp={Spacebar:" ",Right:Jr,Left:Zr,Up:od,Down:rd};function As(e){return e=ti(e)?e:e.key,Jp[e]||e}var dl="keydown";function Qp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){w(),o(ln,m),o(ln,w),o(Bn,f)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,dl,x))}function m(){l(u,dl)}function h(C){p=C}function f(){var C=p;p=!0,_c(function(){p=C})}function x(C){if(!p){var y=As(C);y===c(Zr)?e.go("<"):y===c(Jr)&&e.go(">")}}return{mount:v,destroy:m,disable:h}}var Io=ws+"-lazy",Tr=Io+"-srcset",em="["+Io+"], ["+Tr+"]";function tm(e,t,n){var i=Zt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[so,Li],p=[];function v(){n.lazyLoad&&(w(),o(en,w))}function w(){On(p),m(),c?C():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(y){bs(y.slide,em).forEach(function(S){var B=Sn(S,Io),N=Sn(S,Tr);if(B!==S.src||N!==S.srcset){var q=n.classes.spinner,D=S.parentElement,T=Yo(D,"."+q)||ji("span",q,D);p.push([S,y,T]),S.src||Ao(S,"none")}})})}function h(){p=p.filter(function(y){var S=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,S)?f(y):!0}),p.length||r(u)}function f(y){var S=y[0];En(y[1].slide,Ja),l(S,"load error",Yt(x,y)),$t(S,"src",Sn(S,Io)),$t(S,"srcset",Sn(S,Tr)),Mn(S,Io),Mn(S,Tr)}function x(y,S){var B=y[0],N=y[1];Nn(N.slide,Ja),S.type!=="error"&&(Ti(y[2]),Ao(B,""),d(Ls,B,N),d(Yi)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:v,destroy:Yt(On,p),check:h}}function nm(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,w=u.go,m=t.Direction.resolve,h=c.pagination,f=[],x,C;function y(){S(),o([ln,en,Fr],y);var $=n.pagination;h&&Ao(h,$?"":"none"),$&&(o([Bn,Yr,Li],H),B(),H(),r(Qc,{list:x,items:f},T(e.index)))}function S(){x&&(Ti(h?ri(x.children):x),Nn(x,C),On(f),x=null),i.destroy()}function B(){var $=e.length,I=n.classes,P=n.i18n,E=n.perPage,g=p()?u.getEnd()+1:Fo($/E);x=h||ji("ul",I.pagination,c.track.parentElement),En(x,C=na+"--"+D()),$t(x,Wn,"tablist"),$t(x,yn,P.select),$t(x,Es,D()===Qr?"vertical":"");for(var z=0;z<g;z++){var F=ji("li",null,x),X=ji("button",{class:I.page,type:"button"},F),ie=d.getIn(z).map(function(_){return _.slide.id}),L=!p()&&E>1?P.pageX:P.slideX;l(X,"click",Yt(N,z)),n.paginationKeyboard&&l(X,"keydown",Yt(q,z)),$t(F,Wn,"presentation"),$t(X,Wn,"tab"),$t(X,Ko,ie.join(" ")),$t(X,yn,Ua(L,z+1)),$t(X,Vi,-1),f.push({li:F,button:X,page:z})}}function N($){w(">"+$,!0)}function q($,I){var P=f.length,E=As(I),g=D(),z=-1;E===m(Jr,!1,g)?z=++$%P:E===m(Zr,!1,g)?z=(--$+P)%P:E==="Home"?z=0:E==="End"&&(z=P-1);var F=f[z];F&&(Dc(F.button),w(">"+z),Fn(I,!0))}function D(){return n.paginationDirection||n.direction}function T($){return f[u.toPage($)]}function H(){var $=T(v(!0)),I=T(v());if($){var P=$.button;Nn(P,Ii),Mn(P,ol),$t(P,Vi,-1)}if(I){var E=I.button;En(E,Ii),$t(E,ol,!0),$t(E,Vi,"")}r(ed,{list:x,items:f},$,I)}return{items:f,mount:y,destroy:S,getAt:T,update:H}}var im=[" ","Enter"];function om(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),On(r)}function c(){d(),l()}function u(h,f){var x=Zt(h);x.on(Bn,function(C,y,S){f.go(f.is(lo)?S:C)}),r.push(x)}function p(){var h=Zt(e),f=h.on;f(Cs,w),f(nd,m),f([ai,ln],v),r.push(h),h.emit(Ts,e.splides)}function v(){$t(t.Elements.list,Es,n.direction===Qr?"vertical":"")}function w(h){e.go(h.index)}function m(h,f){vs(im,As(f))&&(w(h),Fn(f))}return{setup:Yt(t.Media.set,{slideFocus:Go(o)?i:o},!0),mount:l,destroy:d,remount:c}}function rm(e,t,n){var i=Zt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,w=qa(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&w-r>h&&(e.go(v?"<":">"),r=w),c(v)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(ao)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var am=90;function sm(e,t,n){var i=Zt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=ji("span",Tp),c=Ur(am,Yt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,sl,!0),d.textContent="…",o(Is,Yt(w,!0)),o(Rs,Yt(w,!1)),o([so,Li],Yt(p,!0)))}function p(m){$t(r,al,m),m?(qo(r,d),c.start()):(Ti(d),c.cancel())}function v(){Mn(r,[rl,sl,al]),Ti(d)}function w(m){l&&$t(r,rl,m?"off":"polite")}return{mount:u,disable:w,destroy:v}}var lm=Object.freeze({__proto__:null,Media:fp,Direction:yp,Elements:Mp,Slides:Ap,Layout:Fp,Clones:Np,Move:Wp,Controller:Hp,Arrows:Bp,Autoplay:jp,Cover:Vp,Scroll:Kp,Drag:Zp,Keyboard:Qp,LazyLoad:tm,Pagination:nm,Sync:om,Wheel:rm,Live:sm}),cm={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"},dm={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:Lp,i18n:cm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function um(e,t,n){var i=t.Slides;function o(){Zt(e).on([ai,en],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),_c(c)}return{mount:o,start:l,cancel:Xa}}function pm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Yt(wn,l,"transition"),c;function u(){Zt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(v(),c())})}function p(m,h){var f=i.toPosition(m,!0),x=i.getPosition(),C=w(m);dn(f-x)>=1&&C>=1?n.useScroll?r.scroll(f,C,!1,h):(d("transform "+C+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(m),h())}function v(){d(""),r.cancel()}function w(m){var h=n.rewindSpeed;if(e.is(Ui)&&h){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&m>=x||f>=x&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:v}}var mm=(function(){function e(n,i){this.event=Zt(),this.Components={},this.state=gp(Bi),this.splides=[],this._o={},this._E={};var o=ti(n)?Bc(document,n):n;To(o,o+" is invalid."),this.root=o,i=Yn({label:Sn(o,yn)||"",labelledby:Sn(o,Ps)||""},dm,e.defaults,i||{});try{Yn(i,JSON.parse(Sn(o,ws)))}catch{To(!1,"Invalid JSON")}this._o=Object.create(Yn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;To(l.is([Bi,Mr]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(Zo)?um:pm),this._E=i||this._E;var c=ko({},lm,this._E,{Transition:this._T});return Ci(c,function(u,p){var v=u(r,d,r._o);d[p]=v,v.setup&&v.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(ai),En(this.root,Ip),l.set(qi),this.emit(Ka),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(qi)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(ri(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(en),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Bi)?Zt(this).on(Ka,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit($s),o.destroy(),i&&On(this.splides),r.set(Mr)),this},cp(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Fs=mm;Fs.defaults={};Fs.STATES=up;var ul=[[ai,"onMounted"],[Ka,"onReady"],[Bn,"onMove"],[so,"onMoved"],[Cs,"onClick"],[Vc,"onActive"],[Gc,"onInactive"],[Xc,"onVisible"],[qc,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Yi,"onResize"],[qr,"onResized"],[Yc,"onDrag"],[Uc,"onDragging"],[Kc,"onDragged"],[Yr,"onScroll"],[Li,"onScrolled"],[$s,"onDestroy"],[Zc,"onArrowsMounted"],[Jc,"onArrowsUpdated"],[Qc,"onPaginationMounted"],[ed,"onPaginationUpdated"],[Ts,"onNavigationMounted"],[Is,"onAutoplayPlay"],[td,"onAutoplayPlaying"],[Rs,"onAutoplayPause"],[Ls,"onLazyLoadLoaded"]];function _s(...e){return e.filter(Boolean).join(" ")}function _r(e){return e!==null&&typeof e=="object"}function Qa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Qa(n,t[i]));if(_r(e)&&_r(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Qa(e[o],t[o]))}return e===t}function gm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function hm(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function es(e,t){const n=e;return hm(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():_r(i)?n[o]=es(_r(n[o])?n[o]:{},i):n[o]=i}),n}var fm=({children:e,className:t,...n})=>s.createElement("div",{className:_s("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Ns=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Fs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=es({},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&&!Qa(this.options,e)&&(this.splide.options=e,this.options=es({},e));const t=this.getSlides();gm(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){ul.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(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:i,...o}=this.props;return s.createElement(t,{className:_s("splide",e),ref:this.splideRef,...this.omit(o,["options",...ul.map(r=>r[1])])},n?s.createElement(fm,null,i):i)}},Ws=({children:e,className:t,...n})=>s.createElement("li",{className:_s("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),pt=require("classnames"),W=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function vu(e){return e.type==="object"&&e.version===1}const xu="ControlSlider-module__wrapper___sHEkd",bu="ControlSlider-module__hoverArrow___A-dOH",wu="ControlSlider-module__sliderItem___QQSkR",Su="ControlSlider-module__sliderImage___9hRl-",Cu="ControlSlider-module__arrow___05ghY",$u="ControlSlider-module__arrowVertical___tBfVN",Tu="ControlSlider-module__nextArrow___-30Yc",Iu="ControlSlider-module__arrowInner___aEra3",Ru="ControlSlider-module__arrowIcon___S4ztF",Lu="ControlSlider-module__arrowImg___2dwJW",Pu="ControlSlider-module__mirror___brd6U",Eu="ControlSlider-module__pagination___bicLF",Mu="ControlSlider-module__paginationInner___bT-P-",ku="ControlSlider-module__paginationVertical___zYqKw",Au="ControlSlider-module__paginationItem___nTRbk",Fu="ControlSlider-module__dot___p1Qun",_u="ControlSlider-module__activeDot___LHFaj",Nu="ControlSlider-module__paginationInsideBottom___R3FWn",Wu="ControlSlider-module__paginationInsideTop___V-qb-",Hu="ControlSlider-module__paginationOutsideBottom___14w8D",Du="ControlSlider-module__paginationOutsideTop___SCLqB",Ou="ControlSlider-module__paginationInsideLeft___yOBRZ",Bu="ControlSlider-module__paginationInsideRight___Rtt3o",zu="ControlSlider-module__paginationOutsideLeft___lahaw",ju="ControlSlider-module__paginationOutsideRight___EtuQa",Vu="ControlSlider-module__imgWrapper___UjEgB",Gu="ControlSlider-module__captionBlock___dJ6-j",Xu="ControlSlider-module__captionTextWrapper___HFlpf",qu="ControlSlider-module__captionText___uGBVc",Yu="ControlSlider-module__active___WZK4G",Uu="ControlSlider-module__withPointerEvents___t-18M",Ku="ControlSlider-module__topLeftAlignment___zjnGM",Zu="ControlSlider-module__topCenterAlignment___gD1xW",Ju="ControlSlider-module__topRightAlignment___NMapS",Qu="ControlSlider-module__middleLeftAlignment___OnUrY",ep="ControlSlider-module__middleCenterAlignment___Tdkl0",tp="ControlSlider-module__middleRightAlignment___wEbfX",np="ControlSlider-module__bottomLeftAlignment___cTP2-",ip="ControlSlider-module__bottomCenterAlignment___c54fB",op="ControlSlider-module__bottomRightAlignment___kEwrz",rp="ControlSlider-module__clickOverlay___DZA28",ap="ControlSlider-module__contain___pLyq7",sp="ControlSlider-module__cover___KdDat",dt={wrapper:xu,hoverArrow:bu,sliderItem:wu,sliderImage:Su,arrow:Cu,arrowVertical:$u,nextArrow:Tu,arrowInner:Iu,arrowIcon:Ru,arrowImg:Lu,mirror:Pu,pagination:Eu,paginationInner:Mu,paginationVertical:ku,paginationItem:Au,dot:Fu,activeDot:_u,paginationInsideBottom:Nu,paginationInsideTop:Wu,paginationOutsideBottom:Hu,paginationOutsideTop:Du,paginationInsideLeft:Ou,paginationInsideRight:Bu,paginationOutsideLeft:zu,paginationOutsideRight:ju,imgWrapper:Vu,captionBlock:Gu,captionTextWrapper:Xu,captionText:qu,active:Yu,withPointerEvents:Uu,topLeftAlignment:Ku,topCenterAlignment:Zu,topRightAlignment:Ju,middleLeftAlignment:Qu,middleCenterAlignment:ep,middleRightAlignment:tp,bottomLeftAlignment:np,bottomCenterAlignment:ip,bottomRightAlignment:op,clickOverlay:rp,contain:ap,cover:sp};function lp(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function cp(e,t,n){return t&&lp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Js="(prefers-reduced-motion: reduce)",Bi=1,dp=2,qi=3,ao=4,Vo=5,Sr=6,Mr=7,up={CREATED:Bi,MOUNTED:dp,IDLE:qi,MOVING:ao,SCROLLING:Vo,DRAGGING:Sr,DESTROYED:Mr};function On(e){e.length=0}function ri(e,t,n){return Array.prototype.slice.call(e,t,n)}function Yt(e){return e.bind.apply(e,[null].concat(ri(arguments,1)))}var _c=setTimeout,Xa=function(){};function Qs(e){return requestAnimationFrame(e)}function Xr(e,t){return typeof t===e}function Po(e){return!ys(e)&&Xr("object",e)}var fs=Array.isArray,Nc=Yt(Xr,"function"),ti=Yt(Xr,"string"),Go=Yt(Xr,"undefined");function ys(e){return e===null}function Wc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Xo(e){return fs(e)?e:[e]}function xn(e,t){Xo(e).forEach(t)}function vs(e,t){return e.indexOf(t)>-1}function Cr(e,t){return e.push.apply(e,Xo(t)),e}function _n(e,t,n){e&&xn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function En(e,t){_n(e,ti(t)?t.split(" "):t,!0)}function qo(e,t){xn(t,e.appendChild.bind(e))}function xs(e,t){xn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Eo(e,t){return Wc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Hc(e,t){var n=e?ri(e.children):[];return t?n.filter(function(i){return Eo(i,t)}):n}function Yo(e,t){return t?Hc(e,t)[0]:e.firstElementChild}var Mo=Object.keys;function Ci(e,t,n){return e&&(n?Mo(e).reverse():Mo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ko(e){return ri(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function Yn(e){return ri(arguments,1).forEach(function(t){Ci(t,function(n,i){fs(n)?e[i]=n.slice():Po(n)?e[i]=Yn({},Po(e[i])?e[i]:{},n):e[i]=n})}),e}function el(e,t){xn(t||Mo(e),function(n){delete e[n]})}function Mn(e,t){xn(e,function(n){xn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Po(t)?Ci(t,function(i,o){$t(e,o,i)}):xn(e,function(i){ys(n)||n===""?Mn(i,t):i.setAttribute(t,String(n))})}function ji(e,t,n){var i=document.createElement(e);return t&&(ti(t)?En(i,t):$t(i,t)),n&&qo(n,i),i}function wn(e,t,n){if(Go(n))return getComputedStyle(e)[t];ys(n)||(e.style[t]=""+n)}function Ao(e,t){wn(e,"display",t)}function Dc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function tl(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function Ti(e){xn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Oc(e){return Yo(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Bc(e,t){return e&&e.querySelector(t)}function bs(e,t){return t?ri(e.querySelectorAll(t)):[]}function Nn(e,t){_n(e,t,!1)}function qa(e){return e.timeStamp}function ui(e){return ti(e)?e:e?e+"px":""}var Uo="splide",ws="data-"+Uo;function To(e,t){if(!e)throw new Error("["+Uo+"] "+(t||""))}var ni=Math.min,kr=Math.max,Ar=Math.floor,Fo=Math.ceil,dn=Math.abs;function zc(e,t,n){return dn(e-t)<n}function $r(e,t,n,i){var o=ni(t,n),r=kr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Wi(e,t,n){var i=ni(t,n),o=kr(t,n);return ni(kr(i,e),o)}function Ya(e){return+(e>0)-+(e<0)}function Ua(e,t){return xn(t,function(n){e=e.replace("%s",""+n)}),e}function Ss(e){return e<10?"0"+e:""+e}var nl={};function pp(e){return""+e+Ss(nl[e]=(nl[e]||0)+1)}function jc(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,w){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);m?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===v&&(!c||w[3]===c)?(w[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){xn(l,function(u){u&&xn(d,function(p){p.split(" ").forEach(function(v){var w=v.split(".");c(u,w[0],w[1])})})})}function r(){e.forEach(function(l){l[4]()}),On(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ai="mounted",Ka="ready",Bn="move",so="moved",Cs="click",Vc="active",Gc="inactive",Xc="visible",qc="hidden",en="refresh",ln="updated",Yi="resize",qr="resized",Yc="drag",Uc="dragging",Kc="dragged",Yr="scroll",Li="scrolled",mp="overflow",$s="destroy",Zc="arrows:mounted",Jc="arrows:updated",Qc="pagination:mounted",ed="pagination:updated",Ts="navigation:mounted",Is="autoplay:play",td="autoplay:playing",Rs="autoplay:pause",Ls="lazyload:loaded",nd="sk",id="sh",Fr="ei";function Zt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=jc();function i(r,l){n.bind(t,Xo(r).join(" "),function(d){l.apply(l,fs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ri(arguments,1))}return e&&e.event.on($s,n.destroy),ko(n,{bus:t,on:i,off:Yt(n.unbind,t),emit:o})}function Ur(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ni((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return w();d=Qs(p)}}function v(C){C||h(),r=o()-(C?l*e:0),c=!1,d=Qs(p)}function w(){c=!0}function m(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(C){e=C}function x(){return c}return{start:v,rewind:m,pause:w,cancel:h,set:f,isPaused:x}}function gp(e){var t=e;function n(o){t=o}function i(o){return vs(Xo(o),t)}return{set:n,is:i}}function hp(e,t){var n=Ur(0,e,null,1);return function(){n.isPaused()&&n.start()}}function fp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=jc(),d=[];function c(){var h=n.mediaQuery==="min";Mo(o).sort(function(f,x){return h?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,Js),v()}function u(h){h&&l.destroy()}function p(h,f){var x=matchMedia(f);l.bind(x,"change",v),d.push([h,x])}function v(){var h=i.is(Mr),f=n.direction,x=d.reduce(function(C,y){return Yn(C,y[1].matches?y[0]:{})},{});el(n),m(x),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function w(h){matchMedia(Js).matches&&(h?Yn(n,r):el(n,Mo(r)))}function m(h,f,x){Yn(n,h),f&&Yn(Object.getPrototypeOf(n),h),(x||!i.is(Bi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:w,set:m}}var Kr="Arrow",Zr=Kr+"Left",Jr=Kr+"Right",od=Kr+"Up",rd=Kr+"Down",il="rtl",Qr="ttb",pa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[od,Jr],ArrowRight:[rd,Zr]};function yp(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===il&&!l?1:d===Qr?0:-1;return pa[r]&&pa[r][c]||r.replace(/width|left|right/i,function(u,p){var v=pa[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(r){return r*(n.direction===il?1:-1)}return{resolve:i,orient:o}}var Wn="role",Vi="tabindex",vp="disabled",Cn="aria-",Ko=Cn+"controls",ad=Cn+"current",ol=Cn+"selected",yn=Cn+"label",Ps=Cn+"labelledby",sd=Cn+"hidden",Es=Cn+"orientation",_o=Cn+"roledescription",rl=Cn+"live",al=Cn+"busy",sl=Cn+"atomic",Ms=[Wn,Vi,vp,Ko,ad,yn,Ps,sd,Es,_o],kn=Uo+"__",si="is-",ma=Uo,ll=kn+"track",xp=kn+"list",ea=kn+"slide",ld=ea+"--clone",bp=ea+"__container",ks=kn+"arrows",ta=kn+"arrow",cd=ta+"--prev",dd=ta+"--next",na=kn+"pagination",ud=na+"__page",wp=kn+"progress",Sp=wp+"__bar",Cp=kn+"toggle",$p=kn+"spinner",Tp=kn+"sr",Ip=si+"initialized",Ii=si+"active",pd=si+"prev",md=si+"next",Za=si+"visible",Ja=si+"loading",gd=si+"focus-in",hd=si+"overflow",Rp=[Ii,Za,pd,md,Ja,gd,hd],Lp={slide:ea,clone:ld,arrows:ks,arrow:ta,prev:cd,next:dd,pagination:na,page:ud,spinner:$p};function Pp(e,t){if(Nc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Eo(n,t);)n=n.parentElement;return n}var Ep=5,cl=200,fd="touchstart mousedown",ga="touchmove mousemove",ha="touchend touchcancel mouseup click";function Mp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],w,m,h;function f(){S(),z(),y()}function x(){o(en,C),o(en,f),o(ln,y),r(document,fd+" keydown",function(B){h=B.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,gd,!!h)})}function C(B){var T=Ms.concat("style");On(u),Nn(l,p),Nn(w,v),Mn([w,m],T),Mn(l,B?T:["style",_o])}function y(){Nn(l,p),Nn(w,v),p=Y(ma),v=Y(ll),En(l,p),En(w,v),$t(l,yn,n.label),$t(l,Ps,n.labelledby)}function S(){w=N("."+ll),m=Yo(w,"."+xp),To(w&&m,"A track/list element is missing."),Cr(u,Hc(m,"."+ea+":not(."+ld+")")),Ci({arrows:ks,pagination:na,prev:cd,next:dd,bar:Sp,toggle:Cp},function(B,T){c[T]=N("."+B)}),ko(c,{root:l,track:w,list:m,slides:u})}function z(){var B=l.id||pp(Uo),T=n.role;l.id=B,w.id=w.id||B+"-track",m.id=m.id||B+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&T&&$t(l,Wn,T),$t(l,_o,d.carousel),$t(m,Wn,"presentation")}function N(B){var T=Bc(l,B);return T&&Pp(T,"."+ma)===l?T:void 0}function Y(B){return[B+"--"+n.type,B+"--"+n.direction,n.drag&&B+"--draggable",n.isNavigation&&B+"--nav",B===ma&&Ii]}return ko(c,{setup:f,mount:x,destroy:C})}var Ui="slide",lo="loop",Zo="fade";function kp(e,t,n,i){var o=Zt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,w=p.updateOnMove,m=p.i18n,h=p.pagination,f=p.slideFocus,x=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),S=n>-1,z=Yo(i,"."+bp),N;function Y(){S||(i.id=u.id+"-slide"+Ss(t+1),$t(i,Wn,h?"tabpanel":"group"),$t(i,_o,m.slide),$t(i,yn,y||Ua(m.slideLabel,[t+1,e.length]))),B()}function B(){d(i,"click",Yt(l,Cs,ie)),d(i,"keydown",Yt(l,nd,ie)),r([so,id,Li],I),r(Ts,H),w&&r(Bn,$)}function T(){N=!0,o.destroy(),Nn(i,Rp),Mn(i,Ms),$t(i,"style",C),$t(i,yn,y||"")}function H(){var L=e.splides.map(function(_){var V=_.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");$t(i,yn,Ua(m.slideX,(S?n:t)+1)),$t(i,Ko,L),$t(i,Wn,f?"button":""),f&&Mn(i,_o)}function $(){N||I()}function I(){if(!N){var L=e.index;P(),M(),_n(i,pd,t===L-1),_n(i,md,t===L+1)}}function P(){var L=D();L!==tl(i,Ii)&&(_n(i,Ii,L),$t(i,ad,v&&L||""),l(L?Vc:Gc,ie))}function M(){var L=A(),_=!L&&(!D()||S);if(e.state.is([ao,Vo])||$t(i,sd,_||""),$t(bs(i,p.focusableNodes||""),Vi,_?-1:""),f&&$t(i,Vi,_?-1:0),L!==tl(i,Za)&&(_n(i,Za,L),l(L?Xc:qc,ie)),!L&&document.activeElement===i){var V=c.Slides.getAt(e.index);V&&Dc(V.slide)}}function g(L,_,V){wn(V&&z||i,L,_)}function D(){var L=e.index;return L===t||p.cloneStatus&&L===n}function A(){if(e.is(Zo))return D();var L=hn(c.Elements.track),_=hn(i),V=x("left",!0),se=x("right",!0);return Ar(L[V])<=Fo(_[V])&&Ar(_[se])<=Fo(L[se])}function X(L,_){var V=dn(L-t);return!S&&(p.rewind||e.is(lo))&&(V=ni(V,e.length-V)),V<=_}var ie={index:t,slideIndex:n,slide:i,container:z,isClone:S,mount:Y,destroy:T,update:I,style:g,isWithin:X};return ie}function Ap(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){w(),o(en,m),o(en,w)}function w(){c.forEach(function(I,P){f(I,P,-1)})}function m(){N(function(I){I.destroy()}),On(p)}function h(){N(function(I){I.update()})}function f(I,P,M){var g=kp(e,P,M,I);g.mount(),p.push(g),p.sort(function(D,A){return D.index-A.index})}function x(I){return I?Y(function(P){return!P.isClone}):p}function C(I){var P=t.Controller,M=P.toIndex(I),g=P.hasFocus()?1:n.perPage;return Y(function(D){return $r(D.index,M,M+g-1)})}function y(I){return Y(I)[0]}function S(I,P){xn(I,function(M){if(ti(M)&&(M=Oc(M)),Wc(M)){var g=c[P];g?xs(M,g):qo(u,M),En(M,n.classes.slide),T(M,Yt(r,Yi))}}),r(en)}function z(I){Ti(Y(I).map(function(P){return P.slide})),r(en)}function N(I,P){x(P).forEach(I)}function Y(I){return p.filter(Nc(I)?I:function(P){return ti(I)?Eo(P.slide,I):vs(Xo(I),P.index)})}function B(I,P,M){N(function(g){g.style(I,P,M)})}function T(I,P){var M=bs(I,"img"),g=M.length;g?M.forEach(function(D){l(D,"load error",function(){--g||P()})}):P()}function H(I){return I?c.length:p.length}function $(){return p.length>n.perPage}return{mount:v,destroy:m,update:h,register:f,get:x,getIn:C,getAt:y,add:S,remove:z,forEach:N,filter:Y,style:B,getLength:H,isEnough:$}}function Fp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,w=u.list,m=d.getAt,h=d.style,f,x,C;function y(){S(),r(window,"resize load",hp(Yt(l,Yi))),o([ln,en],S),o(Yi,z)}function S(){f=n.direction===Qr,wn(p,"maxWidth",ui(n.width)),wn(v,c("paddingLeft"),N(!1)),wn(v,c("paddingRight"),N(!0)),z(!0)}function z(ie){var L=hn(p);(ie||x.width!==L.width||x.height!==L.height)&&(wn(v,"height",Y()),h(c("marginRight"),ui(n.gap)),h("width",T()),h("height",H(),!0),x=L,l(qr),C!==(C=X())&&(_n(p,hd,C),l(mp,C)))}function N(ie){var L=n.padding,_=c(ie?"right":"left");return L&&ui(L[_]||(Po(L)?0:L))||"0px"}function Y(){var ie="";return f&&(ie=B(),To(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+N(!1)+" - "+N(!0)+")"),ie}function B(){return ui(n.height||hn(w).width*n.heightRatio)}function T(){return n.autoWidth?null:ui(n.fixedWidth)||(f?"":$())}function H(){return ui(n.fixedHeight)||(f?n.autoHeight?null:$():B())}function $(){var ie=ui(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function I(){return hn(w)[c("width")]}function P(ie,L){var _=m(ie||0);return _?hn(_.slide)[c("width")]+(L?0:D()):0}function M(ie,L){var _=m(ie);if(_){var V=hn(_.slide)[c("right")],se=hn(w)[c("left")];return dn(V-se)+(L?0:D())}return 0}function g(ie){return M(e.length-1)-M(0)+P(0,ie)}function D(){var ie=m(0);return ie&&parseFloat(wn(ie.slide,c("marginRight")))||0}function A(ie){return parseFloat(wn(v,c("padding"+(ie?"Right":"Left"))))||0}function X(){return e.is(Zo)||g(!0)>I()}return{mount:y,resize:z,listSize:I,slideSize:P,sliderSize:g,totalSize:M,getPadding:A,isOverflow:X}}var _p=2;function Np(e,t,n){var i=Zt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,v),o([ln,Yi],m),(u=x())&&(h(u),t.Layout.resize(!0))}function v(){w(),p()}function w(){Ti(c),On(c),i.destroy()}function m(){var C=x();u!==C&&(u<C||!C)&&i.emit(en)}function h(C){var y=l.get().slice(),S=y.length;if(S){for(;y.length<C;)Cr(y,y);Cr(y.slice(-C),y.slice(0,C)).forEach(function(z,N){var Y=N<C,B=f(z.slide,N);Y?xs(B,y[0].slide):qo(r.list,B),Cr(c,B),l.register(B,N-C+(Y?0:S),z.index)})}}function f(C,y){var S=C.cloneNode(!0);return En(S,n.classes.clone),S.id=e.root.id+"-clone"+Ss(y+1),S}function x(){var C=n.clones;if(!e.is(lo))C=0;else if(Go(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=y&&Fo(hn(r.track)[d("width")]/y);C=S||n[d("autoWidth")]&&e.length||n.perPage*_p}return C}return{mount:p,destroy:w}}function Wp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,w=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,x=t.Elements,C=x.list,y=x.track,S;function z(){S=t.Transition,o([ai,qr,ln,en],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),B(e.index),t.Slides.update())}function Y(_,V,se,re){_!==V&&ie(_>se)&&(I(),T($(g(),_>se),!0)),l(ao),r(Bn,V,se,_),S.start(V,function(){l(qi),r(so,V,se,_),re&&re()})}function B(_){T(M(_,!0))}function T(_,V){if(!e.is(Zo)){var se=V?_:H(_);wn(C,"transform","translate"+h("X")+"("+se+"px)"),_!==se&&r(id)}}function H(_){if(e.is(lo)){var V=P(_),se=V>t.Controller.getEnd(),re=V<0;(re||se)&&(_=$(_,se))}return _}function $(_,V){var se=_-X(V),re=w();return _-=f(re*(Fo(dn(se)/re)||1))*(V?1:-1),_}function I(){T(g(),!0),S.cancel()}function P(_){for(var V=t.Slides.get(),se=0,re=1/0,k=0;k<V.length;k++){var le=V[k].index,G=dn(M(le,!0)-_);if(G<=re)re=G,se=le;else break}return se}function M(_,V){var se=f(p(_-1)-A(_));return V?D(se):se}function g(){var _=h("left");return hn(C)[_]-hn(y)[_]+f(u(!1))}function D(_){return n.trimSpace&&e.is(Ui)&&(_=Wi(_,0,f(w(!0)-v()))),_}function A(_){var V=n.focus;return V==="center"?(v()-c(_,!0))/2:+V*c(_)||0}function X(_){return M(_?t.Controller.getEnd():0,!!n.trimSpace)}function ie(_){var V=f($(g(),_));return _?V>=0:V<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(_,V){V=Go(V)?g():V;var se=_!==!0&&f(V)<f(X(!1)),re=_!==!1&&f(V)>f(X(!0));return se||re}return{mount:z,move:Y,jump:B,translate:T,shift:$,cancel:I,toIndex:P,toPosition:M,getPosition:g,getLimit:X,exceededLimit:L,reposition:N}}function Hp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,w=p.getLength,m=n.omitEnd,h=e.is(lo),f=e.is(Ui),x=Yt(g,!1),C=Yt(g,!0),y=n.start||0,S,z=y,N,Y,B;function T(){H(),o([ln,en,Fr],H),o(qr,$)}function H(){N=w(!0),Y=n.perMove,B=n.perPage,S=ie();var G=Wi(y,0,m?S:N-1);G!==y&&(y=G,l.reposition())}function $(){S!==ie()&&r(Fr)}function I(G,b,E){if(!le()){var j=M(G),me=X(j);me>-1&&(b||me!==y)&&(se(me),l.move(j,me,z,E))}}function P(G,b,E,j){t.Scroll.scroll(G,b,E,function(){var me=X(l.toIndex(d()));se(m?ni(me,S):me),j&&j()})}function M(G){var b=y;if(ti(G)){var E=G.match(/([+\-<>])(\d+)?/)||[],j=E[1],me=E[2];j==="+"||j==="-"?b=D(y+ +(""+j+(+me||1)),y):j===">"?b=me?L(+me):x(!0):j==="<"&&(b=C(!0))}else b=h?G:Wi(G,0,S);return b}function g(G,b){var E=Y||(k()?1:B),j=D(y+E*(G?-1:1),y,!(Y||k()));return j===-1&&f&&!zc(d(),c(!G),1)?G?0:S:b?j:X(j)}function D(G,b,E){if(v()||k()){var j=A(G);j!==G&&(b=G,G=j,E=!1),G<0||G>S?!Y&&($r(0,G,b,!0)||$r(S,b,G,!0))?G=L(_(G)):h?G=E?G<0?-(N%B||B):N:G:n.rewind?G=G<0?S:0:G=-1:E&&G!==b&&(G=L(_(b)+(G<b?-1:1)))}else G=-1;return G}function A(G){if(f&&n.trimSpace==="move"&&G!==y)for(var b=d();b===u(G,!0)&&$r(G,0,e.length-1,!n.rewind);)G<y?--G:++G;return G}function X(G){return h?(G+N)%N||0:G}function ie(){for(var G=N-(k()||h&&Y?1:B);m&&G-- >0;)if(u(N-1,!0)!==u(G,!0)){G++;break}return Wi(G,0,N-1)}function L(G){return Wi(k()?G:B*G,0,S)}function _(G){return k()?ni(G,S):Ar((G>=S?N-1:G)/B)}function V(G){var b=l.toIndex(G);return f?Wi(b,0,S):b}function se(G){G!==y&&(z=y,y=G)}function re(G){return G?z:y}function k(){return!Go(n.focus)||n.isNavigation}function le(){return e.state.is([ao,Vo])&&!!n.waitForTransition}return{mount:T,go:I,scroll:P,getNext:x,getPrev:C,getAdjacent:g,getEnd:ie,setIndex:se,getIndex:re,toIndex:L,toPage:_,toDest:V,hasFocus:k,isBusy:le}}var Dp="http://www.w3.org/2000/svg",Op="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",rr=40;function Bp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,w=u.track,m=v,h=u.prev,f=u.next,x,C,y={};function S(){N(),o(ln,z)}function z(){Y(),S()}function N(){var P=n.arrows;P&&!(h&&f)&&H(),h&&f&&(ko(y,{prev:h,next:f}),Ao(m,P?"":"none"),En(m,C=ks+"--"+n.direction),P&&(B(),I(),$t([h,f],Ko,w.id),l(Zc,h,f)))}function Y(){i.destroy(),Nn(m,C),x?(Ti(v?[h,f]:m),h=f=null):Mn([h,f],Ms)}function B(){o([ai,so,en,Li,Fr],I),r(f,"click",Yt(T,">")),r(h,"click",Yt(T,"<"))}function T(P){p.go(P,!0)}function H(){m=v||ji("div",d.arrows),h=$(!0),f=$(!1),x=!0,qo(m,[h,f]),!v&&xs(m,w)}function $(P){var M='<button class="'+d.arrow+" "+(P?d.prev:d.next)+'" type="button"><svg xmlns="'+Dp+'" viewBox="0 0 '+rr+" "+rr+'" width="'+rr+'" height="'+rr+'" focusable="false"><path d="'+(n.arrowPath||Op)+'" />';return Oc(M)}function I(){if(h&&f){var P=e.index,M=p.getPrev(),g=p.getNext(),D=M>-1&&P<M?c.last:c.prev,A=g>-1&&P>g?c.first:c.next;h.disabled=M<0,f.disabled=g<0,$t(h,yn,D),$t(f,yn,A),l(Jc,h,f,M,g)}}return{arrows:y,mount:S,destroy:Y,update:I}}var zp=ws+"-interval";function jp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=Ur(n.interval,e.go.bind(e,">"),B),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,w=p.toggle,m=n.autoplay,h,f,x=m==="pause";function C(){m&&(y(),w&&$t(w,Ko,u.track.id),x||S(),Y())}function y(){n.pauseOnHover&&r(v,"mouseenter mouseleave",function(H){h=H.type==="mouseenter",N()}),n.pauseOnFocus&&r(v,"focusin focusout",function(H){f=H.type==="focusin",N()}),w&&r(w,"click",function(){x?S():z(!0)}),o([Bn,Yr,en],d.rewind),o(Bn,T)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=x=!1,Y(),l(Is))}function z(H){H===void 0&&(H=!0),x=!!H,Y(),c()||(d.pause(),l(Rs))}function N(){x||(h||f?z(!1):S())}function Y(){w&&(_n(w,Ii,!x),$t(w,yn,n.i18n[x?"play":"pause"]))}function B(H){var $=u.bar;$&&wn($,"width",H*100+"%"),l(td,H)}function T(H){var $=t.Slides.getAt(H);d.set($&&+Sn($.slide,zp)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:z,isPaused:c}}function Vp(e,t,n){var i=Zt(e),o=i.on;function r(){n.cover&&(o(Ls,Yt(d,!0)),o([ai,ln,en],Yt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Yo(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),Ao(u,c?"none":"")}return{mount:r,destroy:Yt(l,!1)}}var Gp=10,Xp=600,qp=.6,Yp=1.5,Up=800;function Kp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,w=e.is(Ui),m,h,f=1;function x(){o(Bn,z),o([ln,en],N)}function C(B,T,H,$,I){var P=c();if(z(),H&&(!w||!p())){var M=t.Layout.sliderSize(),g=Ya(B)*M*Ar(dn(B)/M)||0;B=d.toPosition(t.Controller.toDest(B%M))+g}var D=zc(P,B,1);f=1,T=D?0:T||kr(dn(B-P)/Yp,Up),h=$,m=Ur(T,y,Yt(S,P,B,I),1),l(Vo),r(Yr),m.start()}function y(){l(qi),h&&h(),r(Li)}function S(B,T,H,$){var I=c(),P=B+(T-B)*Y($),M=(P-I)*f;v(I+M),w&&!H&&p()&&(f*=qp,dn(M)<Gp&&C(u(p(!0)),Xp,!1,h,!0))}function z(){m&&m.cancel()}function N(){m&&!m.isPaused()&&(z(),y())}function Y(B){var T=n.easingFunc;return T?T(B):1-Math.pow(1-B,4)}return{mount:x,destroy:z,scroll:C,cancel:N}}var Hi={passive:!1,capture:!0};function Zp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,w=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,x=h.orient,C=u.getPosition,y=u.exceededLimit,S,z,N,Y,B,T=!1,H,$,I;function P(){l(w,ga,Xa,Hi),l(w,ha,Xa,Hi),l(w,fd,g,Hi),l(w,"click",X,{capture:!0}),l(w,"dragstart",Fn),o([ai,ln],M)}function M(){var O=n.drag;te(!O),Y=O==="free"}function g(O){if(H=!1,!$){var J=me(O);j(O.target)&&(J||!O.button)&&(v.isBusy()?Fn(O,!0):(I=J?w:window,B=c.is([ao,Vo]),N=null,l(I,ga,D,Hi),l(I,ha,A,Hi),u.cancel(),p.cancel(),ie(O)))}}function D(O){if(c.is(Sr)||(c.set(Sr),r(Yc)),O.cancelable)if(B){u.translate(S+E(k(O)));var J=le(O)>cl,ne=T!==(T=y());(J||ne)&&ie(O),H=!0,r(Uc),Fn(O)}else V(O)&&(B=_(O),Fn(O))}function A(O){c.is(Sr)&&(c.set(qi),r(Kc)),B&&(L(O),Fn(O)),d(I,ga,D),d(I,ha,A),B=!1}function X(O){!$&&H&&Fn(O,!0)}function ie(O){N=z,z=O,S=C()}function L(O){var J=se(O),ne=re(J),Pe=n.rewind&&n.rewindByDrag;m(!1),Y?v.scroll(ne,0,n.snap):e.is(Zo)?v.go(x(Ya(J))<0?Pe?"<":"-":Pe?">":"+"):e.is(Ui)&&T&&Pe?v.go(y(!0)?">":"<"):v.go(v.toDest(ne),!0),m(!0)}function _(O){var J=n.dragMinThreshold,ne=Po(J),Pe=ne&&J.mouse||0,be=(ne?J.touch:+J)||10;return dn(k(O))>(me(O)?be:Pe)}function V(O){return dn(k(O))>dn(k(O,!0))}function se(O){if(e.is(lo)||!T){var J=le(O);if(J&&J<cl)return k(O)/J}return 0}function re(O){return C()+Ya(O)*ni(dn(O)*(n.flickPower||600),Y?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function k(O,J){return b(O,J)-b(G(O),J)}function le(O){return qa(O)-qa(G(O))}function G(O){return z===O&&N||z}function b(O,J){return(me(O)?O.changedTouches[0]:O)["page"+f(J?"Y":"X")]}function E(O){return O/(T&&e.is(Ui)?Ep:1)}function j(O){var J=n.noDrag;return!Eo(O,"."+ud+", ."+ta)&&(!J||!Eo(O,J))}function me(O){return typeof TouchEvent<"u"&&O instanceof TouchEvent}function K(){return B}function te(O){$=O}return{mount:P,disable:te,isDragging:K}}var Jp={Spacebar:" ",Right:Jr,Left:Zr,Up:od,Down:rd};function As(e){return e=ti(e)?e:e.key,Jp[e]||e}var dl="keydown";function Qp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){w(),o(ln,m),o(ln,w),o(Bn,f)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,dl,x))}function m(){l(u,dl)}function h(C){p=C}function f(){var C=p;p=!0,_c(function(){p=C})}function x(C){if(!p){var y=As(C);y===c(Zr)?e.go("<"):y===c(Jr)&&e.go(">")}}return{mount:v,destroy:m,disable:h}}var Io=ws+"-lazy",Tr=Io+"-srcset",em="["+Io+"], ["+Tr+"]";function tm(e,t,n){var i=Zt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[so,Li],p=[];function v(){n.lazyLoad&&(w(),o(en,w))}function w(){On(p),m(),c?C():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(y){bs(y.slide,em).forEach(function(S){var z=Sn(S,Io),N=Sn(S,Tr);if(z!==S.src||N!==S.srcset){var Y=n.classes.spinner,B=S.parentElement,T=Yo(B,"."+Y)||ji("span",Y,B);p.push([S,y,T]),S.src||Ao(S,"none")}})})}function h(){p=p.filter(function(y){var S=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,S)?f(y):!0}),p.length||r(u)}function f(y){var S=y[0];En(y[1].slide,Ja),l(S,"load error",Yt(x,y)),$t(S,"src",Sn(S,Io)),$t(S,"srcset",Sn(S,Tr)),Mn(S,Io),Mn(S,Tr)}function x(y,S){var z=y[0],N=y[1];Nn(N.slide,Ja),S.type!=="error"&&(Ti(y[2]),Ao(z,""),d(Ls,z,N),d(Yi)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:v,destroy:Yt(On,p),check:h}}function nm(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,w=u.go,m=t.Direction.resolve,h=c.pagination,f=[],x,C;function y(){S(),o([ln,en,Fr],y);var $=n.pagination;h&&Ao(h,$?"":"none"),$&&(o([Bn,Yr,Li],H),z(),H(),r(Qc,{list:x,items:f},T(e.index)))}function S(){x&&(Ti(h?ri(x.children):x),Nn(x,C),On(f),x=null),i.destroy()}function z(){var $=e.length,I=n.classes,P=n.i18n,M=n.perPage,g=p()?u.getEnd()+1:Fo($/M);x=h||ji("ul",I.pagination,c.track.parentElement),En(x,C=na+"--"+B()),$t(x,Wn,"tablist"),$t(x,yn,P.select),$t(x,Es,B()===Qr?"vertical":"");for(var D=0;D<g;D++){var A=ji("li",null,x),X=ji("button",{class:I.page,type:"button"},A),ie=d.getIn(D).map(function(_){return _.slide.id}),L=!p()&&M>1?P.pageX:P.slideX;l(X,"click",Yt(N,D)),n.paginationKeyboard&&l(X,"keydown",Yt(Y,D)),$t(A,Wn,"presentation"),$t(X,Wn,"tab"),$t(X,Ko,ie.join(" ")),$t(X,yn,Ua(L,D+1)),$t(X,Vi,-1),f.push({li:A,button:X,page:D})}}function N($){w(">"+$,!0)}function Y($,I){var P=f.length,M=As(I),g=B(),D=-1;M===m(Jr,!1,g)?D=++$%P:M===m(Zr,!1,g)?D=(--$+P)%P:M==="Home"?D=0:M==="End"&&(D=P-1);var A=f[D];A&&(Dc(A.button),w(">"+D),Fn(I,!0))}function B(){return n.paginationDirection||n.direction}function T($){return f[u.toPage($)]}function H(){var $=T(v(!0)),I=T(v());if($){var P=$.button;Nn(P,Ii),Mn(P,ol),$t(P,Vi,-1)}if(I){var M=I.button;En(M,Ii),$t(M,ol,!0),$t(M,Vi,"")}r(ed,{list:x,items:f},$,I)}return{items:f,mount:y,destroy:S,getAt:T,update:H}}var im=[" ","Enter"];function om(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),On(r)}function c(){d(),l()}function u(h,f){var x=Zt(h);x.on(Bn,function(C,y,S){f.go(f.is(lo)?S:C)}),r.push(x)}function p(){var h=Zt(e),f=h.on;f(Cs,w),f(nd,m),f([ai,ln],v),r.push(h),h.emit(Ts,e.splides)}function v(){$t(t.Elements.list,Es,n.direction===Qr?"vertical":"")}function w(h){e.go(h.index)}function m(h,f){vs(im,As(f))&&(w(h),Fn(f))}return{setup:Yt(t.Media.set,{slideFocus:Go(o)?i:o},!0),mount:l,destroy:d,remount:c}}function rm(e,t,n){var i=Zt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,w=qa(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&w-r>h&&(e.go(v?"<":">"),r=w),c(v)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(ao)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var am=90;function sm(e,t,n){var i=Zt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=ji("span",Tp),c=Ur(am,Yt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,sl,!0),d.textContent="…",o(Is,Yt(w,!0)),o(Rs,Yt(w,!1)),o([so,Li],Yt(p,!0)))}function p(m){$t(r,al,m),m?(qo(r,d),c.start()):(Ti(d),c.cancel())}function v(){Mn(r,[rl,sl,al]),Ti(d)}function w(m){l&&$t(r,rl,m?"off":"polite")}return{mount:u,disable:w,destroy:v}}var lm=Object.freeze({__proto__:null,Media:fp,Direction:yp,Elements:Mp,Slides:Ap,Layout:Fp,Clones:Np,Move:Wp,Controller:Hp,Arrows:Bp,Autoplay:jp,Cover:Vp,Scroll:Kp,Drag:Zp,Keyboard:Qp,LazyLoad:tm,Pagination:nm,Sync:om,Wheel:rm,Live:sm}),cm={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"},dm={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:Lp,i18n:cm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function um(e,t,n){var i=t.Slides;function o(){Zt(e).on([ai,en],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),_c(c)}return{mount:o,start:l,cancel:Xa}}function pm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Yt(wn,l,"transition"),c;function u(){Zt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(v(),c())})}function p(m,h){var f=i.toPosition(m,!0),x=i.getPosition(),C=w(m);dn(f-x)>=1&&C>=1?n.useScroll?r.scroll(f,C,!1,h):(d("transform "+C+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(m),h())}function v(){d(""),r.cancel()}function w(m){var h=n.rewindSpeed;if(e.is(Ui)&&h){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&m>=x||f>=x&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:v}}var mm=(function(){function e(n,i){this.event=Zt(),this.Components={},this.state=gp(Bi),this.splides=[],this._o={},this._E={};var o=ti(n)?Bc(document,n):n;To(o,o+" is invalid."),this.root=o,i=Yn({label:Sn(o,yn)||"",labelledby:Sn(o,Ps)||""},dm,e.defaults,i||{});try{Yn(i,JSON.parse(Sn(o,ws)))}catch{To(!1,"Invalid JSON")}this._o=Object.create(Yn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;To(l.is([Bi,Mr]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(Zo)?um:pm),this._E=i||this._E;var c=ko({},lm,this._E,{Transition:this._T});return Ci(c,function(u,p){var v=u(r,d,r._o);d[p]=v,v.setup&&v.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(ai),En(this.root,Ip),l.set(qi),this.emit(Ka),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(qi)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(ri(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(en),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Bi)?Zt(this).on(Ka,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit($s),o.destroy(),i&&On(this.splides),r.set(Mr)),this},cp(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Fs=mm;Fs.defaults={};Fs.STATES=up;var ul=[[ai,"onMounted"],[Ka,"onReady"],[Bn,"onMove"],[so,"onMoved"],[Cs,"onClick"],[Vc,"onActive"],[Gc,"onInactive"],[Xc,"onVisible"],[qc,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Yi,"onResize"],[qr,"onResized"],[Yc,"onDrag"],[Uc,"onDragging"],[Kc,"onDragged"],[Yr,"onScroll"],[Li,"onScrolled"],[$s,"onDestroy"],[Zc,"onArrowsMounted"],[Jc,"onArrowsUpdated"],[Qc,"onPaginationMounted"],[ed,"onPaginationUpdated"],[Ts,"onNavigationMounted"],[Is,"onAutoplayPlay"],[td,"onAutoplayPlaying"],[Rs,"onAutoplayPause"],[Ls,"onLazyLoadLoaded"]];function _s(...e){return e.filter(Boolean).join(" ")}function _r(e){return e!==null&&typeof e=="object"}function Qa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Qa(n,t[i]));if(_r(e)&&_r(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Qa(e[o],t[o]))}return e===t}function gm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function hm(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function es(e,t){const n=e;return hm(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():_r(i)?n[o]=es(_r(n[o])?n[o]:{},i):n[o]=i}),n}var fm=({children:e,className:t,...n})=>s.createElement("div",{className:_s("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Ns=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Fs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=es({},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&&!Qa(this.options,e)&&(this.splide.options=e,this.options=es({},e));const t=this.getSlides();gm(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){ul.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(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:i,...o}=this.props;return s.createElement(t,{className:_s("splide",e),ref:this.splideRef,...this.omit(o,["options",...ul.map(r=>r[1])])},n?s.createElement(fm,null,i):i)}},Ws=({children:e,className:t,...n})=>s.createElement("li",{className:_s("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 ym="RichTextRenderer-module__link___BWeZ2",vm={link:ym},xm=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},co=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>xm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:co(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:W.scalingValue(e.letterSpacing,t),wordSpacing:W.scalingValue(e.wordSpacing,t),fontSize:W.scalingValue(n,t),lineHeight:i!==void 0?W.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:vm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:bm(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function bm(e){return{...e.fontFamily&&{fontFamily:co(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 wm="SvgImage-module__svg___q3xE-",Sm="SvgImage-module__img___VsTm-",pl={svg:wm,img:Sm},Cm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},$m=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,sn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Cm(e)||!r?a.jsx("img",{src:e,alt:"",className:pt(pl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:pt(pl.svg,i),style:{"--svg":$m(e),"--fill":t,"--hover-fill":n,...o??{}}})},Tm={"top-left":dt.topLeftAlignment,"top-center":dt.topCenterAlignment,"top-right":dt.topRightAlignment,"middle-left":dt.middleLeftAlignment,"middle-center":dt.middleCenterAlignment,"middle-right":dt.middleRightAlignment,"bottom-left":dt.bottomLeftAlignment,"bottom-center":dt.bottomCenterAlignment,"bottom-right":dt.bottomRightAlignment};function Im({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:w,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[x,C]=s.useState(null),[y,S]=s.useState(0),[B,N]=s.useState(0),{direction:q,transition:D,controls:T,pagination:H,imageCaption:$,triggers:I}=e,P=s.useRef(D.type),{x:E,y:g}=e.controls.offset,z=F=>{o&&o.go(F)};return s.useEffect(()=>{if(!x)return;const F=new ResizeObserver(X=>{if(!o)return;const[ie]=X;f({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return F.observe(x),()=>F.unobserve(x)},[x]),s.useEffect(()=>{!o||P.current===D.type||(N(F=>F+1),P.current=D.type)},[D.type]),a.jsx("div",{className:pt(dt.wrapper,{[dt.editor]:i}),ref:C,children:a.jsxs("div",{className:dt.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:D.backgroundColor&&D.type==="fade in"?D.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(dt.captionBlock),children:a.jsx("div",{className:dt.captionTextWrapper,children:t.map((F,X)=>a.jsx("div",{className:pt(dt.captionText,Tm[$.alignment],{[dt.withPointerEvents]:X===y&&i,[dt.active]:X===y}),style:{fontFamily:co(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":W.scalingValue(l.width,i),letterSpacing:W.scalingValue(c,i),wordSpacing:W.scalingValue(p,i),textAlign:u,fontSize:W.scalingValue(v.fontSize,i),lineHeight:W.scalingValue(v.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:m,transitionDuration:D.duration?`${Math.round(parseInt(D.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:dt.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:W.scalingValue($.offset.y,i),left:W.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:F.imageCaption})})},X))})}),a.jsx(Ns,{onMove:F=>{S(F.index)},ref:r,options:{arrows:!1,speed:D.duration?parseInt(D.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:q==="horiz"||D.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:D.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((F,X)=>a.jsx(Ws,{children:a.jsx("div",{className:dt.sliderItem,children:a.jsx("div",{className:dt.imgWrapper,children:a.jsx("img",{className:pt(dt.sliderImage,{[dt.contain]:F.image.objectFit==="contain",[dt.cover]:F.image.objectFit==="cover"}),src:F.image.url,alt:F.image.name??""})})})},X))},B),T.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(dt.arrow,{[dt.arrowVertical]:q==="vert",[dt.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:a.jsxs("button",{onClick:()=>{z("-1")},className:dt.arrowInner,style:{transform:`translate(${W.scalingValue(E,i)}, ${W.scalingValue(g*(q==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&a.jsx(sn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:pt(dt.arrowImg,dt.mirror)}),!T.arrowsImgUrl&&a.jsx(ml,{color:T.color,className:pt(dt.arrowIcon,dt.arrowImg,dt.mirror)})]})}),a.jsx("div",{className:pt(dt.arrow,dt.nextArrow,{[dt.arrowVertical]:q==="vert",[dt.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:a.jsxs("button",{className:dt.arrowInner,onClick:()=>z("+1"),style:{transform:`translate(${W.scalingValue(E*(q==="horiz"?-1:1),i)}, ${W.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&a.jsx(sn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:dt.arrowImg}),!T.arrowsImgUrl&&a.jsx(ml,{color:T.color,className:pt(dt.arrowIcon,dt.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:dt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),H.isActive&&a.jsx("div",{className:pt(dt.pagination,{[dt.paginationInsideBottom]:H.position==="inside-1"&&q==="horiz",[dt.paginationInsideTop]:H.position==="inside-2"&&q==="horiz",[dt.paginationOutsideBottom]:H.position==="outside-1"&&q==="horiz",[dt.paginationOutsideTop]:H.position==="outside-2"&&q==="horiz",[dt.paginationInsideLeft]:H.position==="inside-1"&&q==="vert",[dt.paginationInsideRight]:H.position==="inside-2"&&q==="vert",[dt.paginationOutsideLeft]:H.position==="outside-1"&&q==="vert",[dt.paginationOutsideRight]:H.position==="outside-2"&&q==="vert",[dt.paginationVertical]:q==="vert"}),children:a.jsx("div",{className:dt.paginationInner,style:{backgroundColor:H.colors[2],transform:`scale(${H.scale/100}) translate(${W.scalingValue(H.offset.x,i)}, ${W.scalingValue(H.offset.y,i)}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:t.map((F,X)=>a.jsx("button",{onClick:()=>{o&&o.go(X)},className:pt(dt.paginationItem),children:a.jsx("div",{className:pt(dt.dot,{[dt.activeDot]:X===y}),style:{backgroundColor:X===y?H.colors[0]:H.colors[1],"--pagination-hover-color":H.hover}})},X))})})]})})}function ml({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Rm={element:Im,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Lm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Pm="ImageRevealSlider-module__image___Qjt-e",Em="ImageRevealSlider-module__link___N-iLG",Mm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:Lm,image:Pm,link:Em,cursor:Mm};function gl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function fa(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function km(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await fa(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await fa(e);r=l.height/l.width*o}else{const l=await fa(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Am({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,v]=s.useState({x:0,y:0}),[w,m]=s.useState(1),[h,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:B,randomRangeImageWidth:N}=e.imageSize,{revealPosition:q,visible:D}=e.position,{cursorType:T,target:H,defaultCursorScale:$,defaultCursor:I,hoverCursorScale:P,hoverCursor:E}=e.cursor;s.useEffect(()=>{if(!i)return;const F=(L,_)=>{const V=i.getBoundingClientRect(),ae=L-V.left,re=_-V.top;if(v({x:ae,y:re}),T==="system"){f("none"),m(1);return}const M=ae,se=re,j=document.elementFromPoint(V.left+M,V.top+se);if(j&&j.closest("a")){f("none"),m(1);return}const b=gl(M,se,r)||H==="area"?{img:E??"none",scale:P}:{img:I??"none",scale:$};f(b.img),m(b.scale)},X=L=>{L.stopPropagation(),x.current={x:L.clientX,y:L.clientY},F(L.clientX,L.clientY)},ie=()=>{C&&F(x.current.x,x.current.y)};return i.addEventListener("mousemove",X),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",X),window.removeEventListener("scroll",ie,!0)}},[i,C,p,T,H,E,I,P,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(F,X,ie,L={})=>{const{width:_,height:V,finalWidth:ae}=await km(F.image.url,S,B,N);let re=0,M=0;q==="same"?(re=X/2,M=ie/2):(re=L.x??Math.random()*X,M=L.y??Math.random()*ie);const se=Math.min(Math.max(re,_/2),X-_/2),j=Math.min(Math.max(M,V/2),ie-V/2);return{id:u.current++,url:F.image.url,link:F.link,name:F.image.name,x:se,y:j,width:ae}};s.useEffect(()=>{if(!i||t.length===0)return;const F=i.getBoundingClientRect(),X=F.width,ie=F.height,L=[];(async()=>{const V=t[0],ae=await g(V,X,ie);L.push(ae),l(L),c(1)})()},[S,B,N,q,i]),s.useEffect(()=>{D==="last One"&&l(F=>F.length>0?[F[F.length-1]]:[])},[D]);const z=async F=>{if(!i)return;const X=i.getBoundingClientRect(),ie=F.clientX-X.left,L=F.clientY-X.top;if(H==="image"&&!gl(ie,L,r))return;let _=0,V=0;q==="on Click"?(_=ie,V=L):q==="same"?(_=X.width/2,V=X.height/2):(_=Math.random()*X.width,V=Math.random()*X.height);const ae=t[d],re=await g(ae,X.width,X.height,{x:_,y:V});l(M=>D==="all"?[...M,re]:[re]),c(M=>M>=t.length-1?0:M+1)};return a.jsxs("div",{ref:o,onClick:z,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Mi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(F=>a.jsx("div",{className:Mi.wrapper,style:{top:`${F.y}px`,left:`${F.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:F.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:H==="area"&&F.link?a.jsx("a",{href:F.link,target:"_blank",className:Mi.link,children:a.jsx("img",{src:F.url,alt:F.name,className:Mi.image},F.id)}):a.jsx("img",{src:F.url,alt:F.name,className:Mi.image},F.id)},F.id)),C&&a.jsx("div",{className:Mi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Fm={element:Am,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},_m="LightBox-module__hidden___9s-9x",Nm="LightBox-module__heroImage___sTxNF",Wm="LightBox-module__background___rm9ml",Hm="LightBox-module__editor___4ACaY",Dm="LightBox-module__contentStyle___Bgnsq",Om="LightBox-module__imageStyle___tLIlB",Bm="LightBox-module__imgWrapper___LuFUp",zm="LightBox-module__contain___8-yaS",jm="LightBox-module__cover___hNvOG",Vm="LightBox-module__caption___b6L2I",Gm="LightBox-module__captionTextInner___rCGNH",Xm="LightBox-module__lightboxSplide___XFuWC",qm="LightBox-module__arrow___iz38X",Ym="LightBox-module__arrowVertical___Zfz81",Um="LightBox-module__nextArrow___zkAQN",Km="LightBox-module__arrowInner___p48sW",Zm="LightBox-module__arrowIcon___3VaFf",Jm="LightBox-module__arrowImg___pNV88",Qm="LightBox-module__mirror___pjeXc",eg="LightBox-module__thumbsWrapper___GB-nU",tg="LightBox-module__thumbsContainerVertical___wttk5",ng="LightBox-module__thumbsContainer___osSma",ig="LightBox-module__thumbsAlignStart___MO6tY",og="LightBox-module__thumbsAlignCenter___Q4sUx",rg="LightBox-module__thumbsAlignEnd___p4y9R",ag="LightBox-module__thumbItem___HvnF3",sg="LightBox-module__closeButton___g2khP",lg="LightBox-module__fadeIn___0m5GW",cg="LightBox-module__slideInLeft___gPYwC",dg="LightBox-module__slideInRight___S-pPp",ug="LightBox-module__slideInTop___DFdAj",pg="LightBox-module__slideInBottom___m27kZ",mg="LightBox-module__fadeOut___55qBR",gg="LightBox-module__slideOutLeft___NvU7P",hg="LightBox-module__slideOutRight___SK7eC",fg="LightBox-module__slideOutTop___Vgg0z",yg="LightBox-module__slideOutBottom___nJ0Ef",vg="LightBox-module__scaleSlide___vZriG",Qe={hidden:_m,heroImage:Nm,background:Wm,editor:Hm,contentStyle:Dm,imageStyle:Om,imgWrapper:Bm,contain:zm,cover:jm,caption:Vm,captionTextInner:Gm,lightboxSplide:Xm,arrow:qm,arrowVertical:Ym,nextArrow:Um,arrowInner:Km,arrowIcon:Zm,arrowImg:Jm,mirror:Qm,thumbsWrapper:eg,thumbsContainerVertical:tg,thumbsContainer:ng,thumbsAlignStart:ig,thumbsAlignCenter:og,thumbsAlignEnd:rg,thumbItem:ag,closeButton:sg,fadeIn:lg,slideInLeft:cg,slideInRight:dg,slideInTop:ug,slideInBottom:pg,fadeOut:mg,slideOutLeft:gg,slideOutRight:hg,slideOutTop:fg,slideOutBottom:yg,scaleSlide:vg},ar=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), calc(-50% + ${W.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${W.scalingValue(t.x,n)}, calc(-50% + ${W.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), ${W.scalingValue(t.y,n)})`:i.transform=`translate(${W.scalingValue(t.x,n)}, ${W.scalingValue(t.y,n)})`,i};function yd(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 xg(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function vd(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function bg(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function xd(e,t,n,i,o){const{x:r,y:l}=xg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function wg(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?bg:vd,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:v,offsetY:w}=xd(n,i,u,p,d),m=(v+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Sg(e){return wg(e)}function Nr(e){const t=e.getBoundingClientRect(),n=yd(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=vd(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=xd(i,o,d,c,u),w=t.left+n.left,m=t.top+n.top;return{x:p+w,y:v+m,width:d,height:c}}function hl(e){const t=e.getBoundingClientRect(),n=yd(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function fl(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Cg(e,t){const n=(()=>{if(e==="fade in")return Qe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeIn;if(e==="slide in")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeOut;if(e==="slide in")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})(),r=(()=>{if(e==="fade in")return Qe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const $g=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:Qe.heroImage,onClick:()=>c(!0)}),a.jsx(Tg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Tg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ye;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:w,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[x,C]=s.useState(0),[y,S]=s.useState(0),[B,N]=s.useState(!1),[q,D]=s.useState(!1),[T,H]=s.useState({}),$=s.useRef(null),I=s.useRef(null),P=s.useRef(null),E=s.useRef(!1),g=s.useRef(null),z=s.useRef(null),F=s.useRef(null),X=s.useRef(null),ie=s.useRef(!1),L=s.useRef(null),[_,V]=s.useState(!1),{appear:ae,triggers:re,slider:M,thumbnail:se,controls:j,area:b,caption:k,layout:G}=o.lightboxBlock,{appearClass:he,backdropAppearClass:J,backdropDisappearClass:ee,disappearClass:O}=Cg(ae.type,ae.direction),Z=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const U=()=>{setTimeout(()=>{var le,Ce;(Ce=(le=$.current)==null?void 0:le.splide)==null||Ce.refresh()},16)},ce=()=>{S(le=>le+1)};return window.addEventListener("ArticleEditor.Layout:change",U),window.addEventListener("ArticleEditor.ComponentContent:change",ce),()=>{window.removeEventListener("ArticleEditor.Layout:change",U),window.removeEventListener("ArticleEditor.ComponentContent:change",ce)}},[]),s.useEffect(()=>{if(!e||!se.isActive){V(!1);return}const U=L.current;if(!U)return;const ce=()=>{M.direction==="horiz"?V(U.scrollWidth>U.clientWidth):V(U.scrollHeight>U.clientHeight)};ce();const le=new ResizeObserver(ce);return le.observe(U),()=>le.disconnect()},[e,se.isActive,n.length,T,M.direction]);const te=s.useCallback(()=>{const U=window.matchMedia("(max-width: 768px)").matches,ce=fl(b.color);U&&!l&&ce>.9&&(document.body.style.backgroundColor=""),N(!0),E.current=!0;const le=Ce=>{Ce.target===g.current&&Ce.animationName&&(g.current&&z.current&&g.current.removeEventListener("animationend",z.current),z.current=null,E.current&&(E.current=!1,t()),N(!1))};g.current&&(z.current=le,g.current.addEventListener("animationend",le))},[t,b.color,l]),Le=(U,ce,le)=>{var Ce,Fe;if(U){if(re.type==="click"&&re.switch==="image")re.repeat==="close"&&x===n.length-1?te():(Ce=$.current)==null||Ce.go("+1");else if(re.type==="click"&&re.switch==="50/50"){const Ee=U.getBoundingClientRect(),Y=ce-Ee.left,be=le-Ee.top,de=Ee.width,K=Ee.height;let ue;M.direction==="horiz"?ue=Y<de/2?"-1":"+1":ue=be<K/2?"-1":"+1",(Fe=$.current)==null||Fe.go(ue)}}},ve=U=>{if(ie.current){ie.current=!1;return}const ce=n[x],le=(ce==null?void 0:ce.image.objectFit)==="cover";let Ce,Fe;if("changedTouches"in U&&U.changedTouches.length>0)Ce=U.changedTouches[0].clientX,Fe=U.changedTouches[0].clientY;else if("clientX"in U)Ce=U.clientX,Fe=U.clientY;else return;let Ee;if(le&&P.current){const Y=hl(P.current);Ee=Ce>=Y.left&&Ce<=Y.right&&Fe>=Y.top&&Fe<=Y.bottom}else{const Y=P.current?Nr(P.current):null;if(!Y){U.target===U.currentTarget&&te();return}Ee=Ce>=Y.x&&Ce<=Y.x+Y.width&&Fe>=Y.y&&Fe<=Y.y+Y.height}Ee?Le(P.current,Ce,Fe):te()},Ie=U=>{const ce=U.target;(ce.classList.contains(Qe.thumbsWrapper)||ce.classList.contains(Qe.thumbsContainer))&&ve(U)};s.useEffect(()=>{if(!e)return;const U=ce=>{var le,Ce;if(ce.key==="Escape"){te();return}if(ce.key==="ArrowRight"){C(Fe=>(Fe+1)%Math.max(n.length,1)),(le=$.current)==null||le.go("+1");return}ce.key==="ArrowLeft"&&(C(Fe=>(Fe-1+Math.max(n.length,1))%Math.max(n.length,1)),(Ce=$.current)==null||Ce.go("-1"))};return window.addEventListener("keydown",U),()=>{window.removeEventListener("keydown",U)}},[e,te,n.length]),s.useEffect(()=>{if(e){if(C(0),S(ce=>ce+1),E.current=!1,N(!1),D(!1),H({}),!Z)return;const U=new CustomEvent("page-overlay",{detail:{itemId:Z}});window.dispatchEvent(U)}return()=>{g.current&&z.current&&(g.current.removeEventListener("animationend",z.current),z.current=null),D(!1)}},[e,Z]),s.useEffect(()=>{I.current!==null&&I.current!==M.type&&S(U=>U+1),I.current=M.type},[M.type]),s.useEffect(()=>{if(!e)return;const U=document.body.style.overflow,ce=window.matchMedia("(max-width: 768px)").matches,le=fl(b.color);document.body.style.overflow="hidden",D(!1);const Ce=Ee=>{Ee.target===g.current&&!E.current&&Ee.animationName&&(ce&&!l&&le>.9&&(document.body.style.backgroundColor=b.color),D(!0),g.current&&F.current&&g.current.removeEventListener("animationend",F.current),F.current=null)};g.current&&(F.current=Ce,g.current.addEventListener("animationend",Ce));const Fe=Ee=>{const Y=Ee.target;Y&&(Y.closest(`.${Qe.thumbsWrapper}`)||Y.closest(`.${Qe.thumbsContainer}`))||M.type!=="slide"&&Ee.preventDefault()};return document.addEventListener("touchmove",Fe,{passive:!1}),()=>{document.body.style.overflow=U,document.removeEventListener("touchmove",Fe),g.current&&F.current&&(g.current.removeEventListener("animationend",F.current),F.current=null),D(!1)}},[e,l,b.color,M.type]),s.useEffect(()=>{if(!e)return;const U=ce=>{var Ce,Fe;if(E.current){ce.stopPropagation();return}if(ie.current){ie.current=!1;return}const le=ce.target;if(!(le&&(le.closest(`.${Qe.thumbsContainer}`)||le.closest(`.${Qe.thumbItem}`)||le.closest(`.${Qe.arrow}`)||le.closest(`.${Qe.closeButton}`)||le.closest(`.${Qe.caption}`)))){if(M.type==="slide"&&re.type==="drag"&&((Fe=(Ce=$.current)==null?void 0:Ce.splide)!=null&&Fe.root)){const Ee=$.current.splide.root;if(le&&(Ee.contains(le)||Ee===le))return}if(ce.touches.length===0&&ce.changedTouches.length>0){const Ee=n[x],Y=(Ee==null?void 0:Ee.image.objectFit)==="cover",be=ce.changedTouches[0];let de;if(Y&&P.current){const K=hl(P.current);de=be.clientX>=K.left&&be.clientX<=K.right&&be.clientY>=K.top&&be.clientY<=K.bottom}else{const K=P.current?Nr(P.current):null;if(!K)return;de=be.clientX>=K.x&&be.clientX<=K.x+K.width&&be.clientY>=K.y&&be.clientY<=K.y+K.height}if(!de){ce.stopPropagation(),E.current=!0;const K=ue=>{ue.stopPropagation(),ue.preventDefault(),document.removeEventListener("click",K,!0)};document.addEventListener("click",K,!0),te()}}}};return document.addEventListener("touchend",U,{passive:!0}),()=>{document.removeEventListener("touchend",U)}},[e,te,x,n]);const pe=(M.type==="scale"||M.type==="fade")&&M.direction==="vert"&&re.type==="drag";s.useEffect(()=>{var ue,He;if(!e||!pe||!((He=(ue=$.current)==null?void 0:ue.splide)!=null&&He.root))return;const U=$.current.splide.root,ce=30,le=(fe,Q)=>{if(X.current){const Je=Math.abs(fe-X.current.x),Ne=Math.abs(Q-X.current.y);(Je>0||Ne>0)&&(ie.current=!0)}},Ce=fe=>{X.current&&(fe.preventDefault(),le(fe.clientX,fe.clientY))},Fe=fe=>{X.current&&fe.touches.length>0&&(fe.preventDefault(),le(fe.touches[0].clientX,fe.touches[0].clientY))},Ee=(fe,Q)=>{if(!X.current||!$.current){X.current=null;return}const Je=Math.abs(fe-X.current.x),Ne=Math.abs(Q-X.current.y);Ne>ce&&Ne>Je&&$.current.go(Q<X.current.y?"+1":"-1"),X.current=null},Y=fe=>{X.current&&Ee(fe.clientX,fe.clientY),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("pointermove",Ce)},be=fe=>{if(X.current){if(fe.changedTouches.length>0){const Q=fe.changedTouches[0];Ee(Q.clientX,Q.clientY)}document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),document.removeEventListener("touchmove",Fe)}},de=fe=>{X.current={x:fe.clientX,y:fe.clientY},ie.current=!1,document.addEventListener("pointermove",Ce,{passive:!1}),document.addEventListener("pointerup",Y),document.addEventListener("pointercancel",Y)},K=fe=>{fe.touches.length>0&&(X.current={x:fe.touches[0].clientX,y:fe.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Fe,{passive:!1}),document.addEventListener("touchend",be),document.addEventListener("touchcancel",be))};return U.addEventListener("pointerdown",de),U.addEventListener("touchstart",K),()=>{U.removeEventListener("pointerdown",de),U.removeEventListener("touchstart",K),document.removeEventListener("pointermove",Ce),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("touchmove",Fe),document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),X.current=null,ie.current=!1}},[e,pe,y]);const oe={backgroundColor:b.color,backdropFilter:`blur(${b.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:zn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:g,className:pt(Qe.background,B?ee:J,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{...oe,...q&&!l&&!B?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Qe.contentStyle,B?O:he,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ns,{onMove:U=>C(U.index),ref:$,className:Qe.lightboxSplide,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,direction:M.direction==="horiz"||M.type==="fade"||M.type==="scale"?"ltr":"ttb",pagination:!1,drag:re.type==="drag"&&!pe,perPage:1,width:"100%",height:"100%",type:M.type==="fade"||M.type==="scale"?"fade":"loop",padding:0,rewind:re.repeat!=="close",start:0},style:{"--splide-speed":M.duration},children:n.map((U,ce)=>{const le=ar(G.position,G.offset,l),Ce=`${W.scalingValue(G.padding.top,l)} ${W.scalingValue(G.padding.right,l)} ${W.scalingValue(G.padding.bottom,l)} ${W.scalingValue(G.padding.left,l)}`,Fe=M.type==="scale"?(()=>{const{transform:Ee,...Y}=le;return{...Y,position:"absolute",padding:Ce,boxSizing:"border-box","--position-transform":Ee||"none"}})():{...le,position:"absolute",padding:Ce,boxSizing:"border-box"};return a.jsx(Ws,{children:a.jsx("div",{className:Qe.imgWrapper,onClick:ve,children:a.jsx("img",{ref:ce===x?P:null,className:pt(Qe.imageStyle,{[Qe.contain]:U.image.objectFit==="contain",[Qe.cover]:U.image.objectFit==="cover",[Qe.scaleSlide]:M.type==="scale"}),src:U.image.url,alt:U.image.name??"",style:{...Fe,pointerEvents:U.image.objectFit==="contain"?"none":"auto"}})})},ce)})},y),j.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Qe.arrow,{[Qe.arrowVertical]:M.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${W.scalingValue(j.offset.x,l)}, ${W.scalingValue(j.offset.y*(M.direction==="horiz"?1:-1),l)}) scale(${j.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var U;return(U=$.current)==null?void 0:U.go("-1")},"aria-label":"Previous",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:pt(Qe.arrowImg,Qe.mirror)}),!j.arrowsImgUrl&&a.jsx(yl,{color:j.color,className:pt(Qe.arrowIcon,Qe.arrowImg,Qe.mirror)})]})}),a.jsx("div",{className:pt(Qe.arrow,Qe.nextArrow,{[Qe.arrowVertical]:M.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${W.scalingValue(j.offset.x*(M.direction==="horiz"?-1:1),l)}, ${W.scalingValue(j.offset.y,l)}) scale(${j.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var U;return(U=$.current)==null?void 0:U.go("+1")},"aria-label":"Next",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:Qe.arrowImg}),!j.arrowsImgUrl&&a.jsx(yl,{color:j.color,className:pt(Qe.arrowIcon,Qe.arrowImg)})]})})]}),b.closeIconUrl&&(()=>{const U=ar(b.closeIconAlign,b.closeIconOffset,l),ce=`scale(${b.closeIconScale})`,le=U.transform?`${U.transform} ${ce}`:ce;return a.jsx("button",{className:Qe.closeButton,style:{...U,transform:le},onClick:te,"aria-label":"Close lightbox",children:a.jsx(sn,{url:b.closeIconUrl,fill:b.closeIconColor??"#000000",hoverFill:b.closeIconHover??"#cccccc"})})})(),k&&k.isActive&&i.imageCaption&&((ye=n[x])==null?void 0:ye.imageCaption)&&a.jsx("div",{className:Qe.caption,style:{...ar(k.alignment,k.offset,l),fontFamily:co(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":W.scalingValue(c.width,l),letterSpacing:W.scalingValue(p,l),wordSpacing:W.scalingValue(w,l),textAlign:v,fontSize:W.scalingValue(m.fontSize,l),lineHeight:W.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:U=>U.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Qe.captionTextInner,style:{"--link-color":k.linkColor,"--link-hover-color":k.linkHoverColor},children:a.jsx(Ri,{content:n[x].imageCaption})})}),se.isActive&&(()=>{const[U,ce]=se.position.split("-"),le=M.direction==="horiz"?`${U}-left`:se.position,Ce=ar(le,se.offset,l),Fe=()=>{if(M.direction==="horiz"){if(ce==="left")return"flex-start";if(ce==="center")return"center";if(ce==="right")return"flex-end"}else{if(U==="top")return"flex-start";if(U==="middle")return"center";if(U==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Qe.thumbsWrapper,onClick:Ee=>Ie(Ee),style:{position:l?"absolute":"fixed",...Ce,...M.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Qe.thumbsContainer,{[Qe.thumbsContainerVertical]:M.direction==="vert",[Qe.thumbsAlignStart]:se.align==="start",[Qe.thumbsAlignCenter]:se.align==="center",[Qe.thumbsAlignEnd]:se.align==="end"}),style:{gap:W.scalingValue(se.grid.gap,l),justifyContent:_?"flex-start":Fe()},children:n.map((Ee,Y)=>{const be=Y===x,de=T[Y],ue=se.grid.size*(be?se.activeState.scale:1),He=()=>{if(se.fit!=="fit")return{};if(!de)return M.direction==="horiz"?{height:W.scalingValue(ue,l)}:{width:W.scalingValue(ue,l)};const fe=de.width/de.height;if(M.direction==="horiz"){const Q=ue,Je=Q*fe;return{width:W.scalingValue(Je,l),height:W.scalingValue(Q,l)}}else{const Q=ue,Je=Q/fe;return{width:W.scalingValue(Q,l),height:W.scalingValue(Je,l)}}};return a.jsx("button",{className:Qe.thumbItem,style:{...M.direction==="horiz"&&se.fit!=="fit"?{height:W.scalingValue(ue,l)}:{},...M.direction==="vert"&&se.fit!=="fit"?{width:W.scalingValue(ue,l)}:{},...se.fit==="cover"?{width:W.scalingValue(ue,l),height:W.scalingValue(ue,l)}:{},...He(),transition:be?"all 0.25s ease-out":"none",opacity:be?se.activeState.opacity/100:se.opacity/100,"--thumb-hover":se.activeState.opacity/100},onClick:fe=>{var Q;fe.stopPropagation(),C(Y),(Q=$.current)==null||Q.go(Y)},onMouseEnter:()=>{var fe;se.triggers==="hov"&&((fe=$.current)==null||fe.go(Y))},children:a.jsx("img",{src:Ee.image.url,alt:Ee.image.name??"",onLoad:fe=>{const Q=fe.currentTarget;Q.naturalWidth&&Q.naturalHeight&&H(Je=>({...Je,[Y]:{width:Q.naturalWidth,height:Q.naturalHeight}}))},style:{objectFit:se.fit==="cover"?"cover":"contain",...se.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...se.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ee.image.name}-${Y}`)})})})})()]})]}),document.getElementById(r))};function yl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Ig={element:$g,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function sr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rg(e){return`
|
|
6
|
+
*/const ym="RichTextRenderer-module__link___BWeZ2",vm={link:ym},xm=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},co=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>xm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:co(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:W.scalingValue(e.letterSpacing,t),wordSpacing:W.scalingValue(e.wordSpacing,t),fontSize:W.scalingValue(n,t),lineHeight:i!==void 0?W.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:vm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:bm(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function bm(e){return{...e.fontFamily&&{fontFamily:co(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 wm="SvgImage-module__svg___q3xE-",Sm="SvgImage-module__img___VsTm-",pl={svg:wm,img:Sm},Cm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},$m=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,sn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Cm(e)||!r?a.jsx("img",{src:e,alt:"",className:pt(pl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:pt(pl.svg,i),style:{"--svg":$m(e),"--fill":t,"--hover-fill":n,...o??{}}})},Tm={"top-left":dt.topLeftAlignment,"top-center":dt.topCenterAlignment,"top-right":dt.topRightAlignment,"middle-left":dt.middleLeftAlignment,"middle-center":dt.middleCenterAlignment,"middle-right":dt.middleRightAlignment,"bottom-left":dt.bottomLeftAlignment,"bottom-center":dt.bottomCenterAlignment,"bottom-right":dt.bottomRightAlignment};function Im({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:w,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[x,C]=s.useState(null),[y,S]=s.useState(0),[z,N]=s.useState(0),{direction:Y,transition:B,controls:T,pagination:H,imageCaption:$,triggers:I}=e,P=s.useRef(B.type),{x:M,y:g}=e.controls.offset,D=A=>{o&&o.go(A)};return s.useEffect(()=>{if(!x)return;const A=new ResizeObserver(X=>{if(!o)return;const[ie]=X;f({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return A.observe(x),()=>A.unobserve(x)},[x]),s.useEffect(()=>{!o||P.current===B.type||(N(A=>A+1),P.current=B.type)},[B.type]),a.jsx("div",{className:pt(dt.wrapper,{[dt.editor]:i}),ref:C,children:a.jsxs("div",{className:dt.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:B.backgroundColor&&B.type==="fade in"?B.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(dt.captionBlock),children:a.jsx("div",{className:dt.captionTextWrapper,children:t.map((A,X)=>a.jsx("div",{className:pt(dt.captionText,Tm[$.alignment],{[dt.withPointerEvents]:X===y&&i,[dt.active]:X===y}),style:{fontFamily:co(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":W.scalingValue(l.width,i),letterSpacing:W.scalingValue(c,i),wordSpacing:W.scalingValue(p,i),textAlign:u,fontSize:W.scalingValue(v.fontSize,i),lineHeight:W.scalingValue(v.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:m,transitionDuration:B.duration?`${Math.round(parseInt(B.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:dt.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:W.scalingValue($.offset.y,i),left:W.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:A.imageCaption})})},X))})}),a.jsx(Ns,{onMove:A=>{S(A.index)},ref:r,options:{arrows:!1,speed:B.duration?parseInt(B.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:Y==="horiz"||B.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:B.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((A,X)=>a.jsx(Ws,{children:a.jsx("div",{className:dt.sliderItem,children:a.jsx("div",{className:dt.imgWrapper,children:a.jsx("img",{className:pt(dt.sliderImage,{[dt.contain]:A.image.objectFit==="contain",[dt.cover]:A.image.objectFit==="cover"}),src:A.image.url,alt:A.image.name??""})})})},X))},z),T.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(dt.arrow,{[dt.arrowVertical]:Y==="vert",[dt.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:a.jsxs("button",{onClick:()=>{D("-1")},className:dt.arrowInner,style:{transform:`translate(${W.scalingValue(M,i)}, ${W.scalingValue(g*(Y==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&a.jsx(sn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:pt(dt.arrowImg,dt.mirror)}),!T.arrowsImgUrl&&a.jsx(ml,{color:T.color,className:pt(dt.arrowIcon,dt.arrowImg,dt.mirror)})]})}),a.jsx("div",{className:pt(dt.arrow,dt.nextArrow,{[dt.arrowVertical]:Y==="vert",[dt.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:a.jsxs("button",{className:dt.arrowInner,onClick:()=>D("+1"),style:{transform:`translate(${W.scalingValue(M*(Y==="horiz"?-1:1),i)}, ${W.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&a.jsx(sn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:dt.arrowImg}),!T.arrowsImgUrl&&a.jsx(ml,{color:T.color,className:pt(dt.arrowIcon,dt.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:dt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),H.isActive&&a.jsx("div",{className:pt(dt.pagination,{[dt.paginationInsideBottom]:H.position==="inside-1"&&Y==="horiz",[dt.paginationInsideTop]:H.position==="inside-2"&&Y==="horiz",[dt.paginationOutsideBottom]:H.position==="outside-1"&&Y==="horiz",[dt.paginationOutsideTop]:H.position==="outside-2"&&Y==="horiz",[dt.paginationInsideLeft]:H.position==="inside-1"&&Y==="vert",[dt.paginationInsideRight]:H.position==="inside-2"&&Y==="vert",[dt.paginationOutsideLeft]:H.position==="outside-1"&&Y==="vert",[dt.paginationOutsideRight]:H.position==="outside-2"&&Y==="vert",[dt.paginationVertical]:Y==="vert"}),children:a.jsx("div",{className:dt.paginationInner,style:{backgroundColor:H.colors[2],transform:`scale(${H.scale/100}) translate(${W.scalingValue(H.offset.x,i)}, ${W.scalingValue(H.offset.y,i)}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:t.map((A,X)=>a.jsx("button",{onClick:()=>{o&&o.go(X)},className:pt(dt.paginationItem),children:a.jsx("div",{className:pt(dt.dot,{[dt.activeDot]:X===y}),style:{backgroundColor:X===y?H.colors[0]:H.colors[1],"--pagination-hover-color":H.hover}})},X))})})]})})}function ml({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Rm={element:Im,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Lm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Pm="ImageRevealSlider-module__image___Qjt-e",Em="ImageRevealSlider-module__link___N-iLG",Mm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:Lm,image:Pm,link:Em,cursor:Mm};function gl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function fa(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function km(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await fa(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await fa(e);r=l.height/l.width*o}else{const l=await fa(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Am({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,v]=s.useState({x:0,y:0}),[w,m]=s.useState(1),[h,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:z,randomRangeImageWidth:N}=e.imageSize,{revealPosition:Y,visible:B}=e.position,{cursorType:T,target:H,defaultCursorScale:$,defaultCursor:I,hoverCursorScale:P,hoverCursor:M}=e.cursor;s.useEffect(()=>{if(!i)return;const A=(L,_)=>{const V=i.getBoundingClientRect(),se=L-V.left,re=_-V.top;if(v({x:se,y:re}),T==="system"){f("none"),m(1);return}const k=se,le=re,G=document.elementFromPoint(V.left+k,V.top+le);if(G&&G.closest("a")){f("none"),m(1);return}const b=gl(k,le,r)||H==="area"?{img:M??"none",scale:P}:{img:I??"none",scale:$};f(b.img),m(b.scale)},X=L=>{L.stopPropagation(),x.current={x:L.clientX,y:L.clientY},A(L.clientX,L.clientY)},ie=()=>{C&&A(x.current.x,x.current.y)};return i.addEventListener("mousemove",X),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",X),window.removeEventListener("scroll",ie,!0)}},[i,C,p,T,H,M,I,P,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(A,X,ie,L={})=>{const{width:_,height:V,finalWidth:se}=await km(A.image.url,S,z,N);let re=0,k=0;Y==="same"?(re=X/2,k=ie/2):(re=L.x??Math.random()*X,k=L.y??Math.random()*ie);const le=Math.min(Math.max(re,_/2),X-_/2),G=Math.min(Math.max(k,V/2),ie-V/2);return{id:u.current++,url:A.image.url,link:A.link,name:A.image.name,x:le,y:G,width:se}};s.useEffect(()=>{if(!i||t.length===0)return;const A=i.getBoundingClientRect(),X=A.width,ie=A.height,L=[];(async()=>{const V=t[0],se=await g(V,X,ie);L.push(se),l(L),c(1)})()},[S,z,N,Y,i]),s.useEffect(()=>{B==="last One"&&l(A=>A.length>0?[A[A.length-1]]:[])},[B]);const D=async A=>{if(!i)return;const X=i.getBoundingClientRect(),ie=A.clientX-X.left,L=A.clientY-X.top;if(H==="image"&&!gl(ie,L,r))return;let _=0,V=0;Y==="on Click"?(_=ie,V=L):Y==="same"?(_=X.width/2,V=X.height/2):(_=Math.random()*X.width,V=Math.random()*X.height);const se=t[d],re=await g(se,X.width,X.height,{x:_,y:V});l(k=>B==="all"?[...k,re]:[re]),c(k=>k>=t.length-1?0:k+1)};return a.jsxs("div",{ref:o,onClick:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Mi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(A=>a.jsx("div",{className:Mi.wrapper,style:{top:`${A.y}px`,left:`${A.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:A.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:H==="area"&&A.link?a.jsx("a",{href:A.link,target:"_blank",className:Mi.link,children:a.jsx("img",{src:A.url,alt:A.name,className:Mi.image},A.id)}):a.jsx("img",{src:A.url,alt:A.name,className:Mi.image},A.id)},A.id)),C&&a.jsx("div",{className:Mi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Fm={element:Am,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},_m="LightBox-module__hidden___9s-9x",Nm="LightBox-module__heroImage___sTxNF",Wm="LightBox-module__background___rm9ml",Hm="LightBox-module__editor___4ACaY",Dm="LightBox-module__contentStyle___Bgnsq",Om="LightBox-module__imageStyle___tLIlB",Bm="LightBox-module__imgWrapper___LuFUp",zm="LightBox-module__contain___8-yaS",jm="LightBox-module__cover___hNvOG",Vm="LightBox-module__caption___b6L2I",Gm="LightBox-module__captionTextInner___rCGNH",Xm="LightBox-module__lightboxSplide___XFuWC",qm="LightBox-module__arrow___iz38X",Ym="LightBox-module__arrowVertical___Zfz81",Um="LightBox-module__nextArrow___zkAQN",Km="LightBox-module__arrowInner___p48sW",Zm="LightBox-module__arrowIcon___3VaFf",Jm="LightBox-module__arrowImg___pNV88",Qm="LightBox-module__mirror___pjeXc",eg="LightBox-module__thumbsWrapper___GB-nU",tg="LightBox-module__thumbsContainerVertical___wttk5",ng="LightBox-module__thumbsContainer___osSma",ig="LightBox-module__thumbsAlignStart___MO6tY",og="LightBox-module__thumbsAlignCenter___Q4sUx",rg="LightBox-module__thumbsAlignEnd___p4y9R",ag="LightBox-module__thumbItem___HvnF3",sg="LightBox-module__closeButton___g2khP",lg="LightBox-module__fadeIn___0m5GW",cg="LightBox-module__slideInLeft___gPYwC",dg="LightBox-module__slideInRight___S-pPp",ug="LightBox-module__slideInTop___DFdAj",pg="LightBox-module__slideInBottom___m27kZ",mg="LightBox-module__fadeOut___55qBR",gg="LightBox-module__slideOutLeft___NvU7P",hg="LightBox-module__slideOutRight___SK7eC",fg="LightBox-module__slideOutTop___Vgg0z",yg="LightBox-module__slideOutBottom___nJ0Ef",vg="LightBox-module__scaleSlide___vZriG",Qe={hidden:_m,heroImage:Nm,background:Wm,editor:Hm,contentStyle:Dm,imageStyle:Om,imgWrapper:Bm,contain:zm,cover:jm,caption:Vm,captionTextInner:Gm,lightboxSplide:Xm,arrow:qm,arrowVertical:Ym,nextArrow:Um,arrowInner:Km,arrowIcon:Zm,arrowImg:Jm,mirror:Qm,thumbsWrapper:eg,thumbsContainerVertical:tg,thumbsContainer:ng,thumbsAlignStart:ig,thumbsAlignCenter:og,thumbsAlignEnd:rg,thumbItem:ag,closeButton:sg,fadeIn:lg,slideInLeft:cg,slideInRight:dg,slideInTop:ug,slideInBottom:pg,fadeOut:mg,slideOutLeft:gg,slideOutRight:hg,slideOutTop:fg,slideOutBottom:yg,scaleSlide:vg},ar=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), calc(-50% + ${W.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${W.scalingValue(t.x,n)}, calc(-50% + ${W.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), ${W.scalingValue(t.y,n)})`:i.transform=`translate(${W.scalingValue(t.x,n)}, ${W.scalingValue(t.y,n)})`,i};function yd(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 xg(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function vd(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function bg(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function xd(e,t,n,i,o){const{x:r,y:l}=xg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function wg(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?bg:vd,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:v,offsetY:w}=xd(n,i,u,p,d),m=(v+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Sg(e){return wg(e)}function Nr(e){const t=e.getBoundingClientRect(),n=yd(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=vd(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=xd(i,o,d,c,u),w=t.left+n.left,m=t.top+n.top;return{x:p+w,y:v+m,width:d,height:c}}function hl(e){const t=e.getBoundingClientRect(),n=yd(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function fl(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Cg(e,t){const n=(()=>{if(e==="fade in")return Qe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeIn;if(e==="slide in")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeOut;if(e==="slide in")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})(),r=(()=>{if(e==="fade in")return Qe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const $g=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:Qe.heroImage,onClick:()=>c(!0)}),a.jsx(Tg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Tg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var $e;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:w,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[x,C]=s.useState(0),[y,S]=s.useState(0),[z,N]=s.useState(!1),[Y,B]=s.useState(!1),[T,H]=s.useState({}),$=s.useRef(null),I=s.useRef(null),P=s.useRef(null),M=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),A=s.useRef(null),X=s.useRef(null),ie=s.useRef(!1),L=s.useRef(null),[_,V]=s.useState(!1),{appear:se,triggers:re,slider:k,thumbnail:le,controls:G,area:b,caption:E,layout:j}=o.lightboxBlock,{appearClass:me,backdropAppearClass:K,backdropDisappearClass:te,disappearClass:O}=Cg(se.type,se.direction),J=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const Q=()=>{setTimeout(()=>{var ae,xe;(xe=(ae=$.current)==null?void 0:ae.splide)==null||xe.refresh()},16)},Z=()=>{S(ae=>ae+1)};return window.addEventListener("ArticleEditor.Layout:change",Q),window.addEventListener("ArticleEditor.ComponentContent:change",Z),()=>{window.removeEventListener("ArticleEditor.Layout:change",Q),window.removeEventListener("ArticleEditor.ComponentContent:change",Z)}},[]),s.useEffect(()=>{if(!e||!le.isActive){V(!1);return}const Q=L.current;if(!Q)return;const Z=()=>{k.direction==="horiz"?V(Q.scrollWidth>Q.clientWidth):V(Q.scrollHeight>Q.clientHeight)};Z();const ae=new ResizeObserver(Z);return ae.observe(Q),()=>ae.disconnect()},[e,le.isActive,n.length,T,k.direction]);const ne=s.useCallback(()=>{const Q=window.matchMedia("(max-width: 768px)").matches,Z=fl(b.color);Q&&!l&&Z>.9&&(document.body.style.backgroundColor=""),N(!0),M.current=!0;const ae=xe=>{xe.target===g.current&&xe.animationName&&(g.current&&D.current&&g.current.removeEventListener("animationend",D.current),D.current=null,M.current&&(M.current=!1,t()),N(!1))};g.current&&(D.current=ae,g.current.addEventListener("animationend",ae))},[t,b.color,l]),Pe=(Q,Z,ae)=>{var xe,ke;if(Q){if(re.type==="click"&&re.switch==="image")re.repeat==="close"&&x===n.length-1?ne():(xe=$.current)==null||xe.go("+1");else if(re.type==="click"&&re.switch==="50/50"){const Ce=Q.getBoundingClientRect(),q=Z-Ce.left,ye=ae-Ce.top,ce=Ce.width,U=Ce.height;let de;k.direction==="horiz"?de=q<ce/2?"-1":"+1":de=ye<U/2?"-1":"+1",(ke=$.current)==null||ke.go(de)}}},be=Q=>{if(ie.current){ie.current=!1;return}const Z=n[x],ae=(Z==null?void 0:Z.image.objectFit)==="cover";let xe,ke;if("changedTouches"in Q&&Q.changedTouches.length>0)xe=Q.changedTouches[0].clientX,ke=Q.changedTouches[0].clientY;else if("clientX"in Q)xe=Q.clientX,ke=Q.clientY;else return;let Ce;if(ae&&P.current){const q=hl(P.current);Ce=xe>=q.left&&xe<=q.right&&ke>=q.top&&ke<=q.bottom}else{const q=P.current?Nr(P.current):null;if(!q){Q.target===Q.currentTarget&&ne();return}Ce=xe>=q.x&&xe<=q.x+q.width&&ke>=q.y&&ke<=q.y+q.height}Ce?Pe(P.current,xe,ke):ne()},Re=Q=>{const Z=Q.target;(Z.classList.contains(Qe.thumbsWrapper)||Z.classList.contains(Qe.thumbsContainer))&&be(Q)};s.useEffect(()=>{if(!e)return;const Q=Z=>{var ae,xe;if(Z.key==="Escape"){ne();return}if(Z.key==="ArrowRight"){C(ke=>(ke+1)%Math.max(n.length,1)),(ae=$.current)==null||ae.go("+1");return}Z.key==="ArrowLeft"&&(C(ke=>(ke-1+Math.max(n.length,1))%Math.max(n.length,1)),(xe=$.current)==null||xe.go("-1"))};return window.addEventListener("keydown",Q),()=>{window.removeEventListener("keydown",Q)}},[e,ne,n.length]),s.useEffect(()=>{if(e){if(C(0),S(Z=>Z+1),M.current=!1,N(!1),B(!1),H({}),!J)return;const Q=new CustomEvent("page-overlay",{detail:{itemId:J}});window.dispatchEvent(Q)}return()=>{g.current&&D.current&&(g.current.removeEventListener("animationend",D.current),D.current=null),B(!1)}},[e,J]),s.useEffect(()=>{I.current!==null&&I.current!==k.type&&S(Q=>Q+1),I.current=k.type},[k.type]),s.useEffect(()=>{if(!e)return;const Q=document.body.style.overflow,Z=window.matchMedia("(max-width: 768px)").matches,ae=fl(b.color);document.body.style.overflow="hidden",B(!1);const xe=Ce=>{Ce.target===g.current&&!M.current&&Ce.animationName&&(Z&&!l&&ae>.9&&(document.body.style.backgroundColor=b.color),B(!0),g.current&&A.current&&g.current.removeEventListener("animationend",A.current),A.current=null)};g.current&&(A.current=xe,g.current.addEventListener("animationend",xe));const ke=Ce=>{const q=Ce.target;q&&(q.closest(`.${Qe.thumbsWrapper}`)||q.closest(`.${Qe.thumbsContainer}`))||k.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",ke,{passive:!1}),()=>{document.body.style.overflow=Q,document.removeEventListener("touchmove",ke),g.current&&A.current&&(g.current.removeEventListener("animationend",A.current),A.current=null),B(!1)}},[e,l,b.color,k.type]),s.useEffect(()=>{if(!e)return;const Q=Z=>{var xe,ke;if(M.current){Z.stopPropagation();return}if(ie.current){ie.current=!1;return}const ae=Z.target;if(!(ae&&(ae.closest(`.${Qe.thumbsContainer}`)||ae.closest(`.${Qe.thumbItem}`)||ae.closest(`.${Qe.arrow}`)||ae.closest(`.${Qe.closeButton}`)||ae.closest(`.${Qe.caption}`)))){if(k.type==="slide"&&re.type==="drag"&&((ke=(xe=$.current)==null?void 0:xe.splide)!=null&&ke.root)){const Ce=$.current.splide.root;if(ae&&(Ce.contains(ae)||Ce===ae))return}if(Z.touches.length===0&&Z.changedTouches.length>0){const Ce=n[x],q=(Ce==null?void 0:Ce.image.objectFit)==="cover",ye=Z.changedTouches[0];let ce;if(q&&P.current){const U=hl(P.current);ce=ye.clientX>=U.left&&ye.clientX<=U.right&&ye.clientY>=U.top&&ye.clientY<=U.bottom}else{const U=P.current?Nr(P.current):null;if(!U)return;ce=ye.clientX>=U.x&&ye.clientX<=U.x+U.width&&ye.clientY>=U.y&&ye.clientY<=U.y+U.height}if(!ce){Z.stopPropagation(),M.current=!0;const U=de=>{de.stopPropagation(),de.preventDefault(),document.removeEventListener("click",U,!0)};document.addEventListener("click",U,!0),ne()}}}};return document.addEventListener("touchend",Q,{passive:!0}),()=>{document.removeEventListener("touchend",Q)}},[e,ne,x,n]);const ue=(k.type==="scale"||k.type==="fade")&&k.direction==="vert"&&re.type==="drag";s.useEffect(()=>{var de,He;if(!e||!ue||!((He=(de=$.current)==null?void 0:de.splide)!=null&&He.root))return;const Q=$.current.splide.root,Z=30,ae=(he,ee)=>{if(X.current){const Je=Math.abs(he-X.current.x),Ne=Math.abs(ee-X.current.y);(Je>0||Ne>0)&&(ie.current=!0)}},xe=he=>{X.current&&(he.preventDefault(),ae(he.clientX,he.clientY))},ke=he=>{X.current&&he.touches.length>0&&(he.preventDefault(),ae(he.touches[0].clientX,he.touches[0].clientY))},Ce=(he,ee)=>{if(!X.current||!$.current){X.current=null;return}const Je=Math.abs(he-X.current.x),Ne=Math.abs(ee-X.current.y);Ne>Z&&Ne>Je&&$.current.go(ee<X.current.y?"+1":"-1"),X.current=null},q=he=>{X.current&&Ce(he.clientX,he.clientY),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",q),document.removeEventListener("pointermove",xe)},ye=he=>{if(X.current){if(he.changedTouches.length>0){const ee=he.changedTouches[0];Ce(ee.clientX,ee.clientY)}document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),document.removeEventListener("touchmove",ke)}},ce=he=>{X.current={x:he.clientX,y:he.clientY},ie.current=!1,document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("pointerup",q),document.addEventListener("pointercancel",q)},U=he=>{he.touches.length>0&&(X.current={x:he.touches[0].clientX,y:he.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",ke,{passive:!1}),document.addEventListener("touchend",ye),document.addEventListener("touchcancel",ye))};return Q.addEventListener("pointerdown",ce),Q.addEventListener("touchstart",U),()=>{Q.removeEventListener("pointerdown",ce),Q.removeEventListener("touchstart",U),document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",q),document.removeEventListener("touchmove",ke),document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),X.current=null,ie.current=!1}},[e,ue,y]);const fe={backgroundColor:b.color,backdropFilter:`blur(${b.blur}px)`,animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:zn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:g,className:pt(Qe.background,z?te:K,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{...fe,...Y&&!l&&!z?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Qe.contentStyle,z?O:me,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ns,{onMove:Q=>C(Q.index),ref:$,className:Qe.lightboxSplide,options:{arrows:!1,speed:k.duration?parseInt(k.duration):500,direction:k.direction==="horiz"||k.type==="fade"||k.type==="scale"?"ltr":"ttb",pagination:!1,drag:re.type==="drag"&&!ue,perPage:1,width:"100%",height:"100%",type:k.type==="fade"||k.type==="scale"?"fade":"loop",padding:0,rewind:re.repeat!=="close",start:0},style:{"--splide-speed":k.duration},children:n.map((Q,Z)=>{const ae=ar(j.position,j.offset,l),xe=`${W.scalingValue(j.padding.top,l)} ${W.scalingValue(j.padding.right,l)} ${W.scalingValue(j.padding.bottom,l)} ${W.scalingValue(j.padding.left,l)}`,ke=k.type==="scale"?(()=>{const{transform:Ce,...q}=ae;return{...q,position:"absolute",padding:xe,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...ae,position:"absolute",padding:xe,boxSizing:"border-box"};return a.jsx(Ws,{children:a.jsx("div",{className:Qe.imgWrapper,onClick:be,children:a.jsx("img",{ref:Z===x?P:null,className:pt(Qe.imageStyle,{[Qe.contain]:Q.image.objectFit==="contain",[Qe.cover]:Q.image.objectFit==="cover",[Qe.scaleSlide]:k.type==="scale"}),src:Q.image.url,alt:Q.image.name??"",style:{...ke,pointerEvents:Q.image.objectFit==="contain"?"none":"auto"}})})},Z)})},y),G.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Qe.arrow,{[Qe.arrowVertical]:k.direction==="vert"}),style:{color:G.color,"--arrow-hover-color":G.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${W.scalingValue(G.offset.x,l)}, ${W.scalingValue(G.offset.y*(k.direction==="horiz"?1:-1),l)}) scale(${G.scale}) rotate(${k.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Q;return(Q=$.current)==null?void 0:Q.go("-1")},"aria-label":"Previous",children:[G.arrowsImgUrl&&a.jsx(sn,{url:G.arrowsImgUrl,fill:G.color,hoverFill:G.hover,className:pt(Qe.arrowImg,Qe.mirror)}),!G.arrowsImgUrl&&a.jsx(yl,{color:G.color,className:pt(Qe.arrowIcon,Qe.arrowImg,Qe.mirror)})]})}),a.jsx("div",{className:pt(Qe.arrow,Qe.nextArrow,{[Qe.arrowVertical]:k.direction==="vert"}),style:{color:G.color,"--arrow-hover-color":G.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${W.scalingValue(G.offset.x*(k.direction==="horiz"?-1:1),l)}, ${W.scalingValue(G.offset.y,l)}) scale(${G.scale}) rotate(${k.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Q;return(Q=$.current)==null?void 0:Q.go("+1")},"aria-label":"Next",children:[G.arrowsImgUrl&&a.jsx(sn,{url:G.arrowsImgUrl,fill:G.color,hoverFill:G.hover,className:Qe.arrowImg}),!G.arrowsImgUrl&&a.jsx(yl,{color:G.color,className:pt(Qe.arrowIcon,Qe.arrowImg)})]})})]}),b.closeIconUrl&&(()=>{const Q=ar(b.closeIconAlign,b.closeIconOffset,l),Z=`scale(${b.closeIconScale})`,ae=Q.transform?`${Q.transform} ${Z}`:Z;return a.jsx("button",{className:Qe.closeButton,style:{...Q,transform:ae},onClick:ne,"aria-label":"Close lightbox",children:a.jsx(sn,{url:b.closeIconUrl,fill:b.closeIconColor??"#000000",hoverFill:b.closeIconHover??"#cccccc"})})})(),E&&E.isActive&&i.imageCaption&&(($e=n[x])==null?void 0:$e.imageCaption)&&a.jsx("div",{className:Qe.caption,style:{...ar(E.alignment,E.offset,l),fontFamily:co(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":W.scalingValue(c.width,l),letterSpacing:W.scalingValue(p,l),wordSpacing:W.scalingValue(w,l),textAlign:v,fontSize:W.scalingValue(m.fontSize,l),lineHeight:W.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:Q=>Q.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Qe.captionTextInner,style:{"--link-color":E.linkColor,"--link-hover-color":E.linkHoverColor},children:a.jsx(Ri,{content:n[x].imageCaption})})}),le.isActive&&(()=>{const[Q,Z]=le.position.split("-"),ae=k.direction==="horiz"?`${Q}-left`:le.position,xe=ar(ae,le.offset,l),ke=()=>{if(k.direction==="horiz"){if(Z==="left")return"flex-start";if(Z==="center")return"center";if(Z==="right")return"flex-end"}else{if(Q==="top")return"flex-start";if(Q==="middle")return"center";if(Q==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Qe.thumbsWrapper,onClick:Ce=>Re(Ce),style:{position:l?"absolute":"fixed",...xe,...k.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Qe.thumbsContainer,{[Qe.thumbsContainerVertical]:k.direction==="vert",[Qe.thumbsAlignStart]:le.align==="start",[Qe.thumbsAlignCenter]:le.align==="center",[Qe.thumbsAlignEnd]:le.align==="end"}),style:{gap:W.scalingValue(le.grid.gap,l),justifyContent:_?"flex-start":ke()},children:n.map((Ce,q)=>{const ye=q===x,ce=T[q],de=le.grid.size*(ye?le.activeState.scale:1),He=()=>{if(le.fit!=="fit")return{};if(!ce)return k.direction==="horiz"?{height:W.scalingValue(de,l)}:{width:W.scalingValue(de,l)};const he=ce.width/ce.height;if(k.direction==="horiz"){const ee=de,Je=ee*he;return{width:W.scalingValue(Je,l),height:W.scalingValue(ee,l)}}else{const ee=de,Je=ee/he;return{width:W.scalingValue(ee,l),height:W.scalingValue(Je,l)}}};return a.jsx("button",{className:Qe.thumbItem,style:{...k.direction==="horiz"&&le.fit!=="fit"?{height:W.scalingValue(de,l)}:{},...k.direction==="vert"&&le.fit!=="fit"?{width:W.scalingValue(de,l)}:{},...le.fit==="cover"?{width:W.scalingValue(de,l),height:W.scalingValue(de,l)}:{},...He(),transition:ye?"all 0.25s ease-out":"none",opacity:ye?le.activeState.opacity/100:le.opacity/100,"--thumb-hover":le.activeState.opacity/100},onClick:he=>{var ee;he.stopPropagation(),C(q),(ee=$.current)==null||ee.go(q)},onMouseEnter:()=>{var he;le.triggers==="hov"&&((he=$.current)==null||he.go(q))},children:a.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:he=>{const ee=he.currentTarget;ee.naturalWidth&&ee.naturalHeight&&H(Je=>({...Je,[q]:{width:ee.naturalWidth,height:ee.naturalHeight}}))},style:{objectFit:le.fit==="cover"?"cover":"contain",...le.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...le.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${q}`)})})})})()]})]}),document.getElementById(r))};function yl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Ig={element:$g,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function sr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rg(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function Lg({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=W.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:v=[],buttonLabel:w,gap:m,fieldsGap:h,buttonCorners:f,buttonStroke:x,buttonPadding:C,isButtonFullWidth:y,inputCorners:S,inputStroke:
|
|
158
|
+
`}function Lg({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=W.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:v=[],buttonLabel:w,gap:m,fieldsGap:h,buttonCorners:f,buttonStroke:x,buttonPadding:C,isButtonFullWidth:y,inputCorners:S,inputStroke:z,inputPadding:N,inputColor:Y,inputTextColor:B,inputBorderColor:T,placeholderColor:H,buttonColor:$,buttonTextColor:I,buttonBorderColor:P,labelTextColor:M,successColor:g,errorColor:D,fontFamily:A,inputFontSettings:X,inputFontSize:ie,inputLineHeight:L,inputLetterSpacing:_,inputWordSpacing:V,inputTextAppearance:se,buttonFontSettings:re,buttonFontSize:k,buttonLineHeight:le,buttonLetterSpacing:G,buttonWordSpacing:b,buttonTextAppearance:E,labelFontSettings:j,labelFontSize:me,labelLineHeight:K,labelLetterSpacing:te,labelWordSpacing:O,labelTextAppearance:J,statusFontSettings:ne,statusFontSize:Pe,statusLineHeight:be,statusLetterSpacing:Re,statusWordSpacing:ue,statusTextAppearance:fe,successMessage:$e,errorMessage:Q,stateOverrides:Z}=e,ae=u==="B",xe=v.slice(0,Math.min(p,v.length)),ke={fontSettings:{fontFamily:A,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:L,letterSpacing:_??0,wordSpacing:V??0,textAppearance:se,color:B},Ce=an(Ut(ke,t)),q=W.scalingValue(z??0,t),ye=W.scalingValue((L??ie??.01)+((N==null?void 0:N.top)??0)+((N==null?void 0:N.bottom)??0)+(u==="C"?z??0:(z??0)*2),t),ce={...Ce,borderStyle:"solid",borderRadius:u==="C"?0:W.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:q,borderLeftWidth:0}:{borderWidth:q},paddingTop:W.scalingValue((N==null?void 0:N.top)??0,t),paddingRight:W.scalingValue((N==null?void 0:N.right)??0,t),paddingBottom:W.scalingValue((N==null?void 0:N.bottom)??0,t),paddingLeft:W.scalingValue((N==null?void 0:N.left)??0,t),height:ye,minHeight:ye},U={fontSettings:{fontFamily:A,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:k??.01,lineHeight:le,letterSpacing:G??0,wordSpacing:b??0,textAppearance:E,color:I},de=an(Ut(U,t)),He=W.scalingValue(x??0,t),he={fontSettings:{fontFamily:A,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:me??.01,lineHeight:K,letterSpacing:te??0,wordSpacing:O??0,textAppearance:J,color:M},ee=Ut(he,t),Je={fontSettings:{fontFamily:A,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:Pe??.01,lineHeight:be,letterSpacing:Re??0,wordSpacing:ue??0,textAppearance:fe,color:g},Ne=an(Ut(Je,t)),ct=W.buildColorVars(c,{inputColor:Y,inputTextColor:B,inputBorderColor:T,placeholderColor:H!=null&&H.trim()?H:"#cccccc",buttonColor:$,buttonTextColor:I,buttonBorderColor:P,labelTextColor:M,successColor:g,errorColor:D},Pg,Eg,Z),[Ke,ut]=s.useState(()=>Object.fromEntries(xe.map(Ie=>[Ie.name,""]))),[lt,Ye]=s.useState("idle"),[Le,We]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":lt,Ue=r==="error"?Q:Le,ge=r==="filled",ve=s.useMemo(()=>{if(!ge)return Ke;let Ie=null;for(const Ve of xe)(Ke[Ve.name]??"").trim().length>0||(Ie=Ie??{...Ke},Ie[Ve.name]="Filled");return Ie??Ke},[Ke,ge,xe]),_e=Be==="error"?W.getFormFieldValidationError(xe,ve):null,we=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Te=o==null?void 0:o.submitUrl,Xe=(Ie,Ve)=>{ut(De=>({...De,[Ie]:Ve}))},ze=async Ie=>{if(Ie.preventDefault(),!d)return;const Ve=Object.fromEntries(xe.map(tt=>{var nt;return[tt.name,((nt=Ke[tt.name])==null?void 0:nt.trim())??""]}).filter(([,tt])=>tt));if(!Te){Ye("error"),We("No integrations were found for this form.");return}if(Object.keys(Ve).length===0)return;const De=W.getFormFieldValidationError(xe,Ke);if(De){Ye("error"),We(De);return}Ye("submitting"),We(null);try{const tt=await fetch(Te,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ve)});if(!tt.ok){const nt=await tt.text();throw new Error(nt||`Request failed: ${tt.status}`)}Ye("success"),ut(Object.fromEntries(xe.map(nt=>[nt.name,""])))}catch(tt){Ye("error"),We(tt instanceof Error?tt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${we}`.trim(),style:ct,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Rg(c)}}),a.jsxs("form",{onSubmit:ze,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:xe.map((Ie,Ve)=>a.jsxs(s.Fragment,{children:[Ve>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:W.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${ae?` ${c}-labeled`:""}`,children:[ae&&a.jsx("span",{className:`${c}-field-label`,style:ee?{...ee,lineHeight:ee.fontSize}:void 0,children:Ie.label||Ie.name}),Ie.type==="textarea"?a.jsx("textarea",{name:Ie.name,autoComplete:"off",value:ve[Ie.name]??"",onChange:De=>Xe(Ie.name,De.target.value),placeholder:Ie.placeholder,className:`${c}-input`,style:ce,rows:1,"data-filled":ge||(ve[Ie.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Ie.type==="phone"?"tel":Ie.type==="email"?"email":"text",name:Ie.name,autoComplete:"off",value:ve[Ie.name]??"",onChange:De=>Xe(Ie.name,De.target.value),placeholder:Ie.placeholder,required:Ie.isRequired??Ie.type==="email",className:`${c}-input`,style:ce,"data-filled":ge||(ve[Ie.name]??"").trim().length>0})]})]},Ve))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:W.scalingValue(m??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:W.scalingValue(f??0,t),borderWidth:He,paddingTop:W.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:W.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:W.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:W.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...de,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:lt==="submitting"?"...":w})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Ne},children:$e}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Ne},role:"alert",children:_e??Ue??Q})]})}const Pg={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},Eg=["hover","focus","filled","success","error"],Mg=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${cr(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const Wg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=W.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:v,inputFontSettings:w,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:x,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:S,buttonLineHeight:
|
|
983
|
+
`}const Wg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=W.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:v,inputFontSettings:w,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:x,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:S,buttonLineHeight:z,buttonLetterSpacing:N,buttonWordSpacing:Y,buttonTextAppearance:B,statusFontSettings:T,statusFontSize:H,statusLineHeight:$,statusLetterSpacing:I,statusWordSpacing:P,statusTextAppearance:M,iconMaxWidth:g,minHeight:D,corners:A,stroke:X,stateOverrides:ie,inputPadding:L,buttonPadding:_,successMessage:V="Thanks for subscribing!",errorMessage:se="Please, fill all required fields."}=e,re=d.slice(0,Math.min(p,d.length)),[k,le]=s.useState(()=>Object.fromEntries(re.map(he=>[he.name,""]))),[G,b]=s.useState("idle"),[E,j]=s.useState(null),me=o==="success"?"success":o==="error"?"error":G,K=o==="error"?se:E,te=o==="filled",O=s.useMemo(()=>{if(!te)return k;let he=null;for(const ee of re)(k[ee.name]??"").trim().length>0||(he=he??{...k},he[ee.name]="Filled");return he??k},[te,k,re]),J=me==="error"?W.getFormFieldValidationError(re,O):null,ne=o&&o!=="default"?`${r}-state-${o}`:"",Pe=re.some(he=>(O[he.name]??"").trim().length>0),be=ne!==`${r}-state-filled`&&Pe?`${r}-state-filled`:"",Re=`${ne} ${be}`.trim(),ue=i==null?void 0:i.submitUrl,fe=u??"",$e=(c==null?void 0:c.icon)??"",Q=(c==null?void 0:c.mode)==="On",Z=fe||"Submit",ae={fontSettings:{fontFamily:v,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:m??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:x??0,textAppearance:C,color:e.inputTextColor??"#111111"},xe={fontSettings:{fontFamily:v,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:S??.01,lineHeight:z,letterSpacing:N??0,wordSpacing:Y??0,textAppearance:B,color:e.buttonTextColor??"#ffffff"},ke={fontSettings:{fontFamily:v,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:H??.01,lineHeight:$,letterSpacing:I??0,wordSpacing:P??0,textAppearance:M,color:e.successColor??"#22c55e"},Ce=an(Ut(ae,t)),q=an(Ut(xe,t)),ye=an(Ut(ke,t)),ce=W.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(ae==null?void 0:ae.color)??"#111111",buttonTextColor:e.buttonTextColor??(xe==null?void 0:xe.color)??"#ffffff"},Hg,Dg,ie),U={borderRadius:W.scalingValue(A,t),borderWidth:W.scalingValue(X,t),borderStyle:"solid"},de={borderLeftWidth:W.scalingValue(X,t)},He=async he=>{if(he.preventDefault(),!l)return;const ee=Object.fromEntries(re.map(Ne=>{var ct;return[Ne.name,((ct=k[Ne.name])==null?void 0:ct.trim())??""]}).filter(([,Ne])=>Ne));if(!ue){b("error"),j("No integrations were found for this form.");return}if(Object.keys(ee).length===0)return;const Je=W.getFormFieldValidationError(re,k);if(Je){b("error"),j(Je);return}b("submitting"),j(null);try{const Ne=await fetch(ue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)});if(!Ne.ok){const ct=await Ne.text();throw new Error(ct||`Request failed: ${Ne.status}`)}b("success"),le(Object.fromEntries(re.map(ct=>[ct.name,""])))}catch(Ne){b("error"),j(Ne instanceof Error?Ne.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Re}`.trim(),style:ce,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ng(r)}}),a.jsxs("form",{onSubmit:He,className:`${r}-form`,style:{...U,height:W.scalingValue(D,t),minHeight:W.scalingValue(D,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:re.map(he=>a.jsx("input",{type:he.type==="email"?"email":he.type==="phone"?"tel":"text",name:he.name,autoComplete:"off",value:O[he.name]??"",onChange:ee=>le(Je=>({...Je,[he.name]:ee.target.value})),placeholder:he.placeholder,required:he.isRequired??he.type==="email",className:`${r}-input`,style:{...Ce,paddingRight:W.scalingValue(L.right,t),paddingLeft:W.scalingValue(L.left,t),paddingTop:W.scalingValue(L.top,t),paddingBottom:W.scalingValue(L.bottom,t)}},he.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":Z,style:{...q,...de,paddingRight:W.scalingValue(_.right,t),paddingLeft:W.scalingValue(_.left,t),paddingTop:W.scalingValue(_.top,t),paddingBottom:W.scalingValue(_.bottom,t),pointerEvents:l?"auto":void 0},children:G==="submitting"?"...":Q?$e&&a.jsx(sn,{url:$e,className:`${r}-submitBtnIcon`,style:{maxWidth:W.scalingValue(g??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):fe})})]}),me==="success"&&a.jsx("p",{className:`${r}-success`,style:{...ye},children:V}),me==="error"&&a.jsx("p",{className:`${r}-error`,style:{...ye},role:"alert",children:J??K??se})]})},Hg={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},Dg=["hover","focus","filled","success","error"],Og=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover video {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const qg=30,Yg=20,va=3,Ug=12,Kg=32,Zg=3,Jg=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Qg=(e,t)=>Array.from({length:t},()=>e).flat(),eh=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},bd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),vl=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const d=Array.from({length:t},(u,p)=>e.children[p]),c=bd(d);return c<=0?0:c+r*Math.max(0,t-1)},th=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=bd(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+r*Math.max(0,e.children.length-1)+l},nh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},ih=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>nh(i,e))},oh=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},rh=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,ah=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var P,
|
|
1692
|
+
`}const qg=30,Yg=20,va=3,Ug=12,Kg=32,Zg=3,Jg=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Qg=(e,t)=>Array.from({length:t},()=>e).flat(),eh=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},bd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),vl=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const d=Array.from({length:t},(u,p)=>e.children[p]),c=bd(d);return c<=0?0:c+r*Math.max(0,t-1)},th=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=bd(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+r*Math.max(0,e.children.length-1)+l},nh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},ih=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>nh(i,e))},oh=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},rh=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,ah=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var P,M,g,D;const p=s.useRef(null),v=!!((P=e.image)!=null&&P.url&&oh(e.image));s.useLayoutEffect(()=>{d&&rh(p.current)&&(u==null||u())},[d,(M=e.image)==null?void 0:M.url,u]);const w=n.display==="cover",m=n.ratioValue??"1:1",h=n.reversed??!1,[f,x]=m.split(":").map(Number),S=(h?x:f)/(h?f:x),z=i/S,N=z>o?o:z,Y=z>o?o*S:i,B=c(Y),T=c(N),H={borderRadius:c(r)},$=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...H}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...H},I=((g=e.image)==null?void 0:g.url)&&(v?a.jsx("video",{ref:A=>{p.current=A},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:A=>{p.current=A},src:e.image.url,alt:((D=e.image)==null?void 0:D.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...w?{width:B}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...w?{width:B,height:T,overflow:"hidden",...H}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:I&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:pt(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:I}):I})})},sh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>Xg(r,c),[r,c]),{speed:p,direction:v,pauseOnHover:w,gap:m,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:x,cornerRadius:C=0}=e,y=s.useMemo(()=>eh(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,z=!!o,N=!n||!!i,Y=N&&x!=="off"&&x!=="randomize"?`${r}-image-hover-${x}`:void 0,B=n?!!i:!0,H=((t==null?void 0:t.length)??0)>0&&(B||!!n),$=Math.max(0,p)*qg,I=be=>W.scalingValue(be,n??!1),P=s.useRef(null),M=s.useRef(null),g=s.useRef(null),[D,A]=s.useState(0),X=B&&w==="on",[ie,L]=s.useState(!1),[_,V]=s.useState({}),se=s.useRef(_);se.current=_;const re=s.useRef(null),k=s.useRef(0),le=s.useRef(null),G=s.useMemo(()=>(t??[]).map(be=>{var Re;return((Re=be.image)==null?void 0:Re.url)??""}).join("\0"),[t]),[b,E]=s.useState(va),j=s.useMemo(()=>{const be=t??[];return be.length===0||!(B||!!n)?be:Qg(be,b)},[t,B,b,n]),me=s.useMemo(()=>(t??[]).filter(be=>{var Re;return!!((Re=be.image)!=null&&Re.url)}).length,[t]),K=H?Zg:1;s.useLayoutEffect(()=>{k.current=0,V({}),re.current=null,E(va),d(0)},[G]),s.useEffect(()=>{if(!N||x!=="randomize")return;const be=P.current;if(!be)return;const Re=Q=>{V(Z=>{const ae=Array.from(Q).filter(ke=>ke in Z&&!ih(be,ke));if(ae.length===0)return Z;const xe={...Z};return ae.forEach(ke=>{delete xe[ke]}),xe})},ue=new IntersectionObserver(Q=>{const Z=new Set;for(const ae of Q){const xe=ae.target.dataset.marqueeItemIndex,ke=xe!==void 0?Number(xe):NaN;Number.isNaN(ke)||Z.add(ke)}Z.size>0&&Re(Z)},{root:be,threshold:0});Object.keys(_).forEach(Q=>{const Z=Number(Q);be.querySelectorAll(`[data-marquee-item-index="${Z}"]`).forEach(ae=>ue.observe(ae))});const fe={current:0},$e=()=>{const Q=Object.keys(se.current);Q.length!==0&&(Re(Q.map(Number)),fe.current=requestAnimationFrame($e))};return Object.keys(se.current).length>0&&(fe.current=requestAnimationFrame($e)),()=>{cancelAnimationFrame(fe.current),ue.disconnect()}},[x,_,N]),s.useLayoutEffect(()=>{if(!H)return;const be=P.current,Re=g.current;if(!be||!Re)return;const ue={current:0},fe=()=>{const Z=be.getBoundingClientRect().width||be.offsetWidth,ae=th(Re),xe=re.current,ke=typeof xe=="number"&&Math.abs(xe-ae)<=.25;re.current=ae;let Ce=b,q=0;if((B||n)&&S>0&&Z>0){const U=vl(Re,S);if(U>=Kg){q=U;const de=Math.min(Ug,Math.max(va,Math.ceil(Z/U)+1));Ce=de,de!==b&&E(de)}}const ce=Ce!==b&&q>0?q*Ce:ae>0?ae:q>0?q*Ce:(()=>{const U=vl(Re,S);return U>0?U*Ce:0})();ce>0?d(U=>U<=0?ce:!ke||Math.round(U)===Math.round(ce)?U:ce):!ke&&l<=0&&(cancelAnimationFrame(ue.current),ue.current=requestAnimationFrame(fe))},$e=()=>{cancelAnimationFrame(ue.current),ue.current=requestAnimationFrame(fe)};le.current=$e,$e();const Q=new ResizeObserver($e);return Q.observe(be),Q.observe(Re),()=>{le.current=null,cancelAnimationFrame(ue.current),Q.disconnect()}},[B,H,l,G,b,S,n]),s.useLayoutEffect(()=>{if(!H||c<=0)return;const be=M.current;be&&Jg(be)},[H,c,v,$]),s.useLayoutEffect(()=>{if(!H||l<=0){A(0);return}const be=M.current,Re=g.current;if(!be||!Re)return;const ue=()=>{const $e=be.offsetHeight||be.getBoundingClientRect().height,Q=Array.from(Re.children).reduce((ae,xe)=>Math.max(ae,xe.offsetHeight||xe.getBoundingClientRect().height),0),Z=$e>0?$e:Q;A(Z>0?Z:0)};ue();const fe=new ResizeObserver(ue);return fe.observe(be),fe.observe(Re),()=>fe.disconnect()},[H,K,j,n,m,h,f,l,y,_]),s.useLayoutEffect(()=>{if(!n||!z||!H||typeof window>"u")return;const be=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(be)},[n,z,H,v,l,D,m,j]);const te=()=>{X&&L(!0)},O=()=>{X&&L(!1)},J=s.useCallback(()=>{var be;k.current=Math.min(me,k.current+1),(be=le.current)==null||be.call(le)},[me]),ne=s.useCallback((be,Re)=>{V(ue=>{const fe=ue[be]??Re,$e=(t??[]).filter(Z=>Z!==fe);if($e.length===0)return ue;const Q=$e[Math.floor(Math.random()*$e.length)];return{...ue,[be]:Q}})},[t]),Pe=(be,Re,ue,fe)=>{const $e=N&&x==="randomize"&&y.display==="cover"?_[ue]??be:be,Q=`max(${I(m)}, ${Yg}px)`,Z=`calc(-0.5 * (${Q} + ${I(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ue,onMouseEnter:N&&x==="randomize"&&y.display==="cover"?()=>ne(ue,be):void 0,children:[a.jsx(ah,{item:$e,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:C,imageHoverClass:Y,isEditor:n,isFirstSet:fe,scaled:I,onFirstSetImageDone:J}),z&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:Z,width:Q,height:"100%"}})]},`${Re}-${ue}`)};if(H){const be=B?X&&ie?"paused":"running":"paused",Re=c>0&&$>0?c/$*1e3:0,ue=`${Math.max(0,Re)/1e3}s`;return a.jsxs("div",{ref:P,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:D>0?{height:D}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:M,className:`${r}-marquee-track`,"data-direction":v,onMouseEnter:te,onMouseLeave:O,style:{WebkitAnimationDuration:ue,animationDuration:ue,WebkitAnimationPlayState:be,animationPlayState:be},children:Array.from({length:K},(fe,$e)=>a.jsx("div",{ref:$e===0?g:void 0,className:pt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:I(m),paddingRight:I(m)},"aria-hidden":$e>0,children:j.map((Q,Z)=>Pe(Q,$e,Z,$e===0&&Z<S))},`set-${$e}`))})]})}return a.jsxs("div",{ref:P,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:pt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:I(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((be,Re)=>Pe(be,0,Re))},"marquee-static")]})},lh=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2601,7 +2601,7 @@ ${o}
|
|
|
2601
2601
|
left: -9999px;
|
|
2602
2602
|
top: 0;
|
|
2603
2603
|
}
|
|
2604
|
-
`}const ph=30,xa=3,mh=12,gh=3,ts=.72,hh=100,fh=10,yh=e=>Math.max(0,e)/hh,vh=e=>Math.max(0,e)/fh,xh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},bh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},wh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Sh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Ch=e=>{e.style.transform=""},$h=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Th=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Ih=96,Rh=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const v=p*c,w=v+c;o[p+1]=w,r[p+1]=r[p]+(d(v)+d(w))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Lh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(m,h)=>{if(h-m<=1)return[m,h];const f=m+h>>1;return l[f]<=r?c(f,h):c(m,f)},[u,p]=c(0,l.length-1),v=l[p]-l[u],w=v>0?(r-l[u])/v:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*w)},Ph=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,v)=>{const w=v/c*e,m=(v+1)/c*e,h=m-w,f=l(w),x=l(m),C=w+h/3,y=f+d(w)*h/3,S=m-h/3,B=x-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${B.toFixed(2)} ${m.toFixed(2)} ${x.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Eh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${ts}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),w=a.jsxs(a.Fragment,{children:[p,v]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:w}):w})},Mh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=W.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:v,layoutType:w,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:x,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:B,textTextAppearance:N,textColor:q,backgroundColor:D,ribbonWidth:T}=e,H=T??y,$=w==="curve",I=yh(m),P=vh(h),E=s.useMemo(()=>uh(o,d,$),[o,d,$]),g=s.useMemo(()=>Ut({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:S,wordSpacing:B,fontSize:C,lineHeight:y,textAppearance:N,color:q},n),[f,x,S,B,C,y,N,q,n]),z=ge=>W.scalingValue(ge,n??!1),F=((t==null?void 0:t.length)??0)>0,X=n?!!i:!0,ie=F&&(X||!!n),L=Math.max(0,c)*ph,_=X&&p==="on",[V,ae]=s.useState(!1),re=X?_&&V?"paused":"running":"paused",M=re==="running"&&L>0&&d>0,se=s.useRef(null),j=s.useRef(null),b=s.useRef(null),k=s.useRef(null),G=s.useRef(null),he=s.useRef(null),J=s.useRef(M),ee=s.useRef(null);J.current=M;const[O,Z]=s.useState(0),[te,Le]=s.useState(0),[ve,Ie]=s.useState(0),[pe,oe]=s.useState(0),[ye,U]=s.useState(0),ce=s.useMemo(()=>(t??[]).map(ge=>{var xe;return`${ge.text}\0${((xe=ge.image)==null?void 0:xe.url)??""}`}).join("\0"),[t]),[le,Ce]=s.useState(xa),Fe=s.useMemo(()=>{const ge=t??[];return ge.length===0||!(X||n)?ge:bh(ge,le)},[t,X,le,n]),Ee=ie?gh:1;s.useLayoutEffect(()=>{Ce(xa),l(0)},[ce]),s.useLayoutEffect(()=>{var we;const ge=he.current;if(!ge)return;const xe=()=>{const $e=getComputedStyle(ge),Xe=parseFloat($e.fontSize)||0;if(Xe<=0)return;const ze=wh();if(!ze){Z(Xe*ts),Le(0);return}ze.font=`${$e.fontStyle} ${$e.fontWeight} ${Xe}px ${$e.fontFamily}`;const Te=ze.measureText("H"),Ve=Te.actualBoundingBoxAscent>0?Te.actualBoundingBoxAscent:Xe*ts,De=Math.max(0,Te.actualBoundingBoxDescent||0),tt=Te.fontBoundingBoxAscent||0,nt=Te.fontBoundingBoxDescent||0;Z(St=>Math.abs(St-Ve)>.5?Ve:St);const st=tt>0||nt>0?(nt-De-(tt-Ve))/2:0;Le(St=>Math.abs(St-st)>.25?st:St)};xe();const _e=typeof document<"u"?document.fonts:void 0;(we=_e==null?void 0:_e.ready)==null||we.then(xe).catch(()=>{});const Ze=new ResizeObserver(xe);return Ze.observe(ge),()=>Ze.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!ie)return;const ge=se.current,xe=k.current;if(!ge||!xe)return;const _e={id:0},Ze=()=>{const $e=ge.offsetWidth||ge.getBoundingClientRect().width,Xe=xe.offsetWidth||xe.getBoundingClientRect().width;if(F&&$e>0&&Xe>0){const ze=Xe/le;if(ze>0){const Te=Math.min(mh,Math.max(xa,Math.ceil($e/ze)+1));if(Te!==le){Ce(Te);return}}}Xe>0&&l(Xe)};_e.id=requestAnimationFrame(Ze);const we=new ResizeObserver(()=>{cancelAnimationFrame(_e.id),_e.id=requestAnimationFrame(Ze)});return we.observe(ge),we.observe(xe),()=>{cancelAnimationFrame(_e.id),we.disconnect()}},[ie,ce,le,F,O]),s.useLayoutEffect(()=>{const ge=G.current;if(!ge)return;const xe={id:0},_e=()=>{const we=ge.offsetHeight;we>0&&U($e=>Math.abs($e-we)>.5?we:$e)};xe.id=requestAnimationFrame(_e);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(xe.id),xe.id=requestAnimationFrame(_e)});return Ze.observe(ge),()=>{cancelAnimationFrame(xe.id),Ze.disconnect()}},[H,n]),s.useLayoutEffect(()=>{if(!$){Ie(0),oe(0);return}const ge=se.current,xe=k.current;if(!ge||!xe)return;const _e={id:0},Ze=()=>{const $e=ge.offsetWidth,Xe=xe.offsetHeight;$e>0&&oe(ze=>Math.abs(ze-$e)>.5?$e:ze),Xe>0&&Ie(ze=>Math.abs(ze-Xe)>.5?Xe:ze)};_e.id=requestAnimationFrame(Ze);const we=new ResizeObserver(()=>{cancelAnimationFrame(_e.id),_e.id=requestAnimationFrame(Ze)});return we.observe(ge),we.observe(xe),()=>{cancelAnimationFrame(_e.id),we.disconnect()}},[$,ce,O,y,C,ie]),s.useLayoutEffect(()=>{if(!ie||d<=0)return;const ge=b.current;ge&&xh(ge)},[ie,d,u,L]),s.useLayoutEffect(()=>{if(!$||!F)return;const ge=se.current;if(!ge)return;const xe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},_e=()=>{for(const Te of xe.itemsCache)for(const Ve of Te.glyphs)Ch(Ve.inner)},Ze=()=>{const Te=j.current??ge;xe.itemsCache=Array.from(ge.querySelectorAll("[data-marquee-text-item]"),Ve=>{const De=[];return Ve.querySelectorAll("[data-marquee-wave-node]").forEach(tt=>{const nt=tt.firstElementChild;nt&&De.push({inner:nt,layoutLocalX:Th(tt,Te)})}),{item:Ve,glyphs:De}}),xe.cacheDirty=!1},we=()=>{xe.cacheDirty&&Ze();const Ve=(j.current??ge).offsetWidth||1,De=Ve*I,tt=2*Math.PI*P/Ve,nt=`${Ve}|${De}|${tt}`;nt!==xe.lutKey&&(xe.lutKey=nt,xe.lut=Rh(De,tt,Ih));const st=b.current,St=st?$h(getComputedStyle(st).transform):0,Bt=ge.getBoundingClientRect(),zt=Bt.left,ft=Bt.right,wt=xe.lut&&xe.lut.wavelength>0?Math.max(0,(xe.lut.periodArc/xe.lut.wavelength-1)*Ve):0;for(const{item:jt,glyphs:At}of xe.itemsCache){const xt=jt.getBoundingClientRect();if(!(xt.right<zt||xt.left>ft+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Kt=xe.lut?Lh(xe.lut,Nt):Nt,Jt=tt*Kt,Tt=De*Math.sin(Jt),Wt=De*tt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Sh(Ft.inner,Kt-Nt,Tt,rn)}}},$e=()=>{xe.cancelled||(xe.raf=0,we(),J.current&&!document.hidden&&(xe.raf=requestAnimationFrame($e)))},Xe=()=>{xe.cancelled||xe.raf||(xe.raf=requestAnimationFrame($e))};ee.current=Xe,Xe();const ze=()=>{if(document.hidden){cancelAnimationFrame(xe.raf),xe.raf=0;return}Xe()};return document.addEventListener("visibilitychange",ze),()=>{xe.cancelled=!0,ee.current=null,cancelAnimationFrame(xe.raf),document.removeEventListener("visibilitychange",ze),_e()}},[$,I,P,F,r,ce,le,O]),s.useLayoutEffect(()=>{var ge;(ge=ee.current)==null||ge.call(ee)},[M]);const Y=()=>{_&&ae(!0)},be=()=>{_&&ae(!1)},de=$?I*100:0,K=z(H),ue={minHeight:K,...$?{paddingTop:`${de}%`,paddingBottom:`${de}%`}:{}},He={height:K,...$?{visibility:"hidden"}:{backgroundColor:D}},fe={gap:z(v),minHeight:K},Q=pe*I,Je=ye>0?ye:ve,Ne=Math.max(ve,Je),ct=$&&pe>0&&Ne>0?Ph(pe,Q,P,Q+Ne/2):"",Ke=Q*2+Ne,ut=ct?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${pe} ${Ke}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:ct,fill:"none",stroke:D,strokeWidth:Je,strokeLinecap:"round",strokeLinejoin:"round"})}):null,lt=a.jsx("div",{ref:G,className:`${o}-ribbon`,style:He,"aria-hidden":!0}),Ye=(ge,xe,_e)=>a.jsx(Eh,{item:ge,prefix:o,textCss:g,capHeightPx:O,opticalOffsetY:te,imageGapPx:z(v),isCurve:$},`${xe}-${_e}`),Re=a.jsx("span",{ref:he,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),We=d>0&&L>0?d/L*1e3:0,Be=`${Math.max(0,We)/1e3}s`,Ue=ie?a.jsx("div",{ref:b,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:Y,onMouseLeave:be,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:re,animationPlayState:re},children:Array.from({length:Ee},(ge,xe)=>a.jsx("div",{ref:xe===0?k:void 0,className:`${o}-marquee-set`,style:{...fe,paddingRight:z(v)},"aria-hidden":xe>0,children:Fe.map((_e,Ze)=>Ye(_e,xe,Ze))},`set-${xe}`))}):a.jsx("div",{ref:k,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:fe,children:t==null?void 0:t.map((ge,xe)=>Ye(ge,0,xe))});return a.jsxs("div",{ref:se,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E}}),Re,a.jsxs("div",{ref:j,className:`${o}-marquee-wrapper`,style:ue,children:[lt,ut,Ue]})]})},kh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2604
|
+
`}const ph=30,xa=3,mh=12,gh=3,ts=.72,hh=100,fh=10,yh=e=>Math.max(0,e)/hh,vh=e=>Math.max(0,e)/fh,xh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},bh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},wh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Sh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Ch=e=>{e.style.transform=""},$h=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Th=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Ih=96,Rh=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const v=p*c,w=v+c;o[p+1]=w,r[p+1]=r[p]+(d(v)+d(w))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Lh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(m,h)=>{if(h-m<=1)return[m,h];const f=m+h>>1;return l[f]<=r?c(f,h):c(m,f)},[u,p]=c(0,l.length-1),v=l[p]-l[u],w=v>0?(r-l[u])/v:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*w)},Ph=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,v)=>{const w=v/c*e,m=(v+1)/c*e,h=m-w,f=l(w),x=l(m),C=w+h/3,y=f+d(w)*h/3,S=m-h/3,z=x-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${z.toFixed(2)} ${m.toFixed(2)} ${x.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Eh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${ts}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),w=a.jsxs(a.Fragment,{children:[p,v]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:w}):w})},Mh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=W.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:v,layoutType:w,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:x,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:z,textTextAppearance:N,textColor:Y,backgroundColor:B,ribbonWidth:T}=e,H=T??y,$=w==="curve",I=yh(m),P=vh(h),M=s.useMemo(()=>uh(o,d,$),[o,d,$]),g=s.useMemo(()=>Ut({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:S,wordSpacing:z,fontSize:C,lineHeight:y,textAppearance:N,color:Y},n),[f,x,S,z,C,y,N,Y,n]),D=ge=>W.scalingValue(ge,n??!1),A=((t==null?void 0:t.length)??0)>0,X=n?!!i:!0,ie=A&&(X||!!n),L=Math.max(0,c)*ph,_=X&&p==="on",[V,se]=s.useState(!1),re=X?_&&V?"paused":"running":"paused",k=re==="running"&&L>0&&d>0,le=s.useRef(null),G=s.useRef(null),b=s.useRef(null),E=s.useRef(null),j=s.useRef(null),me=s.useRef(null),K=s.useRef(k),te=s.useRef(null);K.current=k;const[O,J]=s.useState(0),[ne,Pe]=s.useState(0),[be,Re]=s.useState(0),[ue,fe]=s.useState(0),[$e,Q]=s.useState(0),Z=s.useMemo(()=>(t??[]).map(ge=>{var ve;return`${ge.text}\0${((ve=ge.image)==null?void 0:ve.url)??""}`}).join("\0"),[t]),[ae,xe]=s.useState(xa),ke=s.useMemo(()=>{const ge=t??[];return ge.length===0||!(X||n)?ge:bh(ge,ae)},[t,X,ae,n]),Ce=ie?gh:1;s.useLayoutEffect(()=>{xe(xa),l(0)},[Z]),s.useLayoutEffect(()=>{var we;const ge=me.current;if(!ge)return;const ve=()=>{const Te=getComputedStyle(ge),Xe=parseFloat(Te.fontSize)||0;if(Xe<=0)return;const ze=wh();if(!ze){J(Xe*ts),Pe(0);return}ze.font=`${Te.fontStyle} ${Te.fontWeight} ${Xe}px ${Te.fontFamily}`;const Ie=ze.measureText("H"),Ve=Ie.actualBoundingBoxAscent>0?Ie.actualBoundingBoxAscent:Xe*ts,De=Math.max(0,Ie.actualBoundingBoxDescent||0),tt=Ie.fontBoundingBoxAscent||0,nt=Ie.fontBoundingBoxDescent||0;J(St=>Math.abs(St-Ve)>.5?Ve:St);const st=tt>0||nt>0?(nt-De-(tt-Ve))/2:0;Pe(St=>Math.abs(St-st)>.25?st:St)};ve();const _e=typeof document<"u"?document.fonts:void 0;(we=_e==null?void 0:_e.ready)==null||we.then(ve).catch(()=>{});const Ze=new ResizeObserver(ve);return Ze.observe(ge),()=>Ze.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!ie)return;const ge=le.current,ve=E.current;if(!ge||!ve)return;const _e={id:0},Ze=()=>{const Te=ge.offsetWidth||ge.getBoundingClientRect().width,Xe=ve.offsetWidth||ve.getBoundingClientRect().width;if(A&&Te>0&&Xe>0){const ze=Xe/ae;if(ze>0){const Ie=Math.min(mh,Math.max(xa,Math.ceil(Te/ze)+1));if(Ie!==ae){xe(Ie);return}}}Xe>0&&l(Xe)};_e.id=requestAnimationFrame(Ze);const we=new ResizeObserver(()=>{cancelAnimationFrame(_e.id),_e.id=requestAnimationFrame(Ze)});return we.observe(ge),we.observe(ve),()=>{cancelAnimationFrame(_e.id),we.disconnect()}},[ie,Z,ae,A,O]),s.useLayoutEffect(()=>{const ge=j.current;if(!ge)return;const ve={id:0},_e=()=>{const we=ge.offsetHeight;we>0&&Q(Te=>Math.abs(Te-we)>.5?we:Te)};ve.id=requestAnimationFrame(_e);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(ve.id),ve.id=requestAnimationFrame(_e)});return Ze.observe(ge),()=>{cancelAnimationFrame(ve.id),Ze.disconnect()}},[H,n]),s.useLayoutEffect(()=>{if(!$){Re(0),fe(0);return}const ge=le.current,ve=E.current;if(!ge||!ve)return;const _e={id:0},Ze=()=>{const Te=ge.offsetWidth,Xe=ve.offsetHeight;Te>0&&fe(ze=>Math.abs(ze-Te)>.5?Te:ze),Xe>0&&Re(ze=>Math.abs(ze-Xe)>.5?Xe:ze)};_e.id=requestAnimationFrame(Ze);const we=new ResizeObserver(()=>{cancelAnimationFrame(_e.id),_e.id=requestAnimationFrame(Ze)});return we.observe(ge),we.observe(ve),()=>{cancelAnimationFrame(_e.id),we.disconnect()}},[$,Z,O,y,C,ie]),s.useLayoutEffect(()=>{if(!ie||d<=0)return;const ge=b.current;ge&&xh(ge)},[ie,d,u,L]),s.useLayoutEffect(()=>{if(!$||!A)return;const ge=le.current;if(!ge)return;const ve={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},_e=()=>{for(const Ie of ve.itemsCache)for(const Ve of Ie.glyphs)Ch(Ve.inner)},Ze=()=>{const Ie=G.current??ge;ve.itemsCache=Array.from(ge.querySelectorAll("[data-marquee-text-item]"),Ve=>{const De=[];return Ve.querySelectorAll("[data-marquee-wave-node]").forEach(tt=>{const nt=tt.firstElementChild;nt&&De.push({inner:nt,layoutLocalX:Th(tt,Ie)})}),{item:Ve,glyphs:De}}),ve.cacheDirty=!1},we=()=>{ve.cacheDirty&&Ze();const Ve=(G.current??ge).offsetWidth||1,De=Ve*I,tt=2*Math.PI*P/Ve,nt=`${Ve}|${De}|${tt}`;nt!==ve.lutKey&&(ve.lutKey=nt,ve.lut=Rh(De,tt,Ih));const st=b.current,St=st?$h(getComputedStyle(st).transform):0,Bt=ge.getBoundingClientRect(),zt=Bt.left,ft=Bt.right,wt=ve.lut&&ve.lut.wavelength>0?Math.max(0,(ve.lut.periodArc/ve.lut.wavelength-1)*Ve):0;for(const{item:jt,glyphs:At}of ve.itemsCache){const xt=jt.getBoundingClientRect();if(!(xt.right<zt||xt.left>ft+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Kt=ve.lut?Lh(ve.lut,Nt):Nt,Jt=tt*Kt,Tt=De*Math.sin(Jt),Wt=De*tt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Sh(Ft.inner,Kt-Nt,Tt,rn)}}},Te=()=>{ve.cancelled||(ve.raf=0,we(),K.current&&!document.hidden&&(ve.raf=requestAnimationFrame(Te)))},Xe=()=>{ve.cancelled||ve.raf||(ve.raf=requestAnimationFrame(Te))};te.current=Xe,Xe();const ze=()=>{if(document.hidden){cancelAnimationFrame(ve.raf),ve.raf=0;return}Xe()};return document.addEventListener("visibilitychange",ze),()=>{ve.cancelled=!0,te.current=null,cancelAnimationFrame(ve.raf),document.removeEventListener("visibilitychange",ze),_e()}},[$,I,P,A,r,Z,ae,O]),s.useLayoutEffect(()=>{var ge;(ge=te.current)==null||ge.call(te)},[k]);const q=()=>{_&&se(!0)},ye=()=>{_&&se(!1)},ce=$?I*100:0,U=D(H),de={minHeight:U,...$?{paddingTop:`${ce}%`,paddingBottom:`${ce}%`}:{}},He={height:U,...$?{visibility:"hidden"}:{backgroundColor:B}},he={gap:D(v),minHeight:U},ee=ue*I,Je=$e>0?$e:be,Ne=Math.max(be,Je),ct=$&&ue>0&&Ne>0?Ph(ue,ee,P,ee+Ne/2):"",Ke=ee*2+Ne,ut=ct?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${ue} ${Ke}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:ct,fill:"none",stroke:B,strokeWidth:Je,strokeLinecap:"round",strokeLinejoin:"round"})}):null,lt=a.jsx("div",{ref:j,className:`${o}-ribbon`,style:He,"aria-hidden":!0}),Ye=(ge,ve,_e)=>a.jsx(Eh,{item:ge,prefix:o,textCss:g,capHeightPx:O,opticalOffsetY:ne,imageGapPx:D(v),isCurve:$},`${ve}-${_e}`),Le=a.jsx("span",{ref:me,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),We=d>0&&L>0?d/L*1e3:0,Be=`${Math.max(0,We)/1e3}s`,Ue=ie?a.jsx("div",{ref:b,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:q,onMouseLeave:ye,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:re,animationPlayState:re},children:Array.from({length:Ce},(ge,ve)=>a.jsx("div",{ref:ve===0?E:void 0,className:`${o}-marquee-set`,style:{...he,paddingRight:D(v)},"aria-hidden":ve>0,children:ke.map((_e,Ze)=>Ye(_e,ve,Ze))},`set-${ve}`))}):a.jsx("div",{ref:E,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:he,children:t==null?void 0:t.map((ge,ve)=>Ye(ge,0,ve))});return a.jsxs("div",{ref:le,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:M}}),Le,a.jsxs("div",{ref:G,className:`${o}-marquee-wrapper`,style:de,children:[lt,ut,Ue]})]})},kh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2605
2605
|
import cn from 'classnames';
|
|
2606
2606
|
import { CommonComponentProps } from '../props';
|
|
2607
2607
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -3531,7 +3531,7 @@ type MarqueeTextProps = {
|
|
|
3531
3531
|
pointer-events: auto;
|
|
3532
3532
|
z-index: 10;
|
|
3533
3533
|
}
|
|
3534
|
-
`}const Wh=30,xl=2,Hh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Dh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:v,corners:w,stroke:m,strokeColor:h,bgColor:f,padding:x,logoMarginTop:C,logoWidth:y,logoHeight:S,captionMarginTop:
|
|
3534
|
+
`}const Wh=30,xl=2,Hh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Dh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:v,corners:w,stroke:m,strokeColor:h,bgColor:f,padding:x,logoMarginTop:C,logoWidth:y,logoHeight:S,captionMarginTop:z}=e,N=!!o,Y=((t==null?void 0:t.length)??0)>0,B=d>0&&(!n||i),T=Y&&(B||n),H=Math.max(0,d)*Wh,$=q=>W.scalingValue(q,n??!1),I=s.useRef(null),P=s.useRef(null),M=s.useRef(null),[g,D]=s.useState(0),[A,X]=s.useState(0),ie=A>0?A:0,L=s.useMemo(()=>Nh(r,ie),[r,ie]),[_,V]=s.useState(0),se=B&&u==="on",[re,k]=s.useState(!1),le=s.useRef(null),[G,b]=s.useState(0),[E,j]=s.useState(0),me=s.useRef(null),K=q=>{var ce,U,de,He,he;return{fontSettings:{fontFamily:(e==null?void 0:e[`${q}FontFamily`])??"Arial",fontWeight:((ce=e==null?void 0:e[`${q}FontSettings`])==null?void 0:ce.fontWeight)??400,fontStyle:((U=e==null?void 0:e[`${q}FontSettings`])==null?void 0:U.fontStyle)??"normal"},textAppearance:{textTransform:((de=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:de.textTransform)??"none",textDecoration:((He=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:He.textDecoration)??"none",fontVariant:((he=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:he.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${q}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${q}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${q}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${q}LineHeight`])??.01,color:(e==null?void 0:e[`${q}Color`])??"#000000"}},te=K("text"),O=K("caption"),J=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(q=>{var ye,ce;return(((ye=q.text)==null?void 0:ye.length)??0)>0||(((ce=q.caption)==null?void 0:ce.length)??0)>0}),[t]),ne=s.useMemo(()=>!T||(t==null?void 0:t.length)===0?1:A<=0||g<=0?xl:Math.max(xl,Math.ceil(g/A)+1),[T,t==null?void 0:t.length,A,g]);s.useLayoutEffect(()=>{if(!T)return;const q=I.current,ye=M.current;if(!q||!ye)return;let ce=0;const U=()=>{const he=q.getBoundingClientRect().width,ee=ye.getBoundingClientRect().width,Je=me.current,Ne=typeof Je=="number"&&Math.abs(Je-ee)<=.25;if(me.current=ee,D(he),typeof ee=="number"&&ee>0&&A<=0){X(ee);return}Ne&&ee!==A?X(ee):!Ne&&A<=0&&(cancelAnimationFrame(ce),ce=requestAnimationFrame(U))},de=()=>{cancelAnimationFrame(ce),ce=requestAnimationFrame(U)};de();const He=new ResizeObserver(de);return He.observe(q),He.observe(ye),()=>{cancelAnimationFrame(ce),He.disconnect()}},[B,T,A]);const Pe=ie>0&&H>0?ie/H*1e3:0,be=`${Math.max(0,Pe)/1e3}s`;s.useLayoutEffect(()=>{if(!T||ie<=0)return;const q=P.current;q&&Hh(q)},[T,ie,c]),s.useLayoutEffect(()=>{if(!T){V(0);return}const q=M.current,ye=P.current;if(!q||!ye)return;const ce=()=>{let de=0;for(let He=0;He<q.children.length;He++){const ee=q.children[He].firstElementChild;ee&&(de=Math.max(de,ee.offsetHeight))}de<=0&&(de=ye.offsetHeight),V(de>0?de:0)};ce();const U=new ResizeObserver(ce);return U.observe(q),U.observe(ye),()=>{U.disconnect()}},[T,ne,t,n,p,v,x,m,w,y,S,G,E]);const Re=()=>{se&&k(!0)},ue=()=>{se&&k(!1)},fe=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),$e=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),Q=s.useCallback((q,ye,ce,U)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:fe,width:"100%"},children:[a.jsx("div",{"data-controls":N?U==null?void 0:U.controlsName:void 0,"data-controls-axis":N?"y":void 0,className:N?`${r}-control`:void 0,style:{height:$((U==null?void 0:U.marginTop)??0)}}),a.jsx("div",{...U!=null&&U.dataMeasureKind?{"data-testimonial-measure":U.dataMeasureKind}:{},style:{...Ut(q,n),textAlign:$e,pointerEvents:"auto",...typeof(U==null?void 0:U.minHeightPx)=="number"&&U.minHeightPx>0?{minHeight:U.minHeightPx}:{}},children:a.jsx(Ri,{content:ye})})]},ce),[fe,$e,n,N,r,$]),Z=s.useCallback((q,ye,ce)=>{var U,de,He;return a.jsxs("div",{style:{padding:`${$(x.top)} ${$(x.right)} ${$(x.bottom)} ${$(x.left)}`,width:$(v+m*2),height:"100%",borderRadius:$(w),border:`${$(m)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:fe,textAlign:$e},children:[q.text&&Q(te,q.text,"text",ce!=null&&ce.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ce==null?void 0:ce.textMinHeightPx)=="number"&&ce.textMinHeightPx>0?{minHeightPx:ce.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:fe,width:"100%"},children:[a.jsx("div",{"data-controls":N&&!(ce!=null&&ce.dataMeasureAttrs)?"logoMarginTop":void 0,className:N&&!(ce!=null&&ce.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(C)}}),a.jsx("div",{style:{width:$(y),height:$(S)},children:((U=q.logo)==null?void 0:U.url)&&a.jsx("img",{src:q.logo.url,alt:((de=q.logo)==null?void 0:de.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((He=q.logo)==null?void 0:He.objectFit)||"contain"}})})]}),q.caption&&Q(O,q.caption,"caption",{...ce!=null&&ce.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:z,...ce!=null&&ce.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ce==null?void 0:ce.captionMinHeightPx)=="number"&&ce.captionMinHeightPx>0?{minHeightPx:ce.captionMinHeightPx}:{}})]})]},ye)},[f,z,O,v,w,S,C,y,fe,$e,x.bottom,x.left,x.right,x.top,Q,m,h,te,n,N,r]),ae=s.useCallback(q=>{b(q.maxTextPx),j(q.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!J){ae({maxTextPx:0,maxCaptionPx:0});return}const q=le.current;if(!q)return;const ye=()=>{W.readTestimonialTextMeasure(q,ae)};ye();const ce=new ResizeObserver(ye);return ce.observe(q),()=>{ce.disconnect()}},[J,ae,t,Z]);const xe=J?{textMinHeightPx:G,captionMinHeightPx:E}:void 0,ke=J?a.jsx("div",{ref:le,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((q,ye)=>Z(q,`measure-${ye}`,{dataMeasureAttrs:!0}))}):null,Ce=(q,ye)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Z(q,`card-${ye}`,xe),N&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ye);if(T){const q=B?se&&re?"paused":"running":"paused";return a.jsxs("div",{ref:I,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",..._>0?{height:_}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),ke,a.jsx("div",{ref:P,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Re,onMouseLeave:ue,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:be,WebkitAnimationDuration:be,animationPlayState:q,WebkitAnimationPlayState:q},children:Array.from({length:ne},(ye,ce)=>a.jsx("div",{ref:ce===0?M:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":ce>0,children:t==null?void 0:t.map((U,de)=>Ce(U,`${ce}-${de}`))},`set-${ce}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),ke,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((q,ye)=>Ce(q,ye))})]})},Oh=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3535
3535
|
import cn from 'classnames';
|
|
3536
3536
|
import { CommonComponentProps } from '../props';
|
|
3537
3537
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4286,7 +4286,7 @@ type TestimonialsSettings = {
|
|
|
4286
4286
|
width: 100%;
|
|
4287
4287
|
height: 100%;
|
|
4288
4288
|
}
|
|
4289
|
-
`}const Vh=3e3,Gh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:w,imageWidth:m,imageHeight:h,controlsWidth:f,controlsColor:x,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[S,
|
|
4289
|
+
`}const Vh=3e3,Gh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:w,imageWidth:m,imageHeight:h,controlsWidth:f,controlsColor:x,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[S,z]=s.useState(0),[N,Y]=s.useState(null),[B,T]=s.useState(!1),H=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),I=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{z(0),Y(null),T(!1)},[l.length]);const P=l[S],M=N===null?null:l[N],g=K=>{var O,J,ne,Pe,be;return{fontSettings:{fontFamily:(e==null?void 0:e[`${K}FontFamily`])??"Arial",fontWeight:((O=e==null?void 0:e[`${K}FontSettings`])==null?void 0:O.fontWeight)??400,fontStyle:((J=e==null?void 0:e[`${K}FontSettings`])==null?void 0:J.fontStyle)??"normal"},textAppearance:{textTransform:((ne=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:ne.textTransform)??"none",textDecoration:((Pe=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:Pe.textDecoration)??"none",fontVariant:((be=e==null?void 0:e[`${K}TextAppearance`])==null?void 0:be.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${K}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${K}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${K}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${K}WordSpacing`])??0,color:(e==null?void 0:e[`${K}Color`])??"#000000"}},D=g("text"),A=g("caption"),X=l.length>1&&l.some(K=>{var te,O;return(((te=K.text)==null?void 0:te.length)??0)>0||(((O=K.caption)==null?void 0:O.length)??0)>0}),ie=s.useRef(null),[L,_]=s.useState(0),[V,se]=s.useState(0),re=e.controls??{mode:"Off",icon:null},k=l.length>1,le=s.useCallback((K,te)=>!k||te===K?K:(H.current&&window.clearTimeout(H.current),Y(K),T(!0),H.current=window.setTimeout(()=>{Y(null),T(!1),H.current=null},300),te),[k]),G=s.useCallback(()=>{k&&z(K=>le(K,(K-1+l.length)%l.length))},[k,le,l.length]),b=s.useCallback(()=>{k&&z(K=>le(K,(K+1)%l.length))},[k,le,l.length]);s.useEffect(()=>{if(!y||!k)return;const K=Math.max(300,Vh/d),te=window.setInterval(()=>{z(O=>le(O,(O+1)%l.length))},K);return()=>{window.clearInterval(te)}},[y,k,le,l.length,d]),s.useEffect(()=>()=>{H.current&&window.clearTimeout(H.current)},[]);const E=(K,te)=>{var be,Re,ue,fe;const O=te==null?void 0:te.textMinHeightPx,J=te==null?void 0:te.captionMinHeightPx,ne=te==null?void 0:te.dataMeasureAttrs,Pe=o&&!(te!=null&&te.dataMeasureAttrs)&&!(te!=null&&te.hideControls);return a.jsxs(a.Fragment,{children:[K.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Pe?"textMarginTop":void 0,className:Pe?`${r}-control`:void 0,style:{height:W.scalingValue(v??0,n??!1)}}),a.jsx("div",{...ne&&{"data-testimonial-measure":"text"},style:{...Ut(D,n),...O&&O>0?{minHeight:O}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ri,{content:K.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Pe?"imageMarginTop":void 0,className:Pe?`${r}-control`:void 0,style:{height:W.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:W.scalingValue(m??0,n??!1),height:W.scalingValue(h??0,n??!1)},children:((be=K.image)==null?void 0:be.url)&&a.jsx("img",{src:(Re=K.image)==null?void 0:Re.url,alt:((ue=K.image)==null?void 0:ue.name)??"",className:`${r}-icon`,style:{objectFit:((fe=K.image)==null?void 0:fe.objectFit)||"contain"}})})]}),K.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Pe?"captionMarginTop":void 0,className:Pe?`${r}-control`:void 0,style:{height:W.scalingValue(w??0,n??!1)}}),a.jsx("div",{...ne?{"data-testimonial-measure":"caption"}:{},style:{...Ut(A,n),...J&&J>0?{minHeight:J}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ri,{content:K.caption})})]})]})},j=s.useCallback(K=>{_(K.maxTextPx),se(K.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!X){j({maxTextPx:0,maxCaptionPx:0});return}const K=ie.current;if(!K)return;const te=()=>{W.readTestimonialTextMeasure(K,j)};te();const O=new ResizeObserver(te);return O.observe(K),()=>{O.disconnect()}},[X,j,t]),!P)return a.jsx(a.Fragment,{});const me=X?{textMinHeightPx:L,captionMinHeightPx:V}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:jh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:W.scalingValue(u??0,n??!1),alignItems:$},children:[X&&a.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((K,te)=>a.jsx("div",{style:{width:"100%"},children:E(K,{dataMeasureAttrs:!0})},te))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[M&&B&&a.jsx("div",{className:pt(`${r}-fade-item-prev`,`${r}-fade-out`),children:E(M,{...me,hideControls:!0})}),a.jsx("div",{className:pt(`${r}-fade-item-current`,B?`${r}-fade-in`:void 0),children:E(P,me)})]})]}),re.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:W.scalingValue(f??.02,n??!1),height:W.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:G,disabled:!k,"aria-label":"Previous testimonial",children:re.icon&&a.jsx(sn,{url:re.icon,fill:x,hoverFill:C,className:pt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:pt(`${r}-arrow`,`${r}-next-arrow`),style:{width:W.scalingValue(f??.02,n??!1),height:W.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:b,disabled:!k,"aria-label":"Next testimonial",children:re.icon&&a.jsx(sn,{url:re.icon,fill:x,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},Xh=`import cn from 'classnames';
|
|
4290
4290
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4291
4291
|
import { CommonComponentProps } from '../props';
|
|
4292
4292
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -5129,7 +5129,7 @@ type TestimonialsSettings = {
|
|
|
5129
5129
|
z-index: 2;
|
|
5130
5130
|
width: 100%;
|
|
5131
5131
|
}
|
|
5132
|
-
`}function Jh(){return Math.random()<.5?"ltr":"ttb"}function Qh(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function ef(e){const t=Jh();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Qh(e)})})}const bn=500,tf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",nf=72,of=50;function rf(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function af(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function sf(e){const[t]=e.media;return t!=null&&t.url?t:null}function wd(e){return!Array.isArray(e)||e.length===0?[]:rf(e)?e.flatMap(t=>{const n=af(t);if(!n)return[];const i=sf(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function $i(e){return e.type==="video"}function lf(e){const t=new Set,n=[];for(const i of e){const o=wd(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function cf({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>$i(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function df(e){e.pause(),e.removeAttribute("src"),e.load()}function Cl({media:e,className:t,style:n,onMediaClick:i}){return $i(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function $l(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function uf(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function pf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{df(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function mf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=s.useRef(null),w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),B=s.useRef(null),N=s.useRef(0),q=s.useRef(null),D=s.useRef(!1),T=s.useRef(null),H=s.useRef(null),$=s.useRef(null),I=s.useRef(()=>{}),[P,E]=s.useState(null),[g,z]=s.useState(null),[F,X]=s.useState("opening"),[ie,L]=s.useState(0),[_,V]=s.useState(0),[ae,re]=s.useState(null),[M,se]=s.useState(!1),[j,b]=s.useState(!1),[k,G]=s.useState(!1),[he,J]=s.useState(null),ee=s.useRef(n),O=s.useRef(void 0),Z=t[n],te=Z?$i(Z):!1,Le=_!==0||M,ve=ae!==null,Ie=s.useCallback(ge=>{const xe=ge.currentTarget,_e=xe instanceof HTMLVideoElement?{width:xe.videoWidth,height:xe.videoHeight}:{width:xe.naturalWidth,height:xe.naturalHeight};!_e.width||!_e.height||J(_e)},[]);s.useEffect(()=>{B.current=g},[g]),s.useEffect(()=>{const ge=v.current;if(!ge)return;const xe=()=>z($l(ge));xe();const _e=new ResizeObserver(xe);return _e.observe(ge),()=>_e.disconnect()},[]);const pe=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),oe=s.useCallback(()=>{const ge=H.current;H.current=null,pe(),q.current=null,D.current=!1,re(null),se(!1),V(0),N.current=0,b(!1),y.current=!1,x.current=0,C.current="none",ge===1?d():ge===-1&&l()},[pe,d,l]),ye=s.useCallback(()=>{pe(),H.current=null,q.current=null,D.current=!1,re(null),se(!1),V(0),N.current=0},[pe]),U=s.useCallback(()=>{pe(),T.current=window.setTimeout(()=>{H.current!==null&&oe()},bn+32)},[pe,oe]),ce=s.useCallback((ge,xe)=>{var Ze;const _e=((Ze=B.current)==null?void 0:Ze.width)??0;if(pe(),q.current=ge,re(ge),D.current=!0,se(!0),xe){H.current=ge;const we=-ge*_e;N.current=we,V(we),U();return}N.current=0,V(0),T.current=window.setTimeout(()=>{T.current=null,ye()},bn+32)},[pe,ye,U]),le=s.useCallback(ge=>{if(!(t.length<=1)){if(D.current){if(H.current===ge){$.current=ge,oe();return}ye()}pe(),q.current=ge,re(ge),D.current=!1,se(!1),N.current=0,V(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(ge,!0)})})}},[t.length,ce,oe,ye,pe]);I.current=le;const Ce=s.useCallback(ge=>{ge.propertyName!=="transform"||!D.current||H.current!==null&&oe()},[oe]),Fe=s.useCallback(()=>{const ge=w.current;if(!ge)return;const xe=$l(ge);!xe.width||!xe.height||E(xe)},[]);s.useEffect(()=>{Fe();const ge=w.current;if(!ge)return;const xe=new ResizeObserver(()=>Fe());return xe.observe(ge),()=>xe.disconnect()},[Fe]),s.useEffect(()=>{F==="opening"&&P&&X("open")},[F,P]),s.useEffect(()=>{if(F!=="closing")return;const ge=setTimeout(()=>r(),bn);return()=>clearTimeout(ge)},[F,r]),s.useEffect(()=>()=>{pe()},[pe]),s.useLayoutEffect(()=>{ee.current===n&&O.current===(Z==null?void 0:Z.url)||(pe(),H.current=null,re(null),L(0),V(0),se(!1),G(!1),b(!1),J(null),f.current=0,x.current=0,C.current="none",y.current=!1,D.current=!1,N.current=0,q.current=null,h.current=null,S.current=!1,ee.current=n,O.current=Z==null?void 0:Z.url)},[n,Z==null?void 0:Z.url,pe]),s.useLayoutEffect(()=>{const ge=$.current;ge!==null&&($.current=null,requestAnimationFrame(()=>{I.current(ge)}))},[n,Z==null?void 0:Z.url]),s.useEffect(()=>{if(F!=="open")return;let ge=null;const xe=()=>{ge&&(document.removeEventListener("click",ge,!0),ge=null)},_e=()=>{xe(),ge=ze=>{ze.stopPropagation(),ze.preventDefault(),xe()},document.addEventListener("click",ge,!0)},Ze=ze=>{const Te=ze<0?1:-1;if(Math.abs(ze)>of&&t.length>1){ce(Te,!0);return}ce(Te,!1)},we=ze=>{if(ze.touches.length!==1||D.current)return;const Te=ze.touches[0];S.current=!0,h.current={x:Te.clientX,y:Te.clientY},C.current="none",x.current=0,y.current=!1},$e=ze=>{if(!h.current||ze.touches.length!==1||D.current)return;const Te=ze.touches[0],Ve=Te.clientX-h.current.x,De=Te.clientY-h.current.y;if(C.current==="none"){if(Math.abs(Ve)<10&&Math.abs(De)<10)return;if(Math.abs(Ve)>Math.abs(De)){if(t.length<=1)return;C.current="horizontal"}else if(De>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,b(!0),x.current=Ve;const tt=Ve<0?1:-1;q.current!==tt&&(q.current=tt,re(tt)),N.current=Ve,V(Ve),ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,b(!0),f.current=De,L(De),ze.preventDefault())},Xe=()=>{if(!h.current)return;const ze=C.current,Te=y.current;if(Te&&ze==="horizontal")Ze(x.current),_e();else if(Te&&ze==="vertical")if(f.current>nf){const De=window.innerHeight;f.current=De,G(!0),L(De),X("closing")}else f.current=0,L(0),_e();else ze==="horizontal"&&Math.abs(x.current)>0&&(Ze(x.current),_e());h.current=null,C.current="none",x.current=0,y.current=!1,b(!1)};return document.addEventListener("touchstart",we,{passive:!0}),document.addEventListener("touchmove",$e,{passive:!1}),document.addEventListener("touchend",Xe),document.addEventListener("touchcancel",Xe),()=>{document.removeEventListener("touchstart",we),document.removeEventListener("touchmove",$e),document.removeEventListener("touchend",Xe),document.removeEventListener("touchcancel",Xe),xe()}},[F,t.length,ce]),s.useEffect(()=>{const ge=xe=>{xe.key==="Escape"&&(xe.preventDefault(),xe.stopPropagation(),F!=="closing"&&X("closing"))};return window.addEventListener("keydown",ge,!0),()=>window.removeEventListener("keydown",ge,!0)},[F]);const Ee=()=>{F!=="closing"&&X("closing")},Y=F==="open",be=F==="closing",de=ie>0?Math.max(0,1-ie/500):1,K=ie>0?Math.max(.35,1-ie/500):1,ue=P?p?P:uf(P,he):null,He=ge=>{if(ge.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const xe=ue??ge.currentTarget.getBoundingClientRect(),_e=ge.clientY-xe.top,Ze=Math.min(52,xe.height*.2);if(!(_e>xe.height-Ze)){if(ge.clientX-xe.left<xe.width/2){le(-1);return}le(1)}},fe=ge=>{if(t.length<=1)return;const xe=ue??ge.currentTarget.getBoundingClientRect(),_e=ge.clientX-xe.left,Ze=ge.clientY-xe.top,we=Math.min(52,xe.height*.2);if(Ze>xe.height-we){ge.currentTarget.style.cursor="default";return}ge.currentTarget.style.cursor=_e<xe.width/2?"w-resize":"e-resize"},Q={position:"fixed",top:g==null?void 0:g.top,left:g==null?void 0:g.left,width:g==null?void 0:g.width,height:g==null?void 0:g.height,zIndex:9998},Je=p?"cover":"contain",Ne=_!==0||ie>0?`translate(${_}px, ${ie}px)`:void 0,ct=j&&!M?"none":M?`transform ${bn}ms ${jn}`:k?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:F==="opening"||be?`opacity ${bn}ms ${jn}`:"none",Ke={...Q,transform:Ne,opacity:ie>0?K:F==="opening"||be?0:1,transition:ct,pointerEvents:"none"},ut={position:"absolute",top:((ue==null?void 0:ue.top)??0)-((g==null?void 0:g.top)??0),left:((ue==null?void 0:ue.left)??0)-((g==null?void 0:g.left)??0),width:ue==null?void 0:ue.width,height:ue==null?void 0:ue.height,objectFit:Je,pointerEvents:te&&Y&&!Le?"auto":"none",touchAction:te&&Y?"none":void 0},lt=(g==null?void 0:g.width)??0,Ye=ve?(n+ae+t.length)%t.length:null,Re=Ye!==null?t[Ye]:null,We={...Q,transform:ve?`translateX(${ae*lt+_}px)`:void 0,opacity:1,transition:M?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((P==null?void 0:P.top)??0)-((g==null?void 0:g.top)??0),left:((P==null?void 0:P.left)??0)-((g==null?void 0:g.left)??0),width:P==null?void 0:P.width,height:P==null?void 0:P.height,objectFit:Je,pointerEvents:"none"},Ue=ue?{position:"fixed",top:ue.top,height:ue.height,width:ue.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:F==="open"?"none":void 0},onClick:Ee,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Y?de:0,transition:j?"none":`opacity ${bn}ms ${jn}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Y?1:0,transition:`opacity ${bn}ms ${jn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Y?1:0,transition:`opacity ${bn}ms ${jn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),P&&g&&Re&&a.jsx("div",{style:We,onTransitionEnd:Ce,children:$i(Re)?a.jsx("video",{src:Re.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${Ye}-${Re.url}`):a.jsx("img",{src:Re.url,alt:Re.name,style:Be},`neighbor-${Ye}-${Re.url}`)}),P&&g&&Z&&a.jsx("div",{style:Ke,onTransitionEnd:Ce,children:te?a.jsx(pf,{src:Z.url,phase:F,mediaRef:m,mediaStyle:ut,onLoadedMetadata:Ie,onClick:He,onMouseMove:fe},`${n}-${Z.url}`):a.jsx("img",{ref:m,src:Z.url,alt:Z.name,onLoad:Ie,style:ut},`${n}-${Z.url}`)}),Y&&Ue&&t.length>1&&!te&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:ue.left,cursor:"w-resize",pointerEvents:j?"none":"auto"},onClick:ge=>{if(S.current){S.current=!1;return}ge.stopPropagation(),le(-1)}}),a.jsx("div",{style:{...Ue,left:ue.left+ue.width/2,cursor:"e-resize",pointerEvents:j?"none":"auto"},onClick:ge=>{if(S.current){S.current=!1;return}ge.stopPropagation(),le(1)}})]})]})}function gf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function hf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=W.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:w=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:x,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:B,direction:N,transition:q,titleMarginTop:D,subtitleMarginTop:T,titleColor:H,subtitleColor:$,lightboxCounterColor:I,titleFontFamily:P,titleFontSettings:E,titleFontSize:g,titleLineHeight:z,titleLetterSpacing:F,titleWordSpacing:X,titleTextAppearance:ie,subtitleFontFamily:L,subtitleFontSettings:_,subtitleFontSize:V,subtitleLineHeight:ae,subtitleLetterSpacing:re,subtitleWordSpacing:M,subtitleTextAppearance:se,lightboxCounterFontFamily:j,lightboxCounterFontSettings:b,lightboxCounterFontSize:k,lightboxCounterLineHeight:G,lightboxCounterLetterSpacing:he,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:ee,showText:O="always",alignEntries:Z="off",align:te="top"}=e,Le={fontSettings:{fontFamily:P,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:g??.01,lineHeight:z,letterSpacing:F??0,wordSpacing:X??0,textAppearance:ie,color:H},Ie={...an(Ut(Le,n))},pe={fontSettings:{fontFamily:L,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:V??.01,lineHeight:ae,letterSpacing:re??0,wordSpacing:M??0,textAppearance:se,color:$},ye={...an(Ut(pe,n))},U={fontSettings:{fontFamily:j,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:k??.01,lineHeight:G,letterSpacing:he??0,wordSpacing:J??0,textAppearance:ee,color:I},le={...an(Ut(U,n)),...wa(k,G,u,n)},Ce=ba(g,z,`${u}-item-title`,`${u}-text-tight-leading`),Fe=ba(V,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ee=wa(g,z,u,n),Y=wa(V,ae,u,n),be=ba(k,G,`${u}-lightbox-counter`,`${u}-text-tight-leading`),de=W.buildColorVars(u,{titleColor:H,subtitleColor:$,lightboxCounterColor:I},ff,yf),He=`${l&&l!=="default"?`${u}-state-${l}`:""}${O==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),fe=h===0?1/0:h,Q=(t??[]).slice(0,fe),Je=s.useMemo(()=>f==="on"?lf(Q):[],[Q,f]),Ne=v.entryWidth??.2,ct=(x==null?void 0:x.display)==="cover",Ke=(x==null?void 0:x.ratioValue)??"1:1",ut=(x==null?void 0:x.reversed)??!1,[lt,Ye]=Ke.split(":").map(Number),Be=`${ut?Ye:lt} / ${ut?lt:Ye}`,Ue=v.columnsCount,ge=W.scalingValue(Ne??0,n),xe=ge,_e=!ct&&S!=="off",Ze=Q.length%Ue||Ue,we=Ze<Ue&&Q.length>0,$e=Q.length-Ze,Xe=we?Math.floor((Ue-Ze)/2)+1:1,ze=C?W.scalingValue(C,n):void 0,Te={width:xe,...ct?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...ze?{borderRadius:ze,overflow:"hidden"}:{}},Ve=`${u}-item-image-wrapper${_e?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",tt=Z==="on",nt=`calc(${W.scalingValue(Ne??0,n)} * (${w} / 100))`,st=W.scalingValue(Ne*w/100,n),St=ct?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ze?{borderRadius:ze}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ze?{borderRadius:ze}:{}},[Bt,zt]=s.useState(0),ft=s.useRef(null),wt=q==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=ft.current;if(!gt)return;const ke=new ResizeObserver(Ge=>{zt(Math.round(Ge[0].contentRect.width))});return ke.observe(gt),()=>ke.disconnect()},[]);const jt=(()=>{const gt={...de},ke=ft.current?getComputedStyle(ft.current).getPropertyValue("--cntrl-article-width").trim():"";return ke&&(gt["--cntrl-article-width"]=ke),gt})(),[At,xt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Kt,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,ke)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(ke),xt(!0))};s.useEffect(()=>{if(!At||f!=="on"||typeof document>"u")return;const gt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=gt}},[At,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const rn=s.useMemo(()=>Zh(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(cf,{mediaList:Je}),a.jsx("div",{style:de,children:a.jsx("div",{ref:ft,className:`${u}-wrapper ${u}-type-${p}${tt?` ${u}-align-entries`:""} ${u}-image-align-${te} ${He}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${ge})`,rowGap:tt?0:W.scalingValue(m??0,n),columnGap:W.scalingValue(v.horizontalGap??0,n),width:W.scalingValue(v.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:W.scalingValue(m??0,n)}:{}},children:Q.map((gt,ke)=>{var _t;const Ge=Sl(gt.title),rt=Sl(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,yt=Math.floor(ke/Ue)===Math.ceil(Q.length/Ue)-1,Lt=we&&ke>=$e?`${Xe+(ke-$e)}`:void 0,mt=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Ge&&a.jsx("p",{className:Ce,style:{width:nt,...Ie,...Ee},children:gt.title}),Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(D??0,n),width:st}}),rt&&a.jsx("p",{className:Fe,style:{width:nt,...ye,...Y},children:gt.subtitle}),rt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(T??0,n),width:st}})]}):null,Vt=tt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Ge?"titleMarginTop":void 0,className:o&&Ge?`${u}-control`:void 0,style:{height:Ge?W.scalingValue(D??0,n):0,width:st}}),Ge&&a.jsx("p",{className:Ce,style:{width:nt,...Ie,...Ee},children:gt.title}),De&&Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(D??0,n),width:st}})]}):null,kt=tt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&rt?"subtitleMarginTop":void 0,className:o&&rt?`${u}-control`:void 0,style:{height:rt?W.scalingValue(T??0,n):0,width:st}}),rt&&a.jsx("p",{className:Fe,style:{width:nt,...ye,...Y},children:gt.subtitle}),De&&rt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(T??0,n),width:st}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[Vt,kt]}):a.jsxs(a.Fragment,{children:[Vt,kt]}),Xt=wd(gt.gallery),qt=Xt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:Ve,style:Te,children:Xt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:A}=Xt[0],Pe=A?qt.findIndex(Ae=>Ae.url===A.url):-1;return a.jsx(Cl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Pe>=0?()=>Wt(qt,Pe):void 0})})():a.jsxs(a.Fragment,{children:[_e&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Xt.map(({displayMedia:Ct})=>$i(Ct)?a.jsx("video",{src:Ct.url,muted:!0,playsInline:!0},`sizer-${Ct.url}`):a.jsx("img",{src:Ct.url,alt:""},`sizer-${Ct.url}`))}),a.jsx(Ns,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:B*1e3,width:"100%",height:"100%",speed:tf,type:q==="fade"?"fade":"loop",rewind:q==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{N!=="random"||q==="fade"||ef(Ct)},children:Xt.map(({displayMedia:Ct,lightboxMedia:A},Pe)=>{const Ae=A?qt.findIndex(Oe=>Oe.url===A.url):-1;return a.jsx(Ws,{children:a.jsx(Cl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ae>=0?()=>Wt(qt,Ae):void 0})},Pe)})},`${q}-${Ne}-${N}-${B}-${Bt}-${d}`)]})}),Dt=De?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Ge?"titleMarginTop":void 0,className:o&&Ge?`${u}-control`:void 0,style:{height:Ge?W.scalingValue(D??0,n):0,width:st}}),a.jsx("p",{className:Ce,style:{width:nt,...Ie,...Ee},children:gt.title}),a.jsx("div",{"data-controls":o&&rt?"subtitleMarginTop":void 0,className:o&&rt?`${u}-control`:void 0,style:{height:rt?W.scalingValue(T??0,n):0,width:st}}),a.jsx("p",{className:Fe,style:{width:nt,...ye,...Y},children:gt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!tt?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&yt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${ge} * (${w} / 100))`:ge,...Lt&&tt?{gridColumn:Lt}:{}},children:tt?a.jsx(a.Fragment,{children:De?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):ht?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[mt,Ht]}),!De&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},ke)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:jt,"data-selection":"none",children:a.jsx(mf,{prefix:u,items:Ft,index:Kt,imageDisplay:gf(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Jt(ke=>(ke-1+Ft.length)%Ft.length),onNext:()=>Jt(ke=>(ke+1)%Ft.length),counterClassName:be,counterStyle:le})}),gt)})()]})}const ff={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},yf=["hover","focus","filled","success","error"],vf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5132
|
+
`}function Jh(){return Math.random()<.5?"ltr":"ttb"}function Qh(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function ef(e){const t=Jh();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Qh(e)})})}const bn=500,tf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",nf=72,of=50;function rf(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function af(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function sf(e){const[t]=e.media;return t!=null&&t.url?t:null}function wd(e){return!Array.isArray(e)||e.length===0?[]:rf(e)?e.flatMap(t=>{const n=af(t);if(!n)return[];const i=sf(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function $i(e){return e.type==="video"}function lf(e){const t=new Set,n=[];for(const i of e){const o=wd(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function cf({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>$i(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function df(e){e.pause(),e.removeAttribute("src"),e.load()}function Cl({media:e,className:t,style:n,onMediaClick:i}){return $i(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function $l(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function uf(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function pf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{df(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function mf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=s.useRef(null),w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),z=s.useRef(null),N=s.useRef(0),Y=s.useRef(null),B=s.useRef(!1),T=s.useRef(null),H=s.useRef(null),$=s.useRef(null),I=s.useRef(()=>{}),[P,M]=s.useState(null),[g,D]=s.useState(null),[A,X]=s.useState("opening"),[ie,L]=s.useState(0),[_,V]=s.useState(0),[se,re]=s.useState(null),[k,le]=s.useState(!1),[G,b]=s.useState(!1),[E,j]=s.useState(!1),[me,K]=s.useState(null),te=s.useRef(n),O=s.useRef(void 0),J=t[n],ne=J?$i(J):!1,Pe=_!==0||k,be=se!==null,Re=s.useCallback(ge=>{const ve=ge.currentTarget,_e=ve instanceof HTMLVideoElement?{width:ve.videoWidth,height:ve.videoHeight}:{width:ve.naturalWidth,height:ve.naturalHeight};!_e.width||!_e.height||K(_e)},[]);s.useEffect(()=>{z.current=g},[g]),s.useEffect(()=>{const ge=v.current;if(!ge)return;const ve=()=>D($l(ge));ve();const _e=new ResizeObserver(ve);return _e.observe(ge),()=>_e.disconnect()},[]);const ue=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),fe=s.useCallback(()=>{const ge=H.current;H.current=null,ue(),Y.current=null,B.current=!1,re(null),le(!1),V(0),N.current=0,b(!1),y.current=!1,x.current=0,C.current="none",ge===1?d():ge===-1&&l()},[ue,d,l]),$e=s.useCallback(()=>{ue(),H.current=null,Y.current=null,B.current=!1,re(null),le(!1),V(0),N.current=0},[ue]),Q=s.useCallback(()=>{ue(),T.current=window.setTimeout(()=>{H.current!==null&&fe()},bn+32)},[ue,fe]),Z=s.useCallback((ge,ve)=>{var Ze;const _e=((Ze=z.current)==null?void 0:Ze.width)??0;if(ue(),Y.current=ge,re(ge),B.current=!0,le(!0),ve){H.current=ge;const we=-ge*_e;N.current=we,V(we),Q();return}N.current=0,V(0),T.current=window.setTimeout(()=>{T.current=null,$e()},bn+32)},[ue,$e,Q]),ae=s.useCallback(ge=>{if(!(t.length<=1)){if(B.current){if(H.current===ge){$.current=ge,fe();return}$e()}ue(),Y.current=ge,re(ge),B.current=!1,le(!1),N.current=0,V(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(ge,!0)})})}},[t.length,Z,fe,$e,ue]);I.current=ae;const xe=s.useCallback(ge=>{ge.propertyName!=="transform"||!B.current||H.current!==null&&fe()},[fe]),ke=s.useCallback(()=>{const ge=w.current;if(!ge)return;const ve=$l(ge);!ve.width||!ve.height||M(ve)},[]);s.useEffect(()=>{ke();const ge=w.current;if(!ge)return;const ve=new ResizeObserver(()=>ke());return ve.observe(ge),()=>ve.disconnect()},[ke]),s.useEffect(()=>{A==="opening"&&P&&X("open")},[A,P]),s.useEffect(()=>{if(A!=="closing")return;const ge=setTimeout(()=>r(),bn);return()=>clearTimeout(ge)},[A,r]),s.useEffect(()=>()=>{ue()},[ue]),s.useLayoutEffect(()=>{te.current===n&&O.current===(J==null?void 0:J.url)||(ue(),H.current=null,re(null),L(0),V(0),le(!1),j(!1),b(!1),K(null),f.current=0,x.current=0,C.current="none",y.current=!1,B.current=!1,N.current=0,Y.current=null,h.current=null,S.current=!1,te.current=n,O.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,ue]),s.useLayoutEffect(()=>{const ge=$.current;ge!==null&&($.current=null,requestAnimationFrame(()=>{I.current(ge)}))},[n,J==null?void 0:J.url]),s.useEffect(()=>{if(A!=="open")return;let ge=null;const ve=()=>{ge&&(document.removeEventListener("click",ge,!0),ge=null)},_e=()=>{ve(),ge=ze=>{ze.stopPropagation(),ze.preventDefault(),ve()},document.addEventListener("click",ge,!0)},Ze=ze=>{const Ie=ze<0?1:-1;if(Math.abs(ze)>of&&t.length>1){Z(Ie,!0);return}Z(Ie,!1)},we=ze=>{if(ze.touches.length!==1||B.current)return;const Ie=ze.touches[0];S.current=!0,h.current={x:Ie.clientX,y:Ie.clientY},C.current="none",x.current=0,y.current=!1},Te=ze=>{if(!h.current||ze.touches.length!==1||B.current)return;const Ie=ze.touches[0],Ve=Ie.clientX-h.current.x,De=Ie.clientY-h.current.y;if(C.current==="none"){if(Math.abs(Ve)<10&&Math.abs(De)<10)return;if(Math.abs(Ve)>Math.abs(De)){if(t.length<=1)return;C.current="horizontal"}else if(De>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,b(!0),x.current=Ve;const tt=Ve<0?1:-1;Y.current!==tt&&(Y.current=tt,re(tt)),N.current=Ve,V(Ve),ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,b(!0),f.current=De,L(De),ze.preventDefault())},Xe=()=>{if(!h.current)return;const ze=C.current,Ie=y.current;if(Ie&&ze==="horizontal")Ze(x.current),_e();else if(Ie&&ze==="vertical")if(f.current>nf){const De=window.innerHeight;f.current=De,j(!0),L(De),X("closing")}else f.current=0,L(0),_e();else ze==="horizontal"&&Math.abs(x.current)>0&&(Ze(x.current),_e());h.current=null,C.current="none",x.current=0,y.current=!1,b(!1)};return document.addEventListener("touchstart",we,{passive:!0}),document.addEventListener("touchmove",Te,{passive:!1}),document.addEventListener("touchend",Xe),document.addEventListener("touchcancel",Xe),()=>{document.removeEventListener("touchstart",we),document.removeEventListener("touchmove",Te),document.removeEventListener("touchend",Xe),document.removeEventListener("touchcancel",Xe),ve()}},[A,t.length,Z]),s.useEffect(()=>{const ge=ve=>{ve.key==="Escape"&&(ve.preventDefault(),ve.stopPropagation(),A!=="closing"&&X("closing"))};return window.addEventListener("keydown",ge,!0),()=>window.removeEventListener("keydown",ge,!0)},[A]);const Ce=()=>{A!=="closing"&&X("closing")},q=A==="open",ye=A==="closing",ce=ie>0?Math.max(0,1-ie/500):1,U=ie>0?Math.max(.35,1-ie/500):1,de=P?p?P:uf(P,me):null,He=ge=>{if(ge.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ve=de??ge.currentTarget.getBoundingClientRect(),_e=ge.clientY-ve.top,Ze=Math.min(52,ve.height*.2);if(!(_e>ve.height-Ze)){if(ge.clientX-ve.left<ve.width/2){ae(-1);return}ae(1)}},he=ge=>{if(t.length<=1)return;const ve=de??ge.currentTarget.getBoundingClientRect(),_e=ge.clientX-ve.left,Ze=ge.clientY-ve.top,we=Math.min(52,ve.height*.2);if(Ze>ve.height-we){ge.currentTarget.style.cursor="default";return}ge.currentTarget.style.cursor=_e<ve.width/2?"w-resize":"e-resize"},ee={position:"fixed",top:g==null?void 0:g.top,left:g==null?void 0:g.left,width:g==null?void 0:g.width,height:g==null?void 0:g.height,zIndex:9998},Je=p?"cover":"contain",Ne=_!==0||ie>0?`translate(${_}px, ${ie}px)`:void 0,ct=G&&!k?"none":k?`transform ${bn}ms ${jn}`:E?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:A==="opening"||ye?`opacity ${bn}ms ${jn}`:"none",Ke={...ee,transform:Ne,opacity:ie>0?U:A==="opening"||ye?0:1,transition:ct,pointerEvents:"none"},ut={position:"absolute",top:((de==null?void 0:de.top)??0)-((g==null?void 0:g.top)??0),left:((de==null?void 0:de.left)??0)-((g==null?void 0:g.left)??0),width:de==null?void 0:de.width,height:de==null?void 0:de.height,objectFit:Je,pointerEvents:ne&&q&&!Pe?"auto":"none",touchAction:ne&&q?"none":void 0},lt=(g==null?void 0:g.width)??0,Ye=be?(n+se+t.length)%t.length:null,Le=Ye!==null?t[Ye]:null,We={...ee,transform:be?`translateX(${se*lt+_}px)`:void 0,opacity:1,transition:k?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((P==null?void 0:P.top)??0)-((g==null?void 0:g.top)??0),left:((P==null?void 0:P.left)??0)-((g==null?void 0:g.left)??0),width:P==null?void 0:P.width,height:P==null?void 0:P.height,objectFit:Je,pointerEvents:"none"},Ue=de?{position:"fixed",top:de.top,height:de.height,width:de.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:A==="open"?"none":void 0},onClick:Ce,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:q?ce:0,transition:G?"none":`opacity ${bn}ms ${jn}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:q?1:0,transition:`opacity ${bn}ms ${jn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:q?1:0,transition:`opacity ${bn}ms ${jn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),P&&g&&Le&&a.jsx("div",{style:We,onTransitionEnd:xe,children:$i(Le)?a.jsx("video",{src:Le.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${Ye}-${Le.url}`):a.jsx("img",{src:Le.url,alt:Le.name,style:Be},`neighbor-${Ye}-${Le.url}`)}),P&&g&&J&&a.jsx("div",{style:Ke,onTransitionEnd:xe,children:ne?a.jsx(pf,{src:J.url,phase:A,mediaRef:m,mediaStyle:ut,onLoadedMetadata:Re,onClick:He,onMouseMove:he},`${n}-${J.url}`):a.jsx("img",{ref:m,src:J.url,alt:J.name,onLoad:Re,style:ut},`${n}-${J.url}`)}),q&&Ue&&t.length>1&&!ne&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:de.left,cursor:"w-resize",pointerEvents:G?"none":"auto"},onClick:ge=>{if(S.current){S.current=!1;return}ge.stopPropagation(),ae(-1)}}),a.jsx("div",{style:{...Ue,left:de.left+de.width/2,cursor:"e-resize",pointerEvents:G?"none":"auto"},onClick:ge=>{if(S.current){S.current=!1;return}ge.stopPropagation(),ae(1)}})]})]})}function gf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function hf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=W.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:w=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:x,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:z,direction:N,transition:Y,titleMarginTop:B,subtitleMarginTop:T,titleColor:H,subtitleColor:$,lightboxCounterColor:I,titleFontFamily:P,titleFontSettings:M,titleFontSize:g,titleLineHeight:D,titleLetterSpacing:A,titleWordSpacing:X,titleTextAppearance:ie,subtitleFontFamily:L,subtitleFontSettings:_,subtitleFontSize:V,subtitleLineHeight:se,subtitleLetterSpacing:re,subtitleWordSpacing:k,subtitleTextAppearance:le,lightboxCounterFontFamily:G,lightboxCounterFontSettings:b,lightboxCounterFontSize:E,lightboxCounterLineHeight:j,lightboxCounterLetterSpacing:me,lightboxCounterWordSpacing:K,lightboxCounterTextAppearance:te,showText:O="always",alignEntries:J="off",align:ne="top"}=e,Pe={fontSettings:{fontFamily:P,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:g??.01,lineHeight:D,letterSpacing:A??0,wordSpacing:X??0,textAppearance:ie,color:H},Re={...an(Ut(Pe,n))},ue={fontSettings:{fontFamily:L,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:V??.01,lineHeight:se,letterSpacing:re??0,wordSpacing:k??0,textAppearance:le,color:$},$e={...an(Ut(ue,n))},Q={fontSettings:{fontFamily:G,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:E??.01,lineHeight:j,letterSpacing:me??0,wordSpacing:K??0,textAppearance:te,color:I},ae={...an(Ut(Q,n)),...wa(E,j,u,n)},xe=ba(g,D,`${u}-item-title`,`${u}-text-tight-leading`),ke=ba(V,se,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=wa(g,D,u,n),q=wa(V,se,u,n),ye=ba(E,j,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ce=W.buildColorVars(u,{titleColor:H,subtitleColor:$,lightboxCounterColor:I},ff,yf),He=`${l&&l!=="default"?`${u}-state-${l}`:""}${O==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),he=h===0?1/0:h,ee=(t??[]).slice(0,he),Je=s.useMemo(()=>f==="on"?lf(ee):[],[ee,f]),Ne=v.entryWidth??.2,ct=(x==null?void 0:x.display)==="cover",Ke=(x==null?void 0:x.ratioValue)??"1:1",ut=(x==null?void 0:x.reversed)??!1,[lt,Ye]=Ke.split(":").map(Number),Be=`${ut?Ye:lt} / ${ut?lt:Ye}`,Ue=v.columnsCount,ge=W.scalingValue(Ne??0,n),ve=ge,_e=!ct&&S!=="off",Ze=ee.length%Ue||Ue,we=Ze<Ue&&ee.length>0,Te=ee.length-Ze,Xe=we?Math.floor((Ue-Ze)/2)+1:1,ze=C?W.scalingValue(C,n):void 0,Ie={width:ve,...ct?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...ze?{borderRadius:ze,overflow:"hidden"}:{}},Ve=`${u}-item-image-wrapper${_e?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",tt=J==="on",nt=`calc(${W.scalingValue(Ne??0,n)} * (${w} / 100))`,st=W.scalingValue(Ne*w/100,n),St=ct?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ze?{borderRadius:ze}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ze?{borderRadius:ze}:{}},[Bt,zt]=s.useState(0),ft=s.useRef(null),wt=Y==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=ft.current;if(!gt)return;const Ae=new ResizeObserver(Ge=>{zt(Math.round(Ge[0].contentRect.width))});return Ae.observe(gt),()=>Ae.disconnect()},[]);const jt=(()=>{const gt={...ce},Ae=ft.current?getComputedStyle(ft.current).getPropertyValue("--cntrl-article-width").trim():"";return Ae&&(gt["--cntrl-article-width"]=Ae),gt})(),[At,xt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Kt,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,Ae)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(Ae),xt(!0))};s.useEffect(()=>{if(!At||f!=="on"||typeof document>"u")return;const gt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=gt}},[At,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const rn=s.useMemo(()=>Zh(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(cf,{mediaList:Je}),a.jsx("div",{style:ce,children:a.jsx("div",{ref:ft,className:`${u}-wrapper ${u}-type-${p}${tt?` ${u}-align-entries`:""} ${u}-image-align-${ne} ${He}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${ge})`,rowGap:tt?0:W.scalingValue(m??0,n),columnGap:W.scalingValue(v.horizontalGap??0,n),width:W.scalingValue(v.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:W.scalingValue(m??0,n)}:{}},children:ee.map((gt,Ae)=>{var _t;const Ge=Sl(gt.title),rt=Sl(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,yt=Math.floor(Ae/Ue)===Math.ceil(ee.length/Ue)-1,Lt=we&&Ae>=Te?`${Xe+(Ae-Te)}`:void 0,mt=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Ge&&a.jsx("p",{className:xe,style:{width:nt,...Re,...Ce},children:gt.title}),Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(B??0,n),width:st}}),rt&&a.jsx("p",{className:ke,style:{width:nt,...$e,...q},children:gt.subtitle}),rt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(T??0,n),width:st}})]}):null,Vt=tt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Ge?"titleMarginTop":void 0,className:o&&Ge?`${u}-control`:void 0,style:{height:Ge?W.scalingValue(B??0,n):0,width:st}}),Ge&&a.jsx("p",{className:xe,style:{width:nt,...Re,...Ce},children:gt.title}),De&&Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(B??0,n),width:st}})]}):null,kt=tt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&rt?"subtitleMarginTop":void 0,className:o&&rt?`${u}-control`:void 0,style:{height:rt?W.scalingValue(T??0,n):0,width:st}}),rt&&a.jsx("p",{className:ke,style:{width:nt,...$e,...q},children:gt.subtitle}),De&&rt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(T??0,n),width:st}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[Vt,kt]}):a.jsxs(a.Fragment,{children:[Vt,kt]}),Xt=wd(gt.gallery),qt=Xt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:Ve,style:Ie,children:Xt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:F}=Xt[0],Ee=F?qt.findIndex(Fe=>Fe.url===F.url):-1;return a.jsx(Cl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ee>=0?()=>Wt(qt,Ee):void 0})})():a.jsxs(a.Fragment,{children:[_e&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Xt.map(({displayMedia:Ct})=>$i(Ct)?a.jsx("video",{src:Ct.url,muted:!0,playsInline:!0},`sizer-${Ct.url}`):a.jsx("img",{src:Ct.url,alt:""},`sizer-${Ct.url}`))}),a.jsx(Ns,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:z*1e3,width:"100%",height:"100%",speed:tf,type:Y==="fade"?"fade":"loop",rewind:Y==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{N!=="random"||Y==="fade"||ef(Ct)},children:Xt.map(({displayMedia:Ct,lightboxMedia:F},Ee)=>{const Fe=F?qt.findIndex(Oe=>Oe.url===F.url):-1;return a.jsx(Ws,{children:a.jsx(Cl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Fe>=0?()=>Wt(qt,Fe):void 0})},Ee)})},`${Y}-${Ne}-${N}-${z}-${Bt}-${d}`)]})}),Dt=De?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Ge?"titleMarginTop":void 0,className:o&&Ge?`${u}-control`:void 0,style:{height:Ge?W.scalingValue(B??0,n):0,width:st}}),a.jsx("p",{className:xe,style:{width:nt,...Re,...Ce},children:gt.title}),a.jsx("div",{"data-controls":o&&rt?"subtitleMarginTop":void 0,className:o&&rt?`${u}-control`:void 0,style:{height:rt?W.scalingValue(T??0,n):0,width:st}}),a.jsx("p",{className:ke,style:{width:nt,...$e,...q},children:gt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!tt?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&yt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${ge} * (${w} / 100))`:ge,...Lt&&tt?{gridColumn:Lt}:{}},children:tt?a.jsx(a.Fragment,{children:De?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):ht?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[mt,Ht]}),!De&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},Ae)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:jt,"data-selection":"none",children:a.jsx(mf,{prefix:u,items:Ft,index:Kt,imageDisplay:gf(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Jt(Ae=>(Ae-1+Ft.length)%Ft.length),onNext:()=>Jt(Ae=>(Ae+1)%Ft.length),counterClassName:ye,counterStyle:ae})}),gt)})()]})}const ff={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},yf=["hover","focus","filled","success","error"],vf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5133
5133
|
import '@splidejs/react-splide/css/core';
|
|
5134
5134
|
import { CommonComponentProps } from '../props';
|
|
5135
5135
|
import {
|
|
@@ -7182,7 +7182,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7182
7182
|
};
|
|
7183
7183
|
|
|
7184
7184
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7185
|
-
`,Sa={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},xf=["titleColor","subtitleColor","lightboxCounterColor"],bf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Sa.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...Sa.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Sa.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...xf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},wf={element:hf,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:bf,sourceCode:vf},Sf=50,Tl=10,Hs="cntrl-lightbox-journal",ia=Hs,ns=`${Hs}-`,oa=e=>`${Hs}-${e}`,Ds=e=>e===ia||e.startsWith(ns),Il=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Rl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Il(t.get(oa(e)));if(i)return i}const n=Il(t.get(ia));if(n)return n;for(const[i]of t){if(!i.startsWith(ns))continue;const o=i.slice(ns.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Ll=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Sd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Ds(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(oa(t),String(e)):i.searchParams.set(ia,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Cf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===oa(e)||i===ia:Ds(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Cd=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(oa(e)):[...t.keys()].some(n=>Ds(n))},$f=(e,t)=>{if(Cd(t)){if(e){window.history.back();return}Cf(t)}},Tf=20,If=2,Ca=e=>`max(${e}, ${Tf}px)`,Ki=e=>((e==null?void 0:e.image)??[]).slice(0,If),$d=e=>e.reduce((t,n)=>t+Ki(n).length,0),Rf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Ki(r).length,1),i=Ki(e[t]).length;return{start:n,end:n+i-1}},Lf=(e,t)=>{const n=$d(e),{start:i,end:o}=Rf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ir=(e,t)=>t==="B"?e.flatMap((n,i)=>Ki(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Ki(n)})),Pf=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return Lf(i,o)},Pl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Ef=(e,t,n)=>e==="B"?t.length>1:$d(n)>1,fn=.004,Un=.004,Gi={title1Width:.13,title2Width:.13,title3Width:.14},Kn=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},Zi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},No=(e,t)=>Zi(e,t),cn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Zn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Zi(e.length,n),effective:No(e.length,n)}},Td=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Id=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ii=["title1","title2","title3","count"],ot=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Os={title1:"1",title2:"2",title3:"3",count:"Count"},Bs=e=>[ot(e,"fontFamily"),ot(e,"fontSettings"),{type:"row",items:[ot(e,"fontSize"),ot(e,"lineHeight"),ot(e,"letterSpacing"),ot(e,"wordSpacing")]},ot(e,"textAlign"),ot(e,"textAppearance")],Mf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ii.map(e=>[Os[e],Bs(e)]))}),kf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Af={title1:.02,title2:.02,title3:.02,count:.017},xi=(e,t)=>{const n=i=>{const o=ot(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[kf[t]]}},bi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Af[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function Rd({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:w=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:B="#cccccc"}=n,N=W.scalingValue(f,i),q=W.scalingValue(x,i),D=W.scalingValue(m,i),T=h==="mobile",H=bi("title1",xi(n,"title1"),i),$=bi("title2",xi(n,"title2"),i),I=bi("title3",xi(n,"title3"),i),P=s.useMemo(()=>({title1Width:d??Gi.title1Width,title2Width:c??Gi.title2Width,title3Width:u??Gi.title3Width}),[d,c,u]),E=s.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:w}),[v,w]),g=s.useMemo(()=>Kn(e,t,H,$,I),[e,t,H,$,I]),z=s.useMemo(()=>g.map(K=>P[K.widthKey]),[g,P]),F=s.useMemo(()=>Zi(g.length,z),[g.length,z]),X=s.useMemo(()=>No(g.length,z),[g.length,z]),ie=s.useMemo(()=>g.filter(K=>K.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(K=>K.prefix==="title2"||K.prefix==="title3"),[g]),_=s.useMemo(()=>Zn(ie,P),[ie,P]),V=s.useMemo(()=>Zn(L,P),[L,P]),ae=!!(t.title1||t.title2||t.title3),re=C!==null;if(!(ae||re))return null;const se=(p??0)>0||o,j=(K,ue)=>{const He=g.findIndex(Q=>Q.prefix===K.prefix);if(!T||ue==="single-row")return{effectiveWidth:X[He]??0,resolvedWidth:F[He]??0,maxWidth:cn(He,F)};if(ue==="two-row-top"){const Q=ie.findIndex(Je=>Je.prefix===K.prefix);return{effectiveWidth:_.effective[Q]??0,resolvedWidth:_.resolved[Q]??0,maxWidth:cn(Q,_.resolved)}}const fe=L.findIndex(Q=>Q.prefix===K.prefix);return{effectiveWidth:V.effective[fe]??0,resolvedWidth:V.resolved[fe]??0,maxWidth:cn(fe,V.resolved)}},b=(K,ue,He)=>{if(!T||He==="single-row"){const ct=K.findIndex(Ye=>Ye.prefix===ue.prefix),Ke=K.map(Ye=>P[Ye.widthKey]),ut=Zi(K.length,Ke);return{effectiveWidth:No(K.length,Ke)[ct]??0,resolvedWidth:ut[ct]??0,maxWidth:cn(ct,ut)}}if(He==="two-row-top"){const ct=K.filter(Ye=>Ye.prefix==="title1"),Ke=ct.findIndex(Ye=>Ye.prefix===ue.prefix),{resolved:ut,effective:lt}=Zn(ct,P);return{effectiveWidth:lt[Ke]??0,resolvedWidth:ut[Ke]??0,maxWidth:cn(Ke,ut)}}const fe=K.filter(ct=>ct.prefix==="title2"||ct.prefix==="title3"),Q=fe.findIndex(ct=>ct.prefix===ue.prefix),{resolved:Je,effective:Ne}=Zn(fe,P);return{effectiveWidth:Ne[Q]??0,resolvedWidth:Je[Q]??0,maxWidth:cn(Q,Je)}},k=K=>Id(g,F,E,K)+(T?0:p??0),G=()=>T?0:p??0,he=K=>L.slice(0,K).reduce((ue,He,fe)=>ue+(He.marginLeftKey?E[He.marginLeftKey]??0:0)+(V.resolved[fe]??0),0),J=K=>{const ue=L[K];return he(K)+(ue.marginLeftKey?E[ue.marginLeftKey]??0:0)+(V.resolved[K]??0)},ee=(K,ue,He)=>{const fe=K.marginLeftKey?E[K.marginLeftKey]??0:0,{effectiveWidth:Q,resolvedWidth:Je,maxWidth:Ne}=He??j(K,ue),ct=Math.max(fe,Un),Ke=o&&ue==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":K.prefix,style:{width:W.scalingValue(Q,i),...fe>0?{marginLeft:W.scalingValue(fe,i)}:{}},children:[a.jsx("p",{className:K.className,style:K.style,children:K.text}),Ke&&K.marginLeftKey?a.jsx("div",{"data-controls":K.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Je),style:{position:"absolute",top:0,left:W.scalingValue(-fe,i),width:W.scalingValue(ct,i),height:"100%",pointerEvents:"auto"}}):null,Ke?a.jsx("div",{"data-controls":K.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W.scalingValue(-fn/2,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},K.className)},O=(K="two-row")=>{const ue=g.findIndex(Q=>Q.prefix==="title1"),He=ue>=0?F[ue]:P.title1Width,fe=K==="two-row"&&o;return a.jsx("div",{...fe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He)}:{},style:{width:W.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...fe?{pointerEvents:"auto"}:{}}})},Z=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:H,"aria-hidden":"true",children:" "}),te=K=>{const ue=Kn(e,K,H,$,I);return a.jsx(a.Fragment,{children:ue.map(He=>ee(He,"single-row",b(ue,He,"single-row")))})},Le=K=>{const ue=Kn(e,K,H,$,I),He=ue.find(fe=>fe.prefix==="title1");return He?ee(He,"two-row-top",b(ue,He,"two-row-top")):null},ve=(K,ue=!1)=>{const He=Kn(e,K,H,$,I),fe=He.filter(Ne=>Ne.prefix==="title2"||Ne.prefix==="title3"),Q=o&&ue;return fe.length>0||Q||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[fe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:fe.map(Ne=>ee(Ne,"two-row-bottom",b(He,Ne,"two-row-bottom")))}),ue&&o?a.jsxs(a.Fragment,{children:[Ce(),Fe()]}):null]}):null,(m??0)>0||Q?a.jsx("div",{"data-controls":Q?"titleRowMarginBottom":void 0,"data-controls-axis":Q?"y":void 0,"data-controls-reverse":Q?"":void 0,className:Q?`${e}-control`:void 0,style:{height:D,width:"100%",flexShrink:0,pointerEvents:Q?"auto":"none"}}):null]}):null},Ie=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(y??0,i),height:W.scalingValue(y??0,i),marginRight:q,"--close-icon-hover-color":B},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:K=>{K.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:S,hoverFill:i&&!r?S:B,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:q,height:"100%",pointerEvents:"auto"}})]}),pe=()=>re?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Ie()}):null,oe=K=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:K})}),ye=K=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[re||ae?Z():null,se?O("two-row"):null,oe(K),pe()]}),U=(K,ue=!1)=>a.jsxs(a.Fragment,{children:[ye(Le(K)),ve(K,ue)]}),ce=()=>{const K=T?-1:g.findIndex(fe=>fe.prefix==="title1"),ue=!T&&(o||(p??0)>0)?(()=>{const fe=p??0,Q=K>=0?F[K]:P.title1Width,Je=Math.max(fe,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Q),style:{position:"absolute",top:0,left:0,width:W.scalingValue(Je,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,He=g.flatMap((fe,Q)=>{if(!fe.marginLeftKey)return[];const Je=E[fe.marginLeftKey]??0,Ne=Td(g,F,E,Q)+G(),ct=Math.max(Je,Un);return a.jsx("div",{"data-controls":fe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(F[Q]),style:{position:"absolute",top:0,left:W.scalingValue(Ne,i),width:W.scalingValue(ct,i),height:"100%",pointerEvents:"auto"}},fe.marginLeftKey)});return ue?[ue,...He]:He},le=()=>g.map((K,ue)=>{const He=cn(ue,F),Q=k(ue)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":K.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W.scalingValue(Q,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${K.widthKey}-junction`)}),Ce=()=>L.flatMap((K,ue)=>{if(!K.marginLeftKey)return[];const He=E[K.marginLeftKey]??0,fe=he(ue),Q=Math.max(He,Un),{resolvedWidth:Je}=j(K,"two-row-bottom");return a.jsx("div",{"data-controls":K.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Je),style:{position:"absolute",top:0,left:W.scalingValue(fe,i),width:W.scalingValue(Q,i),height:"100%",pointerEvents:"auto"}},K.marginLeftKey)}),Fe=()=>L.map((K,ue)=>{const{maxWidth:He}=j(K,"two-row-bottom"),Q=J(ue)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":K.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W.scalingValue(Q,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${K.widthKey}-junction`)}),Ee=()=>!o||T?null:a.jsxs(a.Fragment,{children:[ce(),le()]}),Y=!!(t.title2||t.title3||(m??0)>0||o),be=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[re||ae?Z():null,se?O("single-row"):null,ae?oe(te(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),pe(),Ee()]}),de=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Y?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Y?void 0:{flex:"0 0 auto",height:"auto"},children:U(t,!0)}),Ee()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:N,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...T?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${T?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${T?` ${e}-text-bar-cell-stacked`:""}`,style:T?void 0:{flex:1,minWidth:0,width:"100%"},children:T?de():be()})})})]})}function Ff(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _f(e){return`
|
|
7185
|
+
`,Sa={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},xf=["titleColor","subtitleColor","lightboxCounterColor"],bf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Sa.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...Sa.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Sa.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...xf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},wf={element:hf,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:bf,sourceCode:vf},Sf=50,Tl=10,Hs="cntrl-lightbox-journal",ia=Hs,ns=`${Hs}-`,oa=e=>`${Hs}-${e}`,Ds=e=>e===ia||e.startsWith(ns),Il=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Rl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Il(t.get(oa(e)));if(i)return i}const n=Il(t.get(ia));if(n)return n;for(const[i]of t){if(!i.startsWith(ns))continue;const o=i.slice(ns.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Ll=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Sd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Ds(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(oa(t),String(e)):i.searchParams.set(ia,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Cf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===oa(e)||i===ia:Ds(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Cd=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(oa(e)):[...t.keys()].some(n=>Ds(n))},$f=(e,t)=>{if(Cd(t)){if(e){window.history.back();return}Cf(t)}},Tf=20,If=2,Ca=e=>`max(${e}, ${Tf}px)`,Ki=e=>((e==null?void 0:e.image)??[]).slice(0,If),$d=e=>e.reduce((t,n)=>t+Ki(n).length,0),Rf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Ki(r).length,1),i=Ki(e[t]).length;return{start:n,end:n+i-1}},Lf=(e,t)=>{const n=$d(e),{start:i,end:o}=Rf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ir=(e,t)=>t==="B"?e.flatMap((n,i)=>Ki(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Ki(n)})),Pf=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return Lf(i,o)},Pl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Ef=(e,t,n)=>e==="B"?t.length>1:$d(n)>1,fn=.004,Un=.004,Gi={title1Width:.13,title2Width:.13,title3Width:.14},Kn=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},Zi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},No=(e,t)=>Zi(e,t),cn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Zn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Zi(e.length,n),effective:No(e.length,n)}},Td=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Id=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ii=["title1","title2","title3","count"],ot=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Os={title1:"1",title2:"2",title3:"3",count:"Count"},Bs=e=>[ot(e,"fontFamily"),ot(e,"fontSettings"),{type:"row",items:[ot(e,"fontSize"),ot(e,"lineHeight"),ot(e,"letterSpacing"),ot(e,"wordSpacing")]},ot(e,"textAlign"),ot(e,"textAppearance")],Mf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ii.map(e=>[Os[e],Bs(e)]))}),kf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Af={title1:.02,title2:.02,title3:.02,count:.017},xi=(e,t)=>{const n=i=>{const o=ot(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[kf[t]]}},bi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Af[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function Rd({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:w=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:z="#cccccc"}=n,N=W.scalingValue(f,i),Y=W.scalingValue(x,i),B=W.scalingValue(m,i),T=h==="mobile",H=bi("title1",xi(n,"title1"),i),$=bi("title2",xi(n,"title2"),i),I=bi("title3",xi(n,"title3"),i),P=s.useMemo(()=>({title1Width:d??Gi.title1Width,title2Width:c??Gi.title2Width,title3Width:u??Gi.title3Width}),[d,c,u]),M=s.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:w}),[v,w]),g=s.useMemo(()=>Kn(e,t,H,$,I),[e,t,H,$,I]),D=s.useMemo(()=>g.map(U=>P[U.widthKey]),[g,P]),A=s.useMemo(()=>Zi(g.length,D),[g.length,D]),X=s.useMemo(()=>No(g.length,D),[g.length,D]),ie=s.useMemo(()=>g.filter(U=>U.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(U=>U.prefix==="title2"||U.prefix==="title3"),[g]),_=s.useMemo(()=>Zn(ie,P),[ie,P]),V=s.useMemo(()=>Zn(L,P),[L,P]),se=!!(t.title1||t.title2||t.title3),re=C!==null;if(!(se||re))return null;const le=(p??0)>0||o,G=(U,de)=>{const He=g.findIndex(ee=>ee.prefix===U.prefix);if(!T||de==="single-row")return{effectiveWidth:X[He]??0,resolvedWidth:A[He]??0,maxWidth:cn(He,A)};if(de==="two-row-top"){const ee=ie.findIndex(Je=>Je.prefix===U.prefix);return{effectiveWidth:_.effective[ee]??0,resolvedWidth:_.resolved[ee]??0,maxWidth:cn(ee,_.resolved)}}const he=L.findIndex(ee=>ee.prefix===U.prefix);return{effectiveWidth:V.effective[he]??0,resolvedWidth:V.resolved[he]??0,maxWidth:cn(he,V.resolved)}},b=(U,de,He)=>{if(!T||He==="single-row"){const ct=U.findIndex(Ye=>Ye.prefix===de.prefix),Ke=U.map(Ye=>P[Ye.widthKey]),ut=Zi(U.length,Ke);return{effectiveWidth:No(U.length,Ke)[ct]??0,resolvedWidth:ut[ct]??0,maxWidth:cn(ct,ut)}}if(He==="two-row-top"){const ct=U.filter(Ye=>Ye.prefix==="title1"),Ke=ct.findIndex(Ye=>Ye.prefix===de.prefix),{resolved:ut,effective:lt}=Zn(ct,P);return{effectiveWidth:lt[Ke]??0,resolvedWidth:ut[Ke]??0,maxWidth:cn(Ke,ut)}}const he=U.filter(ct=>ct.prefix==="title2"||ct.prefix==="title3"),ee=he.findIndex(ct=>ct.prefix===de.prefix),{resolved:Je,effective:Ne}=Zn(he,P);return{effectiveWidth:Ne[ee]??0,resolvedWidth:Je[ee]??0,maxWidth:cn(ee,Je)}},E=U=>Id(g,A,M,U)+(T?0:p??0),j=()=>T?0:p??0,me=U=>L.slice(0,U).reduce((de,He,he)=>de+(He.marginLeftKey?M[He.marginLeftKey]??0:0)+(V.resolved[he]??0),0),K=U=>{const de=L[U];return me(U)+(de.marginLeftKey?M[de.marginLeftKey]??0:0)+(V.resolved[U]??0)},te=(U,de,He)=>{const he=U.marginLeftKey?M[U.marginLeftKey]??0:0,{effectiveWidth:ee,resolvedWidth:Je,maxWidth:Ne}=He??G(U,de),ct=Math.max(he,Un),Ke=o&&de==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":U.prefix,style:{width:W.scalingValue(ee,i),...he>0?{marginLeft:W.scalingValue(he,i)}:{}},children:[a.jsx("p",{className:U.className,style:U.style,children:U.text}),Ke&&U.marginLeftKey?a.jsx("div",{"data-controls":U.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Je),style:{position:"absolute",top:0,left:W.scalingValue(-he,i),width:W.scalingValue(ct,i),height:"100%",pointerEvents:"auto"}}):null,Ke?a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W.scalingValue(-fn/2,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},U.className)},O=(U="two-row")=>{const de=g.findIndex(ee=>ee.prefix==="title1"),He=de>=0?A[de]:P.title1Width,he=U==="two-row"&&o;return a.jsx("div",{...he?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He)}:{},style:{width:W.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...he?{pointerEvents:"auto"}:{}}})},J=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:H,"aria-hidden":"true",children:" "}),ne=U=>{const de=Kn(e,U,H,$,I);return a.jsx(a.Fragment,{children:de.map(He=>te(He,"single-row",b(de,He,"single-row")))})},Pe=U=>{const de=Kn(e,U,H,$,I),He=de.find(he=>he.prefix==="title1");return He?te(He,"two-row-top",b(de,He,"two-row-top")):null},be=(U,de=!1)=>{const He=Kn(e,U,H,$,I),he=He.filter(Ne=>Ne.prefix==="title2"||Ne.prefix==="title3"),ee=o&&de;return he.length>0||ee||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[he.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:he.map(Ne=>te(Ne,"two-row-bottom",b(He,Ne,"two-row-bottom")))}),de&&o?a.jsxs(a.Fragment,{children:[xe(),ke()]}):null]}):null,(m??0)>0||ee?a.jsx("div",{"data-controls":ee?"titleRowMarginBottom":void 0,"data-controls-axis":ee?"y":void 0,"data-controls-reverse":ee?"":void 0,className:ee?`${e}-control`:void 0,style:{height:B,width:"100%",flexShrink:0,pointerEvents:ee?"auto":"none"}}):null]}):null},Re=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(y??0,i),height:W.scalingValue(y??0,i),marginRight:Y,"--close-icon-hover-color":z},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:U=>{U.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:S,hoverFill:i&&!r?S:z,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Y,height:"100%",pointerEvents:"auto"}})]}),ue=()=>re?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Re()}):null,fe=U=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:U})}),$e=U=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[re||se?J():null,le?O("two-row"):null,fe(U),ue()]}),Q=(U,de=!1)=>a.jsxs(a.Fragment,{children:[$e(Pe(U)),be(U,de)]}),Z=()=>{const U=T?-1:g.findIndex(he=>he.prefix==="title1"),de=!T&&(o||(p??0)>0)?(()=>{const he=p??0,ee=U>=0?A[U]:P.title1Width,Je=Math.max(he,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ee),style:{position:"absolute",top:0,left:0,width:W.scalingValue(Je,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,He=g.flatMap((he,ee)=>{if(!he.marginLeftKey)return[];const Je=M[he.marginLeftKey]??0,Ne=Td(g,A,M,ee)+j(),ct=Math.max(Je,Un);return a.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(A[ee]),style:{position:"absolute",top:0,left:W.scalingValue(Ne,i),width:W.scalingValue(ct,i),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return de?[de,...He]:He},ae=()=>g.map((U,de)=>{const He=cn(de,A),ee=E(de)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W.scalingValue(ee,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${U.widthKey}-junction`)}),xe=()=>L.flatMap((U,de)=>{if(!U.marginLeftKey)return[];const He=M[U.marginLeftKey]??0,he=me(de),ee=Math.max(He,Un),{resolvedWidth:Je}=G(U,"two-row-bottom");return a.jsx("div",{"data-controls":U.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Je),style:{position:"absolute",top:0,left:W.scalingValue(he,i),width:W.scalingValue(ee,i),height:"100%",pointerEvents:"auto"}},U.marginLeftKey)}),ke=()=>L.map((U,de)=>{const{maxWidth:He}=G(U,"two-row-bottom"),ee=K(de)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W.scalingValue(ee,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${U.widthKey}-junction`)}),Ce=()=>!o||T?null:a.jsxs(a.Fragment,{children:[Z(),ae()]}),q=!!(t.title2||t.title3||(m??0)>0||o),ye=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[re||se?J():null,le?O("single-row"):null,se?fe(ne(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ue(),Ce()]}),ce=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...q?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:q?void 0:{flex:"0 0 auto",height:"auto"},children:Q(t,!0)}),Ce()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:N,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...T?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${T?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${T?` ${e}-text-bar-cell-stacked`:""}`,style:T?void 0:{flex:1,minWidth:0,width:"100%"},children:T?ce():ye()})})})]})}function Ff(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _f(e){return`
|
|
7186
7186
|
.${e}-wrapper {
|
|
7187
7187
|
display: grid;
|
|
7188
7188
|
align-items: start;
|
|
@@ -7502,7 +7502,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7502
7502
|
pointer-events: auto;
|
|
7503
7503
|
flex-shrink: 0;
|
|
7504
7504
|
}
|
|
7505
|
-
`}const El={url:"",name:"",objectFit:"cover"},Tn=500,go=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Nf=72,Wf=50,Hf=1e4,Df=650,Of=500;function Bf(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Ld(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Nr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function zf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Ld(i,n):null}function jf(e){return e.reduce((t,n,i)=>{const o=zs(n.gallery),l=js(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function So(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function Ml(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return So(e,i,n)}const Vf=.03;function Pd(e){return e.width*Vf}const $a={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function dr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function kl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Gf(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function is(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Xf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:is(e,t.width,t.height)}function qf(e,t){if(uo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Yf(e){const t=new Set,n=[];for(const i of e){const o=zs(i.gallery),r=js(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function Uf({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>uo(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Ji(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Pd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Wr(e,t,n){const i=Ji(e,t,n);return{...i,left:2*i.left-e.left}}function Kf(e,t,n){const{left:i,width:o}=n,r=Pd(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Ed(e,t,n,i){const o=Ji(e,"left",i),r=Ji(e,"right",i),l=Wr(e,"left",i),d=Wr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Zf(e,t,n,i){const{start:o,end:r}=Ed(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Jf(e,t,n){const i=Ji(e,t,n),o=Wr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Md(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function zs(e){if(!e)return;if(Md(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??El,i??o??El]}]}function Qf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ey(e){const[t]=e.media;return t!=null&&t.url?t:null}function js(e){if(!Array.isArray(e)||e.length===0)return[];if(Md(e)){const t=[];for(const n of e){const i=Qf(n);if(!i)continue;const o=ey(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function uo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function ty({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return uo(e)?a.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function ny({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function ur({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return uo(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function iy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:x}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),B=s.useRef(new Map),[N,q]=s.useState(0),D=s.useRef(null),T=s.useRef(0),H=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),P=s.useRef(!1),E=s.useRef(!1),g=s.useRef(null),z=s.useRef(null),F=s.useRef(null),X=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),_=s.useRef(null),V=s.useRef(!1),[ae,re]=s.useState(null),[M,se]=s.useState($a),[j,b]=s.useState(0),[k,G]=s.useState("opening"),[he,J]=s.useState(0),[ee,O]=s.useState(0),[Z,te]=s.useState(!1),[Le,ve]=s.useState(null),[Ie,pe]=s.useState(null),[oe,ye]=s.useState(null),[U,ce]=s.useState(!1),[le,Ce]=s.useState(null),[Fe,Ee]=s.useState(!1),Y=s.useRef(!1),[be,de]=s.useState(!1),[K,ue]=s.useState(!1),He=s.useRef(n),fe=s.useRef(void 0),Q=t[n],Je=Q?uo(Q):!1,Ne=ee!==0||Z,ct=!l&&(!r||!!d),Ke=c&&!l,ut=u.length>1,lt=s.useCallback((A,Pe)=>t.length<=1?null:t[(A+Pe+t.length)%t.length]??null,[t]),Ye=ut?So(u,p,-1):lt(n,-1),Re=ut?So(u,p,1):lt(n,1),We=Le===-1&&Ne?ut&&Ie!==null?So(u,Ie,-1):oe!==null?lt(oe,-1):null:null,Be=Le===1&&Ne?ut&&Ie!==null?So(u,Ie,1):oe!==null?lt(oe,1):null:null,Ue=We&&We.url!==(Ye==null?void 0:Ye.url)?We:null,ge=Be&&Be.url!==(Re==null?void 0:Re.url)?Be:null,xe=Ye&&Ke?(()=>{const A=ut?Ml(u,p,-1):t.length>2?lt((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ye.url?A:null})():null,_e=Re&&Ke?(()=>{const A=ut?Ml(u,p,1):t.length>2?lt((n+1)%t.length,1):null;return A&&A.url!==Re.url?A:null})():null,Ze=Ue??xe,we=ge??_e,$e=s.useCallback((A,Pe,Ae)=>{if(!A||!Pe||!Ae)return;const Oe=B.current,at=Oe.get(A);(at==null?void 0:at.width)===Pe&&(at==null?void 0:at.height)===Ae||(Oe.set(A,{width:Pe,height:Ae}),q(Et=>Et+1))},[]),Xe=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Pe=B.current.get(A.url);return Xf(y.current,Pe)},[N,j]),ze=s.useCallback(()=>{if(!Q)return;const A=Xe(Q);if(A){re(A);return}const Pe=y.current;Pe&&re(kl(Pe))},[Q,Xe]),Te=s.useCallback(A=>{if(ut){const Pe=u.length;pe((p+A+Pe)%Pe),ye(null);return}t.length>1&&(ye((n+A+t.length)%t.length),pe(null))},[ut,u.length,p,t.length,n]),Ve=s.useCallback(A=>{E.current=A,te(A)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),tt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ve(!1)},go+32)},[De,Ve]),nt=s.useCallback(()=>{const A=C.current;if(!A){se({left:0,top:0,width:typeof window<"u"?window.innerWidth:$a.width,height:typeof window<"u"?window.innerHeight:$a.height});return}const Pe=A.getBoundingClientRect();se({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),st=s.useCallback((A,Pe)=>{if(Ne){if(be&&!Z)return`translate(${ee}px, 0px)`;if(Z&&Le!==null){const Ae=Xe(A);if(!Ae)return;const{x:Oe,y:at}=Zf(Ae,Pe,Le,M);return`translate(${Oe}px, ${at}px)`}if(Z)return"translate(0px, 0px)"}},[Ne,be,Z,ee,Le,M,Xe]),St=s.useCallback(()=>{const A=z.current;z.current=null,De(),Ve(!1),ve(null),pe(null),ye(null),O(0),de(!1),I.current=!1,H.current=0,$.current="none",A===-1?f():A===1&&x()},[De,Ve,f,x]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{z.current!==null&&St()},go+32)},[De,St]),zt=s.useCallback(()=>{De(),z.current=null,Ve(!1),ve(null),pe(null),ye(null),O(0),de(!1),I.current=!1,H.current=0,$.current="none"},[De,Ve]),ft=s.useCallback(A=>{if(!(!Ke||!ae)){if(E.current){if(z.current===A){F.current=A,St();return}zt()}De(),Te(A),z.current=A,ve(A),Ve(!0),Bt()}},[Ke,ae,St,zt,De,Te,Ve,Bt]);X.current=ft;const wt=s.useCallback(()=>{ie.current=null,V.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),jt=s.useCallback(A=>{L.current!==null&&window.clearInterval(L.current);const Pe=V.current?Of:Df;L.current=window.setInterval(()=>{X.current(A)},Pe)},[]),At=s.useCallback(A=>{ie.current!==A&&(wt(),ie.current=A,V.current=!1,X.current(A),jt(A),_.current=window.setTimeout(()=>{_.current=null,ie.current===A&&(V.current=!0,jt(A))},Hf))},[wt,jt]),xt=s.useCallback(()=>{const A=y.current;if(!A)return;const Pe=Q==null?void 0:Q.url,Ae=Pe?B.current.get(Pe):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){re(is(A,Ae.width,Ae.height));return}const Oe=S.current;if(Oe&&Pe&&(Oe.src===Pe||Oe.currentSrc===Pe)){const{width:Et,height:it}=Gf(Oe);if(Et&&it){$e(Pe,Et,it),re(is(A,Et,it));return}}const at=kl(A);!at.width||!at.height||re(at)},[Q==null?void 0:Q.url,$e]),Ft=s.useCallback(A=>{if(S.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{nt(),xt(),b(A=>A+1)},[nt,xt]);s.useEffect(()=>{Nt();const A=y.current,Pe=C.current,Ae=new ResizeObserver(()=>Nt());return A&&Ae.observe(A),Pe&&Ae.observe(Pe),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,v]),s.useLayoutEffect(()=>{if(!Q)return;const A=S.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[Q==null?void 0:Q.url,n,xt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const A=new Set,Pe=[],Ae=Oe=>{!(Oe!=null&&Oe.url)||A.has(Oe.url)||(A.add(Oe.url),Pe.push(Oe))};t.forEach(Ae),u.forEach(Oe=>Oe.items.forEach(Ae)),Pe.forEach(Oe=>{B.current.has(Oe.url)||qf(Oe,$e)})},[t,u,$e]),s.useEffect(()=>{if(k!=="opening"||!ae)return;if(!w){G("open");return}ce(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),G("open")})});return()=>cancelAnimationFrame(A)},[k,ae,w]),s.useEffect(()=>{if(k!=="closing")return;const A=setTimeout(()=>h(),Tn);return()=>clearTimeout(A)},[k,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{He.current===n&&fe.current===(Q==null?void 0:Q.url)||(De(),z.current=null,ve(null),pe(null),ye(null),J(0),O(0),Ve(!1),ue(!1),de(!1),T.current=0,H.current=0,$.current="none",I.current=!1,D.current=null,P.current=!1,S.current=null,ze(),He.current=n,fe.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,Ve,De,ze]),s.useLayoutEffect(()=>{const A=F.current;A!==null&&(F.current=null,requestAnimationFrame(()=>{X.current(A)}))},[n,p,Q==null?void 0:Q.url]),s.useLayoutEffect(()=>{if(k==="opening"){Y.current=!1,Ee(!1);return}if(k!=="open"||Y.current)return;if(!Ye&&!Re){Y.current=!0;return}Ee(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ee(!0),Y.current=!0})});return()=>cancelAnimationFrame(A)},[k,Ye==null?void 0:Ye.url,Re==null?void 0:Re.url]),s.useEffect(()=>{if(k!=="open")return;const A=()=>{const it=vt=>{vt.stopPropagation(),vt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Pe=it=>{const vt=it<0?1:-1;De(),Te(vt),z.current=vt,ve(vt),Ve(!0),Bt()},Ae=it=>{if(Math.abs(it)>Wf&&Ke){Pe(it);return}z.current=null,ve(null),pe(null),ye(null),Ve(!0),O(0),tt()},Oe=it=>{if(it.touches.length!==1||E.current)return;const vt=it.touches[0];P.current=!0,D.current={x:vt.clientX,y:vt.clientY},$.current="none",H.current=0,I.current=!1},at=it=>{if(!D.current||it.touches.length!==1||E.current)return;const vt=it.touches[0],Ot=vt.clientX-D.current.x,It=vt.clientY-D.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ke)return;$.current="horizontal"}else if(It>0){if(!ct)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,de(!0),H.current=Ot,O(Ot),it.preventDefault();return}$.current==="vertical"&&(I.current=!0,de(!0),T.current=It,J(It),it.preventDefault())},Et=()=>{if(!D.current)return;const it=$.current,vt=I.current;if(vt&&it==="horizontal")Ae(H.current),A();else if(vt&&it==="vertical"){const Ot=T.current;if(ct&&Ot>Nf){const It=window.innerHeight;T.current=It,ue(!0),J(It),G("closing")}else T.current=0,J(0);A()}else it==="horizontal"&&Math.abs(H.current)>0&&(Ae(H.current),A());D.current=null,$.current="none",H.current=0,I.current=!1,de(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[k,Ke,Ve,tt,De,ct,Bt,Te]);const Kt=s.useCallback(()=>{const A=(m==null?void 0:m())??w??null;A&&ae&&(Ce(A),ce(!0)),G("closing")},[m,w,ae]);s.useEffect(()=>{const A=Oe=>{if(Oe.key==="Escape"){if(r&&d||k==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||k!=="open"||!Ke)return;Oe.preventDefault();const at=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&ie.current===at||At(at)},Pe=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const at=Oe.key==="ArrowLeft"?-1:1;ie.current===at&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Pe),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Pe),window.removeEventListener("blur",Ae),wt()}},[k,r,d,Kt,Ke,At,wt]),s.useEffect(()=>{k!=="open"&&wt()},[k,wt]);const Jt=()=>{k==="closing"||l||Kt()},Tt=k==="open",Wt=k==="closing",rn=he>0?Math.max(0,1-he/500):1,gt=he>0?Math.max(.35,1-he/500):1,ke=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!E.current)){if(z.current!==null){St();return}De(),Ve(!1)}},[De,Ve,St]),Ge=k==="closing"?le??w:w,rt=Ge&&ae&&(k==="opening"||Wt)?Bf(Ge,ae):void 0,ht=Ne&&Q?st(Q,"center"):he>0?`translateY(${he}px)`:rt,yt=ae?dr(ae,M):null,Lt=!!(Ge&&ae),mt=Lt&&(k==="closing"||k==="open"&&U),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:he>0?gt:Lt?1:k==="opening"||Wt?0:1,transition:be&&!Z?"none":Z?`transform ${go}ms ${pn}`:K?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:k==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Je&&Tt&&!Ne?"auto":"none",touchAction:Je&&Tt?"none":void 0,zIndex:1,overflow:Je?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Ne?"auto":"none"},Mt=(A,Pe,Ae="adjacent")=>{const Oe=Xe(A);if(!Oe)return{display:"none"};const at=Ae==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:Et}=Le!==null?Ed(Oe,at,Le,M):{start:Ae==="far"?Wr(Oe,Pe,M):Ji(Oe,Pe,M)},it=dr(Et,M),vt=st(A,at),Ot=!Ne&&Ae==="adjacent"&&Tt&&!Fe?Jf(Oe,Pe,M):null,It=Ae==="far"&&Ne&&Le===(Pe==="left"?-1:1),nn=be&&!Z?!1:Z,un=Ae==="adjacent"&&Tt&&Fe&&!Ne;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:vt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ae==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ae==="far"?`transform ${go}ms ${pn}`:`transform ${go}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:k==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(A,Pe)=>{const Ae=Xe(A);return Ae?Kf(Ji(Ae,Pe,M),Pe,M):null},qt=A=>Pe=>{if(!l){if(P.current){P.current=!1;return}Pe.stopPropagation(),ft(A)}},Ht=Ye?Xt(Ye,"left"):null,Dt=Re?Xt(Re,"right"):null,_t=Ht?dr(Ht,M):null,Ct=Dt?dr(Dt,M):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:k==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:be?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:be?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(Rd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Ze&&a.jsx(ur,{media:Ze,style:Mt(Ze,"left","far"),onMeasure:$e,onTransitionEnd:ke},`far-prev-${Ze.url}`),Tt&&Ye&&a.jsxs(a.Fragment,{children:[a.jsx(ur,{media:Ye,style:Mt(Ye,"left"),onMeasure:$e,onTransitionEnd:ke},`prev-${Ye.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||be?"default":"pointer",pointerEvents:l||be?"none":"auto",zIndex:3},onClick:qt(-1)})]}),Tt&&Re&&a.jsxs(a.Fragment,{children:[a.jsx(ur,{media:Re,style:Mt(Re,"right"),onMeasure:$e,onTransitionEnd:ke},`next-${Re.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||be?"default":"pointer",pointerEvents:l||be?"none":"auto",zIndex:3},onClick:qt(1)})]}),Tt&&we&&a.jsx(ur,{media:we,style:Mt(we,"right","far"),onMeasure:$e,onTransitionEnd:ke},`far-next-${we.url}`),ae&&Q&&(Je?a.jsx(ny,{src:Q.url,phase:k,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:ke},`${n}-${Q.url}`):a.jsx("img",{ref:Ft,src:Q.url,alt:Q.name,onLoad:xt,onTransitionEnd:ke,style:Vt},`${n}-${Q.url}`))]})}function oy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,w=(v==null?void 0:v.display)==="cover",m=(v==null?void 0:v.ratioValue)??"1:1",h=(v==null?void 0:v.reversed)??!1,[f,x]=m.split(":").map(Number),S=`${h?x:f} / ${h?f:x}`,B=c.entryWidth??.2,N=c.columnsCount,q=W.scalingValue(B,n),D=W.scalingValue(c.horizontalGap??0,n),T=q,H=q,$={width:T,...w?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},I=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},P=s.useRef(null),[E,g]=s.useState(!1),[z,F]=s.useState([]),[X,ie]=s.useState(0),[L,_]=s.useState(0),[V,ae]=s.useState(null),[re,M]=s.useState({title1:"",title2:"",title3:""}),se=(()=>{const oe={},ye=P.current?getComputedStyle(P.current).getPropertyValue("--cntrl-article-width").trim():"";return ye&&(oe["--cntrl-article-width"]=ye),oe})(),j=!n||i||o,b=s.useMemo(()=>_f(d),[d]),k=t??[],G=k.length%N||N,he=G<N&&k.length>0,J=k.length-G,ee=he?Math.floor((N-G)/2)+1:1,O=s.useMemo(()=>jf(k),[k]),Z=s.useMemo(()=>Yf(k),[k]),te=(oe,ye,U)=>{if(n&&!o&&!i)return;const ce=O.findIndex(Ce=>Ce.gridIndex===oe);if(ce<0)return;const le=O[ce];_(ce),F(le.items),ie(ye),M(le.entry),ae(U??null),g(!0)},Le=s.useCallback(()=>{g(!1),ae(null)},[]),ve=s.useCallback(()=>{const oe=O[L];return!oe||!P.current?V:zf(P.current,oe.gridIndex,w?"cover":"contain")??V},[O,L,V,w]),Ie=s.useCallback(oe=>{if(O.length>1){const ye=O.length,U=(L+oe+ye)%ye,ce=O[U],le=Math.min(X,ce.items.length-1);_(U),F(ce.items),ie(le),M(ce.entry);return}ie(ye=>(ye+oe+z.length)%z.length)},[O,L,X,z.length]),pe=O.length>1||z.length>1;return s.useEffect(()=>{if(!E||typeof document>"u")return;const oe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=oe}},[E]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:b}}),a.jsx(Uf,{mediaList:Z}),a.jsx("div",{ref:P,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${q})`,rowGap:0,columnGap:D,width:W.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:W.scalingValue(u??0,n)},children:k.map((oe,ye)=>{const U=zs(oe.gallery),ce=js(U),le=ce.filter(de=>de.lightboxMedia).map(de=>de.lightboxMedia),Ce=Math.floor(ye/N)===Math.ceil(k.length/N)-1,Fe=he&&ye>=J?`${ee+(ye-J)}`:void 0,Ee=ce[0],Y=Ee!=null&&Ee.lightboxMedia?le.findIndex(de=>de.url===Ee.lightboxMedia.url):-1,be=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:ce.length>0&&a.jsx(ty,{media:Ee.displayMedia,gridIndex:ye,className:`${d}-item-${uo(Ee.displayMedia)?"video":"image"}`.trim(),style:I,onMediaClick:j&&Y>=0?de=>te(ye,Y,Ld(de.currentTarget,w?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,Ce?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:q,...Fe?{gridColumn:Fe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:H}})}),a.jsx("a",{className:`${d}-item-image-link`,children:be}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:H}})})]})},ye)})}),E&&typeof document<"u"&&(()=>{const oe=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:se,"data-selection":"none",children:a.jsx(iy,{prefix:d,items:z,index:X,entry:re,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:pe,lightboxEntries:O,entryIdx:L,layoutId:r,sourceRect:V,resolveCloseSourceRect:ve,onClose:Le,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),oe)})()]})}const ry=`import { CommonComponentProps } from '../props';
|
|
7505
|
+
`}const El={url:"",name:"",objectFit:"cover"},Tn=500,go=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Nf=72,Wf=50,Hf=1e4,Df=650,Of=500;function Bf(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Ld(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Nr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function zf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Ld(i,n):null}function jf(e){return e.reduce((t,n,i)=>{const o=zs(n.gallery),l=js(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function So(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function Ml(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return So(e,i,n)}const Vf=.03;function Pd(e){return e.width*Vf}const $a={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function dr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function kl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Gf(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function is(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Xf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:is(e,t.width,t.height)}function qf(e,t){if(uo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Yf(e){const t=new Set,n=[];for(const i of e){const o=zs(i.gallery),r=js(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function Uf({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>uo(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Ji(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Pd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Wr(e,t,n){const i=Ji(e,t,n);return{...i,left:2*i.left-e.left}}function Kf(e,t,n){const{left:i,width:o}=n,r=Pd(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Ed(e,t,n,i){const o=Ji(e,"left",i),r=Ji(e,"right",i),l=Wr(e,"left",i),d=Wr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Zf(e,t,n,i){const{start:o,end:r}=Ed(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Jf(e,t,n){const i=Ji(e,t,n),o=Wr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Md(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function zs(e){if(!e)return;if(Md(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??El,i??o??El]}]}function Qf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ey(e){const[t]=e.media;return t!=null&&t.url?t:null}function js(e){if(!Array.isArray(e)||e.length===0)return[];if(Md(e)){const t=[];for(const n of e){const i=Qf(n);if(!i)continue;const o=ey(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function uo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function ty({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return uo(e)?a.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function ny({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function ur({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return uo(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function iy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:x}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),z=s.useRef(new Map),[N,Y]=s.useState(0),B=s.useRef(null),T=s.useRef(0),H=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),P=s.useRef(!1),M=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),A=s.useRef(null),X=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),_=s.useRef(null),V=s.useRef(!1),[se,re]=s.useState(null),[k,le]=s.useState($a),[G,b]=s.useState(0),[E,j]=s.useState("opening"),[me,K]=s.useState(0),[te,O]=s.useState(0),[J,ne]=s.useState(!1),[Pe,be]=s.useState(null),[Re,ue]=s.useState(null),[fe,$e]=s.useState(null),[Q,Z]=s.useState(!1),[ae,xe]=s.useState(null),[ke,Ce]=s.useState(!1),q=s.useRef(!1),[ye,ce]=s.useState(!1),[U,de]=s.useState(!1),He=s.useRef(n),he=s.useRef(void 0),ee=t[n],Je=ee?uo(ee):!1,Ne=te!==0||J,ct=!l&&(!r||!!d),Ke=c&&!l,ut=u.length>1,lt=s.useCallback((F,Ee)=>t.length<=1?null:t[(F+Ee+t.length)%t.length]??null,[t]),Ye=ut?So(u,p,-1):lt(n,-1),Le=ut?So(u,p,1):lt(n,1),We=Pe===-1&&Ne?ut&&Re!==null?So(u,Re,-1):fe!==null?lt(fe,-1):null:null,Be=Pe===1&&Ne?ut&&Re!==null?So(u,Re,1):fe!==null?lt(fe,1):null:null,Ue=We&&We.url!==(Ye==null?void 0:Ye.url)?We:null,ge=Be&&Be.url!==(Le==null?void 0:Le.url)?Be:null,ve=Ye&&Ke?(()=>{const F=ut?Ml(u,p,-1):t.length>2?lt((n-1+t.length)%t.length,-1):null;return F&&F.url!==Ye.url?F:null})():null,_e=Le&&Ke?(()=>{const F=ut?Ml(u,p,1):t.length>2?lt((n+1)%t.length,1):null;return F&&F.url!==Le.url?F:null})():null,Ze=Ue??ve,we=ge??_e,Te=s.useCallback((F,Ee,Fe)=>{if(!F||!Ee||!Fe)return;const Oe=z.current,at=Oe.get(F);(at==null?void 0:at.width)===Ee&&(at==null?void 0:at.height)===Fe||(Oe.set(F,{width:Ee,height:Fe}),Y(Et=>Et+1))},[]),Xe=s.useCallback(F=>{if(!(F!=null&&F.url))return null;const Ee=z.current.get(F.url);return Xf(y.current,Ee)},[N,G]),ze=s.useCallback(()=>{if(!ee)return;const F=Xe(ee);if(F){re(F);return}const Ee=y.current;Ee&&re(kl(Ee))},[ee,Xe]),Ie=s.useCallback(F=>{if(ut){const Ee=u.length;ue((p+F+Ee)%Ee),$e(null);return}t.length>1&&($e((n+F+t.length)%t.length),ue(null))},[ut,u.length,p,t.length,n]),Ve=s.useCallback(F=>{M.current=F,ne(F)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),tt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ve(!1)},go+32)},[De,Ve]),nt=s.useCallback(()=>{const F=C.current;if(!F){le({left:0,top:0,width:typeof window<"u"?window.innerWidth:$a.width,height:typeof window<"u"?window.innerHeight:$a.height});return}const Ee=F.getBoundingClientRect();le({left:Ee.left,top:Ee.top,width:Ee.width,height:Ee.height})},[]),st=s.useCallback((F,Ee)=>{if(Ne){if(ye&&!J)return`translate(${te}px, 0px)`;if(J&&Pe!==null){const Fe=Xe(F);if(!Fe)return;const{x:Oe,y:at}=Zf(Fe,Ee,Pe,k);return`translate(${Oe}px, ${at}px)`}if(J)return"translate(0px, 0px)"}},[Ne,ye,J,te,Pe,k,Xe]),St=s.useCallback(()=>{const F=D.current;D.current=null,De(),Ve(!1),be(null),ue(null),$e(null),O(0),ce(!1),I.current=!1,H.current=0,$.current="none",F===-1?f():F===1&&x()},[De,Ve,f,x]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{D.current!==null&&St()},go+32)},[De,St]),zt=s.useCallback(()=>{De(),D.current=null,Ve(!1),be(null),ue(null),$e(null),O(0),ce(!1),I.current=!1,H.current=0,$.current="none"},[De,Ve]),ft=s.useCallback(F=>{if(!(!Ke||!se)){if(M.current){if(D.current===F){A.current=F,St();return}zt()}De(),Ie(F),D.current=F,be(F),Ve(!0),Bt()}},[Ke,se,St,zt,De,Ie,Ve,Bt]);X.current=ft;const wt=s.useCallback(()=>{ie.current=null,V.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),jt=s.useCallback(F=>{L.current!==null&&window.clearInterval(L.current);const Ee=V.current?Of:Df;L.current=window.setInterval(()=>{X.current(F)},Ee)},[]),At=s.useCallback(F=>{ie.current!==F&&(wt(),ie.current=F,V.current=!1,X.current(F),jt(F),_.current=window.setTimeout(()=>{_.current=null,ie.current===F&&(V.current=!0,jt(F))},Hf))},[wt,jt]),xt=s.useCallback(()=>{const F=y.current;if(!F)return;const Ee=ee==null?void 0:ee.url,Fe=Ee?z.current.get(Ee):void 0;if(Fe!=null&&Fe.width&&(Fe!=null&&Fe.height)){re(is(F,Fe.width,Fe.height));return}const Oe=S.current;if(Oe&&Ee&&(Oe.src===Ee||Oe.currentSrc===Ee)){const{width:Et,height:it}=Gf(Oe);if(Et&&it){Te(Ee,Et,it),re(is(F,Et,it));return}}const at=kl(F);!at.width||!at.height||re(at)},[ee==null?void 0:ee.url,Te]),Ft=s.useCallback(F=>{if(S.current=F,!!F){if(F instanceof HTMLVideoElement){F.readyState>=1&&F.videoWidth>0&&xt();return}F.complete&&F.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{nt(),xt(),b(F=>F+1)},[nt,xt]);s.useEffect(()=>{Nt();const F=y.current,Ee=C.current,Fe=new ResizeObserver(()=>Nt());return F&&Fe.observe(F),Ee&&Fe.observe(Ee),window.addEventListener("resize",Nt),()=>{Fe.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,v]),s.useLayoutEffect(()=>{if(!ee)return;const F=S.current;if(F){if(F instanceof HTMLImageElement&&F.complete&&F.naturalWidth>0){xt();return}F instanceof HTMLVideoElement&&F.readyState>=1&&F.videoWidth>0&&xt()}},[ee==null?void 0:ee.url,n,xt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const F=new Set,Ee=[],Fe=Oe=>{!(Oe!=null&&Oe.url)||F.has(Oe.url)||(F.add(Oe.url),Ee.push(Oe))};t.forEach(Fe),u.forEach(Oe=>Oe.items.forEach(Fe)),Ee.forEach(Oe=>{z.current.has(Oe.url)||qf(Oe,Te)})},[t,u,Te]),s.useEffect(()=>{if(E!=="opening"||!se)return;if(!w){j("open");return}Z(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),j("open")})});return()=>cancelAnimationFrame(F)},[E,se,w]),s.useEffect(()=>{if(E!=="closing")return;const F=setTimeout(()=>h(),Tn);return()=>clearTimeout(F)},[E,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{He.current===n&&he.current===(ee==null?void 0:ee.url)||(De(),D.current=null,be(null),ue(null),$e(null),K(0),O(0),Ve(!1),de(!1),ce(!1),T.current=0,H.current=0,$.current="none",I.current=!1,B.current=null,P.current=!1,S.current=null,ze(),He.current=n,he.current=ee==null?void 0:ee.url)},[n,ee==null?void 0:ee.url,Ve,De,ze]),s.useLayoutEffect(()=>{const F=A.current;F!==null&&(A.current=null,requestAnimationFrame(()=>{X.current(F)}))},[n,p,ee==null?void 0:ee.url]),s.useLayoutEffect(()=>{if(E==="opening"){q.current=!1,Ce(!1);return}if(E!=="open"||q.current)return;if(!Ye&&!Le){q.current=!0;return}Ce(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),q.current=!0})});return()=>cancelAnimationFrame(F)},[E,Ye==null?void 0:Ye.url,Le==null?void 0:Le.url]),s.useEffect(()=>{if(E!=="open")return;const F=()=>{const it=vt=>{vt.stopPropagation(),vt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Ee=it=>{const vt=it<0?1:-1;De(),Ie(vt),D.current=vt,be(vt),Ve(!0),Bt()},Fe=it=>{if(Math.abs(it)>Wf&&Ke){Ee(it);return}D.current=null,be(null),ue(null),$e(null),Ve(!0),O(0),tt()},Oe=it=>{if(it.touches.length!==1||M.current)return;const vt=it.touches[0];P.current=!0,B.current={x:vt.clientX,y:vt.clientY},$.current="none",H.current=0,I.current=!1},at=it=>{if(!B.current||it.touches.length!==1||M.current)return;const vt=it.touches[0],Ot=vt.clientX-B.current.x,It=vt.clientY-B.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ke)return;$.current="horizontal"}else if(It>0){if(!ct)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,ce(!0),H.current=Ot,O(Ot),it.preventDefault();return}$.current==="vertical"&&(I.current=!0,ce(!0),T.current=It,K(It),it.preventDefault())},Et=()=>{if(!B.current)return;const it=$.current,vt=I.current;if(vt&&it==="horizontal")Fe(H.current),F();else if(vt&&it==="vertical"){const Ot=T.current;if(ct&&Ot>Nf){const It=window.innerHeight;T.current=It,de(!0),K(It),j("closing")}else T.current=0,K(0);F()}else it==="horizontal"&&Math.abs(H.current)>0&&(Fe(H.current),F());B.current=null,$.current="none",H.current=0,I.current=!1,ce(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[E,Ke,Ve,tt,De,ct,Bt,Ie]);const Kt=s.useCallback(()=>{const F=(m==null?void 0:m())??w??null;F&&se&&(xe(F),Z(!0)),j("closing")},[m,w,se]);s.useEffect(()=>{const F=Oe=>{if(Oe.key==="Escape"){if(r&&d||E==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||E!=="open"||!Ke)return;Oe.preventDefault();const at=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&ie.current===at||At(at)},Ee=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const at=Oe.key==="ArrowLeft"?-1:1;ie.current===at&&wt()},Fe=()=>{wt()};return window.addEventListener("keydown",F),window.addEventListener("keyup",Ee),window.addEventListener("blur",Fe),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",Ee),window.removeEventListener("blur",Fe),wt()}},[E,r,d,Kt,Ke,At,wt]),s.useEffect(()=>{E!=="open"&&wt()},[E,wt]);const Jt=()=>{E==="closing"||l||Kt()},Tt=E==="open",Wt=E==="closing",rn=me>0?Math.max(0,1-me/500):1,gt=me>0?Math.max(.35,1-me/500):1,Ae=s.useCallback(F=>{if(!(F.propertyName!=="transform"||!M.current)){if(D.current!==null){St();return}De(),Ve(!1)}},[De,Ve,St]),Ge=E==="closing"?ae??w:w,rt=Ge&&se&&(E==="opening"||Wt)?Bf(Ge,se):void 0,ht=Ne&&ee?st(ee,"center"):me>0?`translateY(${me}px)`:rt,yt=se?dr(se,k):null,Lt=!!(Ge&&se),mt=Lt&&(E==="closing"||E==="open"&&Q),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:me>0?gt:Lt?1:E==="opening"||Wt?0:1,transition:ye&&!J?"none":J?`transform ${go}ms ${pn}`:U?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:E==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Je&&Tt&&!Ne?"auto":"none",touchAction:Je&&Tt?"none":void 0,zIndex:1,overflow:Je?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Ne?"auto":"none"},Mt=(F,Ee,Fe="adjacent")=>{const Oe=Xe(F);if(!Oe)return{display:"none"};const at=Fe==="far"?Ee==="left"?"far-left":"far-right":Ee==="left"?"left-adjacent":"right-adjacent",{start:Et}=Pe!==null?Ed(Oe,at,Pe,k):{start:Fe==="far"?Wr(Oe,Ee,k):Ji(Oe,Ee,k)},it=dr(Et,k),vt=st(F,at),Ot=!Ne&&Fe==="adjacent"&&Tt&&!ke?Jf(Oe,Ee,k):null,It=Fe==="far"&&Ne&&Pe===(Ee==="left"?-1:1),nn=ye&&!J?!1:J,un=Fe==="adjacent"&&Tt&&ke&&!Ne;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:vt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Fe==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Fe==="far"?`transform ${go}ms ${pn}`:`transform ${go}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:E==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(F,Ee)=>{const Fe=Xe(F);return Fe?Kf(Ji(Fe,Ee,k),Ee,k):null},qt=F=>Ee=>{if(!l){if(P.current){P.current=!1;return}Ee.stopPropagation(),ft(F)}},Ht=Ye?Xt(Ye,"left"):null,Dt=Le?Xt(Le,"right"):null,_t=Ht?dr(Ht,k):null,Ct=Dt?dr(Dt,k):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:E==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:ye?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:ye?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(Rd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Ze&&a.jsx(ur,{media:Ze,style:Mt(Ze,"left","far"),onMeasure:Te,onTransitionEnd:Ae},`far-prev-${Ze.url}`),Tt&&Ye&&a.jsxs(a.Fragment,{children:[a.jsx(ur,{media:Ye,style:Mt(Ye,"left"),onMeasure:Te,onTransitionEnd:Ae},`prev-${Ye.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||ye?"default":"pointer",pointerEvents:l||ye?"none":"auto",zIndex:3},onClick:qt(-1)})]}),Tt&&Le&&a.jsxs(a.Fragment,{children:[a.jsx(ur,{media:Le,style:Mt(Le,"right"),onMeasure:Te,onTransitionEnd:Ae},`next-${Le.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||ye?"default":"pointer",pointerEvents:l||ye?"none":"auto",zIndex:3},onClick:qt(1)})]}),Tt&&we&&a.jsx(ur,{media:we,style:Mt(we,"right","far"),onMeasure:Te,onTransitionEnd:Ae},`far-next-${we.url}`),se&&ee&&(Je?a.jsx(ny,{src:ee.url,phase:E,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Ae},`${n}-${ee.url}`):a.jsx("img",{ref:Ft,src:ee.url,alt:ee.name,onLoad:xt,onTransitionEnd:Ae,style:Vt},`${n}-${ee.url}`))]})}function oy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,w=(v==null?void 0:v.display)==="cover",m=(v==null?void 0:v.ratioValue)??"1:1",h=(v==null?void 0:v.reversed)??!1,[f,x]=m.split(":").map(Number),S=`${h?x:f} / ${h?f:x}`,z=c.entryWidth??.2,N=c.columnsCount,Y=W.scalingValue(z,n),B=W.scalingValue(c.horizontalGap??0,n),T=Y,H=Y,$={width:T,...w?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},I=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},P=s.useRef(null),[M,g]=s.useState(!1),[D,A]=s.useState([]),[X,ie]=s.useState(0),[L,_]=s.useState(0),[V,se]=s.useState(null),[re,k]=s.useState({title1:"",title2:"",title3:""}),le=(()=>{const fe={},$e=P.current?getComputedStyle(P.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(fe["--cntrl-article-width"]=$e),fe})(),G=!n||i||o,b=s.useMemo(()=>_f(d),[d]),E=t??[],j=E.length%N||N,me=j<N&&E.length>0,K=E.length-j,te=me?Math.floor((N-j)/2)+1:1,O=s.useMemo(()=>jf(E),[E]),J=s.useMemo(()=>Yf(E),[E]),ne=(fe,$e,Q)=>{if(n&&!o&&!i)return;const Z=O.findIndex(xe=>xe.gridIndex===fe);if(Z<0)return;const ae=O[Z];_(Z),A(ae.items),ie($e),k(ae.entry),se(Q??null),g(!0)},Pe=s.useCallback(()=>{g(!1),se(null)},[]),be=s.useCallback(()=>{const fe=O[L];return!fe||!P.current?V:zf(P.current,fe.gridIndex,w?"cover":"contain")??V},[O,L,V,w]),Re=s.useCallback(fe=>{if(O.length>1){const $e=O.length,Q=(L+fe+$e)%$e,Z=O[Q],ae=Math.min(X,Z.items.length-1);_(Q),A(Z.items),ie(ae),k(Z.entry);return}ie($e=>($e+fe+D.length)%D.length)},[O,L,X,D.length]),ue=O.length>1||D.length>1;return s.useEffect(()=>{if(!M||typeof document>"u")return;const fe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=fe}},[M]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:b}}),a.jsx(Uf,{mediaList:J}),a.jsx("div",{ref:P,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${Y})`,rowGap:0,columnGap:B,width:W.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:W.scalingValue(u??0,n)},children:E.map((fe,$e)=>{const Q=zs(fe.gallery),Z=js(Q),ae=Z.filter(ce=>ce.lightboxMedia).map(ce=>ce.lightboxMedia),xe=Math.floor($e/N)===Math.ceil(E.length/N)-1,ke=me&&$e>=K?`${te+($e-K)}`:void 0,Ce=Z[0],q=Ce!=null&&Ce.lightboxMedia?ae.findIndex(ce=>ce.url===Ce.lightboxMedia.url):-1,ye=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:Z.length>0&&a.jsx(ty,{media:Ce.displayMedia,gridIndex:$e,className:`${d}-item-${uo(Ce.displayMedia)?"video":"image"}`.trim(),style:I,onMediaClick:G&&q>=0?ce=>ne($e,q,Ld(ce.currentTarget,w?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,xe?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:Y,...ke?{gridColumn:ke}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:H}})}),a.jsx("a",{className:`${d}-item-image-link`,children:ye}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:H}})})]})},$e)})}),M&&typeof document<"u"&&(()=>{const fe=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:le,"data-selection":"none",children:a.jsx(iy,{prefix:d,items:D,index:X,entry:re,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ue,lightboxEntries:O,entryIdx:L,layoutId:r,sourceRect:V,resolveCloseSourceRect:be,onClose:Pe,onPrev:()=>Re(-1),onNext:()=>Re(1)})}),fe)})()]})}const ry=`import { CommonComponentProps } from '../props';
|
|
7506
7506
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7507
7507
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7508
7508
|
import { createPortal } from 'react-dom';
|
|
@@ -10221,7 +10221,7 @@ a.${e}-list-item {
|
|
|
10221
10221
|
overflow-wrap: anywhere;
|
|
10222
10222
|
word-break: break-word;
|
|
10223
10223
|
}
|
|
10224
|
-
`}const oi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Vs=["AColumn","BColumn","CColumn","DColumn","EColumn"],Hn="cutLabel",Wo=[...Vs,Hn],ra=["A","B","C","D","E"];function kd(e){return`${e}ColumnVerticalAlign`}const os=["Top","Center","Bottom"];function Gs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ra.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Cy(e){const t=Gs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function $y(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ra.includes(n)?n:null}function Ad(e,t,n){const i=$y(e);return i?i===t?!1:Cy(n[kd(i)]):!0}function Ho(e){const t=Gs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ra.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Ty(e,t,n){if(Fd(e,t,n))return Ho(e);const i=Ho(e);return i.kind==="baseline"?{kind:"top"}:i}function Iy(e){const t=Ho(e);return t.kind==="baseline"?{kind:"top"}:t}function Fd(e,t,n){return Ad(e,n,t)?Ho(e).kind==="baseline":!1}function Ry(e){const t={};let n=!1;for(const i of ra){const o=kd(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Ad(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ly(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Py(e){const t=Ho(e).kind;return t==="baseline"?"center":t}function Ey(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Hl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function My(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),r=o-i;return n.remove(),r}function La(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=My(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function ky(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function Ay(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Fy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const _y={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Ny(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Wy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Wo.map(e=>[_y[e],Ny(e)]))}}function Hr(e,t){const n=i=>{const o=Pt(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===Hn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Dl(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return an(Ut(n,t))}function Ol(e,t,n,i){const o=Hr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Bl(e,t,n,i){const o=Hr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((r-l)/2,i)}}const vn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],eo=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],to=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],no=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Hy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Dy=["hover","focus","filled","success","error"],zl=.004,Di=.004,Pa=Di,Xs=50,Do=1440,Oo=Xs/Do;function _d(e){const t=typeof e=="number"&&e>0?e:Do;return Xs/t}function Oy(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return Do}const Nd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ro(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function By(e,t=1){const n=t/e;return Object.fromEntries(vn.map(i=>[i,n]))}function zy(){return Object.fromEntries([...eo.map(e=>[e,0]),...to.map(e=>[e,0])])}function jy(){return Object.fromEntries(no.map(e=>[e,0]))}function pr(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Nd[t]]))}function Wd(e,t,n){const i=e-Oo,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function Rr(e,t,n){const i=qs(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Vy(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=eo[o],l=to[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Wd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function qs(e,t,n){if(e<=0)return[];const i=vn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+Oo;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-Oo;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function Gy(e,t,n){if(e<=1)return{};const i=qs(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=vn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function jl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...oi]}function Xy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function qy(e,t,n,i){const o=Math.min(i,e.length,vn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=vn[c],p=eo[c],v=to[c],w=no[c],m=vn[l],h=eo[l],f=to[l],x=no[l],C=n[u],y=n[p],S=n[v],B=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof B=="number"&&(r[x]=B)}return r}function Hd(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function Yy(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ro(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...By(n,o),...zy()};if(r)for(const d of no)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,jy());return Hd(e,l)?l:e}function Uy(e,t,n){const i=Ry(e);i&&(e={...e,...i});const o=_d(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Ro(e),c=Ro(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:oi.length,v=S=>{if(u)return S;const B=pr({...t,...S}),N=Ro(S),q=Rr(p,N,B),D=Vy(p,q,{...t,...S});return Object.keys(D).length===0?S:{...S,...D}};if(typeof r=="number"&&r!==l)return e;const w=jl(e),m=jl(t);if(!Xy(w,m))return v({...e,...qy(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=pr({...t,...e});return v({...e,...Gy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,B=Math.max(0,(d-o)/2);return S>B?{...e,textPaddingLR:B}:e}const h=pr({...t,...e}),f=Rr(p,c,pr(t)),C=Rr(p,d,h).some((S,B)=>S<(f[B]??S)),y=vn.some(S=>{const B=e[S],N=t[S];return typeof B=="number"&&typeof N=="number"&&B!==N});return C||y?v(e):e}function Ky(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Oo,i-o-r-Oo)}function Zy(e,t){return Math.random()*(t-e)+e}function Jy(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Nd[t]]))}function Ea(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Qy(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=eo[d],u=to[d],p=no[d];return{key:l,textPrefix:Fy[l],widthKey:vn[d],width:n[vn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function ev({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=W.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:w,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:x,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:B,imageSize:N,imageOnHover:q,imagePosition:D="cursor",imageInterpolation:T="on",entryHoverEffect:H,entryHoverShowOption:$,rowPaddingTop:I,rowPaddingBottom:P,rowPaddingTopB:E,columnsOrder:g,textPaddingLR:z,textColor:F,backgroundColor:X,dividerColor:ie,textHoverColor:L,backgroundHoverColor:_,dividerHoverColor:V}=e,[ae,re]=s.useState(void 0),[M,se]=s.useState(null),j=s.useRef(null),b=q==="on"&&(!n||i),k=D==="cursor",G=k&&T==="on",{anchorRef:he,onShow:J,onCursorMove:ee,exit:O}=wy(!!(b&&M!==null),G),Z=(C??0)>0,te=v==="b",Le=s.useRef(null),ve=s.useRef(null),[Ie,pe]=s.useState(null),[oe,ye]=s.useState(Do),U=_d(oe),ce=Math.max(0,((w??0)-U)/2),le=Math.min(z??0,ce),Ce=Math.max(le,Di),Fe=((w??0)+U)/2;s.useLayoutEffect(()=>{if(!n){ye(Do);return}const ke=()=>{ye(Oy(Le.current))};ke();const Ge=Le.current;if(!Ge)return;const rt=new ResizeObserver(ke);rt.observe(Ge);let ht=Ge;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&rt.observe(ht),()=>rt.disconnect()},[n,l]),s.useEffect(()=>{re(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&re(void 0)},[n,i]);const Ee=W.buildColorVars(c,{textColor:F,backgroundColor:X,dividerColor:ie,textHoverColor:L,backgroundHoverColor:_,dividerHoverColor:V},Hy,Dy),Y=r&&r!=="default"?`${c}-state-${r}`:"",de=`${!n||i?H==="default"?`${c}-entry-hover-default`:H==="blinds"?`${c}-entry-hover-blinds`:H==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Y}`.trim(),K=H==="reveal"&&(!n||i),ue=(x==null?void 0:x[0])??!1,He=(x==null?void 0:x[1])??!1,fe=s.useRef(e),Q=s.useRef(l);s.useEffect(()=>{if(!d||!n){fe.current=e,Q.current=l;return}if(Q.current!==l){fe.current=e,Q.current=l;return}const ke=fe.current;if(!(ke!==e))return;if(typeof ke.columns=="number"&&typeof e.columns=="number"&&ke.columns!==e.columns){fe.current=e;return}const rt=Uy(e,ke,{designWidth:oe});fe.current=e,Hd(e,rt)&&d(rt)},[e,d,n,l,oe]);const Je=s.useMemo(()=>Jy(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Ne=s.useMemo(()=>Ea(e,eo),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ct=s.useMemo(()=>Ea(e,to),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ke=s.useMemo(()=>Ea(e,no),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ut=s.useMemo(()=>Array.isArray(g)&&g.length>0?g:[...oi],[g]),lt=s.useMemo(()=>Qy(ut,p,Je,Ne,ct,Ke),[ut,p,Je,Ne,ct,Ke]),Ye=Ro(e),Re=s.useMemo(()=>vn.slice(0,p).map(ke=>Je[ke]),[p,Je]),We=s.useMemo(()=>qs(p,Ye,Je),[p,Ye,Je]),Be=s.useMemo(()=>Rr(p,Ye,Je),[p,Ye,Je]),Ue=s.useMemo(()=>lt.map((ke,Ge)=>Wd(Be[Ge]??0,ke.paddingLeft,ke.paddingRight)),[lt,Be]),ge=s.useMemo(()=>{const ke=m===0?1/0:m;return(t??[]).slice(0,ke).map((rt,ht)=>({id:ht,cells:Object.fromEntries(oi.map(yt=>[yt,rt[yt]??""])),image:rt.image,link:rt.link}))},[t,m]),xe=Z?ae??C:ge.length,_e=s.useMemo(()=>Z?ge.slice(0,xe):ge,[ge,Z,xe]),Ze=Z&&xe<ge.length,we=_e.length>1||Ze,$e=[ue?`${c}-divider-top`:"",He||we?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Xe=!n||i,ze=()=>{if(!Xe)return;const ke=ae??C;if(!y){re(ge.length);return}re(Math.min(ke+y,ge.length))},Te=ke=>W.scalingValue(ke,n??!1),Ve=te?E??0:I??0,De=P??0,tt=h??0,nt=Math.max(De,Pa),st=_l(0,_e.length,ue,He,Ze,f??0,n??!1).borderTopWidth,St=te?"rowPaddingTopB":"rowPaddingTop",Bt=lt[0],zt=lt[lt.length-1],ft=Ue[0],wt=Ue[Ue.length-1],jt=Bt&&ft?Math.max(ft.paddingLeft,Di):0,At=zt&&wt?Math.max(wt.paddingRight,Di):0,xt=Ye,Ft=(ke,Ge)=>by(D,Le.current,k?ke:null,Ge),Nt=(ke,Ge)=>{if(!b)return;const rt=ke.image;if(!(rt!=null&&rt.url)){O(()=>se(null));return}const ht=(N==null?void 0:N.min)??80,yt=(N==null?void 0:N.max)??320,Lt=(M==null?void 0:M.rowId)===ke.id,mt=Lt?M.widthPx:Zy(ht,yt),{x:Vt,y:kt}=Ft(Ge,mt);if(Lt&&k){ee(Vt,kt);return}se({rowId:ke.id,url:rt.url,objectFit:"contain",isVideo:hy(rt),widthPx:mt}),j.current={x:Vt,y:kt}},Kt=ke=>{if(!b||!M||!k)return;const{x:Ge,y:rt}=Ft(ke,M.widthPx);ee(Ge,rt)},Jt=()=>{M&&O(()=>se(null))},Tt=ke=>{K&&Al(ke,c),!(!b||!M)&&O(()=>se(null))},Wt=ke=>{K&&Fl(ke,c)};s.useLayoutEffect(()=>{if(!M||!j.current)return;const{x:ke,y:Ge}=j.current;j.current=null,J(ke,Ge)},[M==null?void 0:M.rowId,M==null?void 0:M.url,J]),s.useLayoutEffect(()=>{if(!u||te){pe(null);return}const ke=ve.current,Ge=ke==null?void 0:ke.parentElement;if(!ke||!Ge){pe(null);return}const rt=()=>{const yt=ke.querySelector("[data-list-row]");if(!yt){pe(null);return}const Lt=Ge.getBoundingClientRect(),mt=yt.getBoundingClientRect();pe(mt.top-Lt.top+mt.height/2)};rt();const ht=new ResizeObserver(rt);return ht.observe(ke),ht.observe(Ge),()=>ht.disconnect()},[u,te,_e,Ve,De,tt,t,e,lt,Be,oe,f,ue,He,Ze]);const rn=s.useMemo(()=>!te&&Vs.some(ke=>{const Ge=ke.charAt(0),rt=e[`${ke}VerticalAlign`];return Fd(rt,e,Ge)}),[te,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Vt;const ke=Le.current;if(!ke)return;const Ge=()=>{ke.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Xt=kt.querySelector(`.${c}-list-col-title`);Xt&&(Xt.style.transform="")})};if(te||!rn){Ge();return}const rt=()=>{const kt=Array.from(ke.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Xt=`${c}-baseline-probe`;kt.forEach(qt=>{qt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Dt=Ht.querySelector(`.${Mt}`);Dt&&(Dt.style.minHeight="",Dt.style.height="");const _t=Ht.querySelector(`.${c}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(qt=>{const Ht=Array.from(qt.querySelectorAll("[data-list-col]"));ky(qt,Ht,Mt)}),ke.offsetHeight,kt.forEach(qt=>{const Ht=Array.from(qt.querySelectorAll("[data-list-col]")),Dt=qt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Ae=>{const Oe=Ae.querySelector(`.${c}-list-col-title`),at={el:Ae,titleEl:Oe,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return _t.set(at.letter,at),at}),A=new Map,Pe=(Ae,Oe)=>{const at=A.get(Ae.letter);if(at!==void 0)return at;const Et=Ae.anchor?_t.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Et||Oe.has(Ae.letter)){const nn=La(Ae,Dt,Mt,Xt);return A.set(Ae.letter,nn),nn}Oe.add(Ae.letter);const it=Pe(Et,Oe);Oe.delete(Ae.letter);const vt=La(Ae,Dt,Mt,Xt),Ot=it-vt;Ay(Ae.titleEl,Ot);const It=La(Ae,Dt,Mt,Xt);return A.set(Ae.letter,It),It};Ct.forEach(Ae=>Pe(Ae,new Set))})};let ht=null;const yt=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,rt()}))};rt();const Lt=new ResizeObserver(()=>yt());Lt.observe(ke);let mt=!1;return typeof document<"u"&&((Vt=document.fonts)!=null&&Vt.ready)&&document.fonts.ready.then(()=>{mt||yt()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Ge()}},[rn,te,e,t,oe,_e,Be]);const gt=s.useMemo(()=>Sy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:Ee,children:a.jsxs("div",{ref:Le,className:`${c}-wrapper ${de}${$e?` ${$e}`:""}${te?` ${c}-type-b`:""}`.trim(),style:{width:W.scalingValue(w??0,n)},onMouseMove:b?Kt:void 0,onMouseLeave:b?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[_e.map((ke,Ge)=>{var Lt;const rt=(((Lt=ke.link)==null?void 0:Lt.length)??0)>0,ht=rt&&(!n||i)?"a":"div",yt=_l(Ge,_e.length,ue,He,Ze,f??0,n??!1);return a.jsxs(ht,{ref:Ge===0?mt=>{ve.current=mt}:void 0,className:`${c}-list-item${rt||$==="always"?` ${c}-list-item-has-link`:""}${Ze&&Ge===_e.length-1?` ${c}-list-item-before-cut`:""}`,...rt?{href:ke.link,target:"_blank"}:{},style:yt,onMouseEnter:mt=>{K&&(rt||$==="always")&&Al(mt,c),b&&Nt(ke,mt)},onMouseLeave:mt=>{K&&(rt||$==="always")&&Fl(mt,c)},children:[Ve>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Te(Ve)}}),a.jsxs("div",{className:`${c}-list-cols-row${te?"":` ${c}-list-cols-row-h`}${u&&Ge===0&&te?` ${c}-list-cols-row-controls`:""}`,...te?{}:{"data-list-row":""},style:te?void 0:{minHeight:Te(tt)},children:[lt.map((mt,Vt)=>{const kt=Vt===lt.length-1,Mt=Ue[Vt],Xt=mt.paddingBottom,qt=yy(ke.cells[mt.key]),Ht=te&&qt&&Xt>0,Dt=te?{minHeight:Te(tt)}:{width:Te(Be[Vt])},_t=te?{paddingLeft:Te(le),paddingRight:Te(le)}:{paddingLeft:Te(Mt.paddingLeft),paddingRight:Te(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),A=te?Iy(e[`${mt.textPrefix}VerticalAlign`]):Ty(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Pe=te&&qt&&u&&Ge===0;return te&&!qt?null:a.jsxs("div",{className:te?`${c}-list-col-wrap`:void 0,...te?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":A.kind,...A.kind==="baseline"?{"data-valign-anchor":A.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...te?{justifyContent:Hl(A.kind)}:{}},"data-test":mt.width,children:a.jsx("span",{className:Ol(e,mt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Dl(Hr(e,mt.textPrefix),n),...Bl(e,mt.textPrefix,c,n),...te?{}:Ly(A.kind)},children:ke.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Te(Xt)}}),Pe&&a.jsx("div",{"data-controls":mt.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Te(Math.max(Xt,Pa))}})]},mt.key)}),u&&Ge===0&&te&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Fe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Te(Ce),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Fe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Te(Math.max(Ce,Ye-Ce)),width:Te(Ce),height:"100%"}})]})]}),!te&&De>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Te(De)}}),u&&Ge===0&&!te&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Te(nt)}})]},ke.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":St,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":te?"center":"left-y",className:`${c}-control-anchor`,style:{top:st,left:0,width:"100%",height:Te(Math.max(Ve,Pa))}})},"row-padding-handles"),u&&!te&&Bt&&zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Bt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((ft==null?void 0:ft.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Te(jt),height:"100%"}}),a.jsx("div",{"data-controls":zt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[lt.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:Te(xt-At),width:Te(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!te&<.slice(0,-1).map((ke,Ge)=>{const rt=lt[Ge+1],ht=We.slice(0,Ge+1).reduce((kt,Mt)=>kt+Mt,0),yt=Ue[Ge],Lt=Ue[Ge+1],mt=Math.max(yt.paddingRight,Di),Vt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":ke.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[Ge]-yt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:Te(ht-mt),width:Te(mt),height:"100%"}}),a.jsx("div",{"data-controls":rt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[Ge+1]-Lt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:Te(ht),width:Te(Vt),height:"100%"}})]},`${ke.paddingRightKey}-padding`)}),u&&!te&<.slice(0,-1).map((ke,Ge)=>{const rt=Ky(Ge,We,Re,Ye),yt=We.slice(0,Ge+1).reduce((Lt,mt)=>Lt+mt,0)-zl/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":ke.widthKey,"data-controls-axis":"x","data-controls-min":String(Xs),"data-controls-max-fraction":String(rt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Te(yt),width:Te(zl),height:"calc(100%)",pointerEvents:"auto"}})},`${ke.widthKey}-junction`)})]}),Ze&&(()=>{const ke=Hr(e,Hn),Ge=Py(e.cutLabelVerticalAlign),rt=ke.textTextAlign==="justify"||te;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Te(S??0),cursor:Xe?"pointer":"default",...vy(He,f??0,n??!1)},onClick:Xe?ze:void 0,onMouseEnter:K||b?Tt:void 0,onMouseLeave:K?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...te?{paddingLeft:Te(le),paddingRight:Te(le)}:{},justifyContent:Ey(ke.textTextAlign),alignItems:Hl(Ge)},children:a.jsx("span",{className:Ol(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Dl(ke,n),...Bl(e,Hn,c,n),...rt?{width:"100%"}:{}},children:B})})})})(),b&&M&&(()=>{const ke=`${M.widthPx}px`,Ge={width:ke,height:"auto",maxHeight:ke,objectFit:"contain"};return a.jsx("div",{ref:he,className:`${c}-hover-media-anchor`,children:a.jsx(fy,{media:M,className:M.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ge},`${M.rowId}-${M.url}`)})})()]})})]})}const tv=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10224
|
+
`}const oi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Vs=["AColumn","BColumn","CColumn","DColumn","EColumn"],Hn="cutLabel",Wo=[...Vs,Hn],ra=["A","B","C","D","E"];function kd(e){return`${e}ColumnVerticalAlign`}const os=["Top","Center","Bottom"];function Gs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ra.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Cy(e){const t=Gs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function $y(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ra.includes(n)?n:null}function Ad(e,t,n){const i=$y(e);return i?i===t?!1:Cy(n[kd(i)]):!0}function Ho(e){const t=Gs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ra.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Ty(e,t,n){if(Fd(e,t,n))return Ho(e);const i=Ho(e);return i.kind==="baseline"?{kind:"top"}:i}function Iy(e){const t=Ho(e);return t.kind==="baseline"?{kind:"top"}:t}function Fd(e,t,n){return Ad(e,n,t)?Ho(e).kind==="baseline":!1}function Ry(e){const t={};let n=!1;for(const i of ra){const o=kd(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Ad(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ly(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Py(e){const t=Ho(e).kind;return t==="baseline"?"center":t}function Ey(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Hl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function My(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),r=o-i;return n.remove(),r}function La(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=My(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function ky(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function Ay(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Fy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const _y={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Ny(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Wy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Wo.map(e=>[_y[e],Ny(e)]))}}function Hr(e,t){const n=i=>{const o=Pt(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===Hn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Dl(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return an(Ut(n,t))}function Ol(e,t,n,i){const o=Hr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Bl(e,t,n,i){const o=Hr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((r-l)/2,i)}}const vn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],eo=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],to=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],no=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Hy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Dy=["hover","focus","filled","success","error"],zl=.004,Di=.004,Pa=Di,Xs=50,Do=1440,Oo=Xs/Do;function _d(e){const t=typeof e=="number"&&e>0?e:Do;return Xs/t}function Oy(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return Do}const Nd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ro(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function By(e,t=1){const n=t/e;return Object.fromEntries(vn.map(i=>[i,n]))}function zy(){return Object.fromEntries([...eo.map(e=>[e,0]),...to.map(e=>[e,0])])}function jy(){return Object.fromEntries(no.map(e=>[e,0]))}function pr(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Nd[t]]))}function Wd(e,t,n){const i=e-Oo,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function Rr(e,t,n){const i=qs(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Vy(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=eo[o],l=to[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Wd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function qs(e,t,n){if(e<=0)return[];const i=vn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+Oo;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-Oo;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function Gy(e,t,n){if(e<=1)return{};const i=qs(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=vn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function jl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...oi]}function Xy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function qy(e,t,n,i){const o=Math.min(i,e.length,vn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=vn[c],p=eo[c],v=to[c],w=no[c],m=vn[l],h=eo[l],f=to[l],x=no[l],C=n[u],y=n[p],S=n[v],z=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof z=="number"&&(r[x]=z)}return r}function Hd(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function Yy(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ro(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...By(n,o),...zy()};if(r)for(const d of no)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,jy());return Hd(e,l)?l:e}function Uy(e,t,n){const i=Ry(e);i&&(e={...e,...i});const o=_d(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Ro(e),c=Ro(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:oi.length,v=S=>{if(u)return S;const z=pr({...t,...S}),N=Ro(S),Y=Rr(p,N,z),B=Vy(p,Y,{...t,...S});return Object.keys(B).length===0?S:{...S,...B}};if(typeof r=="number"&&r!==l)return e;const w=jl(e),m=jl(t);if(!Xy(w,m))return v({...e,...qy(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=pr({...t,...e});return v({...e,...Gy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,z=Math.max(0,(d-o)/2);return S>z?{...e,textPaddingLR:z}:e}const h=pr({...t,...e}),f=Rr(p,c,pr(t)),C=Rr(p,d,h).some((S,z)=>S<(f[z]??S)),y=vn.some(S=>{const z=e[S],N=t[S];return typeof z=="number"&&typeof N=="number"&&z!==N});return C||y?v(e):e}function Ky(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Oo,i-o-r-Oo)}function Zy(e,t){return Math.random()*(t-e)+e}function Jy(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Nd[t]]))}function Ea(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Qy(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=eo[d],u=to[d],p=no[d];return{key:l,textPrefix:Fy[l],widthKey:vn[d],width:n[vn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function ev({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=W.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:w,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:x,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:z,imageSize:N,imageOnHover:Y,imagePosition:B="cursor",imageInterpolation:T="on",entryHoverEffect:H,entryHoverShowOption:$,rowPaddingTop:I,rowPaddingBottom:P,rowPaddingTopB:M,columnsOrder:g,textPaddingLR:D,textColor:A,backgroundColor:X,dividerColor:ie,textHoverColor:L,backgroundHoverColor:_,dividerHoverColor:V}=e,[se,re]=s.useState(void 0),[k,le]=s.useState(null),G=s.useRef(null),b=Y==="on"&&(!n||i),E=B==="cursor",j=E&&T==="on",{anchorRef:me,onShow:K,onCursorMove:te,exit:O}=wy(!!(b&&k!==null),j),J=(C??0)>0,ne=v==="b",Pe=s.useRef(null),be=s.useRef(null),[Re,ue]=s.useState(null),[fe,$e]=s.useState(Do),Q=_d(fe),Z=Math.max(0,((w??0)-Q)/2),ae=Math.min(D??0,Z),xe=Math.max(ae,Di),ke=((w??0)+Q)/2;s.useLayoutEffect(()=>{if(!n){$e(Do);return}const Ae=()=>{$e(Oy(Pe.current))};Ae();const Ge=Pe.current;if(!Ge)return;const rt=new ResizeObserver(Ae);rt.observe(Ge);let ht=Ge;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&rt.observe(ht),()=>rt.disconnect()},[n,l]),s.useEffect(()=>{re(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&re(void 0)},[n,i]);const Ce=W.buildColorVars(c,{textColor:A,backgroundColor:X,dividerColor:ie,textHoverColor:L,backgroundHoverColor:_,dividerHoverColor:V},Hy,Dy),q=r&&r!=="default"?`${c}-state-${r}`:"",ce=`${!n||i?H==="default"?`${c}-entry-hover-default`:H==="blinds"?`${c}-entry-hover-blinds`:H==="reveal"?`${c}-entry-hover-reveal`:"":""} ${q}`.trim(),U=H==="reveal"&&(!n||i),de=(x==null?void 0:x[0])??!1,He=(x==null?void 0:x[1])??!1,he=s.useRef(e),ee=s.useRef(l);s.useEffect(()=>{if(!d||!n){he.current=e,ee.current=l;return}if(ee.current!==l){he.current=e,ee.current=l;return}const Ae=he.current;if(!(Ae!==e))return;if(typeof Ae.columns=="number"&&typeof e.columns=="number"&&Ae.columns!==e.columns){he.current=e;return}const rt=Uy(e,Ae,{designWidth:fe});he.current=e,Hd(e,rt)&&d(rt)},[e,d,n,l,fe]);const Je=s.useMemo(()=>Jy(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Ne=s.useMemo(()=>Ea(e,eo),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ct=s.useMemo(()=>Ea(e,to),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ke=s.useMemo(()=>Ea(e,no),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ut=s.useMemo(()=>Array.isArray(g)&&g.length>0?g:[...oi],[g]),lt=s.useMemo(()=>Qy(ut,p,Je,Ne,ct,Ke),[ut,p,Je,Ne,ct,Ke]),Ye=Ro(e),Le=s.useMemo(()=>vn.slice(0,p).map(Ae=>Je[Ae]),[p,Je]),We=s.useMemo(()=>qs(p,Ye,Je),[p,Ye,Je]),Be=s.useMemo(()=>Rr(p,Ye,Je),[p,Ye,Je]),Ue=s.useMemo(()=>lt.map((Ae,Ge)=>Wd(Be[Ge]??0,Ae.paddingLeft,Ae.paddingRight)),[lt,Be]),ge=s.useMemo(()=>{const Ae=m===0?1/0:m;return(t??[]).slice(0,Ae).map((rt,ht)=>({id:ht,cells:Object.fromEntries(oi.map(yt=>[yt,rt[yt]??""])),image:rt.image,link:rt.link}))},[t,m]),ve=J?se??C:ge.length,_e=s.useMemo(()=>J?ge.slice(0,ve):ge,[ge,J,ve]),Ze=J&&ve<ge.length,we=_e.length>1||Ze,Te=[de?`${c}-divider-top`:"",He||we?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Xe=!n||i,ze=()=>{if(!Xe)return;const Ae=se??C;if(!y){re(ge.length);return}re(Math.min(Ae+y,ge.length))},Ie=Ae=>W.scalingValue(Ae,n??!1),Ve=ne?M??0:I??0,De=P??0,tt=h??0,nt=Math.max(De,Pa),st=_l(0,_e.length,de,He,Ze,f??0,n??!1).borderTopWidth,St=ne?"rowPaddingTopB":"rowPaddingTop",Bt=lt[0],zt=lt[lt.length-1],ft=Ue[0],wt=Ue[Ue.length-1],jt=Bt&&ft?Math.max(ft.paddingLeft,Di):0,At=zt&&wt?Math.max(wt.paddingRight,Di):0,xt=Ye,Ft=(Ae,Ge)=>by(B,Pe.current,E?Ae:null,Ge),Nt=(Ae,Ge)=>{if(!b)return;const rt=Ae.image;if(!(rt!=null&&rt.url)){O(()=>le(null));return}const ht=(N==null?void 0:N.min)??80,yt=(N==null?void 0:N.max)??320,Lt=(k==null?void 0:k.rowId)===Ae.id,mt=Lt?k.widthPx:Zy(ht,yt),{x:Vt,y:kt}=Ft(Ge,mt);if(Lt&&E){te(Vt,kt);return}le({rowId:Ae.id,url:rt.url,objectFit:"contain",isVideo:hy(rt),widthPx:mt}),G.current={x:Vt,y:kt}},Kt=Ae=>{if(!b||!k||!E)return;const{x:Ge,y:rt}=Ft(Ae,k.widthPx);te(Ge,rt)},Jt=()=>{k&&O(()=>le(null))},Tt=Ae=>{U&&Al(Ae,c),!(!b||!k)&&O(()=>le(null))},Wt=Ae=>{U&&Fl(Ae,c)};s.useLayoutEffect(()=>{if(!k||!G.current)return;const{x:Ae,y:Ge}=G.current;G.current=null,K(Ae,Ge)},[k==null?void 0:k.rowId,k==null?void 0:k.url,K]),s.useLayoutEffect(()=>{if(!u||ne){ue(null);return}const Ae=be.current,Ge=Ae==null?void 0:Ae.parentElement;if(!Ae||!Ge){ue(null);return}const rt=()=>{const yt=Ae.querySelector("[data-list-row]");if(!yt){ue(null);return}const Lt=Ge.getBoundingClientRect(),mt=yt.getBoundingClientRect();ue(mt.top-Lt.top+mt.height/2)};rt();const ht=new ResizeObserver(rt);return ht.observe(Ae),ht.observe(Ge),()=>ht.disconnect()},[u,ne,_e,Ve,De,tt,t,e,lt,Be,fe,f,de,He,Ze]);const rn=s.useMemo(()=>!ne&&Vs.some(Ae=>{const Ge=Ae.charAt(0),rt=e[`${Ae}VerticalAlign`];return Fd(rt,e,Ge)}),[ne,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Vt;const Ae=Pe.current;if(!Ae)return;const Ge=()=>{Ae.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Xt=kt.querySelector(`.${c}-list-col-title`);Xt&&(Xt.style.transform="")})};if(ne||!rn){Ge();return}const rt=()=>{const kt=Array.from(Ae.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Xt=`${c}-baseline-probe`;kt.forEach(qt=>{qt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Dt=Ht.querySelector(`.${Mt}`);Dt&&(Dt.style.minHeight="",Dt.style.height="");const _t=Ht.querySelector(`.${c}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(qt=>{const Ht=Array.from(qt.querySelectorAll("[data-list-col]"));ky(qt,Ht,Mt)}),Ae.offsetHeight,kt.forEach(qt=>{const Ht=Array.from(qt.querySelectorAll("[data-list-col]")),Dt=qt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Fe=>{const Oe=Fe.querySelector(`.${c}-list-col-title`),at={el:Fe,titleEl:Oe,letter:Fe.getAttribute("data-col-letter")??"",kind:Fe.getAttribute("data-valign")??"top",anchor:Fe.getAttribute("data-valign-anchor")};return _t.set(at.letter,at),at}),F=new Map,Ee=(Fe,Oe)=>{const at=F.get(Fe.letter);if(at!==void 0)return at;const Et=Fe.anchor?_t.get(Fe.anchor):void 0;if(Fe.kind!=="baseline"||!Et||Oe.has(Fe.letter)){const nn=La(Fe,Dt,Mt,Xt);return F.set(Fe.letter,nn),nn}Oe.add(Fe.letter);const it=Ee(Et,Oe);Oe.delete(Fe.letter);const vt=La(Fe,Dt,Mt,Xt),Ot=it-vt;Ay(Fe.titleEl,Ot);const It=La(Fe,Dt,Mt,Xt);return F.set(Fe.letter,It),It};Ct.forEach(Fe=>Ee(Fe,new Set))})};let ht=null;const yt=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,rt()}))};rt();const Lt=new ResizeObserver(()=>yt());Lt.observe(Ae);let mt=!1;return typeof document<"u"&&((Vt=document.fonts)!=null&&Vt.ready)&&document.fonts.ready.then(()=>{mt||yt()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Ge()}},[rn,ne,e,t,fe,_e,Be]);const gt=s.useMemo(()=>Sy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Pe,className:`${c}-wrapper ${ce}${Te?` ${Te}`:""}${ne?` ${c}-type-b`:""}`.trim(),style:{width:W.scalingValue(w??0,n)},onMouseMove:b?Kt:void 0,onMouseLeave:b?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[_e.map((Ae,Ge)=>{var Lt;const rt=(((Lt=Ae.link)==null?void 0:Lt.length)??0)>0,ht=rt&&(!n||i)?"a":"div",yt=_l(Ge,_e.length,de,He,Ze,f??0,n??!1);return a.jsxs(ht,{ref:Ge===0?mt=>{be.current=mt}:void 0,className:`${c}-list-item${rt||$==="always"?` ${c}-list-item-has-link`:""}${Ze&&Ge===_e.length-1?` ${c}-list-item-before-cut`:""}`,...rt?{href:Ae.link,target:"_blank"}:{},style:yt,onMouseEnter:mt=>{U&&(rt||$==="always")&&Al(mt,c),b&&Nt(Ae,mt)},onMouseLeave:mt=>{U&&(rt||$==="always")&&Fl(mt,c)},children:[Ve>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ie(Ve)}}),a.jsxs("div",{className:`${c}-list-cols-row${ne?"":` ${c}-list-cols-row-h`}${u&&Ge===0&&ne?` ${c}-list-cols-row-controls`:""}`,...ne?{}:{"data-list-row":""},style:ne?void 0:{minHeight:Ie(tt)},children:[lt.map((mt,Vt)=>{const kt=Vt===lt.length-1,Mt=Ue[Vt],Xt=mt.paddingBottom,qt=yy(Ae.cells[mt.key]),Ht=ne&&qt&&Xt>0,Dt=ne?{minHeight:Ie(tt)}:{width:Ie(Be[Vt])},_t=ne?{paddingLeft:Ie(ae),paddingRight:Ie(ae)}:{paddingLeft:Ie(Mt.paddingLeft),paddingRight:Ie(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),F=ne?Iy(e[`${mt.textPrefix}VerticalAlign`]):Ty(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Ee=ne&&qt&&u&&Ge===0;return ne&&!qt?null:a.jsxs("div",{className:ne?`${c}-list-col-wrap`:void 0,...ne?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":F.kind,...F.kind==="baseline"?{"data-valign-anchor":F.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...ne?{justifyContent:Hl(F.kind)}:{}},"data-test":mt.width,children:a.jsx("span",{className:Ol(e,mt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Dl(Hr(e,mt.textPrefix),n),...Bl(e,mt.textPrefix,c,n),...ne?{}:Ly(F.kind)},children:Ae.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ie(Xt)}}),Ee&&a.jsx("div",{"data-controls":mt.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ie(Math.max(Xt,Pa))}})]},mt.key)}),u&&Ge===0&&ne&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ke),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Ie(xe),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ke),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Ie(Math.max(xe,Ye-xe)),width:Ie(xe),height:"100%"}})]})]}),!ne&&De>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ie(De)}}),u&&Ge===0&&!ne&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ie(nt)}})]},Ae.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":St,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":ne?"center":"left-y",className:`${c}-control-anchor`,style:{top:st,left:0,width:"100%",height:Ie(Math.max(Ve,Pa))}})},"row-padding-handles"),u&&!ne&&Bt&&zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Bt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((ft==null?void 0:ft.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Ie(jt),height:"100%"}}),a.jsx("div",{"data-controls":zt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[lt.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ie(xt-At),width:Ie(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!ne&<.slice(0,-1).map((Ae,Ge)=>{const rt=lt[Ge+1],ht=We.slice(0,Ge+1).reduce((kt,Mt)=>kt+Mt,0),yt=Ue[Ge],Lt=Ue[Ge+1],mt=Math.max(yt.paddingRight,Di),Vt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ae.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[Ge]-yt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ie(ht-mt),width:Ie(mt),height:"100%"}}),a.jsx("div",{"data-controls":rt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[Ge+1]-Lt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ie(ht),width:Ie(Vt),height:"100%"}})]},`${Ae.paddingRightKey}-padding`)}),u&&!ne&<.slice(0,-1).map((Ae,Ge)=>{const rt=Ky(Ge,We,Le,Ye),yt=We.slice(0,Ge+1).reduce((Lt,mt)=>Lt+mt,0)-zl/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ae.widthKey,"data-controls-axis":"x","data-controls-min":String(Xs),"data-controls-max-fraction":String(rt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ie(yt),width:Ie(zl),height:"calc(100%)",pointerEvents:"auto"}})},`${Ae.widthKey}-junction`)})]}),Ze&&(()=>{const Ae=Hr(e,Hn),Ge=Py(e.cutLabelVerticalAlign),rt=Ae.textTextAlign==="justify"||ne;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ie(S??0),cursor:Xe?"pointer":"default",...vy(He,f??0,n??!1)},onClick:Xe?ze:void 0,onMouseEnter:U||b?Tt:void 0,onMouseLeave:U?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...ne?{paddingLeft:Ie(ae),paddingRight:Ie(ae)}:{},justifyContent:Ey(Ae.textTextAlign),alignItems:Hl(Ge)},children:a.jsx("span",{className:Ol(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Dl(Ae,n),...Bl(e,Hn,c,n),...rt?{width:"100%"}:{}},children:z})})})})(),b&&k&&(()=>{const Ae=`${k.widthPx}px`,Ge={width:Ae,height:"auto",maxHeight:Ae,objectFit:"contain"};return a.jsx("div",{ref:me,className:`${c}-hover-media-anchor`,children:a.jsx(fy,{media:k,className:k.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ge},`${k.rowId}-${k.url}`)})})()]})})]})}const tv=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10225
10225
|
import { CommonComponentProps } from '../props';
|
|
10226
10226
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10227
10227
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13474,7 +13474,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13474
13474
|
pointer-events: none;
|
|
13475
13475
|
z-index: 2;
|
|
13476
13476
|
}
|
|
13477
|
-
`}function Kl(e,t,n,i,o,r,l,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:r??0,textAppearance:l,color:d??"#000000"}}function Cv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=W.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:v="solid",entryHoverEffect:w="default",autoclose:m="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:x=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:S="#000000",dividerColor:
|
|
13477
|
+
`}function Kl(e,t,n,i,o,r,l,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:r??0,textAppearance:l,color:d??"#000000"}}function Cv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=W.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:v="solid",entryHoverEffect:w="default",autoclose:m="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:x=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:S="#000000",dividerColor:z="#0000001F",iconColor:N="#000000",questionHoverColor:Y="#666666",iconHoverColor:B="#666666",iconActiveColor:T="#000000",dividerHoverColor:H="#000000",questionFontFamily:$,questionFontSettings:I,questionFontSize:P,questionLineHeight:M,questionLetterSpacing:g,questionWordSpacing:D,questionTextAppearance:A,answerFontFamily:X,answerFontSettings:ie,answerFontSize:L,answerLineHeight:_,answerLetterSpacing:V,answerWordSpacing:se,answerTextAppearance:re,questionPaddingLeft:k=0,questionPaddingTop:le=0,questionPaddingBottom:G=0,answerPaddingLeft:b=0,answerPaddingRight:E=0,answerPaddingTop:j=0,answerPaddingBottom:me=0}=e,K=t??[],[te,O]=s.useState(()=>new Set),J=!n||i;s.useEffect(()=>{O(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&O(new Set)},[n,o,i]);const ne=Ue=>W.scalingValue(Ue,n??!1),Pe=Math.max(k,Vn),be=Math.max(le,Vn),Re=Math.max(G,Vn),ue=Math.max(b,Vn),fe=Math.max(E,Vn),$e=Math.max(j,Vn),Q=Math.max(me,Vn),Z=Math.max(0,(c??1)-x-f),ae=Math.max(0,(c??1)-E),xe=Math.max(0,(c??1)-b),ke=Math.max(x,Vn),Ce=Math.max(0,(c??1)-k-f),q=s.useMemo(()=>te.size===0?0:Math.min(...te),[te]),ye=s.useCallback(Ue=>te.has(Ue),[te]),ce=J&&w==="default"?`${l}-entry-hover-default`:"",U=h??"",de=U!=="",He=C.replace(/^rotate /,""),he=`${l}-icon-anim-${He}`,ee=an(Ut(Kl($,I,P,M,g,D,A,y),n)),Je=an(Ut(Kl(X,ie,L,_,V,se,re,S),n)),Ne=Yl(P,M,`${l}-question`,`${l}-text-tight-leading`),ct=Yl(L,_,`${l}-answer-text`,`${l}-text-tight-leading`),Ke=Ul(P,M,l,n),ut=Ul(L,_,l,n),lt=W.buildColorVars(l,{questionColor:y,answerColor:S,dividerColor:z,iconColor:N,questionHoverColor:Y,iconHoverColor:B,iconActiveColor:T,dividerHoverColor:H},xv,bv),Ye=r&&r!=="default"?`${l}-state-${r}`:"",Le=s.useCallback(Ue=>{J&&O(ge=>{if(ge.has(Ue)){const _e=new Set(ge);return _e.delete(Ue),_e}if(m==="on")return new Set([Ue]);const ve=new Set(ge);return ve.add(Ue),ve})},[J,m]),We=s.useMemo(()=>Sv(l),[l]),Be={[`--${l}-divider-width`]:W.scalingValue(p,n??!1),[`--${l}-divider-style`]:v,[`--${l}-icon-max-width`]:W.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:W.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:We}}),a.jsx("div",{style:lt,children:a.jsx("div",{className:pt(`${l}-wrapper`,n&&!i&&`${l}-editor`,ce,Ye),style:{width:W.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:K.map((Ue,ge)=>{var Xe;const ve=ye(ge),_e=((Xe=Ue.question)==null?void 0:Xe.trim())??"",Ze=Ue.answer,we=((Ze==null?void 0:Ze.length)??0)>0,Te=d&&ge===q;return a.jsxs("div",{className:pt(`${l}-item`,ve&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Te&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:ne(be)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ne(Pe),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:ne(ke),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ve,style:{...ee,...Ke,paddingLeft:ne(k),paddingRight:ne(x)},onClick:()=>Le(ge),children:[le>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:ne(le)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Ne,children:_e}),we&&(de?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${he}`,"aria-hidden":"true",children:a.jsx(sn,{url:U,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):a.jsx("span",{className:`${l}-icon ${l}-icon-default ${he}`,"aria-hidden":"true"}))]}),G>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:ne(G)},"aria-hidden":"true"})]}),Te&&a.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ne(Re)}})]}),we&&Ze&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!ve,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Te&&ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:ne($e)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ae),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ne(ue),height:"100%"}}),a.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(xe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:ne(fe),height:"100%"}})]}),j>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:ne(j)}}),a.jsx("div",{className:`${l}-answer`,style:{...Je,...ut,paddingLeft:ne(b),paddingRight:ne(E)},children:a.jsx("div",{className:ct,children:a.jsx(Ri,{content:Ze})})}),me>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:ne(me)}}),Te&&ve&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ne(Q)}})]})})})]},ge)})})})]})}const $v=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13478
13478
|
import cn from 'classnames';
|
|
13479
13479
|
import { CommonComponentProps } from '../props';
|
|
13480
13480
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14222,7 +14222,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14222
14222
|
</>
|
|
14223
14223
|
);
|
|
14224
14224
|
}
|
|
14225
|
-
`;function Gn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Zl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Tv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Iv={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:Gn("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...Zl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...Zl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:Gn("Question Padding Left"),questionPaddingTop:Gn("Question Padding Top"),questionPaddingBottom:Gn("Question Padding Bottom"),answerPaddingLeft:Gn("Answer Padding Left"),answerPaddingRight:Gn("Answer Padding Right"),answerPaddingTop:Gn("Answer Padding Top"),answerPaddingBottom:Gn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...Tv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Rv={element:Cv,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Iv,sourceCode:$v},Dn=e=>e.display==="cover",aa=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Jl=100,Lv=.2,Ql=8,Od=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Jl:Math.max(Jl,window.innerHeight*Lv),[]),v=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),w=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const I=typeof window<"u"?window.innerHeight:800,P=Math.max(.88,1-$/I*.12);return`translateY(${$}px) scale(${P})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),x=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),C=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const P=$.clientX-I.startX,E=$.clientY-I.startY;if(I.isLocked===null){if(Math.abs(P)<Ql&&Math.abs(E)<Ql)return;if(E>0&&E>Math.abs(P))I.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{I.isLocked=!1,h();return}}if(!I.isLocked)return;$.preventDefault();const g=Math.max(0,E);u.current=g,r(g)},[e,h]),S=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const P=I.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!P){h();return}$.clientY-I.startY>=p?x():f()},[p,x,e,h,f]),B=s.useCallback($=>{S($)},[S]),N=s.useCallback($=>{S($)},[S]),q=o>0,D=l?`transform ${n}ms ease`:"none",T=l?`opacity ${n}ms ease`:"none",H=o>0||l;return{isSwipeDragging:q,backdropStyle:{opacity:v(o),transition:T},mediaAreaStyle:{transform:m(o),transition:D,touchAction:q?"none":void 0,willChange:q?"transform":void 0},overlayContentStyle:H?{opacity:w(o),transition:T}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:B,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:q?"none":"pan-x"}:void 0}},Pv="[data-lightbox-scrollable]",Bd=()=>{s.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,r=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(Pv)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},Ev=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Mv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},kv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Av=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Mv(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const w=()=>{t.removeEventListener("transitionend",m),clearTimeout(v)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,w(),u(n,!0))};return t.addEventListener("transitionend",m),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,w(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-kv(t),!1))}},Lo=300,Fv=900,_v=1500,Nv="cubic-bezier(0.16, 1, 0.3, 1)",Wv=3e3,Hv=2,Dv=16,Ov=.05,Bv=1,gr=.3,zv=50,jv=20,Ai=.004,io=["title1","title2","title3"],Vv={title1:"1",title2:"2",title3:"3"},Gv={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Xv={title1:.02,title2:.02,title3:.02},hr=e=>`max(${e}, ${jv}px)`,qv=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},Yv=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=qv(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Uv=e=>[Gt(e,"fontFamily"),Gt(e,"fontSettings"),{type:"row",items:[Gt(e,"fontSize"),Gt(e,"lineHeight"),Gt(e,"letterSpacing"),Gt(e,"wordSpacing")]},Gt(e,"textAlign"),Gt(e,"textAppearance")],Kv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(io.map(e=>[Vv[e],Uv(e)]))}),Ys=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},zd=(e,t)=>Ys(e,t),fr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ec=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ys(e.length,n),effective:zd(e.length,n)}},Zv=(e,t,n,i,o,r,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},Ma=(e,t)=>{const n=i=>{const o=Gt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Gv[t]]}},Jv=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ka=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Xv[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},Qv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:w,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:B,title1Width:N,title2Width:q,title3Width:D,title1MarginLeft:T=0,title2MarginLeft:H=0,title3MarginLeft:$=0,titleRowMarginBottom:I=0,titleHeaderLayout:P="desktop",contentMarginTop:E,iconMarginLeft:g}=n,z=R=>W.scalingValue(R,i??!1),F=c??n.thumnailSize??.03,X=z(F),ie=z(u),L=z(p??.02),_=z(v??0),V=z(E??0),ae=hr(V),re=z(g??0),[M,se]=s.useState(0),j=s.useRef(M);j.current=M;const b=t[M],{title1:k,title2:G,title3:he}=Yv(b),J=ka("title1",Ma(n,"title1"),i),ee=ka("title2",Ma(n,"title2"),i),O=ka("title3",Ma(n,"title3"),i),Z=P==="mobile",te=!o&&(!i||r),Le=te,ve=te,Ie=te,pe=Dn(y),oe=pe?{"--image-aspect-ratio":aa(y)}:void 0,ye=!!(k||G||he),U=s.useMemo(()=>Zv(e,k,G,he,J,ee,O),[e,M,k,G,he,J,ee,O]),ce=s.useMemo(()=>({title1Width:N,title2Width:q,title3Width:D}),[N,q,D]),le=s.useMemo(()=>U.map(R=>ce[R.widthKey]),[U,ce]),Ce=s.useMemo(()=>Ys(U.length,le),[U.length,le]),Fe=s.useMemo(()=>zd(U.length,le),[U.length,le]),Ee=s.useMemo(()=>U.filter(R=>R.prefix==="title1"),[U]),Y=s.useMemo(()=>U.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[U]),be=s.useMemo(()=>ec(Ee,ce),[Ee,ce]),de=s.useMemo(()=>ec(Y,ce),[Y,ce]),K=s.useCallback((R,ne)=>{const me=U.indexOf(R);if(!Z||ne==="single-row")return{effectiveWidth:Fe[me]??0,resolvedWidth:Ce[me]??0,maxWidth:fr(me,Ce)};if(ne==="two-row-top"){const je=Ee.indexOf(R);return{effectiveWidth:be.effective[je]??0,resolvedWidth:be.resolved[je]??0,maxWidth:fr(je,be.resolved)}}const Me=Y.indexOf(R);return{effectiveWidth:de.effective[Me]??0,resolvedWidth:de.resolved[Me]??0,maxWidth:fr(Me,de.resolved)}},[Y,de,Fe,Ce,U,Ee,be,Z]),ue=s.useCallback(R=>W.scalingValue(R,i??!1),[i]),He=ue(I??0),fe=s.useMemo(()=>({title1MarginLeft:T,title2MarginLeft:H,title3MarginLeft:$}),[T,H,$]),Q=s.useCallback(R=>U.slice(0,R+1).reduce((ne,me,Me)=>ne+(me!=null&&me.marginLeftKey?fe[me.marginLeftKey]??0:0)+(Ce[Me]??0),0)+(Z?0:T??0),[U,fe,Ce,Z,T]),Je=s.useCallback(()=>Z?0:T??0,[Z,T]),Ne=s.useCallback(R=>Y.slice(0,R).reduce((ne,me,Me)=>ne+(me.marginLeftKey?fe[me.marginLeftKey]??0:0)+(de.resolved[Me]??0),0),[Y,de.resolved,fe]),ct=s.useCallback(R=>{const ne=Y[R];return Ne(R)+(ne.marginLeftKey?fe[ne.marginLeftKey]??0:0)+(de.resolved[R]??0)},[Y,de.resolved,Ne,fe]),Ke=(R,ne)=>{const me=R.marginLeftKey?fe[R.marginLeftKey]??0:0,{effectiveWidth:Me,resolvedWidth:je,maxWidth:et}=K(R,ne),bt=o&&ne==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...ne==="single-row"?{gridArea:R.prefix}:{},width:ue(Me),...me>0?{marginLeft:ue(me)}:{}},children:[a.jsx("p",{className:R.className,style:R.style,children:R.text}),bt&&R.marginLeftKey&&a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:ue(-me),width:`max(${ue(me)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(et),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:ue(-Ai/2),width:ue(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},ut=()=>{const R=Z?-1:U.findIndex(Me=>Me.prefix==="title1"),ne=!Z&&(o||(T??0)>0)?(()=>{const Me=T??0,je=R>=0?Ce[R]:N??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${ue(Me)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,me=U.flatMap((Me,je)=>{if(!Me.marginLeftKey)return[];const et=fe[Me.marginLeftKey]??0,bt=Jv(U,Ce,fe,je)+Je();return a.jsx("div",{"data-controls":Me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ce[je]),style:{position:"absolute",top:0,left:ue(bt),width:`max(${ue(et)}, 10px)`,height:"100%",pointerEvents:"auto"}},Me.marginLeftKey)});return ne?[ne,...me]:me},lt=()=>U.map((R,ne)=>{const me=fr(ne,Ce),je=Q(ne)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(me),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ue(je),width:ue(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),Ye=()=>Y.flatMap((R,ne)=>{if(!R.marginLeftKey)return[];const me=fe[R.marginLeftKey]??0,Me=Ne(ne),{resolvedWidth:je}=K(R,"two-row-bottom");return a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:ue(Me),width:`max(${ue(me)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Re=()=>Y.map((R,ne)=>{const{maxWidth:me}=K(R,"two-row-bottom"),je=ct(ne)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(me),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ue(je),width:ue(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),We=s.useRef(null),Be=s.useRef(null),Ue=s.useRef(null),ge=s.useRef(null),xe=s.useRef([]),_e=s.useRef([]),Ze=s.useRef(0),we=s.useRef(null),$e=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Xe=s.useRef(null),ze=s.useRef(null),Te=s.useRef(0),Ve=s.useRef("forward"),De=s.useRef(0),tt=s.useRef(null),nt=s.useRef(!1),st=t.length>1&&(!o||!!r),St=st?3:1,Bt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[zt,ft]=s.useState(!1),[wt,jt]=s.useState(!1),[At,xt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Kt=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Le&&!At,gt=s.useCallback(()=>{Le&&(xt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{$e.current.isActive||xt(!1)},Wv))},[Le]),ke=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,jt(!1),Tt.current=setTimeout(()=>{l()},Lo))},[o,l]),Ge=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:W.scalingValue(m??0,i),height:W.scalingValue(m??0,i),marginRight:re,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:ke,"aria-label":"Close",children:a.jsx(sn,{url:w,fill:h,hoverFill:i&&!r?h:f,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:re,height:"100%",pointerEvents:"auto"}})]}),rt=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ue(T??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=U.find(Me=>Me.prefix==="title1"),ne=U.filter(Me=>Me.prefix==="title2"||Me.prefix==="title3"),me=ne.length>0||o||(I??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(T??0)>0||o?rt():null,R&&Ke(R,"two-row-top"),w&&Ge()]}),me?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ne.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ne.map(Me=>Ke(Me,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ye(),Re()]})]}):null,a.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:He,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},yt=()=>a.jsxs(a.Fragment,{children:[(T??0)>0||o?rt("single-row"):null,U.map(R=>Ke(R,"single-row")),o?a.jsxs(a.Fragment,{children:[ut(),lt()]}):null,w?Ge():null]}),Lt=s.useCallback(R=>!!(R.closest("[data-controls]")||R.closest(`.${e}-thumbnails`)||R.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:Vt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Xt,dismissAreaStyle:qt}=Od({enabled:te??!1,onClose:ke,animMs:Lo,isBlockedTarget:Lt}),Ht=()=>{if(!st||t.length===0)return Ze.current=0,0;const R=_e.current[0],ne=_e.current[t.length];if(!R||!ne)return Ze.current;const me=ne.offsetLeft-R.offsetLeft;return me>0&&(Ze.current=me),Ze.current},Dt=(R=!1)=>{if(!st)return;const ne=Be.current,me=Ht();!ne||me<=0||me<ne.clientWidth*.25||(ne.scrollLeft<=0?(ne.scrollLeft+=me,R&&($e.current.scrollLeft+=me),nt.current&&(De.current+=me)):ne.scrollLeft>=me*2&&(ne.scrollLeft-=me,R&&($e.current.scrollLeft-=me),nt.current&&(De.current-=me)))},_t=(R,ne=(me=>(me=Be.current)==null?void 0:me.scrollLeft)()??0)=>{if(!st)return R;let Me=t.length+R,je=1/0;for(let et=0;et<St;et++){const bt=et*t.length+R,Rt=_e.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-ne);tn<je&&(je=tn,Me=bt)}return Me},Ct=R=>{const ne=Be.current;return!R||!ne?!1:R.offsetWidth>ne.clientWidth+1},A=R=>{const ne=Be.current;if(!R||!ne||!Ct(R))return!1;const me=R.offsetLeft,Me=me+R.offsetWidth;return ne.scrollLeft>=me-1&&ne.scrollLeft+ne.clientWidth<=Me+1},Pe=(R=(ne=>(ne=Be.current)==null?void 0:ne.scrollLeft)()??0)=>{for(let Me=0;Me<_e.current.length;Me+=1){const je=_e.current[Me];if(je&&A(je))return Me}let me={flatIndex:0,distance:1/0};return _e.current.forEach((Me,je)=>{if(!Me)return;const et=Math.abs(Me.offsetLeft-R);et<me.distance&&(me={flatIndex:je,distance:et})}),me.flatIndex},Ae=R=>{Be.current&&_e.current.forEach(ne=>{ne&&(ne.style.scrollSnapAlign=Ct(ne)&&R==="backward"?"end":"start")})},Oe=(R,ne,me)=>{const Me=R-ne,je=Pe(ne),et=_e.current[je];if(A(et))return Pe(R)%t.length;const bt=_e.current[je+1],Rt=et?bt?bt.offsetLeft-et.offsetLeft:et.offsetWidth:0,tn=Rt>0?Me>Rt*gr?1:Me<-Rt*gr?-1:0:0;return tn===0?me:st?(me+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,me+tn))},at=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const ne=ge.current,me=j.current,Me=xe.current[me];if(!ne||!Me||ne.scrollWidth<=ne.clientWidth)return;const je=ne.scrollLeft,et=je+ne.clientWidth,bt=Me.offsetLeft,Rt=bt+Me.offsetWidth;if(bt>=je&&Rt<=et)return;const tn=ne.scrollWidth-ne.clientWidth;let Qt=je;if(!R&&Ft.current===null){const Ei=xe.current[me-1],mo=xe.current[me+1],or=Ei?Me.offsetLeft-Ei.offsetLeft:mo?mo.offsetLeft-Me.offsetLeft:Me.offsetWidth;Rt>et?Qt+=or:bt<je&&(Qt-=or)}else Rt>et?Qt=Rt-ne.clientWidth:Qt=bt;ne.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Kt.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const ne=Kt.current;Kt.current=!1,at(ne)}))},[at]),it=s.useCallback(R=>{if(R===j.current)return;const ne=j.current;j.current=R;const me=Math.abs(R-ne)>1,Me=st&&t.length>1&&(ne===t.length-1&&R===0||ne===0&&R===t.length-1);se(R),Et(me||Me)},[t.length,st,Et]),vt=()=>{if(!Be.current||t.length===0||Ft.current!==null||$e.current.isActive&&$e.current.hasMoved)return;const R=Be.current.scrollLeft,ne=Pe(R)%t.length;ne!==j.current&&it(ne)},Ot=()=>{Ft.current=null},It=R=>{const ne=Be.current;ne&&(ne.style.scrollSnapType=R?"":"none")},nn=()=>{var R;(R=ze.current)==null||R.call(ze),ze.current=null},un=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),nt.current=!1},li=()=>{const R=Be.current;if(!R){tt.current=null,nt.current=!1;return}const ne=De.current-R.scrollLeft;if(Math.abs(ne)<.5){R.scrollLeft=De.current,Dt(),vt(),tt.current=null,nt.current=!1;return}R.scrollLeft+=ne*Ov,Dt(),vt(),gt(),tt.current=requestAnimationFrame(li)},ci=()=>{const R=Ue.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},er=(R,ne,me,Me)=>{ci(),R.scrollLeft=ne,Te.current=R.scrollLeft,Dt(),me!==void 0?(j.current=me,se(me)):vt(),It(!0),Me==null||Me()},tr=(R,{behavior:ne="smooth",activeIndex:me,onComplete:Me}={})=>{const je=Be.current,et=Ue.current;if(!je||!et)return;if(un(),nn(),It(!1),ne==="auto"){er(je,R,me,Me);return}const bt=Math.abs(R-je.scrollLeft),Rt=Ev(bt,Fv,_v,je.clientWidth*.55);ze.current=Av(je,et,R,{duration:Rt,easing:Nv,onComplete:()=>{ze.current=null,er(je,R,me,Me)}})},la=(R="smooth")=>{const ne=Be.current;if(!ne||t.length===0)return;const me=Pe()%t.length,Me=_t(me,ne.scrollLeft),je=_e.current[Me];je&&tr(je.offsetLeft,{behavior:R,activeIndex:me})},ca=(R,ne="smooth",me,Me)=>{const je=Be.current;if(!je||t.length===0)return;const et=(Me??je.scrollLeft)-R,bt=Pe(R),Rt=_e.current[bt];if(A(Rt)){It(!0),vt();return}const tn=_e.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?et>Qt*gr?1:et<-Qt*gr?-1:0:0)!==0){const fu=me??bt%t.length,yu=Oe(Me??je.scrollLeft,R,fu);$n(yu,ne);return}const mo=Me??je.scrollLeft,or=Pe(mo),Zs=_e.current[or];if(Zs&&Math.abs(Zs.offsetLeft-mo)<1){It(!0),vt();return}la("auto")},$n=(R,ne="smooth")=>{const me=Be.current;if(!me||t.length===0)return;const Me=_t(R,me.scrollLeft),je=_e.current[Me];je&&(ne==="smooth"?Ft.current=R:Ft.current=null,j.current=R,se(R),Et(!0),tr(je.offsetLeft,{behavior:ne,activeIndex:R,onComplete:ne==="smooth"?Ot:void 0}))},Pi=()=>{Xe.current&&(window.removeEventListener("pointerup",Xe.current),window.removeEventListener("pointercancel",Xe.current),Xe.current=null)},nr=(R,ne,me,Me,je)=>{const et=me-R,bt=Me-ne,Rt=Math.abs(et),tn=Math.abs(bt);if(Rt<zv||Rt<=tn)return!1;const Qt=et<0?1:-1,Ei=st?(je+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+Qt));return Ei===je?!1:($n(Ei),!0)},di=R=>{if(!$e.current.isActive)return;Pi();const ne=Be.current;if(!ne)return;const{scrollLeft:me,startActiveIndex:Me,hasMoved:je}=$e.current,et=ne.scrollLeft;Dt(!0),$e.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ft(!1),R!==void 0&&ne.hasPointerCapture(R)&&ne.releasePointerCapture(R),je?ca(me,"smooth",Me,et):(It(!0),vt()),gt()},ir=(R,ne)=>{const me=we.current;we.current=null,me&&(nr(me.startX,me.startY,R,ne,me.startActiveIndex),gt())},da=R=>{if(!ve)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;we.current={startX:R.clientX,startY:R.clientY,startActiveIndex:j.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const ne=Be.current;if(!ne)return;un(),nn(),ci(),Ft.current=null,$e.current={isActive:!0,startX:R.clientX,scrollLeft:ne.scrollLeft,startActiveIndex:j.current,hasMoved:!1},It(!1),gt(),ne.setPointerCapture(R.pointerId),Pi();const me=Me=>{Me.pointerType==="mouse"&&di(Me.pointerId)};Xe.current=me,window.addEventListener("pointerup",me),window.addEventListener("pointercancel",me)},ua=R=>{if(!ve||R.pointerType!=="mouse")return;const ne=Be.current;if(!ne||!$e.current.isActive)return;if(R.buttons===0){di(R.pointerId);return}const me=R.clientX-$e.current.startX;Math.abs(me)>Bv&&($e.current.hasMoved=!0,ft(!0)),$e.current.hasMoved&&(R.preventDefault(),ne.scrollLeft=$e.current.scrollLeft-me,Dt(!0),vt(),gt())},Se=R=>{if(ve){if(R.pointerType==="touch"){R.type==="pointerup"?ir(R.clientX,R.clientY):we.current=null;return}R.pointerType==="mouse"&&di(R.pointerId)}},qe=R=>{!ve||R.pointerType!=="mouse"||di(R.pointerId)};return Bd(),s.useEffect(()=>{const R=requestAnimationFrame(()=>jt(!0));return()=>{cancelAnimationFrame(R),nn(),Pi(),Nt.current!==null&&(cancelAnimationFrame(Nt.current),Nt.current=null),Tt.current&&clearTimeout(Tt.current),Wt.current&&clearTimeout(Wt.current)}},[]),s.useEffect(()=>{if(!Le){xt(!0);return}gt();const R=We.current;if(!R)return;const ne=()=>gt();return R.addEventListener("pointermove",ne),R.addEventListener("pointerdown",ne),()=>{R.removeEventListener("pointermove",ne),R.removeEventListener("pointerdown",ne),Wt.current&&clearTimeout(Wt.current)}},[Le,gt]),s.useEffect(()=>{const R=ne=>{ne.key==="Escape"&&ke()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[ke]),s.useLayoutEffect(()=>{Ht()},[_,t.length,st]),s.useLayoutEffect(()=>{o||$n(j.current,"auto")},[_,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,st]),s.useEffect(()=>{const R=Be.current;if(!R||o||!te)return;const ne=me=>{if(me.preventDefault(),Math.abs(me.deltaY)<=Math.abs(me.deltaX))return;const Me=me.deltaMode===1?Dv:me.deltaMode===2?R.clientHeight:1,je=me.deltaY*Me*Hv;if(je!==0){if(nn(),nt.current||(nt.current=!0,De.current=R.scrollLeft,Ft.current=null,It(!1)),De.current+=je,!st){const et=R.scrollWidth-R.clientWidth;De.current=Math.max(0,Math.min(et,De.current))}gt(),tt.current===null&&(tt.current=requestAnimationFrame(li))}};return R.addEventListener("wheel",ne,{passive:!1}),()=>{R.removeEventListener("wheel",ne),un()}},[o,te,st]),s.useEffect(()=>{const R=Be.current;if(!R)return;const ne=()=>{Dt($e.current.isActive);const Me=R.scrollLeft,je=Me-Te.current;Te.current=Me;const et=Ze.current>0?Ze.current*.5:1/0;if(je!==0&&Math.abs(je)<et){const bt=je>0?"forward":"backward";bt!==Ve.current&&(Ve.current=bt,Ae(bt))}$e.current.isActive&&$e.current.hasMoved||vt()};R.addEventListener("scroll",ne,{passive:!0});const me=new ResizeObserver(()=>{Ht(),Dt($e.current.isActive),Ae(Ve.current),vt()});return me.observe(R),()=>{nn(),R.removeEventListener("scroll",ne),me.disconnect()}},[t.length,st]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||ke()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${Lo}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:qt,...Xt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ve&&t.length>0?"true":"false","data-mouse-dragging":zt?"true":"false",onPointerDown:da,onPointerMove:ua,onPointerUp:Se,onPointerCancel:Se,onLostPointerCapture:qe,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:_},children:Bt.map((R,ne)=>{const me=R.image.objectFit??"contain",Me=ne%t.length,je=Math.floor(ne/t.length),et=hr(_),bt=`calc(-0.5 * (${et} + ${_}))`;return a.jsxs("div",{ref:Rt=>_e.current[ne]=Rt,className:`${e}-strip-item`,style:{height:P==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:R.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:me}}),o&&Me<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:et,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${R.image.url}-${Me}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:V,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:ae,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${Z?` ${e}-lightbox-content-area-stacked`:""}`,children:(ye||w)&&a.jsx("div",{className:`${e}-header ${Z?`${e}-header-two-row`:`${e}-header-single-row`}`,children:Z?ht():ye||w?yt():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=hr(L),ne=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:ge,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:me=>me.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ie,"--thumbnail-active-color":B},children:[t.map((me,Me)=>{const je=hr(ie),et=`calc(-0.5 * (${je} + ${ie}))`;return a.jsxs("div",{ref:bt=>{xe.current[Me]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":M===Me?"true":"false",onClick:()=>te&&x==="click"&&$n(Me),onMouseEnter:()=>Ie&&x==="hover"&&$n(Me),"aria-label":me.image.name?`View ${me.image.name}`:`View image ${Me+1}`,"aria-current":M===Me?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${pe?` ${e}-thumb-image-cover`:""}`,src:me.image.url,alt:"",draggable:!1,style:{...oe,maxWidth:X,maxHeight:X,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Me<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:et,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${me.image.url}-${Me}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:ne,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ex(e){return`
|
|
14225
|
+
`;function Gn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Zl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Tv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Iv={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:Gn("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...Zl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...Zl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:Gn("Question Padding Left"),questionPaddingTop:Gn("Question Padding Top"),questionPaddingBottom:Gn("Question Padding Bottom"),answerPaddingLeft:Gn("Answer Padding Left"),answerPaddingRight:Gn("Answer Padding Right"),answerPaddingTop:Gn("Answer Padding Top"),answerPaddingBottom:Gn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...Tv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Rv={element:Cv,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Iv,sourceCode:$v},Dn=e=>e.display==="cover",aa=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Jl=100,Lv=.2,Ql=8,Od=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Jl:Math.max(Jl,window.innerHeight*Lv),[]),v=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),w=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const I=typeof window<"u"?window.innerHeight:800,P=Math.max(.88,1-$/I*.12);return`translateY(${$}px) scale(${P})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),x=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),C=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const P=$.clientX-I.startX,M=$.clientY-I.startY;if(I.isLocked===null){if(Math.abs(P)<Ql&&Math.abs(M)<Ql)return;if(M>0&&M>Math.abs(P))I.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{I.isLocked=!1,h();return}}if(!I.isLocked)return;$.preventDefault();const g=Math.max(0,M);u.current=g,r(g)},[e,h]),S=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const P=I.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!P){h();return}$.clientY-I.startY>=p?x():f()},[p,x,e,h,f]),z=s.useCallback($=>{S($)},[S]),N=s.useCallback($=>{S($)},[S]),Y=o>0,B=l?`transform ${n}ms ease`:"none",T=l?`opacity ${n}ms ease`:"none",H=o>0||l;return{isSwipeDragging:Y,backdropStyle:{opacity:v(o),transition:T},mediaAreaStyle:{transform:m(o),transition:B,touchAction:Y?"none":void 0,willChange:Y?"transform":void 0},overlayContentStyle:H?{opacity:w(o),transition:T}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:z,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:Y?"none":"pan-x"}:void 0}},Pv="[data-lightbox-scrollable]",Bd=()=>{s.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,r=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(Pv)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},Ev=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Mv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},kv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Av=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Mv(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const w=()=>{t.removeEventListener("transitionend",m),clearTimeout(v)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,w(),u(n,!0))};return t.addEventListener("transitionend",m),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,w(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-kv(t),!1))}},Lo=300,Fv=900,_v=1500,Nv="cubic-bezier(0.16, 1, 0.3, 1)",Wv=3e3,Hv=2,Dv=16,Ov=.05,Bv=1,gr=.3,zv=50,jv=20,Ai=.004,io=["title1","title2","title3"],Vv={title1:"1",title2:"2",title3:"3"},Gv={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Xv={title1:.02,title2:.02,title3:.02},hr=e=>`max(${e}, ${jv}px)`,qv=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},Yv=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=qv(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Uv=e=>[Gt(e,"fontFamily"),Gt(e,"fontSettings"),{type:"row",items:[Gt(e,"fontSize"),Gt(e,"lineHeight"),Gt(e,"letterSpacing"),Gt(e,"wordSpacing")]},Gt(e,"textAlign"),Gt(e,"textAppearance")],Kv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(io.map(e=>[Vv[e],Uv(e)]))}),Ys=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},zd=(e,t)=>Ys(e,t),fr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ec=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ys(e.length,n),effective:zd(e.length,n)}},Zv=(e,t,n,i,o,r,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},Ma=(e,t)=>{const n=i=>{const o=Gt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Gv[t]]}},Jv=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ka=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Xv[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},Qv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:w,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:z,title1Width:N,title2Width:Y,title3Width:B,title1MarginLeft:T=0,title2MarginLeft:H=0,title3MarginLeft:$=0,titleRowMarginBottom:I=0,titleHeaderLayout:P="desktop",contentMarginTop:M,iconMarginLeft:g}=n,D=R=>W.scalingValue(R,i??!1),A=c??n.thumnailSize??.03,X=D(A),ie=D(u),L=D(p??.02),_=D(v??0),V=D(M??0),se=hr(V),re=D(g??0),[k,le]=s.useState(0),G=s.useRef(k);G.current=k;const b=t[k],{title1:E,title2:j,title3:me}=Yv(b),K=ka("title1",Ma(n,"title1"),i),te=ka("title2",Ma(n,"title2"),i),O=ka("title3",Ma(n,"title3"),i),J=P==="mobile",ne=!o&&(!i||r),Pe=ne,be=ne,Re=ne,ue=Dn(y),fe=ue?{"--image-aspect-ratio":aa(y)}:void 0,$e=!!(E||j||me),Q=s.useMemo(()=>Zv(e,E,j,me,K,te,O),[e,k,E,j,me,K,te,O]),Z=s.useMemo(()=>({title1Width:N,title2Width:Y,title3Width:B}),[N,Y,B]),ae=s.useMemo(()=>Q.map(R=>Z[R.widthKey]),[Q,Z]),xe=s.useMemo(()=>Ys(Q.length,ae),[Q.length,ae]),ke=s.useMemo(()=>zd(Q.length,ae),[Q.length,ae]),Ce=s.useMemo(()=>Q.filter(R=>R.prefix==="title1"),[Q]),q=s.useMemo(()=>Q.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[Q]),ye=s.useMemo(()=>ec(Ce,Z),[Ce,Z]),ce=s.useMemo(()=>ec(q,Z),[q,Z]),U=s.useCallback((R,oe)=>{const pe=Q.indexOf(R);if(!J||oe==="single-row")return{effectiveWidth:ke[pe]??0,resolvedWidth:xe[pe]??0,maxWidth:fr(pe,xe)};if(oe==="two-row-top"){const je=Ce.indexOf(R);return{effectiveWidth:ye.effective[je]??0,resolvedWidth:ye.resolved[je]??0,maxWidth:fr(je,ye.resolved)}}const Me=q.indexOf(R);return{effectiveWidth:ce.effective[Me]??0,resolvedWidth:ce.resolved[Me]??0,maxWidth:fr(Me,ce.resolved)}},[q,ce,ke,xe,Q,Ce,ye,J]),de=s.useCallback(R=>W.scalingValue(R,i??!1),[i]),He=de(I??0),he=s.useMemo(()=>({title1MarginLeft:T,title2MarginLeft:H,title3MarginLeft:$}),[T,H,$]),ee=s.useCallback(R=>Q.slice(0,R+1).reduce((oe,pe,Me)=>oe+(pe!=null&&pe.marginLeftKey?he[pe.marginLeftKey]??0:0)+(xe[Me]??0),0)+(J?0:T??0),[Q,he,xe,J,T]),Je=s.useCallback(()=>J?0:T??0,[J,T]),Ne=s.useCallback(R=>q.slice(0,R).reduce((oe,pe,Me)=>oe+(pe.marginLeftKey?he[pe.marginLeftKey]??0:0)+(ce.resolved[Me]??0),0),[q,ce.resolved,he]),ct=s.useCallback(R=>{const oe=q[R];return Ne(R)+(oe.marginLeftKey?he[oe.marginLeftKey]??0:0)+(ce.resolved[R]??0)},[q,ce.resolved,Ne,he]),Ke=(R,oe)=>{const pe=R.marginLeftKey?he[R.marginLeftKey]??0:0,{effectiveWidth:Me,resolvedWidth:je,maxWidth:et}=U(R,oe),bt=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...oe==="single-row"?{gridArea:R.prefix}:{},width:de(Me),...pe>0?{marginLeft:de(pe)}:{}},children:[a.jsx("p",{className:R.className,style:R.style,children:R.text}),bt&&R.marginLeftKey&&a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:de(-pe),width:`max(${de(pe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(et),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:de(-Ai/2),width:de(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},ut=()=>{const R=J?-1:Q.findIndex(Me=>Me.prefix==="title1"),oe=!J&&(o||(T??0)>0)?(()=>{const Me=T??0,je=R>=0?xe[R]:N??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${de(Me)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,pe=Q.flatMap((Me,je)=>{if(!Me.marginLeftKey)return[];const et=he[Me.marginLeftKey]??0,bt=Jv(Q,xe,he,je)+Je();return a.jsx("div",{"data-controls":Me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe[je]),style:{position:"absolute",top:0,left:de(bt),width:`max(${de(et)}, 10px)`,height:"100%",pointerEvents:"auto"}},Me.marginLeftKey)});return oe?[oe,...pe]:pe},lt=()=>Q.map((R,oe)=>{const pe=fr(oe,xe),je=ee(oe)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:de(je),width:de(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),Ye=()=>q.flatMap((R,oe)=>{if(!R.marginLeftKey)return[];const pe=he[R.marginLeftKey]??0,Me=Ne(oe),{resolvedWidth:je}=U(R,"two-row-bottom");return a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:de(Me),width:`max(${de(pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Le=()=>q.map((R,oe)=>{const{maxWidth:pe}=U(R,"two-row-bottom"),je=ct(oe)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:de(je),width:de(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),We=s.useRef(null),Be=s.useRef(null),Ue=s.useRef(null),ge=s.useRef(null),ve=s.useRef([]),_e=s.useRef([]),Ze=s.useRef(0),we=s.useRef(null),Te=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Xe=s.useRef(null),ze=s.useRef(null),Ie=s.useRef(0),Ve=s.useRef("forward"),De=s.useRef(0),tt=s.useRef(null),nt=s.useRef(!1),st=t.length>1&&(!o||!!r),St=st?3:1,Bt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[zt,ft]=s.useState(!1),[wt,jt]=s.useState(!1),[At,xt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Kt=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Pe&&!At,gt=s.useCallback(()=>{Pe&&(xt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Te.current.isActive||xt(!1)},Wv))},[Pe]),Ae=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,jt(!1),Tt.current=setTimeout(()=>{l()},Lo))},[o,l]),Ge=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:W.scalingValue(m??0,i),height:W.scalingValue(m??0,i),marginRight:re,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ae,"aria-label":"Close",children:a.jsx(sn,{url:w,fill:h,hoverFill:i&&!r?h:f,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:re,height:"100%",pointerEvents:"auto"}})]}),rt=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:de(T??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=Q.find(Me=>Me.prefix==="title1"),oe=Q.filter(Me=>Me.prefix==="title2"||Me.prefix==="title3"),pe=oe.length>0||o||(I??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(T??0)>0||o?rt():null,R&&Ke(R,"two-row-top"),w&&Ge()]}),pe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[oe.map(Me=>Ke(Me,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ye(),Le()]})]}):null,a.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:He,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},yt=()=>a.jsxs(a.Fragment,{children:[(T??0)>0||o?rt("single-row"):null,Q.map(R=>Ke(R,"single-row")),o?a.jsxs(a.Fragment,{children:[ut(),lt()]}):null,w?Ge():null]}),Lt=s.useCallback(R=>!!(R.closest("[data-controls]")||R.closest(`.${e}-thumbnails`)||R.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:Vt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Xt,dismissAreaStyle:qt}=Od({enabled:ne??!1,onClose:Ae,animMs:Lo,isBlockedTarget:Lt}),Ht=()=>{if(!st||t.length===0)return Ze.current=0,0;const R=_e.current[0],oe=_e.current[t.length];if(!R||!oe)return Ze.current;const pe=oe.offsetLeft-R.offsetLeft;return pe>0&&(Ze.current=pe),Ze.current},Dt=(R=!1)=>{if(!st)return;const oe=Be.current,pe=Ht();!oe||pe<=0||pe<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=pe,R&&(Te.current.scrollLeft+=pe),nt.current&&(De.current+=pe)):oe.scrollLeft>=pe*2&&(oe.scrollLeft-=pe,R&&(Te.current.scrollLeft-=pe),nt.current&&(De.current-=pe)))},_t=(R,oe=(pe=>(pe=Be.current)==null?void 0:pe.scrollLeft)()??0)=>{if(!st)return R;let Me=t.length+R,je=1/0;for(let et=0;et<St;et++){const bt=et*t.length+R,Rt=_e.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-oe);tn<je&&(je=tn,Me=bt)}return Me},Ct=R=>{const oe=Be.current;return!R||!oe?!1:R.offsetWidth>oe.clientWidth+1},F=R=>{const oe=Be.current;if(!R||!oe||!Ct(R))return!1;const pe=R.offsetLeft,Me=pe+R.offsetWidth;return oe.scrollLeft>=pe-1&&oe.scrollLeft+oe.clientWidth<=Me+1},Ee=(R=(oe=>(oe=Be.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Me=0;Me<_e.current.length;Me+=1){const je=_e.current[Me];if(je&&F(je))return Me}let pe={flatIndex:0,distance:1/0};return _e.current.forEach((Me,je)=>{if(!Me)return;const et=Math.abs(Me.offsetLeft-R);et<pe.distance&&(pe={flatIndex:je,distance:et})}),pe.flatIndex},Fe=R=>{Be.current&&_e.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=Ct(oe)&&R==="backward"?"end":"start")})},Oe=(R,oe,pe)=>{const Me=R-oe,je=Ee(oe),et=_e.current[je];if(F(et))return Ee(R)%t.length;const bt=_e.current[je+1],Rt=et?bt?bt.offsetLeft-et.offsetLeft:et.offsetWidth:0,tn=Rt>0?Me>Rt*gr?1:Me<-Rt*gr?-1:0:0;return tn===0?pe:st?(pe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,pe+tn))},at=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const oe=ge.current,pe=G.current,Me=ve.current[pe];if(!oe||!Me||oe.scrollWidth<=oe.clientWidth)return;const je=oe.scrollLeft,et=je+oe.clientWidth,bt=Me.offsetLeft,Rt=bt+Me.offsetWidth;if(bt>=je&&Rt<=et)return;const tn=oe.scrollWidth-oe.clientWidth;let Qt=je;if(!R&&Ft.current===null){const Ei=ve.current[pe-1],mo=ve.current[pe+1],or=Ei?Me.offsetLeft-Ei.offsetLeft:mo?mo.offsetLeft-Me.offsetLeft:Me.offsetWidth;Rt>et?Qt+=or:bt<je&&(Qt-=or)}else Rt>et?Qt=Rt-oe.clientWidth:Qt=bt;oe.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Kt.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const oe=Kt.current;Kt.current=!1,at(oe)}))},[at]),it=s.useCallback(R=>{if(R===G.current)return;const oe=G.current;G.current=R;const pe=Math.abs(R-oe)>1,Me=st&&t.length>1&&(oe===t.length-1&&R===0||oe===0&&R===t.length-1);le(R),Et(pe||Me)},[t.length,st,Et]),vt=()=>{if(!Be.current||t.length===0||Ft.current!==null||Te.current.isActive&&Te.current.hasMoved)return;const R=Be.current.scrollLeft,oe=Ee(R)%t.length;oe!==G.current&&it(oe)},Ot=()=>{Ft.current=null},It=R=>{const oe=Be.current;oe&&(oe.style.scrollSnapType=R?"":"none")},nn=()=>{var R;(R=ze.current)==null||R.call(ze),ze.current=null},un=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),nt.current=!1},li=()=>{const R=Be.current;if(!R){tt.current=null,nt.current=!1;return}const oe=De.current-R.scrollLeft;if(Math.abs(oe)<.5){R.scrollLeft=De.current,Dt(),vt(),tt.current=null,nt.current=!1;return}R.scrollLeft+=oe*Ov,Dt(),vt(),gt(),tt.current=requestAnimationFrame(li)},ci=()=>{const R=Ue.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},er=(R,oe,pe,Me)=>{ci(),R.scrollLeft=oe,Ie.current=R.scrollLeft,Dt(),pe!==void 0?(G.current=pe,le(pe)):vt(),It(!0),Me==null||Me()},tr=(R,{behavior:oe="smooth",activeIndex:pe,onComplete:Me}={})=>{const je=Be.current,et=Ue.current;if(!je||!et)return;if(un(),nn(),It(!1),oe==="auto"){er(je,R,pe,Me);return}const bt=Math.abs(R-je.scrollLeft),Rt=Ev(bt,Fv,_v,je.clientWidth*.55);ze.current=Av(je,et,R,{duration:Rt,easing:Nv,onComplete:()=>{ze.current=null,er(je,R,pe,Me)}})},la=(R="smooth")=>{const oe=Be.current;if(!oe||t.length===0)return;const pe=Ee()%t.length,Me=_t(pe,oe.scrollLeft),je=_e.current[Me];je&&tr(je.offsetLeft,{behavior:R,activeIndex:pe})},ca=(R,oe="smooth",pe,Me)=>{const je=Be.current;if(!je||t.length===0)return;const et=(Me??je.scrollLeft)-R,bt=Ee(R),Rt=_e.current[bt];if(F(Rt)){It(!0),vt();return}const tn=_e.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?et>Qt*gr?1:et<-Qt*gr?-1:0:0)!==0){const fu=pe??bt%t.length,yu=Oe(Me??je.scrollLeft,R,fu);$n(yu,oe);return}const mo=Me??je.scrollLeft,or=Ee(mo),Zs=_e.current[or];if(Zs&&Math.abs(Zs.offsetLeft-mo)<1){It(!0),vt();return}la("auto")},$n=(R,oe="smooth")=>{const pe=Be.current;if(!pe||t.length===0)return;const Me=_t(R,pe.scrollLeft),je=_e.current[Me];je&&(oe==="smooth"?Ft.current=R:Ft.current=null,G.current=R,le(R),Et(!0),tr(je.offsetLeft,{behavior:oe,activeIndex:R,onComplete:oe==="smooth"?Ot:void 0}))},Pi=()=>{Xe.current&&(window.removeEventListener("pointerup",Xe.current),window.removeEventListener("pointercancel",Xe.current),Xe.current=null)},nr=(R,oe,pe,Me,je)=>{const et=pe-R,bt=Me-oe,Rt=Math.abs(et),tn=Math.abs(bt);if(Rt<zv||Rt<=tn)return!1;const Qt=et<0?1:-1,Ei=st?(je+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+Qt));return Ei===je?!1:($n(Ei),!0)},di=R=>{if(!Te.current.isActive)return;Pi();const oe=Be.current;if(!oe)return;const{scrollLeft:pe,startActiveIndex:Me,hasMoved:je}=Te.current,et=oe.scrollLeft;Dt(!0),Te.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ft(!1),R!==void 0&&oe.hasPointerCapture(R)&&oe.releasePointerCapture(R),je?ca(pe,"smooth",Me,et):(It(!0),vt()),gt()},ir=(R,oe)=>{const pe=we.current;we.current=null,pe&&(nr(pe.startX,pe.startY,R,oe,pe.startActiveIndex),gt())},da=R=>{if(!be)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;we.current={startX:R.clientX,startY:R.clientY,startActiveIndex:G.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const oe=Be.current;if(!oe)return;un(),nn(),ci(),Ft.current=null,Te.current={isActive:!0,startX:R.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:G.current,hasMoved:!1},It(!1),gt(),oe.setPointerCapture(R.pointerId),Pi();const pe=Me=>{Me.pointerType==="mouse"&&di(Me.pointerId)};Xe.current=pe,window.addEventListener("pointerup",pe),window.addEventListener("pointercancel",pe)},ua=R=>{if(!be||R.pointerType!=="mouse")return;const oe=Be.current;if(!oe||!Te.current.isActive)return;if(R.buttons===0){di(R.pointerId);return}const pe=R.clientX-Te.current.startX;Math.abs(pe)>Bv&&(Te.current.hasMoved=!0,ft(!0)),Te.current.hasMoved&&(R.preventDefault(),oe.scrollLeft=Te.current.scrollLeft-pe,Dt(!0),vt(),gt())},Se=R=>{if(be){if(R.pointerType==="touch"){R.type==="pointerup"?ir(R.clientX,R.clientY):we.current=null;return}R.pointerType==="mouse"&&di(R.pointerId)}},qe=R=>{!be||R.pointerType!=="mouse"||di(R.pointerId)};return Bd(),s.useEffect(()=>{const R=requestAnimationFrame(()=>jt(!0));return()=>{cancelAnimationFrame(R),nn(),Pi(),Nt.current!==null&&(cancelAnimationFrame(Nt.current),Nt.current=null),Tt.current&&clearTimeout(Tt.current),Wt.current&&clearTimeout(Wt.current)}},[]),s.useEffect(()=>{if(!Pe){xt(!0);return}gt();const R=We.current;if(!R)return;const oe=()=>gt();return R.addEventListener("pointermove",oe),R.addEventListener("pointerdown",oe),()=>{R.removeEventListener("pointermove",oe),R.removeEventListener("pointerdown",oe),Wt.current&&clearTimeout(Wt.current)}},[Pe,gt]),s.useEffect(()=>{const R=oe=>{oe.key==="Escape"&&Ae()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Ae]),s.useLayoutEffect(()=>{Ht()},[_,t.length,st]),s.useLayoutEffect(()=>{o||$n(G.current,"auto")},[_,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,st]),s.useEffect(()=>{const R=Be.current;if(!R||o||!ne)return;const oe=pe=>{if(pe.preventDefault(),Math.abs(pe.deltaY)<=Math.abs(pe.deltaX))return;const Me=pe.deltaMode===1?Dv:pe.deltaMode===2?R.clientHeight:1,je=pe.deltaY*Me*Hv;if(je!==0){if(nn(),nt.current||(nt.current=!0,De.current=R.scrollLeft,Ft.current=null,It(!1)),De.current+=je,!st){const et=R.scrollWidth-R.clientWidth;De.current=Math.max(0,Math.min(et,De.current))}gt(),tt.current===null&&(tt.current=requestAnimationFrame(li))}};return R.addEventListener("wheel",oe,{passive:!1}),()=>{R.removeEventListener("wheel",oe),un()}},[o,ne,st]),s.useEffect(()=>{const R=Be.current;if(!R)return;const oe=()=>{Dt(Te.current.isActive);const Me=R.scrollLeft,je=Me-Ie.current;Ie.current=Me;const et=Ze.current>0?Ze.current*.5:1/0;if(je!==0&&Math.abs(je)<et){const bt=je>0?"forward":"backward";bt!==Ve.current&&(Ve.current=bt,Fe(bt))}Te.current.isActive&&Te.current.hasMoved||vt()};R.addEventListener("scroll",oe,{passive:!0});const pe=new ResizeObserver(()=>{Ht(),Dt(Te.current.isActive),Fe(Ve.current),vt()});return pe.observe(R),()=>{nn(),R.removeEventListener("scroll",oe),pe.disconnect()}},[t.length,st]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Ae()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${Lo}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:qt,...Xt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":be&&t.length>0?"true":"false","data-mouse-dragging":zt?"true":"false",onPointerDown:da,onPointerMove:ua,onPointerUp:Se,onPointerCancel:Se,onLostPointerCapture:qe,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:_},children:Bt.map((R,oe)=>{const pe=R.image.objectFit??"contain",Me=oe%t.length,je=Math.floor(oe/t.length),et=hr(_),bt=`calc(-0.5 * (${et} + ${_}))`;return a.jsxs("div",{ref:Rt=>_e.current[oe]=Rt,className:`${e}-strip-item`,style:{height:P==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:R.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:pe}}),o&&Me<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:et,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${R.image.url}-${Me}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:V,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:se,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:($e||w)&&a.jsx("div",{className:`${e}-header ${J?`${e}-header-two-row`:`${e}-header-single-row`}`,children:J?ht():$e||w?yt():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=hr(L),oe=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:ge,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:pe=>pe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ie,"--thumbnail-active-color":z},children:[t.map((pe,Me)=>{const je=hr(ie),et=`calc(-0.5 * (${je} + ${ie}))`;return a.jsxs("div",{ref:bt=>{ve.current[Me]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":k===Me?"true":"false",onClick:()=>ne&&x==="click"&&$n(Me),onMouseEnter:()=>Re&&x==="hover"&&$n(Me),"aria-label":pe.image.name?`View ${pe.image.name}`:`View image ${Me+1}`,"aria-current":k===Me?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ue?` ${e}-thumb-image-cover`:""}`,src:pe.image.url,alt:"",draggable:!1,style:{...fe,maxWidth:X,maxHeight:X,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Me<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:et,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${pe.image.url}-${Me}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:oe,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ex(e){return`
|
|
14226
14226
|
.${e}-wrapper {
|
|
14227
14227
|
position: relative;
|
|
14228
14228
|
width: 100%;
|
|
@@ -15153,7 +15153,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15153
15153
|
</>
|
|
15154
15154
|
);
|
|
15155
15155
|
};
|
|
15156
|
-
`,ix="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function ox(e){const t={};return t[Gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSettings")]={...hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSize")]={...hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Gt(e,"lineHeight")]={...hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Gt(e,"letterSpacing")]={...hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Gt(e,"wordSpacing")]={...hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Gt(e,"textAlign")]={...hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Gt(e,"textAppearance")]={...hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const rx=io.reduce((e,t)=>({...e,...ox(t)}),{}),ax=io.reduce((e,t)=>({...e,[Gt(t,"fontFamily")]:"Goudy Bookletter 1911",[Gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Gt(t,"letterSpacing")]:0,[Gt(t,"wordSpacing")]:0,[Gt(t,"textAlign")]:"left",[Gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Aa(e){return io.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Gt(n,"fontSize")]=i),o!==void 0&&(t[Gt(n,"lineHeight")]=o),t},{})}const sx=Kv(),lx={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...rx,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ix,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...ax},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Aa({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Aa({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Aa({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[sx]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},cx={element:tx,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:lx,sourceCode:nx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...io.map(e=>({path:`${Gt(e,"fontFamily")}`}))]},fontRelations:{...io.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Gt(t,"fontFamily")}`}),{})}},dx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:w,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:x,textTransition:C,title1Width:y,title2Width:S,title3Width:B,title1MarginLeft:N=0,title2MarginLeft:q=0,title3MarginLeft:D=0,titleRowMarginBottom:T=0,titleHeaderLayout:H="single-row",countCloseGap:$=0,closeIcon:I,closeIconMaxWidth:P,closeIconColor:E,closeIconHoverColor:g,contentMarginTop:z=0,iconMarginRight:F=0}=n,X=s.useCallback(Se=>W.scalingValue(Se,i??!1),[i]),ie=X(h??0),L=`${f}%`,_=`${x}%`,V=X($),ae=X(z),re=X(F),M=bi("title1",xi(n,"title1"),i),se=bi("title2",xi(n,"title2"),i),j=bi("title3",xi(n,"title3"),i),b=bi("count",xi(n,"count"),i),k=H==="mobile",G=!i||!!r,he=!o&&(!i||!!r),J=s.useMemo(()=>Ir(t,v),[t,v]),[ee,O]=s.useState(l),Z=J[ee],te=Z==null?void 0:Z.entry,[Le,ve]=s.useState(!1),[Ie,pe]=s.useState(null),[oe,ye]=s.useState(!1),[U,ce]=s.useState(null),[le,Ce]=s.useState(!1),[Fe,Ee]=s.useState(0),[Y,be]=s.useState(),[de,K]=s.useState(),[ue,He]=s.useState(null),fe=s.useRef(null),Q=s.useRef(0),Je=s.useRef(0),Ne=s.useRef(0),ct=s.useRef(!1),Ke=s.useRef(null),ut=s.useRef(null),lt=s.useRef(null),Ye=s.useRef(null),Re=s.useRef(null),We=s.useRef(null),Be=s.useRef(null),Ue=s.useCallback(()=>{const Se=ut.current;if(!Se)return;const qe=Se.closest(`.${e}-lightbox-content-area`);if(!qe)return Se.getBoundingClientRect().width;const R=Array.from(qe.children).reduce((ne,me)=>!(me instanceof HTMLElement)||me.contains(Se)?ne:ne+me.getBoundingClientRect().width,0);return qe.getBoundingClientRect().width-R},[e]),ge=s.useCallback(()=>{fe.current&&(clearTimeout(fe.current),fe.current=null)},[]),xe=s.useCallback(Se=>{Se===Q.current&&(ce(null),Ce(!1))},[]),_e=s.useCallback(()=>{o||ct.current||(ct.current=!0,u==null||u(),ve(!1),Ke.current=setTimeout(()=>{p()},300))},[o,u,p]),Ze=s.useCallback(Se=>!!(Se.closest("[data-controls]")||Se.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:we,backdropStyle:$e,mediaAreaStyle:Xe,overlayContentStyle:ze,swipeHandlers:Te,dismissAreaStyle:Ve}=Od({enabled:he,onClose:_e,animMs:300,isBlockedTarget:Ze}),De=s.useCallback(Se=>{d&&Sd(Se+1,c,!0)},[d,c]),tt=s.useCallback(Se=>{if(Se)return Se.getBoundingClientRect().height},[]),nt=s.useCallback(Se=>{if(J.length===0)return;const qe=(Se%J.length+J.length)%J.length;if(qe===ee)return;const R=J[ee],ne=J[qe];Q.current+=1;const me=Q.current,Me=C==="fade"&&Pl(R==null?void 0:R.entry)!==Pl(ne==null?void 0:ne.entry),je=tt(lt.current),et=Me?(()=>{const Rt=Ue();zn.flushSync(()=>{He(ne.entry)}),lt.current&&Rt&&(lt.current.style.width=`${Rt}px`);const tn=tt(lt.current);return lt.current&&(lt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(je??0,(et==null?void 0:et.measuredIncomingTitlesHeight)??0)||void 0;Ee(me),ce(ee),Ce(!0),O(qe),De(qe),Ne.current=qe,Me?(ge(),bt&&be(bt),et!=null&&et.incomingTitlesMeasureWidth&&K(et.incomingTitlesMeasureWidth),pe((R==null?void 0:R.entryIndex)??null),ye(!0),Je.current=ne.entryIndex,fe.current=setTimeout(()=>{pe(null),ye(!1),be(void 0),K(void 0),He(null),fe.current=null},400)):(ge(),pe(null),ye(!1),be(void 0),K(void 0),He(null),Je.current=ne.entryIndex)},[ee,ge,Ue,tt,J,De,C]),st=s.useCallback(()=>{Be.current=null},[]),St=s.useCallback(Se=>{!G||J.length<=1||Se.pointerType==="mouse"&&Se.button!==0||Se.target.closest("[data-controls]")||(Be.current={startX:Se.clientX,startY:Se.clientY,pointerId:Se.pointerId})},[G,J.length]),Bt=s.useCallback(Se=>{var Rt;if(!G||J.length<=1||Se.pointerType==="mouse"&&Se.button!==0)return;if(we){st();return}const qe=Be.current;if(!qe||qe.pointerId!==Se.pointerId||(st(),Se.target.closest("[data-controls]")))return;const ne=Se.clientX-qe.startX,me=Se.clientY-qe.startY,Me=Math.abs(ne),je=Math.abs(me);if(Me>=Sf&&Me>je){nt(ne>0?ee-1:ee+1);return}if(Me>Tl||je>Tl)return;const et=(Rt=Ye.current)==null?void 0:Rt.getBoundingClientRect(),bt=et?et.left+et.width/2:window.innerWidth/2;nt(Se.clientX<bt?ee-1:ee+1)},[ee,G,nt,we,st,J.length]),zt=s.useCallback(Se=>{const qe=Be.current;(qe==null?void 0:qe.pointerId)===Se.pointerId&&st()},[st]);Bd(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Se=requestAnimationFrame(()=>{ve(!0),requestAnimationFrame(()=>{Re.current?Re.current.focus():Ye.current&&Ye.current.focus()})});return()=>{cancelAnimationFrame(Se),Ke.current&&clearTimeout(Ke.current),fe.current&&clearTimeout(fe.current);const qe=We.current;qe&&document.contains(qe)&&qe.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Se;C!=="fade"&&(Je.current=((Se=J[ee])==null?void 0:Se.entryIndex)??0,ge(),pe(null),ye(!1),be(void 0),K(void 0))},[ee,ge,J,C]),s.useEffect(()=>{const Se=qe=>{if(qe.key==="Escape"){_e();return}if(qe.key==="ArrowLeft"&&J.length>1){nt(ee-1);return}if(qe.key==="ArrowRight"&&J.length>1){nt(ee+1);return}if(qe.key==="Tab"&&Ye.current){const R=Ye.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ne=Array.from(R).filter(et=>!et.closest('[aria-hidden="true"]'));if(ne.length===0)return;const me=ne[0],Me=ne[ne.length-1],je=document.activeElement;qe.shiftKey?(je===me||!Ye.current.contains(je))&&(qe.preventDefault(),Me.focus()):(je===Me||!Ye.current.contains(je))&&(qe.preventDefault(),me.focus())}};return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[nt,_e,ee,J.length]),s.useLayoutEffect(()=>{ge(),Q.current=0,Ee(0),ce(null),Ce(!1),pe(null),ye(!1),be(void 0),K(void 0),He(null),O(Se=>{const qe=Math.max(0,J.length-1);return Math.min(Se,qe)})},[ge,t.length,v,J.length]),s.useLayoutEffect(()=>{var R;const Se=Math.max(0,J.length-1),qe=Math.min(Math.max(0,l),Se);Ne.current=qe,Je.current=((R=J[qe])==null?void 0:R.entryIndex)??0,O(qe)},[l]);const ft=Ie!==null?t[Ie]:null,wt=U!==null?J[U]:null,jt=(te==null?void 0:te.title1)||(te==null?void 0:te.title2)||(te==null?void 0:te.title3)||(ft==null?void 0:ft.title1)||(ft==null?void 0:ft.title2)||(ft==null?void 0:ft.title3),At=Ef(v,J,t),xt=I!==null,Ft=jt||At||xt,Nt=At&&xt?{gap:V}:void 0,Kt=`${e}-titles-stack${k?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${k?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(N??0)>0||o,rn=X(T),gt=s.useMemo(()=>({title1Width:y??Gi.title1Width,title2Width:S??Gi.title2Width,title3Width:B??Gi.title3Width}),[y,S,B]),ke=s.useMemo(()=>({title2MarginLeft:q,title3MarginLeft:D}),[q,D]),Ge=s.useMemo(()=>te?Kn(e,te,M,se,j):[],[e,te,M,se,j]),rt=s.useMemo(()=>Ge.map(Se=>gt[Se.widthKey]),[Ge,gt]),ht=s.useMemo(()=>Zi(Ge.length,rt),[Ge.length,rt]),yt=s.useMemo(()=>No(Ge.length,rt),[Ge.length,rt]),Lt=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title1"),[Ge]),mt=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),[Ge]),Vt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((Se,qe)=>{const R=Ge.findIndex(me=>me.prefix===Se.prefix);if(!k||qe==="single-row")return{effectiveWidth:yt[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(qe==="two-row-top"){const me=Lt.findIndex(Me=>Me.prefix===Se.prefix);return{effectiveWidth:Vt.effective[me]??0,resolvedWidth:Vt.resolved[me]??0,maxWidth:cn(me,Vt.resolved)}}const ne=mt.findIndex(me=>me.prefix===Se.prefix);return{effectiveWidth:kt.effective[ne]??0,resolvedWidth:kt.resolved[ne]??0,maxWidth:cn(ne,kt.resolved)}},[Ge,mt,kt,yt,ht,Lt,Vt,k]),Xt=s.useCallback(Se=>Id(Ge,ht,ke,Se)+(k?0:N??0),[Ge,ht,ke,k,N]),qt=s.useCallback(()=>k?0:N??0,[k,N]),Ht=s.useCallback(Se=>mt.slice(0,Se).reduce((qe,R,ne)=>qe+(R.marginLeftKey?ke[R.marginLeftKey]??0:0)+(kt.resolved[ne]??0),0),[mt,kt.resolved,ke]),Dt=s.useCallback(Se=>{const qe=mt[Se];return Ht(Se)+(qe.marginLeftKey?ke[qe.marginLeftKey]??0:0)+(kt.resolved[Se]??0)},[mt,kt.resolved,Ht,ke]),_t=s.useCallback((Se,qe,R)=>{if(!k||R==="single-row"){const et=Se.findIndex(Qt=>Qt.prefix===qe.prefix),bt=Se.map(Qt=>gt[Qt.widthKey]),Rt=Zi(Se.length,bt);return{effectiveWidth:No(Se.length,bt)[et]??0,resolvedWidth:Rt[et]??0,maxWidth:cn(et,Rt)}}if(R==="two-row-top"){const et=Se.filter(Qt=>Qt.prefix==="title1"),bt=et.findIndex(Qt=>Qt.prefix===qe.prefix),{resolved:Rt,effective:tn}=Zn(et,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const ne=Se.filter(et=>et.prefix==="title2"||et.prefix==="title3"),me=ne.findIndex(et=>et.prefix===qe.prefix),{resolved:Me,effective:je}=Zn(ne,gt);return{effectiveWidth:je[me]??0,resolvedWidth:Me[me]??0,maxWidth:cn(me,Me)}},[gt,k]),Ct=(Se,qe,R)=>{const ne=Se.marginLeftKey?ke[Se.marginLeftKey]??0:0,{effectiveWidth:me,resolvedWidth:Me,maxWidth:je}=R??Mt(Se,qe),et=Math.max(ne,Un),bt=o&&qe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Se.prefix,style:{width:X(me),...ne>0?{marginLeft:X(ne)}:{}},children:[a.jsx("p",{className:Se.className,style:Se.style,children:Se.text}),bt&&Se.marginLeftKey?a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:X(-ne),width:X(et),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:X(-fn/2),width:X(fn),height:"100%",pointerEvents:"auto"}}):null]},Se.className)},A=(Se="two-row")=>{const qe=Ge.findIndex(me=>me.prefix==="title1"),R=qe>=0?ht[qe]:gt.title1Width,ne=Se==="two-row"&&o;return a.jsx("div",{...ne?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:X(N??0),flexShrink:0,alignSelf:"stretch",...ne?{pointerEvents:"auto"}:{}}})},Pe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:M,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:b,"aria-live":"polite","aria-atomic":"true",children:Pf(J,ee,v,t)}),Oe=()=>At?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ae(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ca(V)} + ${V}))`,width:Ca(V),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,at=()=>!At&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[Oe(),xt?vt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Pe():null,Wt?A("single-row"):null,It(te),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),at(),$n()]}),it=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Pe():null,Wt?A("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:oe&&Y?{minHeight:Y}:void 0,children:[a.jsx("div",{ref:lt,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(ue||te)}),a.jsxs("div",{ref:ut,className:Kt,style:{position:oe?"absolute":"relative",inset:oe?0:void 0,width:"100%",...oe&&de?{width:de,maxWidth:"100%"}:void 0},children:[ft&&oe?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:ci(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${oe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ci(te)})]})]}),at(),$n()]}),vt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(P??0,i),height:W.scalingValue(P??0,i),marginRight:re,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Re,type:"button",className:`${e}-close-icon-inner`,onClick:_e,"aria-label":"Close",children:a.jsx(sn,{url:I??"",fill:E,hoverFill:i&&!r?E:g,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:re,height:"100%",pointerEvents:"auto"}})]}),Ot=(Se,qe)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||jt?Pe():null,Wt?A("two-row"):null,qe!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:qe},children:Se}):a.jsxs(a.Fragment,{children:[Se,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),at()]}),It=Se=>{if(!Se)return null;const qe=Kn(e,Se,M,se,j);return a.jsx(a.Fragment,{children:qe.map(R=>Ct(R,"single-row",_t(qe,R,"single-row")))})},nn=Se=>{if(!Se)return null;const qe=Kn(e,Se,M,se,j),R=qe.find(ne=>ne.prefix==="title1");return R?Ct(R,"two-row-top",_t(qe,R,"two-row-top")):null},un=(Se,qe=!1)=>{const R=Se?Kn(e,Se,M,se,j):[],ne=R.filter(je=>je.prefix==="title2"||je.prefix==="title3"),me=o&&qe;return ne.length>0||me||(T??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ne.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ne.map(je=>Ct(je,"two-row-bottom",_t(R,je,"two-row-bottom"))),qe&&o?a.jsxs(a.Fragment,{children:[la(),ca()]}):null]}):null,(T??0)>0||me?a.jsx("div",{"data-controls":me?"titleRowMarginBottom":void 0,"data-controls-axis":me?"y":void 0,"data-controls-reverse":me?"":void 0,className:me?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:me?"auto":"none"}}):null]}):null},li=(Se,qe=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(Se)),un(Se,qe)]}),ci=Se=>k?a.jsx("div",{className:`${e}-titles-row-two-row`,children:li(Se)}):Se?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(Se)}):null,er=()=>{const Se=k?-1:Ge.findIndex(ne=>ne.prefix==="title1"),qe=!k&&(o||(N??0)>0)?(()=>{const ne=N??0,me=Se>=0?ht[Se]:gt.title1Width,Me=Math.max(ne,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(me),style:{position:"absolute",top:0,left:0,width:X(Me),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Ge.flatMap((ne,me)=>{if(!ne.marginLeftKey)return[];const Me=ke[ne.marginLeftKey]??0,je=Td(Ge,ht,ke,me)+qt(),et=Math.max(Me,Un);return a.jsx("div",{"data-controls":ne.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[me]),style:{position:"absolute",top:0,left:X(je),width:X(et),height:"100%",pointerEvents:"auto"}},ne.marginLeftKey)});return qe?[qe,...R]:R},tr=()=>Ge.map((Se,qe)=>{const R=cn(qe,ht),me=Xt(qe)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(me),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),la=()=>mt.flatMap((Se,qe)=>{if(!Se.marginLeftKey)return[];const R=ke[Se.marginLeftKey]??0,ne=Ht(qe),me=Math.max(R,Un),{resolvedWidth:Me}=Mt(Se,"two-row-bottom");return a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:X(ne),width:X(me),height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)}),ca=()=>mt.map((Se,qe)=>{const{maxWidth:R}=Mt(Se,"two-row-bottom"),me=Dt(qe)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(me),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),$n=()=>!o||k?null:a.jsxs(a.Fragment,{children:[er(),tr()]}),Pi=Se=>{const qe=!Se.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${qe?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:_,...qe?{"--image-aspect-ratio":aa(w)}:{}}}},nr=Se=>Se.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Se.objectFit}}:Dn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},di=Se=>{if(Se.length===0)return null;const qe=Se.length>1,R=Ca(ie),ne=`calc(-0.5 * (${R} + ${ie}))`;if(Se.length===1){const me=Se[0];return a.jsx("div",{...Pi(me),children:a.jsx("img",{...nr(me),src:me.url,alt:me.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:qe?{gap:ie}:void 0,children:Se.map((me,Me)=>a.jsxs("div",{...Pi(me),children:[a.jsx("img",{...nr(me),src:me.url,alt:me.name??"",draggable:!1}),o&&qe&&Me<Se.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ne,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${me.url}-${Me}`))})},ir=!!(te!=null&&te.title2||te!=null&&te.title3||ft!=null&&ft.title2||ft!=null&&ft.title3||(T??0)>0||o),da=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:lt,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:li(ue||te)}),a.jsxs("div",{ref:ut,className:`${e}-titles-row-two-row`,style:{...oe&&Y?{minHeight:Y}:void 0,...oe&&de?{width:de,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Kt,style:{position:oe?"absolute":"relative",inset:oe?0:void 0,width:"100%"},children:[ft&&oe?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${oe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(te)})]}),oe&&Y?Y:void 0),ir?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ft&&oe?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${oe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${k?` ${e}-titles-layer-in-stacked`:""}`,children:un(te,!0)})]}):null]})]}),ua=()=>{const Se=ir;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Se?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Se?void 0:{flex:"0 0 auto",height:"auto"},children:li(te,!0)}),$n()]})};return a.jsxs("div",{ref:Ye,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{we||_e()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Le?1:0,transition:"opacity 300ms ease",pointerEvents:Le?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...$e}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ve,...Te,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Xe,onClick:Se=>Se.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":G&&J.length>1?"true":"false",onPointerDown:G?St:void 0,onPointerUp:G?Bt:void 0,onPointerCancel:G?zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&le?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Se=>{Se.target===Se.currentTarget&&xe(Fe)},children:a.jsx("div",{className:`${e}-slide-area`,children:di(wt.images)})},`slide-out-${Fe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${le?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:Z?di(Z.images):null})},`slide-in-${Fe}-${ee}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:ze,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...k?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${k?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${k?` ${e}-text-bar-cell-stacked`:""}`,style:k?void 0:{flex:1,minWidth:0,width:"100%"},children:k?C==="fade"?da():ua():C==="fade"?it():Et()})})})]})]})]})};function ux(e){return`
|
|
15156
|
+
`,ix="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function ox(e){const t={};return t[Gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSettings")]={...hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSize")]={...hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Gt(e,"lineHeight")]={...hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Gt(e,"letterSpacing")]={...hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Gt(e,"wordSpacing")]={...hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Gt(e,"textAlign")]={...hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Gt(e,"textAppearance")]={...hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const rx=io.reduce((e,t)=>({...e,...ox(t)}),{}),ax=io.reduce((e,t)=>({...e,[Gt(t,"fontFamily")]:"Goudy Bookletter 1911",[Gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Gt(t,"letterSpacing")]:0,[Gt(t,"wordSpacing")]:0,[Gt(t,"textAlign")]:"left",[Gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Aa(e){return io.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Gt(n,"fontSize")]=i),o!==void 0&&(t[Gt(n,"lineHeight")]=o),t},{})}const sx=Kv(),lx={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...rx,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ix,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...ax},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Aa({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Aa({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Aa({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[sx]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},cx={element:tx,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:lx,sourceCode:nx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...io.map(e=>({path:`${Gt(e,"fontFamily")}`}))]},fontRelations:{...io.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Gt(t,"fontFamily")}`}),{})}},dx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:w,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:x,textTransition:C,title1Width:y,title2Width:S,title3Width:z,title1MarginLeft:N=0,title2MarginLeft:Y=0,title3MarginLeft:B=0,titleRowMarginBottom:T=0,titleHeaderLayout:H="single-row",countCloseGap:$=0,closeIcon:I,closeIconMaxWidth:P,closeIconColor:M,closeIconHoverColor:g,contentMarginTop:D=0,iconMarginRight:A=0}=n,X=s.useCallback(Se=>W.scalingValue(Se,i??!1),[i]),ie=X(h??0),L=`${f}%`,_=`${x}%`,V=X($),se=X(D),re=X(A),k=bi("title1",xi(n,"title1"),i),le=bi("title2",xi(n,"title2"),i),G=bi("title3",xi(n,"title3"),i),b=bi("count",xi(n,"count"),i),E=H==="mobile",j=!i||!!r,me=!o&&(!i||!!r),K=s.useMemo(()=>Ir(t,v),[t,v]),[te,O]=s.useState(l),J=K[te],ne=J==null?void 0:J.entry,[Pe,be]=s.useState(!1),[Re,ue]=s.useState(null),[fe,$e]=s.useState(!1),[Q,Z]=s.useState(null),[ae,xe]=s.useState(!1),[ke,Ce]=s.useState(0),[q,ye]=s.useState(),[ce,U]=s.useState(),[de,He]=s.useState(null),he=s.useRef(null),ee=s.useRef(0),Je=s.useRef(0),Ne=s.useRef(0),ct=s.useRef(!1),Ke=s.useRef(null),ut=s.useRef(null),lt=s.useRef(null),Ye=s.useRef(null),Le=s.useRef(null),We=s.useRef(null),Be=s.useRef(null),Ue=s.useCallback(()=>{const Se=ut.current;if(!Se)return;const qe=Se.closest(`.${e}-lightbox-content-area`);if(!qe)return Se.getBoundingClientRect().width;const R=Array.from(qe.children).reduce((oe,pe)=>!(pe instanceof HTMLElement)||pe.contains(Se)?oe:oe+pe.getBoundingClientRect().width,0);return qe.getBoundingClientRect().width-R},[e]),ge=s.useCallback(()=>{he.current&&(clearTimeout(he.current),he.current=null)},[]),ve=s.useCallback(Se=>{Se===ee.current&&(Z(null),xe(!1))},[]),_e=s.useCallback(()=>{o||ct.current||(ct.current=!0,u==null||u(),be(!1),Ke.current=setTimeout(()=>{p()},300))},[o,u,p]),Ze=s.useCallback(Se=>!!(Se.closest("[data-controls]")||Se.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:we,backdropStyle:Te,mediaAreaStyle:Xe,overlayContentStyle:ze,swipeHandlers:Ie,dismissAreaStyle:Ve}=Od({enabled:me,onClose:_e,animMs:300,isBlockedTarget:Ze}),De=s.useCallback(Se=>{d&&Sd(Se+1,c,!0)},[d,c]),tt=s.useCallback(Se=>{if(Se)return Se.getBoundingClientRect().height},[]),nt=s.useCallback(Se=>{if(K.length===0)return;const qe=(Se%K.length+K.length)%K.length;if(qe===te)return;const R=K[te],oe=K[qe];ee.current+=1;const pe=ee.current,Me=C==="fade"&&Pl(R==null?void 0:R.entry)!==Pl(oe==null?void 0:oe.entry),je=tt(lt.current),et=Me?(()=>{const Rt=Ue();zn.flushSync(()=>{He(oe.entry)}),lt.current&&Rt&&(lt.current.style.width=`${Rt}px`);const tn=tt(lt.current);return lt.current&&(lt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(je??0,(et==null?void 0:et.measuredIncomingTitlesHeight)??0)||void 0;Ce(pe),Z(te),xe(!0),O(qe),De(qe),Ne.current=qe,Me?(ge(),bt&&ye(bt),et!=null&&et.incomingTitlesMeasureWidth&&U(et.incomingTitlesMeasureWidth),ue((R==null?void 0:R.entryIndex)??null),$e(!0),Je.current=oe.entryIndex,he.current=setTimeout(()=>{ue(null),$e(!1),ye(void 0),U(void 0),He(null),he.current=null},400)):(ge(),ue(null),$e(!1),ye(void 0),U(void 0),He(null),Je.current=oe.entryIndex)},[te,ge,Ue,tt,K,De,C]),st=s.useCallback(()=>{Be.current=null},[]),St=s.useCallback(Se=>{!j||K.length<=1||Se.pointerType==="mouse"&&Se.button!==0||Se.target.closest("[data-controls]")||(Be.current={startX:Se.clientX,startY:Se.clientY,pointerId:Se.pointerId})},[j,K.length]),Bt=s.useCallback(Se=>{var Rt;if(!j||K.length<=1||Se.pointerType==="mouse"&&Se.button!==0)return;if(we){st();return}const qe=Be.current;if(!qe||qe.pointerId!==Se.pointerId||(st(),Se.target.closest("[data-controls]")))return;const oe=Se.clientX-qe.startX,pe=Se.clientY-qe.startY,Me=Math.abs(oe),je=Math.abs(pe);if(Me>=Sf&&Me>je){nt(oe>0?te-1:te+1);return}if(Me>Tl||je>Tl)return;const et=(Rt=Ye.current)==null?void 0:Rt.getBoundingClientRect(),bt=et?et.left+et.width/2:window.innerWidth/2;nt(Se.clientX<bt?te-1:te+1)},[te,j,nt,we,st,K.length]),zt=s.useCallback(Se=>{const qe=Be.current;(qe==null?void 0:qe.pointerId)===Se.pointerId&&st()},[st]);Bd(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Se=requestAnimationFrame(()=>{be(!0),requestAnimationFrame(()=>{Le.current?Le.current.focus():Ye.current&&Ye.current.focus()})});return()=>{cancelAnimationFrame(Se),Ke.current&&clearTimeout(Ke.current),he.current&&clearTimeout(he.current);const qe=We.current;qe&&document.contains(qe)&&qe.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Se;C!=="fade"&&(Je.current=((Se=K[te])==null?void 0:Se.entryIndex)??0,ge(),ue(null),$e(!1),ye(void 0),U(void 0))},[te,ge,K,C]),s.useEffect(()=>{const Se=qe=>{if(qe.key==="Escape"){_e();return}if(qe.key==="ArrowLeft"&&K.length>1){nt(te-1);return}if(qe.key==="ArrowRight"&&K.length>1){nt(te+1);return}if(qe.key==="Tab"&&Ye.current){const R=Ye.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(R).filter(et=>!et.closest('[aria-hidden="true"]'));if(oe.length===0)return;const pe=oe[0],Me=oe[oe.length-1],je=document.activeElement;qe.shiftKey?(je===pe||!Ye.current.contains(je))&&(qe.preventDefault(),Me.focus()):(je===Me||!Ye.current.contains(je))&&(qe.preventDefault(),pe.focus())}};return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[nt,_e,te,K.length]),s.useLayoutEffect(()=>{ge(),ee.current=0,Ce(0),Z(null),xe(!1),ue(null),$e(!1),ye(void 0),U(void 0),He(null),O(Se=>{const qe=Math.max(0,K.length-1);return Math.min(Se,qe)})},[ge,t.length,v,K.length]),s.useLayoutEffect(()=>{var R;const Se=Math.max(0,K.length-1),qe=Math.min(Math.max(0,l),Se);Ne.current=qe,Je.current=((R=K[qe])==null?void 0:R.entryIndex)??0,O(qe)},[l]);const ft=Re!==null?t[Re]:null,wt=Q!==null?K[Q]:null,jt=(ne==null?void 0:ne.title1)||(ne==null?void 0:ne.title2)||(ne==null?void 0:ne.title3)||(ft==null?void 0:ft.title1)||(ft==null?void 0:ft.title2)||(ft==null?void 0:ft.title3),At=Ef(v,K,t),xt=I!==null,Ft=jt||At||xt,Nt=At&&xt?{gap:V}:void 0,Kt=`${e}-titles-stack${E?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${E?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(N??0)>0||o,rn=X(T),gt=s.useMemo(()=>({title1Width:y??Gi.title1Width,title2Width:S??Gi.title2Width,title3Width:z??Gi.title3Width}),[y,S,z]),Ae=s.useMemo(()=>({title2MarginLeft:Y,title3MarginLeft:B}),[Y,B]),Ge=s.useMemo(()=>ne?Kn(e,ne,k,le,G):[],[e,ne,k,le,G]),rt=s.useMemo(()=>Ge.map(Se=>gt[Se.widthKey]),[Ge,gt]),ht=s.useMemo(()=>Zi(Ge.length,rt),[Ge.length,rt]),yt=s.useMemo(()=>No(Ge.length,rt),[Ge.length,rt]),Lt=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title1"),[Ge]),mt=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),[Ge]),Vt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((Se,qe)=>{const R=Ge.findIndex(pe=>pe.prefix===Se.prefix);if(!E||qe==="single-row")return{effectiveWidth:yt[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(qe==="two-row-top"){const pe=Lt.findIndex(Me=>Me.prefix===Se.prefix);return{effectiveWidth:Vt.effective[pe]??0,resolvedWidth:Vt.resolved[pe]??0,maxWidth:cn(pe,Vt.resolved)}}const oe=mt.findIndex(pe=>pe.prefix===Se.prefix);return{effectiveWidth:kt.effective[oe]??0,resolvedWidth:kt.resolved[oe]??0,maxWidth:cn(oe,kt.resolved)}},[Ge,mt,kt,yt,ht,Lt,Vt,E]),Xt=s.useCallback(Se=>Id(Ge,ht,Ae,Se)+(E?0:N??0),[Ge,ht,Ae,E,N]),qt=s.useCallback(()=>E?0:N??0,[E,N]),Ht=s.useCallback(Se=>mt.slice(0,Se).reduce((qe,R,oe)=>qe+(R.marginLeftKey?Ae[R.marginLeftKey]??0:0)+(kt.resolved[oe]??0),0),[mt,kt.resolved,Ae]),Dt=s.useCallback(Se=>{const qe=mt[Se];return Ht(Se)+(qe.marginLeftKey?Ae[qe.marginLeftKey]??0:0)+(kt.resolved[Se]??0)},[mt,kt.resolved,Ht,Ae]),_t=s.useCallback((Se,qe,R)=>{if(!E||R==="single-row"){const et=Se.findIndex(Qt=>Qt.prefix===qe.prefix),bt=Se.map(Qt=>gt[Qt.widthKey]),Rt=Zi(Se.length,bt);return{effectiveWidth:No(Se.length,bt)[et]??0,resolvedWidth:Rt[et]??0,maxWidth:cn(et,Rt)}}if(R==="two-row-top"){const et=Se.filter(Qt=>Qt.prefix==="title1"),bt=et.findIndex(Qt=>Qt.prefix===qe.prefix),{resolved:Rt,effective:tn}=Zn(et,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const oe=Se.filter(et=>et.prefix==="title2"||et.prefix==="title3"),pe=oe.findIndex(et=>et.prefix===qe.prefix),{resolved:Me,effective:je}=Zn(oe,gt);return{effectiveWidth:je[pe]??0,resolvedWidth:Me[pe]??0,maxWidth:cn(pe,Me)}},[gt,E]),Ct=(Se,qe,R)=>{const oe=Se.marginLeftKey?Ae[Se.marginLeftKey]??0:0,{effectiveWidth:pe,resolvedWidth:Me,maxWidth:je}=R??Mt(Se,qe),et=Math.max(oe,Un),bt=o&&qe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Se.prefix,style:{width:X(pe),...oe>0?{marginLeft:X(oe)}:{}},children:[a.jsx("p",{className:Se.className,style:Se.style,children:Se.text}),bt&&Se.marginLeftKey?a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:X(-oe),width:X(et),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:X(-fn/2),width:X(fn),height:"100%",pointerEvents:"auto"}}):null]},Se.className)},F=(Se="two-row")=>{const qe=Ge.findIndex(pe=>pe.prefix==="title1"),R=qe>=0?ht[qe]:gt.title1Width,oe=Se==="two-row"&&o;return a.jsx("div",{...oe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:X(N??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Ee=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:k,"aria-hidden":"true",children:" "}),Fe=()=>a.jsx("span",{className:`${e}-entry-counter`,style:b,"aria-live":"polite","aria-atomic":"true",children:Pf(K,te,v,t)}),Oe=()=>At?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Fe(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ca(V)} + ${V}))`,width:Ca(V),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Fe():null,at=()=>!At&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[Oe(),xt?vt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Ee():null,Wt?F("single-row"):null,It(ne),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),at(),$n()]}),it=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Ee():null,Wt?F("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:fe&&q?{minHeight:q}:void 0,children:[a.jsx("div",{ref:lt,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(de||ne)}),a.jsxs("div",{ref:ut,className:Kt,style:{position:fe?"absolute":"relative",inset:fe?0:void 0,width:"100%",...fe&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[ft&&fe?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:ci(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ci(ne)})]})]}),at(),$n()]}),vt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(P??0,i),height:W.scalingValue(P??0,i),marginRight:re,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Le,type:"button",className:`${e}-close-icon-inner`,onClick:_e,"aria-label":"Close",children:a.jsx(sn,{url:I??"",fill:M,hoverFill:i&&!r?M:g,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:re,height:"100%",pointerEvents:"auto"}})]}),Ot=(Se,qe)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||jt?Ee():null,Wt?F("two-row"):null,qe!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:qe},children:Se}):a.jsxs(a.Fragment,{children:[Se,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),at()]}),It=Se=>{if(!Se)return null;const qe=Kn(e,Se,k,le,G);return a.jsx(a.Fragment,{children:qe.map(R=>Ct(R,"single-row",_t(qe,R,"single-row")))})},nn=Se=>{if(!Se)return null;const qe=Kn(e,Se,k,le,G),R=qe.find(oe=>oe.prefix==="title1");return R?Ct(R,"two-row-top",_t(qe,R,"two-row-top")):null},un=(Se,qe=!1)=>{const R=Se?Kn(e,Se,k,le,G):[],oe=R.filter(je=>je.prefix==="title2"||je.prefix==="title3"),pe=o&&qe;return oe.length>0||pe||(T??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[oe.map(je=>Ct(je,"two-row-bottom",_t(R,je,"two-row-bottom"))),qe&&o?a.jsxs(a.Fragment,{children:[la(),ca()]}):null]}):null,(T??0)>0||pe?a.jsx("div",{"data-controls":pe?"titleRowMarginBottom":void 0,"data-controls-axis":pe?"y":void 0,"data-controls-reverse":pe?"":void 0,className:pe?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:pe?"auto":"none"}}):null]}):null},li=(Se,qe=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(Se)),un(Se,qe)]}),ci=Se=>E?a.jsx("div",{className:`${e}-titles-row-two-row`,children:li(Se)}):Se?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(Se)}):null,er=()=>{const Se=E?-1:Ge.findIndex(oe=>oe.prefix==="title1"),qe=!E&&(o||(N??0)>0)?(()=>{const oe=N??0,pe=Se>=0?ht[Se]:gt.title1Width,Me=Math.max(oe,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pe),style:{position:"absolute",top:0,left:0,width:X(Me),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Ge.flatMap((oe,pe)=>{if(!oe.marginLeftKey)return[];const Me=Ae[oe.marginLeftKey]??0,je=Td(Ge,ht,Ae,pe)+qt(),et=Math.max(Me,Un);return a.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[pe]),style:{position:"absolute",top:0,left:X(je),width:X(et),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return qe?[qe,...R]:R},tr=()=>Ge.map((Se,qe)=>{const R=cn(qe,ht),pe=Xt(qe)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(pe),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),la=()=>mt.flatMap((Se,qe)=>{if(!Se.marginLeftKey)return[];const R=Ae[Se.marginLeftKey]??0,oe=Ht(qe),pe=Math.max(R,Un),{resolvedWidth:Me}=Mt(Se,"two-row-bottom");return a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:X(oe),width:X(pe),height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)}),ca=()=>mt.map((Se,qe)=>{const{maxWidth:R}=Mt(Se,"two-row-bottom"),pe=Dt(qe)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(pe),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),$n=()=>!o||E?null:a.jsxs(a.Fragment,{children:[er(),tr()]}),Pi=Se=>{const qe=!Se.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${qe?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:_,...qe?{"--image-aspect-ratio":aa(w)}:{}}}},nr=Se=>Se.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Se.objectFit}}:Dn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},di=Se=>{if(Se.length===0)return null;const qe=Se.length>1,R=Ca(ie),oe=`calc(-0.5 * (${R} + ${ie}))`;if(Se.length===1){const pe=Se[0];return a.jsx("div",{...Pi(pe),children:a.jsx("img",{...nr(pe),src:pe.url,alt:pe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:qe?{gap:ie}:void 0,children:Se.map((pe,Me)=>a.jsxs("div",{...Pi(pe),children:[a.jsx("img",{...nr(pe),src:pe.url,alt:pe.name??"",draggable:!1}),o&&qe&&Me<Se.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:oe,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${pe.url}-${Me}`))})},ir=!!(ne!=null&&ne.title2||ne!=null&&ne.title3||ft!=null&&ft.title2||ft!=null&&ft.title3||(T??0)>0||o),da=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:lt,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:li(de||ne)}),a.jsxs("div",{ref:ut,className:`${e}-titles-row-two-row`,style:{...fe&&q?{minHeight:q}:void 0,...fe&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Kt,style:{position:fe?"absolute":"relative",inset:fe?0:void 0,width:"100%"},children:[ft&&fe?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(ne)})]}),fe&&q?q:void 0),ir?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ft&&fe?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${E?` ${e}-titles-layer-in-stacked`:""}`,children:un(ne,!0)})]}):null]})]}),ua=()=>{const Se=ir;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Se?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Se?void 0:{flex:"0 0 auto",height:"auto"},children:li(ne,!0)}),$n()]})};return a.jsxs("div",{ref:Ye,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{we||_e()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Pe?1:0,transition:"opacity 300ms ease",pointerEvents:Pe?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...Te}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ve,...Ie,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Xe,onClick:Se=>Se.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":j&&K.length>1?"true":"false",onPointerDown:j?St:void 0,onPointerUp:j?Bt:void 0,onPointerCancel:j?zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&ae?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Se=>{Se.target===Se.currentTarget&&ve(ke)},children:a.jsx("div",{className:`${e}-slide-area`,children:di(wt.images)})},`slide-out-${ke}`):null,a.jsx("div",{className:`${e}-slide-layer-in${ae?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:J?di(J.images):null})},`slide-in-${ke}-${te}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:ze,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:se,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...E?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${E?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${E?` ${e}-text-bar-cell-stacked`:""}`,style:E?void 0:{flex:1,minWidth:0,width:"100%"},children:E?C==="fade"?da():ua():C==="fade"?it():Et()})})})]})]})]})};function ux(e){return`
|
|
15157
15157
|
.${e}-wrapper {
|
|
15158
15158
|
position: relative;
|
|
15159
15159
|
width: 100%;
|
|
@@ -15675,7 +15675,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15675
15675
|
pointer-events: auto;
|
|
15676
15676
|
z-index: 10;
|
|
15677
15677
|
}
|
|
15678
|
-
`}const px=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=W.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,w=s.useRef(null),[m,h]=s.useState(!1),[f,x]=s.useState(0),C=s.useRef(!1),y=s.useRef(!1),S=s.useRef(!1),
|
|
15678
|
+
`}const px=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=W.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,w=s.useRef(null),[m,h]=s.useState(!1),[f,x]=s.useState(0),C=s.useRef(!1),y=s.useRef(!1),S=s.useRef(!1),z=s.useMemo(()=>(t??[]).filter($=>Ki($).length>0),[t]),N=m&&z.length>0,Y=!n,B=s.useCallback(()=>{Y&&(S.current=!0,$f(y.current,c),y.current=!1)},[Y,c]),T=($=0)=>{if(z.length===0||n&&!i&&!o)return;const I=Ir(z,v),P=Math.max(0,Math.min($,I.length-1));if(x(P),Y){const M=Cd();Sd(P+1,c,M),y.current=!M}h(!0)},H=s.useCallback(()=>{h(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!Y||C.current)return;C.current=!0;const $=Rl(c);if(!$)return;const I=Ll($,Ir(z,v).length);I<0||(x(I),h(!0))},[z,c,Y,v]),s.useEffect(()=>{if(!Y)return;const $=()=>{if(S.current){S.current=!1,h(!1);return}const I=Rl(c);if(!I){h(!1);return}const P=Ll(I,Ir(z,v).length);if(P<0){h(!1);return}y.current=!1,x(P),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[z,c,Y,v]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ux(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Dn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>T(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Dn(p)?{"--image-aspect-ratio":aa(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${Dn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),N&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(dx,{prefix:d,entries:z,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:Y,journalItemId:c,onBeforeClose:B,onClose:H}),$)})()]})},mx=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15679
15679
|
import { createPortal } from 'react-dom';
|
|
15680
15680
|
import { CommonComponentProps } from '../props';
|
|
15681
15681
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16466,7 +16466,7 @@ export type LightboxJournalSettings = {
|
|
|
16466
16466
|
width: 32px;
|
|
16467
16467
|
height: 32px;
|
|
16468
16468
|
}
|
|
16469
|
-
`}function $x(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function Tx(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await $x(i)]));return new Map(n)}function Ix({settings:e,content:t=[],isEditor:n}){const{prefix:i}=W.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[v,w]=s.useState({x:0,y:0}),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[x,C]=s.useState(!1),[y,S]=s.useState(!1),
|
|
16469
|
+
`}function $x(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function Tx(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await $x(i)]));return new Map(n)}function Ix({settings:e,content:t=[],isEditor:n}){const{prefix:i}=W.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[v,w]=s.useState({x:0,y:0}),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[x,C]=s.useState(!1),[y,S]=s.useState(!1),z=s.useRef(new Map),{imageSize:N=wx,cursor:Y="system",target:B="area",position:T="random",visible:H="all",defaultCursor:$=null,hoverCursor:I=null}=e,P=t.filter(L=>{var _;return!!((_=L==null?void 0:L.image)!=null&&_.url)}),M=s.useMemo(()=>Cx(i),[i]),g=s.useCallback((L,_,V=l)=>{if(!o)return;const se=o.getBoundingClientRect(),re=L-se.left,k=_-se.top;w({x:re,y:k}),h(Sx(re,k,V,o,Y,B,I,$))},[o,l,Y,B,I,$]);s.useEffect(()=>{const L=[...P.map(V=>V.image.url),$,I].filter(V=>!!V);if(L.length===0){z.current=new Map,S(!0);return}let _=!1;return S(!1),Tx(L).then(V=>{_||(z.current=V,S(!0))}),()=>{_=!0}},[t,$,I]),s.useEffect(()=>{if(!o)return;const L=V=>{V.stopPropagation(),f.current={x:V.clientX,y:V.clientY},g(V.clientX,V.clientY)},_=()=>{x&&g(f.current.x,f.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",_,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",_,!0)}},[o,x,g]),s.useEffect(()=>{!o||!x||g(f.current.x,f.current.y)},[l,o,x,g]),s.useEffect(()=>{x||h("none")},[x]);const D=(L,_,V,se={})=>{var E,j;if(!((E=L==null?void 0:L.image)!=null&&E.url))return null;const re=((j=z.current.get(L.image.url))==null?void 0:j.aspectRatio)??1,k=nc(L.image.url,N,z.current),{heightPx:le}=Dr(k,re);let G=0,b=0;return T==="same"?{x:G,y:b}=tc(_,V,k,re):(G=se.x??Math.random()*_,b=se.y??Math.random()*V,{x:G,y:b}=rs(G,b,_,V,k,le)),{id:p.current++,url:L.image.url,link:L.link,name:L.image.name,x:G,y:b,xRatio:G/_,yRatio:b/V,aspectRatio:re,widthPx:k}},A=()=>{if(!o)return;const L=o.getBoundingClientRect(),_=L.width,V=L.height;_===0||V===0||d(se=>se.length===0?se:se.map(re=>{const k=N.sizeType==="random"?re.widthPx:nc(re.url,N,z.current),{heightPx:le}=Dr(k,re.aspectRatio);if(T==="same"){const{x:E,y:j}=tc(_,V,k,re.aspectRatio);return{...re,x:E,y:j,widthPx:k}}const{x:G,y:b}=rs(re.xRatio*_,re.yRatio*V,_,V,k,le);return{...re,x:G,y:b,widthPx:k}}))};s.useEffect(()=>{if(!o||P.length===0||!y)return;const L=o.getBoundingClientRect(),_=L.width,V=L.height,se=D(P[0],_,V);se&&(d([se]),u(P.length>1?1:0))},[N,T,o,t,y]),s.useEffect(()=>{if(!o)return;A();const L=new ResizeObserver(A);return L.observe(o),window.addEventListener("resize",A),()=>{L.disconnect(),window.removeEventListener("resize",A)}},[o,T,N,l.length]),s.useEffect(()=>{H==="last One"&&d(L=>L.length>0?[L[L.length-1]]:[])},[H]);const X=L=>{if(!o||P.length===0||!y)return;const _=o.getBoundingClientRect(),V=L.clientX-_.left,se=L.clientY-_.top;if(B==="image"&&!jd(V,se,l))return;let re=0,k=0;T==="on Click"?(re=V,k=se):T==="same"?(re=_.width/2,k=_.height/2):(re=Math.random()*_.width,k=Math.random()*_.height);const le=P[c%P.length],G=D(le,_.width,_.height,{x:re,y:k});if(!G)return;const b=H==="all"?[...l,G]:[G];d(b),u(E=>(E+1)%P.length),g(L.clientX,L.clientY,b)},ie=Y==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:M}}),a.jsxs("div",{ref:r,onClick:X,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map(L=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${L.y}px`,left:`${L.x}px`,width:`${L.widthPx}px`,cursor:ie?"none":"default"},children:B==="area"&&L.link?a.jsx("a",{href:L.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})}):a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})},L.id)),x&&ie&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${v.x}px`,top:`${v.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Rx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16470
16470
|
import { CommonComponentProps } from '../props';
|
|
16471
16471
|
import { useScopedStyles } from '../utils/index';
|
|
16472
16472
|
|
|
@@ -17106,7 +17106,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17106
17106
|
display: block;
|
|
17107
17107
|
pointer-events: none;
|
|
17108
17108
|
}
|
|
17109
|
-
`}function Ax(e){return e==="blur"?Mx:e==="greyscale"?Ex:0}function fo(e,t=1,n=1){const i=Ax(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function ic(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Fx(e,t){return t<=1?0:(e-1+t)%t}function _x(e,t=1){return!e||e.height===0?t:e.width/e.height}function Nx(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function oc(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function Vd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function rc(e,t,n){return{...Vd(e),[`--${n}-stage-scale`]:t}}function Wx(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function Hx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var
|
|
17109
|
+
`}function Ax(e){return e==="blur"?Mx:e==="greyscale"?Ex:0}function fo(e,t=1,n=1){const i=Ax(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function ic(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Fx(e,t){return t<=1?0:(e-1+t)%t}function _x(e,t=1){return!e||e.height===0?t:e.width/e.height}function Nx(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function oc(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function Vd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function rc(e,t,n){return{...Vd(e),[`--${n}-stage-scale`]:t}}function Wx(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function Hx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var $e,Q,Z,ae,xe,ke,Ce;const{prefix:o}=W.useScopedStyles(),r=s.useMemo(()=>kx(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,v=t??[],w=ic(v.length),[m,h]=s.useState(w.activeIndex),[f,x]=s.useState(w.backgroundIndex),[C,y]=s.useState(!1),[S,z]=s.useState(!1),[N,Y]=s.useState(null),[B,T]=s.useState(null),[H,$]=s.useState(0),[I,P]=s.useState(1),[M,g]=s.useState("none"),[D,A]=s.useState("next"),[X,ie]=s.useState({}),[L,_]=s.useState({width:0,height:0}),V=s.useRef(null),se=s.useRef(null),re=!n||!!i,k=l??60,le=Math.max(10,Math.min(100,d??k)),G=Math.max(10,Math.min(100,c??k)),b=Math.max(100,u),E=fo(p),j=s.useCallback(q=>{const ye=_x(q?X[q]:void 0);return Nx(L.width,L.height,ye,le,G)},[L.height,L.width,X,G,le]);s.useEffect(()=>{const q=se.current;if(!q)return;const ye=new ResizeObserver(([ce])=>{const{width:U,height:de}=ce.contentRect;_({width:U,height:de})});return ye.observe(q),()=>ye.disconnect()},[]),s.useEffect(()=>{const q=(t??[]).map(ye=>{var ce;return(ce=ye.image)==null?void 0:ce.url}).filter(ye=>!!ye);Wx(q,(ye,ce)=>{ie(U=>{var de,He;return((de=U[ye])==null?void 0:de.width)===ce.width&&((He=U[ye])==null?void 0:He.height)===ce.height?U:{...U,[ye]:ce}})})},[t]),s.useEffect(()=>{const{backgroundIndex:q,activeIndex:ye}=ic(v.length);h(ye),x(q),y(!1),z(!1),Y(null),T(null),$(0),P(1),g("none"),A("next")},[v.length,t]),s.useEffect(()=>()=>{V.current&&clearTimeout(V.current)},[]);const me=s.useCallback(q=>{var he,ee,Je,Ne;if(!re||C||v.length<=1)return;const ye=q==="next"?(m+1)%v.length:(m-1+v.length)%v.length,ce=j((ee=(he=v[m])==null?void 0:he.image)==null?void 0:ee.url),U=j((Ne=(Je=v[ye])==null?void 0:Je.image)==null?void 0:Ne.url),de=oc(L.width,L.height,ce),He=oc(L.width,L.height,U);V.current&&clearTimeout(V.current),A(q),z(!0),y(!0),q==="next"?(Y(m),T(ye),$(0),P(1),g(fo(p,0,1))):(x(Fx(ye,v.length)),Y(ye),T(m),$(1),P(He),g(fo(p,1,He))),requestAnimationFrame(()=>{z(!1),requestAnimationFrame(()=>{q==="next"?($(1),P(de),g(fo(p,1,de))):($(0),P(1),g(fo(p,0,1)))})}),V.current=setTimeout(()=>{q==="next"&&x(m),h(ye),Y(null),T(null),y(!1)},b)},[m,p,L.height,L.width,j,C,re,v,b]),K=v[m],te=f!==null?v[f]:null,O=N!==null?v[N]:null,J=B!==null?v[B]:null,ne=v.length<=1?0:(m-1+v.length)%v.length,Pe=v.length<=1?0:(m+1)%v.length,be=j(($e=K==null?void 0:K.image)==null?void 0:$e.url),Re=j((Q=O==null?void 0:O.image)==null?void 0:Q.url),ue=j((Z=J==null?void 0:J.image)==null?void 0:Z.url),fe={[`--${o}-transition-ms`]:`${b}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:se,className:pt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:fe,"aria-label":"Zoom gallery",children:[((ae=te==null?void 0:te.image)==null?void 0:ae.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:te.image.url,alt:"",style:{filter:E}})}),C&&((xe=O==null?void 0:O.image)==null?void 0:xe.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${D}`),style:rc(Re,I,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:O.image.url,alt:"",style:{filter:M}})}),C&&((ke=J==null?void 0:J.image)==null?void 0:ke.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${D}`),style:rc(ue,H,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:J.image.url,alt:""})}),!C&&((Ce=K==null?void 0:K.image)==null?void 0:Ce.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:Vd(be),children:a.jsx("img",{className:`${o}-image`,src:K.image.url,alt:K.image.name??""})}),re&&v.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>me("prev"),"aria-label":`Show previous image (${ne+1} of ${v.length})`}),a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>me("next"),"aria-label":`Show next image (${Pe+1} of ${v.length})`})]})]})]})}const Dx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17110
17110
|
import cn from 'classnames';
|
|
17111
17111
|
import { CommonComponentProps } from '../props';
|
|
17112
17112
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17865,7 +17865,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17865
17865
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17866
17866
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17867
17867
|
}
|
|
17868
|
-
`}function Na(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function ac(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=W.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function qx({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=W.useScopedStyles(),l=s.useMemo(()=>Xx(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:v,order:w="text-icon",gap:m=0,iconSize:h=0,iconWidthC:f=0,dimensions:x=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:
|
|
17868
|
+
`}function Na(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function ac(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=W.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function qx({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=W.useScopedStyles(),l=s.useMemo(()=>Xx(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:v,order:w="text-icon",gap:m=0,iconSize:h=0,iconWidthC:f=0,dimensions:x=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:z="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:Y="rgba(0, 0, 0, 0)",stroke:B=0,backgroundColor:T="#000000",textColor:H="#ffffff",borderColor:$="#ffffff",iconColor:I="#ffffff",hoverEffect:P="none",fontFamily:M,fontSettings:g,fontSize:D,lineHeight:A,letterSpacing:X=0,wordSpacing:ie=0,textAppearance:L,stateOverrides:_,minWidth:V=0,minHeight:se=0,width:re=0,height:k=0}=e,le=W.buildColorVars(r,{backgroundColor:T,textColor:H,borderColor:$,iconColor:I,boxShadowColor:z,innerBoxShadowColor:Y},zx,jx,_),G=i&&i!=="default"?`${r}-state-${i}`:"",b=t&&!n?`${r}-editing`:"",E=P!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${P}`:"",j=P==="reveal"||P==="swipe",me=P==="content-roll",K=P==="reveal"&&(!t||n),te=x===!0,J=d==="a"?v??p:p,ne=d==="c",Pe=d!=="b",be={fontSettings:{fontFamily:M,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:D??.01,lineHeight:A,letterSpacing:X,wordSpacing:ie,textAppearance:L,color:H},ue={...Pe?an(Ut(be,t)):{},[`--${r}-box-shadow-x`]:W.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:W.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:W.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:W.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:W.scalingValue(N.left,t),[`--${r}-inner-box-shadow-y`]:W.scalingValue(N.top,t),[`--${r}-inner-box-shadow-blur`]:W.scalingValue(N.right,t),[`--${r}-inner-box-shadow-spread`]:W.scalingValue(N.bottom,t),paddingTop:W.scalingValue(C.top,t),paddingRight:W.scalingValue(C.right,t),paddingBottom:W.scalingValue(C.bottom,t),paddingLeft:W.scalingValue(C.left,t),borderRadius:W.scalingValue(y,t),borderWidth:W.scalingValue(B,t),...ne?{}:{justifyContent:_a[J],textAlign:J},...ne&&!me?{gap:W.scalingValue(m,t)}:{},...te?{width:W.scalingValue(re,t),height:W.scalingValue(k,t)}:{minWidth:W.scalingValue(V,t),minHeight:W.scalingValue(se,t),...ne?{width:"100%"}:{}}};let fe;const $e={display:"inline-flex",alignItems:"center",justifyContent:ne?_a[J]:_a[d==="a"?J:"center"],gap:ne?W.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:J}:{}};if(d==="b"){const ae=()=>ac(r,u,h>0?"fixed":"fill",100,h,t);fe=me?Na(r,ae,`${r}-icon-roll`,void 0,$e):ae()}else if(d==="c"){const ae=()=>{const xe=a.jsx("span",{className:`${r}-text`,style:{textAlign:J},children:c}),ke=ac(r,u,f>0?"fixed":"fill",100,f,t);return w==="icon-text"?a.jsxs(a.Fragment,{children:[ke,xe]}):a.jsxs(a.Fragment,{children:[xe,ke]})};fe=me?Na(r,ae,`${r}-icon-text-roll`,void 0,$e):ae()}else fe=me?Na(r,()=>c,`${r}-label-roll`,void 0,$e):j?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const Q=K?ae=>Vx(ae,r):void 0,Z=K?ae=>Gx(ae,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:le,children:a.jsx("div",{className:`${r}-wrapper ${G} ${b}`.trim(),children:a.jsx("div",{className:`${r}-button ${E}`.trim(),style:ue,onMouseEnter:Q,onMouseLeave:Z,role:"button",tabIndex:o||t&&!n?void 0:0,children:fe})})})]})}const Yx=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17869
17869
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17870
17870
|
import { CommonComponentProps } from '../props';
|
|
17871
17871
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18690,7 +18690,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18690
18690
|
pointer-events: auto;
|
|
18691
18691
|
flex-shrink: 0;
|
|
18692
18692
|
}
|
|
18693
|
-
`}const In=500,yo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",e0=72,t0=50,n0=1e4,i0=650,o0=500;function r0(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Gd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Nr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function a0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Gd(i,n):null}function s0(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function Co(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function sc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Co(e,i,n)}const l0=.03;function Xd(e){return e.width*l0}const Wa={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function yr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function lc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function c0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function as(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function d0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:as(e,t.width,t.height)}function u0(e,t){if(sa(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function p0(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function m0({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>sa(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function oo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Xd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Or(e,t,n){const i=oo(e,t,n);return{...i,left:2*i.left-e.left}}function g0(e,t,n){const{left:i,width:o}=n,r=Xd(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function qd(e,t,n,i){const o=oo(e,"left",i),r=oo(e,"right",i),l=Or(e,"left",i),d=Or(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function h0(e,t,n,i){const{start:o,end:r}=qd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function f0(e,t,n){const i=oo(e,t,n),o=Or(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function sa(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function y0({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function vr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return sa(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function v0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:x}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),B=s.useRef(new Map),[N,q]=s.useState(0),D=s.useRef(null),T=s.useRef(0),H=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),P=s.useRef(!1),E=s.useRef(!1),g=s.useRef(null),z=s.useRef(null),F=s.useRef(null),X=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),_=s.useRef(null),V=s.useRef(!1),[ae,re]=s.useState(null),[M,se]=s.useState(Wa),[j,b]=s.useState(0),[k,G]=s.useState("opening"),[he,J]=s.useState(0),[ee,O]=s.useState(0),[Z,te]=s.useState(!1),[Le,ve]=s.useState(null),[Ie,pe]=s.useState(null),[oe,ye]=s.useState(null),[U,ce]=s.useState(!1),[le,Ce]=s.useState(null),[Fe,Ee]=s.useState(!1),Y=s.useRef(!1),[be,de]=s.useState(!1),[K,ue]=s.useState(!1),He=s.useRef(n),fe=s.useRef(void 0),Q=t[n],Je=Q?sa(Q):!1,Ne=ee!==0||Z,ct=!l&&(!r||!!d),Ke=c&&!l,ut=u.length>1,lt=s.useCallback((A,Pe)=>t.length<=1?null:t[(A+Pe+t.length)%t.length]??null,[t]),Ye=ut?Co(u,p,-1):lt(n,-1),Re=ut?Co(u,p,1):lt(n,1),We=Le===-1&&Ne?ut&&Ie!==null?Co(u,Ie,-1):oe!==null?lt(oe,-1):null:null,Be=Le===1&&Ne?ut&&Ie!==null?Co(u,Ie,1):oe!==null?lt(oe,1):null:null,Ue=We&&We.url!==(Ye==null?void 0:Ye.url)?We:null,ge=Be&&Be.url!==(Re==null?void 0:Re.url)?Be:null,xe=Ye&&Ke?(()=>{const A=ut?sc(u,p,-1):t.length>2?lt((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ye.url?A:null})():null,_e=Re&&Ke?(()=>{const A=ut?sc(u,p,1):t.length>2?lt((n+1)%t.length,1):null;return A&&A.url!==Re.url?A:null})():null,Ze=Ue??xe,we=ge??_e,$e=s.useCallback((A,Pe,Ae)=>{if(!A||!Pe||!Ae)return;const Oe=B.current,at=Oe.get(A);(at==null?void 0:at.width)===Pe&&(at==null?void 0:at.height)===Ae||(Oe.set(A,{width:Pe,height:Ae}),q(Et=>Et+1))},[]),Xe=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Pe=B.current.get(A.url);return d0(y.current,Pe)},[N,j]),ze=s.useCallback(()=>{if(!Q)return;const A=Xe(Q);if(A){re(A);return}const Pe=y.current;Pe&&re(lc(Pe))},[Q,Xe]),Te=s.useCallback(A=>{if(ut){const Pe=u.length;pe((p+A+Pe)%Pe),ye(null);return}t.length>1&&(ye((n+A+t.length)%t.length),pe(null))},[ut,u.length,p,t.length,n]),Ve=s.useCallback(A=>{E.current=A,te(A)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),tt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ve(!1)},yo+32)},[De,Ve]),nt=s.useCallback(()=>{const A=C.current;if(!A){se({left:0,top:0,width:typeof window<"u"?window.innerWidth:Wa.width,height:typeof window<"u"?window.innerHeight:Wa.height});return}const Pe=A.getBoundingClientRect();se({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),st=s.useCallback((A,Pe)=>{if(Ne){if(be&&!Z)return`translate(${ee}px, 0px)`;if(Z&&Le!==null){const Ae=Xe(A);if(!Ae)return;const{x:Oe,y:at}=h0(Ae,Pe,Le,M);return`translate(${Oe}px, ${at}px)`}if(Z)return"translate(0px, 0px)"}},[Ne,be,Z,ee,Le,M,Xe]),St=s.useCallback(()=>{const A=z.current;z.current=null,De(),Ve(!1),ve(null),pe(null),ye(null),O(0),de(!1),I.current=!1,H.current=0,$.current="none",A===-1?f():A===1&&x()},[De,Ve,f,x]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{z.current!==null&&St()},yo+32)},[De,St]),zt=s.useCallback(()=>{De(),z.current=null,Ve(!1),ve(null),pe(null),ye(null),O(0),de(!1),I.current=!1,H.current=0,$.current="none"},[De,Ve]),ft=s.useCallback(A=>{if(!(!Ke||!ae)){if(E.current){if(z.current===A){F.current=A,St();return}zt()}De(),Te(A),z.current=A,ve(A),Ve(!0),Bt()}},[Ke,ae,St,zt,De,Te,Ve,Bt]);X.current=ft;const wt=s.useCallback(()=>{ie.current=null,V.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),jt=s.useCallback(A=>{L.current!==null&&window.clearInterval(L.current);const Pe=V.current?o0:i0;L.current=window.setInterval(()=>{X.current(A)},Pe)},[]),At=s.useCallback(A=>{ie.current!==A&&(wt(),ie.current=A,V.current=!1,X.current(A),jt(A),_.current=window.setTimeout(()=>{_.current=null,ie.current===A&&(V.current=!0,jt(A))},n0))},[wt,jt]),xt=s.useCallback(()=>{const A=y.current;if(!A)return;const Pe=Q==null?void 0:Q.url,Ae=Pe?B.current.get(Pe):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){re(as(A,Ae.width,Ae.height));return}const Oe=S.current;if(Oe&&Pe&&(Oe.src===Pe||Oe.currentSrc===Pe)){const{width:Et,height:it}=c0(Oe);if(Et&&it){$e(Pe,Et,it),re(as(A,Et,it));return}}const at=lc(A);!at.width||!at.height||re(at)},[Q==null?void 0:Q.url,$e]),Ft=s.useCallback(A=>{if(S.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{nt(),xt(),b(A=>A+1)},[nt,xt]);s.useEffect(()=>{Nt();const A=y.current,Pe=C.current,Ae=new ResizeObserver(()=>Nt());return A&&Ae.observe(A),Pe&&Ae.observe(Pe),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,v]),s.useLayoutEffect(()=>{if(!Q)return;const A=S.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[Q==null?void 0:Q.url,n,xt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const A=new Set,Pe=[],Ae=Oe=>{!(Oe!=null&&Oe.url)||A.has(Oe.url)||(A.add(Oe.url),Pe.push(Oe))};t.forEach(Ae),u.forEach(Oe=>Oe.items.forEach(Ae)),Pe.forEach(Oe=>{B.current.has(Oe.url)||u0(Oe,$e)})},[t,u,$e]),s.useEffect(()=>{if(k!=="opening"||!ae)return;if(!w){G("open");return}ce(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),G("open")})});return()=>cancelAnimationFrame(A)},[k,ae,w]),s.useEffect(()=>{if(k!=="closing")return;const A=setTimeout(()=>h(),In);return()=>clearTimeout(A)},[k,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{He.current===n&&fe.current===(Q==null?void 0:Q.url)||(De(),z.current=null,ve(null),pe(null),ye(null),J(0),O(0),Ve(!1),ue(!1),de(!1),T.current=0,H.current=0,$.current="none",I.current=!1,D.current=null,P.current=!1,S.current=null,ze(),He.current=n,fe.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,Ve,De,ze]),s.useLayoutEffect(()=>{const A=F.current;A!==null&&(F.current=null,requestAnimationFrame(()=>{X.current(A)}))},[n,p,Q==null?void 0:Q.url]),s.useLayoutEffect(()=>{if(k==="opening"){Y.current=!1,Ee(!1);return}if(k!=="open"||Y.current)return;if(!Ye&&!Re){Y.current=!0;return}Ee(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ee(!0),Y.current=!0})});return()=>cancelAnimationFrame(A)},[k,Ye==null?void 0:Ye.url,Re==null?void 0:Re.url]),s.useEffect(()=>{if(k!=="open")return;const A=()=>{const it=vt=>{vt.stopPropagation(),vt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Pe=it=>{const vt=it<0?1:-1;De(),Te(vt),z.current=vt,ve(vt),Ve(!0),Bt()},Ae=it=>{if(Math.abs(it)>t0&&Ke){Pe(it);return}z.current=null,ve(null),pe(null),ye(null),Ve(!0),O(0),tt()},Oe=it=>{if(it.touches.length!==1||E.current)return;const vt=it.touches[0];P.current=!0,D.current={x:vt.clientX,y:vt.clientY},$.current="none",H.current=0,I.current=!1},at=it=>{if(!D.current||it.touches.length!==1||E.current)return;const vt=it.touches[0],Ot=vt.clientX-D.current.x,It=vt.clientY-D.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ke)return;$.current="horizontal"}else if(It>0){if(!ct)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,de(!0),H.current=Ot,O(Ot),it.preventDefault();return}$.current==="vertical"&&(I.current=!0,de(!0),T.current=It,J(It),it.preventDefault())},Et=()=>{if(!D.current)return;const it=$.current,vt=I.current;if(vt&&it==="horizontal")Ae(H.current),A();else if(vt&&it==="vertical"){const Ot=T.current;if(ct&&Ot>e0){const It=window.innerHeight;T.current=It,ue(!0),J(It),G("closing")}else T.current=0,J(0);A()}else it==="horizontal"&&Math.abs(H.current)>0&&(Ae(H.current),A());D.current=null,$.current="none",H.current=0,I.current=!1,de(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[k,Ke,Ve,tt,De,ct,Bt,Te]);const Kt=s.useCallback(()=>{const A=(m==null?void 0:m())??w??null;A&&ae&&(Ce(A),ce(!0)),G("closing")},[m,w,ae]);s.useEffect(()=>{const A=Oe=>{if(Oe.key==="Escape"){if(r&&d||k==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||k!=="open"||!Ke)return;Oe.preventDefault();const at=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&ie.current===at||At(at)},Pe=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const at=Oe.key==="ArrowLeft"?-1:1;ie.current===at&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Pe),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Pe),window.removeEventListener("blur",Ae),wt()}},[k,r,d,Kt,Ke,At,wt]),s.useEffect(()=>{k!=="open"&&wt()},[k,wt]);const Jt=()=>{k==="closing"||l||Kt()},Tt=k==="open",Wt=k==="closing",rn=he>0?Math.max(0,1-he/500):1,gt=he>0?Math.max(.35,1-he/500):1,ke=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!E.current)){if(z.current!==null){St();return}De(),Ve(!1)}},[De,Ve,St]),Ge=k==="closing"?le??w:w,rt=Ge&&ae&&(k==="opening"||Wt)?r0(Ge,ae):void 0,ht=Ne&&Q?st(Q,"center"):he>0?`translateY(${he}px)`:rt,yt=ae?yr(ae,M):null,Lt=!!(Ge&&ae),mt=Lt&&(k==="closing"||k==="open"&&U),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:he>0?gt:Lt?1:k==="opening"||Wt?0:1,transition:be&&!Z?"none":Z?`transform ${yo}ms ${mn}`:K?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:k==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Je&&Tt&&!Ne?"auto":"none",touchAction:Je&&Tt?"none":void 0,zIndex:1,overflow:Je?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Ne?"auto":"none"},Mt=(A,Pe,Ae="adjacent")=>{const Oe=Xe(A);if(!Oe)return{display:"none"};const at=Ae==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:Et}=Le!==null?qd(Oe,at,Le,M):{start:Ae==="far"?Or(Oe,Pe,M):oo(Oe,Pe,M)},it=yr(Et,M),vt=st(A,at),Ot=!Ne&&Ae==="adjacent"&&Tt&&!Fe?f0(Oe,Pe,M):null,It=Ae==="far"&&Ne&&Le===(Pe==="left"?-1:1),nn=be&&!Z?!1:Z,un=Ae==="adjacent"&&Tt&&Fe&&!Ne;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:vt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ae==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ae==="far"?`transform ${yo}ms ${mn}`:`transform ${yo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:k==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(A,Pe)=>{const Ae=Xe(A);return Ae?g0(oo(Ae,Pe,M),Pe,M):null},qt=A=>Pe=>{if(!l){if(P.current){P.current=!1;return}Pe.stopPropagation(),ft(A)}},Ht=Ye?Xt(Ye,"left"):null,Dt=Re?Xt(Re,"right"):null,_t=Ht?yr(Ht,M):null,Ct=Dt?yr(Dt,M):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:k==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:be?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:be?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Rd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Ze&&a.jsx(vr,{media:Ze,style:Mt(Ze,"left","far"),onMeasure:$e,onTransitionEnd:ke},`far-prev-${Ze.url}`),Tt&&Ye&&a.jsxs(a.Fragment,{children:[a.jsx(vr,{media:Ye,style:Mt(Ye,"left"),onMeasure:$e,onTransitionEnd:ke},`prev-${Ye.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||be?"default":"pointer",pointerEvents:l||be?"none":"auto",zIndex:3},onClick:qt(-1)})]}),Tt&&Re&&a.jsxs(a.Fragment,{children:[a.jsx(vr,{media:Re,style:Mt(Re,"right"),onMeasure:$e,onTransitionEnd:ke},`next-${Re.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||be?"default":"pointer",pointerEvents:l||be?"none":"auto",zIndex:3},onClick:qt(1)})]}),Tt&&we&&a.jsx(vr,{media:we,style:Mt(we,"right","far"),onMeasure:$e,onTransitionEnd:ke},`far-next-${we.url}`),ae&&Q&&(Je?a.jsx(y0,{src:Q.url,phase:k,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:ke},`${n}-${Q.url}`):a.jsx("img",{ref:Ft,src:Q.url,alt:Q.name,onLoad:xt,onTransitionEnd:ke,style:Vt},`${n}-${Q.url}`))]})}const x0=20,b0=.18;function w0(e){return`
|
|
18693
|
+
`}const In=500,yo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",e0=72,t0=50,n0=1e4,i0=650,o0=500;function r0(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Gd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Nr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function a0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Gd(i,n):null}function s0(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function Co(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function sc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Co(e,i,n)}const l0=.03;function Xd(e){return e.width*l0}const Wa={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function yr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function lc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function c0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function as(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function d0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:as(e,t.width,t.height)}function u0(e,t){if(sa(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function p0(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function m0({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>sa(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function oo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Xd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Or(e,t,n){const i=oo(e,t,n);return{...i,left:2*i.left-e.left}}function g0(e,t,n){const{left:i,width:o}=n,r=Xd(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function qd(e,t,n,i){const o=oo(e,"left",i),r=oo(e,"right",i),l=Or(e,"left",i),d=Or(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function h0(e,t,n,i){const{start:o,end:r}=qd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function f0(e,t,n){const i=oo(e,t,n),o=Or(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function sa(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function y0({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function vr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return sa(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function v0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:x}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),z=s.useRef(new Map),[N,Y]=s.useState(0),B=s.useRef(null),T=s.useRef(0),H=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),P=s.useRef(!1),M=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),A=s.useRef(null),X=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),_=s.useRef(null),V=s.useRef(!1),[se,re]=s.useState(null),[k,le]=s.useState(Wa),[G,b]=s.useState(0),[E,j]=s.useState("opening"),[me,K]=s.useState(0),[te,O]=s.useState(0),[J,ne]=s.useState(!1),[Pe,be]=s.useState(null),[Re,ue]=s.useState(null),[fe,$e]=s.useState(null),[Q,Z]=s.useState(!1),[ae,xe]=s.useState(null),[ke,Ce]=s.useState(!1),q=s.useRef(!1),[ye,ce]=s.useState(!1),[U,de]=s.useState(!1),He=s.useRef(n),he=s.useRef(void 0),ee=t[n],Je=ee?sa(ee):!1,Ne=te!==0||J,ct=!l&&(!r||!!d),Ke=c&&!l,ut=u.length>1,lt=s.useCallback((F,Ee)=>t.length<=1?null:t[(F+Ee+t.length)%t.length]??null,[t]),Ye=ut?Co(u,p,-1):lt(n,-1),Le=ut?Co(u,p,1):lt(n,1),We=Pe===-1&&Ne?ut&&Re!==null?Co(u,Re,-1):fe!==null?lt(fe,-1):null:null,Be=Pe===1&&Ne?ut&&Re!==null?Co(u,Re,1):fe!==null?lt(fe,1):null:null,Ue=We&&We.url!==(Ye==null?void 0:Ye.url)?We:null,ge=Be&&Be.url!==(Le==null?void 0:Le.url)?Be:null,ve=Ye&&Ke?(()=>{const F=ut?sc(u,p,-1):t.length>2?lt((n-1+t.length)%t.length,-1):null;return F&&F.url!==Ye.url?F:null})():null,_e=Le&&Ke?(()=>{const F=ut?sc(u,p,1):t.length>2?lt((n+1)%t.length,1):null;return F&&F.url!==Le.url?F:null})():null,Ze=Ue??ve,we=ge??_e,Te=s.useCallback((F,Ee,Fe)=>{if(!F||!Ee||!Fe)return;const Oe=z.current,at=Oe.get(F);(at==null?void 0:at.width)===Ee&&(at==null?void 0:at.height)===Fe||(Oe.set(F,{width:Ee,height:Fe}),Y(Et=>Et+1))},[]),Xe=s.useCallback(F=>{if(!(F!=null&&F.url))return null;const Ee=z.current.get(F.url);return d0(y.current,Ee)},[N,G]),ze=s.useCallback(()=>{if(!ee)return;const F=Xe(ee);if(F){re(F);return}const Ee=y.current;Ee&&re(lc(Ee))},[ee,Xe]),Ie=s.useCallback(F=>{if(ut){const Ee=u.length;ue((p+F+Ee)%Ee),$e(null);return}t.length>1&&($e((n+F+t.length)%t.length),ue(null))},[ut,u.length,p,t.length,n]),Ve=s.useCallback(F=>{M.current=F,ne(F)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),tt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ve(!1)},yo+32)},[De,Ve]),nt=s.useCallback(()=>{const F=C.current;if(!F){le({left:0,top:0,width:typeof window<"u"?window.innerWidth:Wa.width,height:typeof window<"u"?window.innerHeight:Wa.height});return}const Ee=F.getBoundingClientRect();le({left:Ee.left,top:Ee.top,width:Ee.width,height:Ee.height})},[]),st=s.useCallback((F,Ee)=>{if(Ne){if(ye&&!J)return`translate(${te}px, 0px)`;if(J&&Pe!==null){const Fe=Xe(F);if(!Fe)return;const{x:Oe,y:at}=h0(Fe,Ee,Pe,k);return`translate(${Oe}px, ${at}px)`}if(J)return"translate(0px, 0px)"}},[Ne,ye,J,te,Pe,k,Xe]),St=s.useCallback(()=>{const F=D.current;D.current=null,De(),Ve(!1),be(null),ue(null),$e(null),O(0),ce(!1),I.current=!1,H.current=0,$.current="none",F===-1?f():F===1&&x()},[De,Ve,f,x]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{D.current!==null&&St()},yo+32)},[De,St]),zt=s.useCallback(()=>{De(),D.current=null,Ve(!1),be(null),ue(null),$e(null),O(0),ce(!1),I.current=!1,H.current=0,$.current="none"},[De,Ve]),ft=s.useCallback(F=>{if(!(!Ke||!se)){if(M.current){if(D.current===F){A.current=F,St();return}zt()}De(),Ie(F),D.current=F,be(F),Ve(!0),Bt()}},[Ke,se,St,zt,De,Ie,Ve,Bt]);X.current=ft;const wt=s.useCallback(()=>{ie.current=null,V.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),jt=s.useCallback(F=>{L.current!==null&&window.clearInterval(L.current);const Ee=V.current?o0:i0;L.current=window.setInterval(()=>{X.current(F)},Ee)},[]),At=s.useCallback(F=>{ie.current!==F&&(wt(),ie.current=F,V.current=!1,X.current(F),jt(F),_.current=window.setTimeout(()=>{_.current=null,ie.current===F&&(V.current=!0,jt(F))},n0))},[wt,jt]),xt=s.useCallback(()=>{const F=y.current;if(!F)return;const Ee=ee==null?void 0:ee.url,Fe=Ee?z.current.get(Ee):void 0;if(Fe!=null&&Fe.width&&(Fe!=null&&Fe.height)){re(as(F,Fe.width,Fe.height));return}const Oe=S.current;if(Oe&&Ee&&(Oe.src===Ee||Oe.currentSrc===Ee)){const{width:Et,height:it}=c0(Oe);if(Et&&it){Te(Ee,Et,it),re(as(F,Et,it));return}}const at=lc(F);!at.width||!at.height||re(at)},[ee==null?void 0:ee.url,Te]),Ft=s.useCallback(F=>{if(S.current=F,!!F){if(F instanceof HTMLVideoElement){F.readyState>=1&&F.videoWidth>0&&xt();return}F.complete&&F.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{nt(),xt(),b(F=>F+1)},[nt,xt]);s.useEffect(()=>{Nt();const F=y.current,Ee=C.current,Fe=new ResizeObserver(()=>Nt());return F&&Fe.observe(F),Ee&&Fe.observe(Ee),window.addEventListener("resize",Nt),()=>{Fe.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,v]),s.useLayoutEffect(()=>{if(!ee)return;const F=S.current;if(F){if(F instanceof HTMLImageElement&&F.complete&&F.naturalWidth>0){xt();return}F instanceof HTMLVideoElement&&F.readyState>=1&&F.videoWidth>0&&xt()}},[ee==null?void 0:ee.url,n,xt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const F=new Set,Ee=[],Fe=Oe=>{!(Oe!=null&&Oe.url)||F.has(Oe.url)||(F.add(Oe.url),Ee.push(Oe))};t.forEach(Fe),u.forEach(Oe=>Oe.items.forEach(Fe)),Ee.forEach(Oe=>{z.current.has(Oe.url)||u0(Oe,Te)})},[t,u,Te]),s.useEffect(()=>{if(E!=="opening"||!se)return;if(!w){j("open");return}Z(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),j("open")})});return()=>cancelAnimationFrame(F)},[E,se,w]),s.useEffect(()=>{if(E!=="closing")return;const F=setTimeout(()=>h(),In);return()=>clearTimeout(F)},[E,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{He.current===n&&he.current===(ee==null?void 0:ee.url)||(De(),D.current=null,be(null),ue(null),$e(null),K(0),O(0),Ve(!1),de(!1),ce(!1),T.current=0,H.current=0,$.current="none",I.current=!1,B.current=null,P.current=!1,S.current=null,ze(),He.current=n,he.current=ee==null?void 0:ee.url)},[n,ee==null?void 0:ee.url,Ve,De,ze]),s.useLayoutEffect(()=>{const F=A.current;F!==null&&(A.current=null,requestAnimationFrame(()=>{X.current(F)}))},[n,p,ee==null?void 0:ee.url]),s.useLayoutEffect(()=>{if(E==="opening"){q.current=!1,Ce(!1);return}if(E!=="open"||q.current)return;if(!Ye&&!Le){q.current=!0;return}Ce(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),q.current=!0})});return()=>cancelAnimationFrame(F)},[E,Ye==null?void 0:Ye.url,Le==null?void 0:Le.url]),s.useEffect(()=>{if(E!=="open")return;const F=()=>{const it=vt=>{vt.stopPropagation(),vt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Ee=it=>{const vt=it<0?1:-1;De(),Ie(vt),D.current=vt,be(vt),Ve(!0),Bt()},Fe=it=>{if(Math.abs(it)>t0&&Ke){Ee(it);return}D.current=null,be(null),ue(null),$e(null),Ve(!0),O(0),tt()},Oe=it=>{if(it.touches.length!==1||M.current)return;const vt=it.touches[0];P.current=!0,B.current={x:vt.clientX,y:vt.clientY},$.current="none",H.current=0,I.current=!1},at=it=>{if(!B.current||it.touches.length!==1||M.current)return;const vt=it.touches[0],Ot=vt.clientX-B.current.x,It=vt.clientY-B.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ke)return;$.current="horizontal"}else if(It>0){if(!ct)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,ce(!0),H.current=Ot,O(Ot),it.preventDefault();return}$.current==="vertical"&&(I.current=!0,ce(!0),T.current=It,K(It),it.preventDefault())},Et=()=>{if(!B.current)return;const it=$.current,vt=I.current;if(vt&&it==="horizontal")Fe(H.current),F();else if(vt&&it==="vertical"){const Ot=T.current;if(ct&&Ot>e0){const It=window.innerHeight;T.current=It,de(!0),K(It),j("closing")}else T.current=0,K(0);F()}else it==="horizontal"&&Math.abs(H.current)>0&&(Fe(H.current),F());B.current=null,$.current="none",H.current=0,I.current=!1,ce(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[E,Ke,Ve,tt,De,ct,Bt,Ie]);const Kt=s.useCallback(()=>{const F=(m==null?void 0:m())??w??null;F&&se&&(xe(F),Z(!0)),j("closing")},[m,w,se]);s.useEffect(()=>{const F=Oe=>{if(Oe.key==="Escape"){if(r&&d||E==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||E!=="open"||!Ke)return;Oe.preventDefault();const at=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&ie.current===at||At(at)},Ee=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const at=Oe.key==="ArrowLeft"?-1:1;ie.current===at&&wt()},Fe=()=>{wt()};return window.addEventListener("keydown",F),window.addEventListener("keyup",Ee),window.addEventListener("blur",Fe),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",Ee),window.removeEventListener("blur",Fe),wt()}},[E,r,d,Kt,Ke,At,wt]),s.useEffect(()=>{E!=="open"&&wt()},[E,wt]);const Jt=()=>{E==="closing"||l||Kt()},Tt=E==="open",Wt=E==="closing",rn=me>0?Math.max(0,1-me/500):1,gt=me>0?Math.max(.35,1-me/500):1,Ae=s.useCallback(F=>{if(!(F.propertyName!=="transform"||!M.current)){if(D.current!==null){St();return}De(),Ve(!1)}},[De,Ve,St]),Ge=E==="closing"?ae??w:w,rt=Ge&&se&&(E==="opening"||Wt)?r0(Ge,se):void 0,ht=Ne&&ee?st(ee,"center"):me>0?`translateY(${me}px)`:rt,yt=se?yr(se,k):null,Lt=!!(Ge&&se),mt=Lt&&(E==="closing"||E==="open"&&Q),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:me>0?gt:Lt?1:E==="opening"||Wt?0:1,transition:ye&&!J?"none":J?`transform ${yo}ms ${mn}`:U?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:E==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Je&&Tt&&!Ne?"auto":"none",touchAction:Je&&Tt?"none":void 0,zIndex:1,overflow:Je?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Ne?"auto":"none"},Mt=(F,Ee,Fe="adjacent")=>{const Oe=Xe(F);if(!Oe)return{display:"none"};const at=Fe==="far"?Ee==="left"?"far-left":"far-right":Ee==="left"?"left-adjacent":"right-adjacent",{start:Et}=Pe!==null?qd(Oe,at,Pe,k):{start:Fe==="far"?Or(Oe,Ee,k):oo(Oe,Ee,k)},it=yr(Et,k),vt=st(F,at),Ot=!Ne&&Fe==="adjacent"&&Tt&&!ke?f0(Oe,Ee,k):null,It=Fe==="far"&&Ne&&Pe===(Ee==="left"?-1:1),nn=ye&&!J?!1:J,un=Fe==="adjacent"&&Tt&&ke&&!Ne;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:vt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Fe==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Fe==="far"?`transform ${yo}ms ${mn}`:`transform ${yo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:E==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(F,Ee)=>{const Fe=Xe(F);return Fe?g0(oo(Fe,Ee,k),Ee,k):null},qt=F=>Ee=>{if(!l){if(P.current){P.current=!1;return}Ee.stopPropagation(),ft(F)}},Ht=Ye?Xt(Ye,"left"):null,Dt=Le?Xt(Le,"right"):null,_t=Ht?yr(Ht,k):null,Ct=Dt?yr(Dt,k):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:E==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:ye?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:ye?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Rd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Ze&&a.jsx(vr,{media:Ze,style:Mt(Ze,"left","far"),onMeasure:Te,onTransitionEnd:Ae},`far-prev-${Ze.url}`),Tt&&Ye&&a.jsxs(a.Fragment,{children:[a.jsx(vr,{media:Ye,style:Mt(Ye,"left"),onMeasure:Te,onTransitionEnd:Ae},`prev-${Ye.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||ye?"default":"pointer",pointerEvents:l||ye?"none":"auto",zIndex:3},onClick:qt(-1)})]}),Tt&&Le&&a.jsxs(a.Fragment,{children:[a.jsx(vr,{media:Le,style:Mt(Le,"right"),onMeasure:Te,onTransitionEnd:Ae},`next-${Le.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||ye?"default":"pointer",pointerEvents:l||ye?"none":"auto",zIndex:3},onClick:qt(1)})]}),Tt&&we&&a.jsx(vr,{media:we,style:Mt(we,"right","far"),onMeasure:Te,onTransitionEnd:Ae},`far-next-${we.url}`),se&&ee&&(Je?a.jsx(y0,{src:ee.url,phase:E,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Ae},`${n}-${ee.url}`):a.jsx("img",{ref:Ft,src:ee.url,alt:ee.name,onLoad:xt,onTransitionEnd:Ae,style:Vt},`${n}-${ee.url}`))]})}const x0=20,b0=.18;function w0(e){return`
|
|
18694
18694
|
.${e}-wrapper {
|
|
18695
18695
|
box-sizing: border-box;
|
|
18696
18696
|
max-width: 100%;
|
|
@@ -18778,7 +18778,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18778
18778
|
pointer-events: auto;
|
|
18779
18779
|
}
|
|
18780
18780
|
${Qx(e)}
|
|
18781
|
-
`}function S0(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,d=i?o:r;return d>0?l/d:1}function C0(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function $0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:W.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:W.scalingValue(i*b0,n??!1),[`--${t}-image-aspect`]:S0(e)}}function T0(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function I0(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function R0(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?Gd(d,o):void 0)}}function L0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>w0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",v=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=W.scalingValue(w,n??!1),h=`max(${m}, ${x0}px)`,{objectFitMode:f,imageStyle:x}=I0(e),C=T0(e,n),y=s.useRef(null),[S,
|
|
18781
|
+
`}function S0(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,d=i?o:r;return d>0?l/d:1}function C0(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function $0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:W.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:W.scalingValue(i*b0,n??!1),[`--${t}-image-aspect`]:S0(e)}}function T0(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function I0(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function R0(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?Gd(d,o):void 0)}}function L0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>w0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",v=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=W.scalingValue(w,n??!1),h=`max(${m}, ${x0}px)`,{objectFitMode:f,imageStyle:x}=I0(e),C=T0(e,n),y=s.useRef(null),[S,z]=s.useState(!1),[N,Y]=s.useState([]),[B,T]=s.useState(0),[H,$]=s.useState(0),[I,P]=s.useState(null),[M,g]=s.useState({title1:"",title2:"",title3:""}),D=(!n||i)&&!S,A=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},X=A.sizeType??"none",ie=D&&X!=="none"?`${d}-item-image-hover-${X}`:void 0,L=(A.value??120)/100,_=s.useCallback(te=>{!te||X!=="scale"||(te.style.transformOrigin=Sg(te))},[X]),V=s.useCallback(te=>{if(te){if(f==="contain"){const O=C0(te);if(O){const J=te.closest(`.${d}-item-image`);J instanceof HTMLElement&&J.style.setProperty(`--${d}-item-media-aspect`,String(O))}}_(te)}},[d,_,f]),se={width:W.scalingValue(v,n??!1),...C,...$0(e,d,n),[`--${d}-image-hover-scale`]:String(L)},re=(()=>{const te={},O=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return O&&(te["--cntrl-article-width"]=O),te})(),k=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),le=s.useMemo(()=>s0(u),[u]),G=s.useMemo(()=>p0(u),[u]),b=(te,O)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const J=le.findIndex(Pe=>Pe.gridIndex===te);if(J<0)return;const ne=le[J];$(J),Y(ne.items),T(0),g(ne.entry),P(O??null),z(!0)},E=s.useCallback(()=>{z(!1),P(null)},[]),j=s.useCallback(()=>{const te=le[H];return!te||!y.current?I:a0(y.current,te.gridIndex,f)??I},[le,H,I,f]),me=s.useCallback(te=>{if(le.length>1){const O=le.length,J=(H+te+O)%O,ne=le[J];$(J),Y(ne.items),T(0),g(ne.entry);return}T(O=>(O+te+N.length)%N.length)},[le,H,N.length]),K=le.length>1||N.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const te=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=te}},[S]),s.useEffect(()=>{!n||o||i||z(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&z(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(m0,{mediaList:G}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:se,children:u.map((te,O)=>{var Pe,be;const J=!!((Pe=te.image)!=null&&Pe.url),ne=R0(!!k,J,O,d,f,b);return a.jsxs("div",{className:`${d}-item`,children:[te.title?a.jsx("span",{className:`${d}-item-title`,onClick:ne,style:ne?{cursor:"pointer"}:void 0,children:te.title}):null,(be=te.image)!=null&&be.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:te.image.type==="video"?a.jsx("video",{ref:V,src:te.image.url,"data-waterfall-index":O,style:x,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:ne,onLoadedData:Re=>V(Re.currentTarget)}):a.jsx("img",{ref:V,src:te.image.url,alt:te.image.name??"","data-waterfall-index":O,style:x,onClick:ne,onLoad:Re=>V(Re.currentTarget)})}):null,O<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},children:o&&!S&&a.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:h,height:"100%"}})})]},O)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const te=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:re,"data-selection":"none",children:a.jsx(v0,{prefix:d,items:N,index:B,entry:M,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:K,lightboxEntries:le,entryIdx:H,layoutId:r,sourceRect:I,resolveCloseSourceRect:j,onClose:E,onPrev:()=>me(-1),onNext:()=>me(1)})}),te)})()]})}const P0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18782
18782
|
import type React from 'react';
|
|
18783
18783
|
import { createPortal } from 'react-dom';
|
|
18784
18784
|
import { CommonComponentProps } from '../props';
|
|
@@ -19562,7 +19562,7 @@ export function Waterfall({
|
|
|
19562
19562
|
from { clip-path: inset(100% 0 0 0); }
|
|
19563
19563
|
to { clip-path: inset(0 0 0 0); }
|
|
19564
19564
|
}
|
|
19565
|
-
`}function Z0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=W.useScopedStyles(),l=G0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??dc,p=u.sizeType??"drag",v=u.value??dc.value,w=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=j0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Re=>W.scalingValue(Re*C,n),S=(e==null?void 0:e.show)??"always",B=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,q=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,D=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,T=(e==null?void 0:e.controlsColor)??cc.color,H=(e==null?void 0:e.controlsHoverColor)??cc.hover,$=(e==null?void 0:e.navColor)??vo.colors.inactive,I=(e==null?void 0:e.navPaginationColor)??vo.colors.pagination,P=(e==null?void 0:e.navBackgroundColor)??vo.colors.background,E=(e==null?void 0:e.linkColor)??Da.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,z=w==="horizontal",F=p==="click",X=p==="drag",ie=p==="auto"&&(!n||!!i),L=!n,_=m==="slide",V=h==="classic",ae=S!=="never",re=S==="on hover",M=W.scalingValue(N,n),se={width:M,height:M,maxWidth:M},j=_&&c>1,[b,k]=s.useState(0),[G,he]=s.useState(j?1:0),[J,ee]=s.useState(!1),[O,Z]=s.useState(!1),[te,Le]=s.useState(!1),[ve,Ie]=s.useState(0),[pe,oe]=s.useState(!1),[ye,U]=s.useState(!1),ce=s.useRef(!1),le=s.useRef(G);le.current=G;const Ce=s.useRef(null),Fe=s.useRef(0),Ee=s.useRef(null),Y=s.useRef(null),be=s.useRef(null),de=s.useRef(null),K=s.useCallback(Re=>{ce.current=Re,ee(Re)},[]),ue=s.useCallback(Re=>{if(c<2||Re===0)return;const We=Re>0?1:-1,Be=Math.abs(Re);if(oe(!0),K(!0),!_){k(we=>$o(we+Re,c));return}let Ue=le.current;const ge=j&&(Ue===0||Ue===c+1),xe=ge?b+1:null;ge&&(Ue=b+1);let _e=Be;for(;_e>0;){const we=X0(Ue,We,c,j);if(Ue=we.position,_e-=1,we.hitBoundary){Fe.current=_e*We;break}}const Ze=Be-_e;if(Ze>0&&k(we=>$o(we+Ze*We,c)),le.current=Ue,xe!==null){if(le.current=xe,Ue===xe){Z(!0),he(Ue);return}Ce.current=Ue,Z(!0),he(xe);return}Z(!1),he(Ue)},[b,c,j,_,K]),He=s.useCallback(Re=>{ue(Re)},[ue]),fe=s.useCallback(Re=>{if(c<2)return;const We=$o(Re,c);if(!(We===b&&!ce.current)&&(oe(!0),K(!0),k(We),_)){const Be=We+(j?1:0);Ce.current=null,Fe.current=0,le.current=Be,Z(!1),he(Be)}},[b,c,j,_,K]);s.useEffect(()=>{if(!J)return;const Re=window.setTimeout(()=>{if(j&&(G===0||G===c+1)){Ce.current=null,Z(!0),he(b+1);return}K(!1)},Xi);return()=>window.clearTimeout(Re)},[b,c,j,J,K,G]),s.useEffect(()=>{if(!O)return;let Re=0;const We=requestAnimationFrame(()=>{Re=requestAnimationFrame(()=>{const Be=Ce.current;Ce.current=null;const Ue=Fe.current;if(Fe.current=0,Z(!1),Be!==null){le.current=Be,he(Be);return}if(Ue!==0){ue(Ue);return}K(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Re)}},[ue,K,O]);const Q=`${j}:${c}`,Je=s.useRef(Q);s.useEffect(()=>{if(Je.current===Q)return;Je.current=Q;const Re=c>0?Math.min(b,c-1):0;be.current=null,de.current=null,Le(!1),Ie(0),k(Re),Z(!0),he(Re+(j?1:0))},[b,c,j,Q]),s.useEffect(()=>{if(!pe)return;const Re=window.setTimeout(()=>oe(!1),H0);return()=>window.clearTimeout(Re)},[pe,b]),s.useEffect(()=>{if(!ie||c<2)return;const Re=Math.max(v,.1)*1e3,We=window.setInterval(()=>{L&&ye||He(1)},Re);return()=>window.clearInterval(We)},[v,c,He,ie,ye,L]);const Ne=s.useCallback(Re=>{const We=be.current;if(!We||We.pointerId!==Re.pointerId)return;be.current=null,de.current=null;const Be=Ee.current;if(Be!=null&&Be.hasPointerCapture(Re.pointerId)&&Be.releasePointerCapture(Re.pointerId),!We.isActive){_&&Ie(0);return}const ge=!(Re.timeStamp-We.lastTime>z0)&&Math.abs(We.velocity)>B0,xe=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*O0;if(Le(!1),!ge&&!xe){Ie(0);return}const _e=xe?We.offset-We.baseOffset:We.velocity;let Ze=1;xe&&We.size>0&&(Ze=Math.max(1,Math.round(Math.abs(_e)/We.size))),Ie(0),ue(_e<0?Ze:-Ze)},[ue,_]);s.useEffect(()=>{const Re=We=>{de.current===null||We.pointerId!==de.current||Ne(We)};return window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re),()=>{window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re)}},[Ne]);const ct=Re=>{const We=Ee.current;if(!X||c<2||!We||Re.pointerType==="mouse"&&Re.button!==0)return;Ce.current=null,Fe.current=0,ce.current&&K(!1);let Be=0;const Ue=Y.current;if(_&&Ue){const ge=z?Ue.offsetWidth:Ue.offsetHeight;if(ge>0){const xe=q0(Ue,z);let _e=le.current;j&&(_e===0||_e===c+1)?(_e=b+1,le.current=_e,Z(!0),he(_e),Be=0):Be=xe+_e*ge,Ie(Be)}}We.setPointerCapture(Re.pointerId),de.current=Re.pointerId,be.current={pointerId:Re.pointerId,startClientX:Re.clientX,startClientY:Re.clientY,axes:Y0(We,`${r}-axis-probe`),size:z?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Re.timeStamp,velocity:0}},Ke=Re=>{const We=be.current;if(!We||We.pointerId!==Re.pointerId)return;if(Re.pointerType==="mouse"&&Re.buttons===0){Ne(Re);return}const Be=Re.clientX-We.startClientX,Ue=Re.clientY-We.startClientY,ge=We.axes?U0(We.axes,Be,Ue):{x:Be,y:Ue},xe=z?ge.x:ge.y,_e=z?ge.y:ge.x,Ze=We.baseOffset+xe;if(!We.isActive){if(Math.max(Math.abs(xe),Math.abs(_e))<D0)return;if(Math.abs(_e)>Math.abs(xe)){const $e=Ee.current;$e!=null&&$e.hasPointerCapture(We.pointerId)&&$e.releasePointerCapture(We.pointerId),be.current=null,de.current=null,_&&Ie(0);return}We.isActive=!0,Le(!0)}const we=Re.timeStamp-We.lastTime;we>0&&(We.velocity=(Ze-We.offset)/we,We.lastTime=Re.timeStamp),We.offset=Ze,_&&Ie(Ze)},ut=Re=>{Ne(Re)},lt=z?`translate3d(calc(${-G*100}% + ${ve}px), 0, 0)`:`translate3d(0, calc(${-G*100}% + ${ve}px), 0)`,Ye=j?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:K0(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!z}),onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Ee,className:pt(`${r}-track`,{[`${r}-track-draggable`]:X,[`${r}-track-draggable-vertical`]:X&&!z}),onPointerDown:ct,onPointerMove:Ke,onPointerUp:ut,onPointerCancel:ut,onLostPointerCapture:Re=>{de.current===Re.pointerId&&Ne(Re)},children:a.jsx("div",{ref:Y,className:pt(`${r}-list`,{[`${r}-list-slide`]:_,[`${r}-list-slide-vertical`]:_&&!z,[`${r}-list-fade`]:!_}),style:_?{transform:lt,transition:te||O?"none":`transform ${Xi}ms ${Yd}`}:void 0,children:Ye.map((Re,We)=>{const Be=j?$o(We-1,c):We,ge=j&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!_&&Be===b}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:pt(`${r}-slider-image`,{[`${r}-contain`]:Re.image.objectFit==="contain",[`${r}-cover`]:Re.image.objectFit==="cover"}),src:Re.image.url,alt:Re.image.name??"",draggable:!1})})})},ge)})})}),ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:z,[`${r}-arrow-prev-vertical`]:!z,[`${r}-hover-arrow`]:re}),style:{color:T,"--arrow-hover-color":H,...se},children:a.jsxs("button",{onClick:Re=>{Re.stopPropagation(),He(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${W.scalingValue(q,n)}, ${W.scalingValue(D*(z?1:-1),n)}) rotate(${z?"0deg":"90deg"})`},children:[B&&a.jsx(sn,{url:B,fill:T,hoverFill:H,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:se}),!B&&a.jsx(uc,{color:T,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-next`]:z,[`${r}-arrow-next-vertical`]:!z,[`${r}-hover-arrow`]:re}),style:{color:T,"--arrow-hover-color":H,...se},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Re=>{Re.stopPropagation(),He(1)},style:{transform:`translate(${W.scalingValue(q*(z?-1:1),n)}, ${W.scalingValue(D,n)}) rotate(${z?"0deg":"90deg"})`},children:[B&&a.jsx(sn,{url:B,fill:T,hoverFill:H,className:`${r}-arrow-img`,style:se}),!B&&a.jsx(uc,{color:T,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),F&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>He(1)}),V&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:z,[`${r}-pagination-inside-left`]:!z}),style:z?{bottom:y(x.inset)}:{left:y(x.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!z,[`${r}-animate-dots`]:pe}),style:{backgroundColor:P,gap:y(x.gapInactive-x.activeDot+x.dot),...z?{height:y(x.activeDot+x.paddingY*2),paddingTop:y(x.paddingY),paddingBottom:y(x.paddingY),paddingLeft:y(x.paddingActive),paddingRight:y(x.paddingActive)}:{width:y(x.activeDot+x.paddingY*2),paddingLeft:y(x.paddingY),paddingRight:y(x.paddingY),paddingTop:y(x.paddingActive),paddingBottom:y(x.paddingActive)},borderRadius:y(x.borderRadius),transform:`translate(${W.scalingValue(vo.offset.x,n)}, ${W.scalingValue(vo.offset.y,n)})`},children:d.map((Re,We)=>{const Be=We===b,Ue=Be?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>fe(We),className:`${r}-pagination-item`,style:{width:y(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?I:$,width:y(Ue)}})},We)})},`${f}-${w}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:W.scalingValue(g,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Re,We)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===b&&n,[`${r}-active`]:We===b}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Xi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":E,"--link-hover-color":E,position:"relative",top:W.scalingValue(Da.offset.y,n),left:W.scalingValue(Da.offset.x,n)},children:a.jsx(Ri,{content:Re.imageCaption})})},We))})]})]})]})}function uc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const J0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19565
|
+
`}function Z0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=W.useScopedStyles(),l=G0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??dc,p=u.sizeType??"drag",v=u.value??dc.value,w=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=j0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Le=>W.scalingValue(Le*C,n),S=(e==null?void 0:e.show)??"always",z=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,Y=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,B=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,T=(e==null?void 0:e.controlsColor)??cc.color,H=(e==null?void 0:e.controlsHoverColor)??cc.hover,$=(e==null?void 0:e.navColor)??vo.colors.inactive,I=(e==null?void 0:e.navPaginationColor)??vo.colors.pagination,P=(e==null?void 0:e.navBackgroundColor)??vo.colors.background,M=(e==null?void 0:e.linkColor)??Da.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,D=w==="horizontal",A=p==="click",X=p==="drag",ie=p==="auto"&&(!n||!!i),L=!n,_=m==="slide",V=h==="classic",se=S!=="never",re=S==="on hover",k=W.scalingValue(N,n),le={width:k,height:k,maxWidth:k},G=_&&c>1,[b,E]=s.useState(0),[j,me]=s.useState(G?1:0),[K,te]=s.useState(!1),[O,J]=s.useState(!1),[ne,Pe]=s.useState(!1),[be,Re]=s.useState(0),[ue,fe]=s.useState(!1),[$e,Q]=s.useState(!1),Z=s.useRef(!1),ae=s.useRef(j);ae.current=j;const xe=s.useRef(null),ke=s.useRef(0),Ce=s.useRef(null),q=s.useRef(null),ye=s.useRef(null),ce=s.useRef(null),U=s.useCallback(Le=>{Z.current=Le,te(Le)},[]),de=s.useCallback(Le=>{if(c<2||Le===0)return;const We=Le>0?1:-1,Be=Math.abs(Le);if(fe(!0),U(!0),!_){E(we=>$o(we+Le,c));return}let Ue=ae.current;const ge=G&&(Ue===0||Ue===c+1),ve=ge?b+1:null;ge&&(Ue=b+1);let _e=Be;for(;_e>0;){const we=X0(Ue,We,c,G);if(Ue=we.position,_e-=1,we.hitBoundary){ke.current=_e*We;break}}const Ze=Be-_e;if(Ze>0&&E(we=>$o(we+Ze*We,c)),ae.current=Ue,ve!==null){if(ae.current=ve,Ue===ve){J(!0),me(Ue);return}xe.current=Ue,J(!0),me(ve);return}J(!1),me(Ue)},[b,c,G,_,U]),He=s.useCallback(Le=>{de(Le)},[de]),he=s.useCallback(Le=>{if(c<2)return;const We=$o(Le,c);if(!(We===b&&!Z.current)&&(fe(!0),U(!0),E(We),_)){const Be=We+(G?1:0);xe.current=null,ke.current=0,ae.current=Be,J(!1),me(Be)}},[b,c,G,_,U]);s.useEffect(()=>{if(!K)return;const Le=window.setTimeout(()=>{if(G&&(j===0||j===c+1)){xe.current=null,J(!0),me(b+1);return}U(!1)},Xi);return()=>window.clearTimeout(Le)},[b,c,G,K,U,j]),s.useEffect(()=>{if(!O)return;let Le=0;const We=requestAnimationFrame(()=>{Le=requestAnimationFrame(()=>{const Be=xe.current;xe.current=null;const Ue=ke.current;if(ke.current=0,J(!1),Be!==null){ae.current=Be,me(Be);return}if(Ue!==0){de(Ue);return}U(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Le)}},[de,U,O]);const ee=`${G}:${c}`,Je=s.useRef(ee);s.useEffect(()=>{if(Je.current===ee)return;Je.current=ee;const Le=c>0?Math.min(b,c-1):0;ye.current=null,ce.current=null,Pe(!1),Re(0),E(Le),J(!0),me(Le+(G?1:0))},[b,c,G,ee]),s.useEffect(()=>{if(!ue)return;const Le=window.setTimeout(()=>fe(!1),H0);return()=>window.clearTimeout(Le)},[ue,b]),s.useEffect(()=>{if(!ie||c<2)return;const Le=Math.max(v,.1)*1e3,We=window.setInterval(()=>{L&&$e||He(1)},Le);return()=>window.clearInterval(We)},[v,c,He,ie,$e,L]);const Ne=s.useCallback(Le=>{const We=ye.current;if(!We||We.pointerId!==Le.pointerId)return;ye.current=null,ce.current=null;const Be=Ce.current;if(Be!=null&&Be.hasPointerCapture(Le.pointerId)&&Be.releasePointerCapture(Le.pointerId),!We.isActive){_&&Re(0);return}const ge=!(Le.timeStamp-We.lastTime>z0)&&Math.abs(We.velocity)>B0,ve=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*O0;if(Pe(!1),!ge&&!ve){Re(0);return}const _e=ve?We.offset-We.baseOffset:We.velocity;let Ze=1;ve&&We.size>0&&(Ze=Math.max(1,Math.round(Math.abs(_e)/We.size))),Re(0),de(_e<0?Ze:-Ze)},[de,_]);s.useEffect(()=>{const Le=We=>{ce.current===null||We.pointerId!==ce.current||Ne(We)};return window.addEventListener("pointerup",Le),window.addEventListener("pointercancel",Le),()=>{window.removeEventListener("pointerup",Le),window.removeEventListener("pointercancel",Le)}},[Ne]);const ct=Le=>{const We=Ce.current;if(!X||c<2||!We||Le.pointerType==="mouse"&&Le.button!==0)return;xe.current=null,ke.current=0,Z.current&&U(!1);let Be=0;const Ue=q.current;if(_&&Ue){const ge=D?Ue.offsetWidth:Ue.offsetHeight;if(ge>0){const ve=q0(Ue,D);let _e=ae.current;G&&(_e===0||_e===c+1)?(_e=b+1,ae.current=_e,J(!0),me(_e),Be=0):Be=ve+_e*ge,Re(Be)}}We.setPointerCapture(Le.pointerId),ce.current=Le.pointerId,ye.current={pointerId:Le.pointerId,startClientX:Le.clientX,startClientY:Le.clientY,axes:Y0(We,`${r}-axis-probe`),size:D?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Le.timeStamp,velocity:0}},Ke=Le=>{const We=ye.current;if(!We||We.pointerId!==Le.pointerId)return;if(Le.pointerType==="mouse"&&Le.buttons===0){Ne(Le);return}const Be=Le.clientX-We.startClientX,Ue=Le.clientY-We.startClientY,ge=We.axes?U0(We.axes,Be,Ue):{x:Be,y:Ue},ve=D?ge.x:ge.y,_e=D?ge.y:ge.x,Ze=We.baseOffset+ve;if(!We.isActive){if(Math.max(Math.abs(ve),Math.abs(_e))<D0)return;if(Math.abs(_e)>Math.abs(ve)){const Te=Ce.current;Te!=null&&Te.hasPointerCapture(We.pointerId)&&Te.releasePointerCapture(We.pointerId),ye.current=null,ce.current=null,_&&Re(0);return}We.isActive=!0,Pe(!0)}const we=Le.timeStamp-We.lastTime;we>0&&(We.velocity=(Ze-We.offset)/we,We.lastTime=Le.timeStamp),We.offset=Ze,_&&Re(Ze)},ut=Le=>{Ne(Le)},lt=D?`translate3d(calc(${-j*100}% + ${be}px), 0, 0)`:`translate3d(0, calc(${-j*100}% + ${be}px), 0)`,Ye=G?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:K0(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!D}),onMouseEnter:()=>Q(!0),onMouseLeave:()=>Q(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Ce,className:pt(`${r}-track`,{[`${r}-track-draggable`]:X,[`${r}-track-draggable-vertical`]:X&&!D}),onPointerDown:ct,onPointerMove:Ke,onPointerUp:ut,onPointerCancel:ut,onLostPointerCapture:Le=>{ce.current===Le.pointerId&&Ne(Le)},children:a.jsx("div",{ref:q,className:pt(`${r}-list`,{[`${r}-list-slide`]:_,[`${r}-list-slide-vertical`]:_&&!D,[`${r}-list-fade`]:!_}),style:_?{transform:lt,transition:ne||O?"none":`transform ${Xi}ms ${Yd}`}:void 0,children:Ye.map((Le,We)=>{const Be=G?$o(We-1,c):We,ge=G&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!_&&Be===b}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:pt(`${r}-slider-image`,{[`${r}-contain`]:Le.image.objectFit==="contain",[`${r}-cover`]:Le.image.objectFit==="cover"}),src:Le.image.url,alt:Le.image.name??"",draggable:!1})})})},ge)})})}),se&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:D,[`${r}-arrow-prev-vertical`]:!D,[`${r}-hover-arrow`]:re}),style:{color:T,"--arrow-hover-color":H,...le},children:a.jsxs("button",{onClick:Le=>{Le.stopPropagation(),He(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${W.scalingValue(Y,n)}, ${W.scalingValue(B*(D?1:-1),n)}) rotate(${D?"0deg":"90deg"})`},children:[z&&a.jsx(sn,{url:z,fill:T,hoverFill:H,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:le}),!z&&a.jsx(uc,{color:T,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-next`]:D,[`${r}-arrow-next-vertical`]:!D,[`${r}-hover-arrow`]:re}),style:{color:T,"--arrow-hover-color":H,...le},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Le=>{Le.stopPropagation(),He(1)},style:{transform:`translate(${W.scalingValue(Y*(D?-1:1),n)}, ${W.scalingValue(B,n)}) rotate(${D?"0deg":"90deg"})`},children:[z&&a.jsx(sn,{url:z,fill:T,hoverFill:H,className:`${r}-arrow-img`,style:le}),!z&&a.jsx(uc,{color:T,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),A&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>He(1)}),V&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:D,[`${r}-pagination-inside-left`]:!D}),style:D?{bottom:y(x.inset)}:{left:y(x.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!D,[`${r}-animate-dots`]:ue}),style:{backgroundColor:P,gap:y(x.gapInactive-x.activeDot+x.dot),...D?{height:y(x.activeDot+x.paddingY*2),paddingTop:y(x.paddingY),paddingBottom:y(x.paddingY),paddingLeft:y(x.paddingActive),paddingRight:y(x.paddingActive)}:{width:y(x.activeDot+x.paddingY*2),paddingLeft:y(x.paddingY),paddingRight:y(x.paddingY),paddingTop:y(x.paddingActive),paddingBottom:y(x.paddingActive)},borderRadius:y(x.borderRadius),transform:`translate(${W.scalingValue(vo.offset.x,n)}, ${W.scalingValue(vo.offset.y,n)})`},children:d.map((Le,We)=>{const Be=We===b,Ue=Be?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>he(We),className:`${r}-pagination-item`,style:{width:y(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?I:$,width:y(Ue)}})},We)})},`${f}-${w}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:W.scalingValue(g,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Le,We)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===b&&n,[`${r}-active`]:We===b}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Xi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":M,"--link-hover-color":M,position:"relative",top:W.scalingValue(Da.offset.y,n),left:W.scalingValue(Da.offset.x,n)},children:a.jsx(Ri,{content:Le.imageCaption})})},We))})]})]})]})}function uc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const J0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19566
19566
|
import cn from 'classnames';
|
|
19567
19567
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19568
19568
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20960,7 +20960,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20960
20960
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
20961
20961
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
20962
20962
|
}
|
|
20963
|
-
`}const ob="rgba(28,31,34,0.9)",An=500,yi="cubic-bezier(0.22, 1, 0.36, 1)",rb=72,ab=50,sb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},lb=[];function cb(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function db(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ub(e){const[t]=e.media;return t!=null&&t.url?t:null}function pb(e){if(!Array.isArray(e)||e.length===0)return[];if(cb(e)){const t=[];for(const n of e){const i=db(n);if(!i)continue;const o=ub(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function ss(e){return e.type==="video"}function mb(e){e.pause(),e.removeAttribute("src"),e.load()}function br(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function gb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const hb=1140/1440;function fb(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function yb(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function vb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function xb({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{mb(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function bb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),B=s.useRef(!1),N=s.useRef(null),[q,D]=s.useState(null),[T,H]=s.useState("opening"),[$,I]=s.useState(0),[P,E]=s.useState(0),[g,z]=s.useState(!1),[F,X]=s.useState(!1),[ie,L]=s.useState(!1),_=s.useRef(n),V=t[n],ae=V?ss(V):!1,re=P!==0||g,M=s.useCallback(pe=>{B.current=pe,z(pe)},[]),se=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),j=s.useCallback(()=>{se(),N.current=window.setTimeout(()=>{se(),M(!1)},An+32)},[se,M]),b=s.useCallback(()=>{const pe=w.current,oe=m.current;if(!pe)return;const ye=pe.getBoundingClientRect(),U=ye.width,ce=ye.height;if(!U||!ce)return;if(i==="cover"){D({width:U,height:ce,left:ye.left,top:ye.top});return}if(!oe){D(br(pe));return}const{width:le,height:Ce}=gb(oe);if(!le||!Ce){D(br(pe));return}const Fe=le/Ce,Ee=U/ce;if(Fe>Ee){const Y=U/Fe;D({width:U,height:Y,left:ye.left,top:ye.top+(ce-Y)/2})}else{const Y=ce*Fe;D({width:Y,height:ce,left:ye.left+(U-Y)/2,top:ye.top})}},[i]);s.useEffect(()=>{b();const pe=w.current;if(!pe)return;const oe=new ResizeObserver(()=>b());return oe.observe(pe),()=>oe.disconnect()},[b,n]),s.useEffect(()=>{T==="opening"&&q&&H("open")},[T,q]),s.useEffect(()=>{if(T!=="closing")return;const pe=setTimeout(()=>r(),An);return()=>clearTimeout(pe)},[T,r]),s.useEffect(()=>()=>{se()},[se]),s.useLayoutEffect(()=>{if(_.current===n)return;se(),I(0),E(0),M(!1),L(!1),X(!1),f.current=0,x.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const pe=w.current;pe&&D(br(pe)),_.current=n},[n,M,se]),s.useEffect(()=>{if(T!=="open")return;let pe=null;const oe=()=>{pe&&(document.removeEventListener("click",pe,!0),pe=null)},ye=()=>{oe(),pe=Ee=>{Ee.stopPropagation(),Ee.preventDefault(),oe()},document.addEventListener("click",pe,!0)},U=Ee=>{se(),B.current=!1,z(!1),E(0),X(!1),y.current=!1,x.current=0,C.current="none";const Y=w.current;Y&&D(br(Y)),Ee<0?d():l()},ce=Ee=>{if(Math.abs(Ee)>ab&&t.length>1){U(Ee);return}M(!0),E(0),j()},le=Ee=>{if(Ee.touches.length!==1||B.current)return;const Y=Ee.touches[0];S.current=!0,h.current={x:Y.clientX,y:Y.clientY},C.current="none",x.current=0,y.current=!1},Ce=Ee=>{if(!h.current||Ee.touches.length!==1||B.current)return;const Y=Ee.touches[0],be=Y.clientX-h.current.x,de=Y.clientY-h.current.y;if(C.current==="none"){if(Math.abs(be)<10&&Math.abs(de)<10)return;if(Math.abs(be)>Math.abs(de)){if(t.length<=1)return;C.current="horizontal"}else if(de>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,X(!0),x.current=be,E(be),Ee.preventDefault();return}C.current==="vertical"&&(y.current=!0,X(!0),f.current=de,I(de),Ee.preventDefault())},Fe=()=>{if(!h.current)return;const Ee=C.current,Y=y.current;if(Y&&Ee==="horizontal")ce(x.current),ye();else if(Y&&Ee==="vertical")if(f.current>rb){const de=window.innerHeight;f.current=de,L(!0),I(de),H("closing")}else f.current=0,I(0),ye();else Ee==="horizontal"&&Math.abs(x.current)>0&&(ce(x.current),ye());h.current=null,C.current="none",x.current=0,y.current=!1,X(!1)};return document.addEventListener("touchstart",le,{passive:!0}),document.addEventListener("touchmove",Ce,{passive:!1}),document.addEventListener("touchend",Fe),document.addEventListener("touchcancel",Fe),()=>{document.removeEventListener("touchstart",le),document.removeEventListener("touchmove",Ce),document.removeEventListener("touchend",Fe),document.removeEventListener("touchcancel",Fe),oe()}},[T,t.length,d,l,M,j,se]),s.useEffect(()=>{const pe=oe=>{oe.key==="Escape"&&(oe.preventDefault(),oe.stopPropagation(),T!=="closing"&&H("closing"))};return window.addEventListener("keydown",pe,!0),()=>window.removeEventListener("keydown",pe,!0)},[T]);const k=()=>{T!=="closing"&&H("closing")},G=T==="open",he=T==="closing",J=$>0?Math.max(0,1-$/500):1,ee=$>0?Math.max(.35,1-$/500):1,O=pe=>{if(pe.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const oe=pe.currentTarget.getBoundingClientRect(),ye=pe.clientY-oe.top,U=Math.min(52,oe.height*.2);if(!(ye>oe.height-U)){if(pe.clientX-oe.left<oe.width/2){l();return}d()}},Z=pe=>{if(t.length<=1)return;const oe=pe.currentTarget.getBoundingClientRect(),ye=pe.clientX-oe.left,U=pe.clientY-oe.top,ce=Math.min(52,oe.height*.2);if(U>oe.height-ce){pe.currentTarget.style.cursor="default";return}pe.currentTarget.style.cursor=ye<oe.width/2?"w-resize":"e-resize"},te=s.useCallback(pe=>{pe.propertyName!=="transform"||!B.current||(se(),M(!1))},[se,M]),Le=re?`translateX(${P}px)`:$>0?`translateY(${$}px)`:void 0,ve={position:"fixed",top:q==null?void 0:q.top,left:q==null?void 0:q.left,width:q==null?void 0:q.width,height:q==null?void 0:q.height,objectFit:i==="cover"?"cover":"contain",transform:Le,opacity:$>0?ee:T==="opening"||he?0:1,transition:F&&!g?"none":g?`transform ${An}ms ${yi}`:ie?`transform ${An}ms ${yi}, opacity ${An}ms ${yi}`:T==="opening"||he?`opacity ${An}ms ${yi}`:"none",pointerEvents:ae&&G&&!re?"auto":"none",touchAction:ae&&G?"none":void 0,zIndex:9998},Ie=q?{position:"fixed",top:q.top,height:q.height,width:q.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:T==="open"?"none":void 0},onClick:k,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:G?J:0,transition:F?"none":`opacity ${An}ms ${yi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:G?1:0,transition:`opacity ${An}ms ${yi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:G?1:0,transition:`opacity ${An}ms ${yi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),q&&V&&(ae?a.jsx(xb,{src:V.url,phase:T,mediaRef:m,mediaStyle:ve,onLoadedMetadata:b,onClick:O,onMouseMove:Z,onTransitionEnd:te},`${n}-${V.url}`):a.jsx("img",{ref:m,src:V.url,alt:V.name,onLoad:b,onTransitionEnd:te,style:ve},`${n}-${V.url}`)),G&&Ie&&t.length>1&&!ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ie,left:q.left,cursor:"w-resize",pointerEvents:re?"none":"auto"},onClick:pe=>{if(S.current){S.current=!1;return}pe.stopPropagation(),l()}}),a.jsx("div",{style:{...Ie,left:q.left+q.width/2,cursor:"e-resize",pointerEvents:re?"none":"auto"},onClick:pe=>{if(S.current){S.current=!1;return}pe.stopPropagation(),d()}})]})]})}function gc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${ss(t)?"video":"image"}`,w=r.display==="cover",m=yb(r),h=T=>W.scalingValue(T,l??!1),f=n??Oi,x=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},C=i?{borderRadius:h(i)}:{},y={...x,...w?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...C},S={...w?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...w?{}:C},N={className:v,style:S,onClick:p?T=>{T.stopPropagation(),p()}:void 0},q=Math.max(d,vi),D=ss(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[w?a.jsx("div",{style:y,children:D}):D,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(q)}})]})}function wb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,w=v>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function Sb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function hc({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function fc({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function Oa({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[v,w]=s.useState(0),m=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>w(f.offsetHeight);x();const C=new ResizeObserver(x);return C.observe(f),()=>C.disconnect()},[m,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${v}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const yc=45;function vc(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function Cb(e){const t=vc(e,"--cntrl-viewport-height",window.innerHeight),n=vc(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function $b(e,t,n){const{top:i,centerY:o}=Cb(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function Tb(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=$b(u,n,c);return Math.exp(-(p*p)/(2*yc*yc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Ib(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(Tb(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function Rb(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function Lb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var tt;const{prefix:l}=W.useScopedStyles(),d=s.useMemo(()=>ib(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??Oi,w=(e==null?void 0:e.titleWidth)??hb,m=fb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??tb,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,S=Sb(e==null?void 0:e.transition),B=(e==null?void 0:e.lightbox)??"on",N=p==="b",q=S==="fade"||S==="retype",{setTitleRef:D,dominantIndex:T}=Ib(c.length,q,f),H=((tt=c[T])==null?void 0:tt.title)??"",$=Rb(H,S==="retype"),I=S==="fade"||S==="retype",P=S==="retype"?$:H,E=N?void 0:{width:W.scalingValue(v,n??!1)},g=B==="on"&&(!n||i||o),z=o??!1,F=(e==null?void 0:e.galleryPaddingRight)??0,X=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,L=nt=>W.scalingValue(nt,n??!1),V={width:L(w)},ae=p==="a"?F:X,re=N?{width:"100%"}:{width:`calc(100% - ${L(v)} - ${L(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},M=Math.max(F,vi),se=Math.max(X,vi),j=Math.max(ie,vi),b=Math.max(x,vi),k=Math.max(C,vi),G=Math.max(y,vi),he=Math.max(0,(u??1)-(v??Oi)),J=p==="a"?Math.max(0,(u??1)-(v??Oi)-F):p==="c"?Math.max(0,(u??1)-(v??Oi)-X):p==="b"?u??1:1,ee=z&&(p==="a"||p==="b"||p==="c")&&f==="top",O=z&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),Z=z&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),te=c.length>1,Le=N?void 0:L((p==="c"?X:F)+(v??Oi)),ve=p==="c"&&Le?{left:Le}:void 0,Ie=p==="a"&&Le?{right:Le}:void 0,pe=N?{left:0,width:"100%"}:p==="a"?{right:L(F),width:L(v)}:{left:L(X),width:L(v)},{titleColor:oe,titleFontFamily:ye,titleFontSettings:U,titleFontSize:ce,titleLineHeight:le,titleLetterSpacing:Ce,titleWordSpacing:Fe,titleAlign:Ee,titleTextAppearance:Y,lightboxCounterColor:be,lightboxCounterFontFamily:de,lightboxCounterFontSettings:K,lightboxCounterFontSize:ue,lightboxCounterLineHeight:He,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:Q,lightboxCounterTextAppearance:Je}=e??{},Ne={fontSettings:{fontFamily:ye,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:ce??.01,lineHeight:le,letterSpacing:Ce??0,wordSpacing:Fe??0,textAlign:Ee??"left",textAppearance:Y,color:oe??"#000000"},Ke=an(Ut(Ne,n)),ut=V,lt=mc(ce,le,l,n),Ye=pc(ce,le,`${l}-title`,`${l}-text-tight-leading`),Re={fontSettings:{fontFamily:de,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:ue??.01,lineHeight:He,letterSpacing:fe??0,wordSpacing:Q??0,textAppearance:Je,color:be??"#DEDDDD"},Be={...an(Ut(Re,n)),...mc(ue,He,l,n)},Ue=pc(ue,He,`${l}-lightbox-counter`,`${l}-text-tight-leading`),ge=W.buildColorVars(l,{titleColor:oe??"#000000",lightboxCounterColor:be??"#DEDDDD"},sb,lb),xe=s.useRef(null),[_e,Ze]=s.useState(!1),[we,$e]=s.useState([]),[Xe,ze]=s.useState(0),Te=s.useCallback((nt,st)=>{g&&($e(nt),ze(st),Ze(!0))},[g]),Ve=s.useCallback(()=>{Ze(!1)},[]),De=s.useMemo(()=>{const nt={...ge},st=xe.current?getComputedStyle(xe.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(nt["--cntrl-article-width"]=st),nt},[ge,_e]);return s.useEffect(()=>{if(!_e||B!=="on"||typeof document>"u")return;const nt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=nt}},[_e,B]),s.useEffect(()=>{!n||o||i||Ze(!1)},[n,o,i]),s.useEffect(()=>{B==="off"&&Ze(!1)},[B]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:ge,children:a.jsxs("div",{ref:xe,className:`${l}-wrapper`,style:{width:W.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?L(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?L(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?L(y):void 0},children:[I&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Oa,{P:l,title:P,position:f,titleRef:()=>{},titleClassName:`${Ye} ${l}-single-title`,titleContainerStyle:{...lt,...re},titleTextBoxStyle:ut,titleStyle:Ke,showTextBoxOutline:z,topPaddingControl:ee?hc({P:l,scaled:L,height:b,paired:!1}):void 0})}),c.map((nt,st)=>{const St=pb(nt.gallery),Bt=st<c.length-1,zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),ft={P:l,position:f,titleRef:D(st),titleClassName:Ye,titleContainerStyle:lt,titleTextBoxStyle:I?{maxWidth:"100%"}:ut,titleStyle:Ke,showTextBoxOutline:z&&!I,topPaddingControl:ee&&!I?hc({P:l,scaled:L,height:b,paired:te}):void 0};return a.jsxs("div",{"data-item-index":st,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Bt?L(ie):void 0},children:[O&&fc({P:l,controlKey:"titleLeftPadding",scaled:L,width:k,maxFraction:J,side:"left",paired:te,anchorStyle:ve}),Z&&fc({P:l,controlKey:"titleRightPadding",scaled:L,width:G,maxFraction:J,side:"right",paired:te,anchorStyle:Ie}),z&&Bt&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:L(j),...pe}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const xt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(gc,{P:l,media:wt,imgWidth:v||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:z,onMediaClick:g&&xt>=0?()=>Te(zt,xt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Oa,{...ft,title:I?"":nt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Oa,{...ft,title:I?"":nt.title}),St.length>0&&a.jsx(wb,{P:l,layoutType:p,galleryWidthStyle:E,galleryPaddingRight:F,galleryPaddingLeft:X,galleryPaddingRightWidth:M,galleryPaddingLeftWidth:se,galleryPaddingMaxFraction:he,showControls:z,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const xt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(gc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:z,onMediaClick:g&&xt>=0?()=>Te(zt,xt):void 0},`${wt.url}-${At}`)})})]})]},st)})]})}),_e&&B==="on"&&typeof document<"u"&&e&&(()=>{const nt=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:De,"data-selection":"none",children:a.jsx(bb,{prefix:l,items:we,index:Xe,imageDisplay:vb(e.lightboxImageDisplay),isEditor:n,onClose:Ve,onPrev:()=>ze(st=>(st-1+we.length)%we.length),onNext:()=>ze(st=>(st+1)%we.length),counterClassName:Ue,counterStyle:Be,backgroundColor:e.backgroundColor??ob})}),nt)})()]})}const Pb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20963
|
+
`}const ob="rgba(28,31,34,0.9)",An=500,yi="cubic-bezier(0.22, 1, 0.36, 1)",rb=72,ab=50,sb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},lb=[];function cb(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function db(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ub(e){const[t]=e.media;return t!=null&&t.url?t:null}function pb(e){if(!Array.isArray(e)||e.length===0)return[];if(cb(e)){const t=[];for(const n of e){const i=db(n);if(!i)continue;const o=ub(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function ss(e){return e.type==="video"}function mb(e){e.pause(),e.removeAttribute("src"),e.load()}function br(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function gb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const hb=1140/1440;function fb(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function yb(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function vb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function xb({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{mb(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function bb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),z=s.useRef(!1),N=s.useRef(null),[Y,B]=s.useState(null),[T,H]=s.useState("opening"),[$,I]=s.useState(0),[P,M]=s.useState(0),[g,D]=s.useState(!1),[A,X]=s.useState(!1),[ie,L]=s.useState(!1),_=s.useRef(n),V=t[n],se=V?ss(V):!1,re=P!==0||g,k=s.useCallback(ue=>{z.current=ue,D(ue)},[]),le=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),G=s.useCallback(()=>{le(),N.current=window.setTimeout(()=>{le(),k(!1)},An+32)},[le,k]),b=s.useCallback(()=>{const ue=w.current,fe=m.current;if(!ue)return;const $e=ue.getBoundingClientRect(),Q=$e.width,Z=$e.height;if(!Q||!Z)return;if(i==="cover"){B({width:Q,height:Z,left:$e.left,top:$e.top});return}if(!fe){B(br(ue));return}const{width:ae,height:xe}=gb(fe);if(!ae||!xe){B(br(ue));return}const ke=ae/xe,Ce=Q/Z;if(ke>Ce){const q=Q/ke;B({width:Q,height:q,left:$e.left,top:$e.top+(Z-q)/2})}else{const q=Z*ke;B({width:q,height:Z,left:$e.left+(Q-q)/2,top:$e.top})}},[i]);s.useEffect(()=>{b();const ue=w.current;if(!ue)return;const fe=new ResizeObserver(()=>b());return fe.observe(ue),()=>fe.disconnect()},[b,n]),s.useEffect(()=>{T==="opening"&&Y&&H("open")},[T,Y]),s.useEffect(()=>{if(T!=="closing")return;const ue=setTimeout(()=>r(),An);return()=>clearTimeout(ue)},[T,r]),s.useEffect(()=>()=>{le()},[le]),s.useLayoutEffect(()=>{if(_.current===n)return;le(),I(0),M(0),k(!1),L(!1),X(!1),f.current=0,x.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const ue=w.current;ue&&B(br(ue)),_.current=n},[n,k,le]),s.useEffect(()=>{if(T!=="open")return;let ue=null;const fe=()=>{ue&&(document.removeEventListener("click",ue,!0),ue=null)},$e=()=>{fe(),ue=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),fe()},document.addEventListener("click",ue,!0)},Q=Ce=>{le(),z.current=!1,D(!1),M(0),X(!1),y.current=!1,x.current=0,C.current="none";const q=w.current;q&&B(br(q)),Ce<0?d():l()},Z=Ce=>{if(Math.abs(Ce)>ab&&t.length>1){Q(Ce);return}k(!0),M(0),G()},ae=Ce=>{if(Ce.touches.length!==1||z.current)return;const q=Ce.touches[0];S.current=!0,h.current={x:q.clientX,y:q.clientY},C.current="none",x.current=0,y.current=!1},xe=Ce=>{if(!h.current||Ce.touches.length!==1||z.current)return;const q=Ce.touches[0],ye=q.clientX-h.current.x,ce=q.clientY-h.current.y;if(C.current==="none"){if(Math.abs(ye)<10&&Math.abs(ce)<10)return;if(Math.abs(ye)>Math.abs(ce)){if(t.length<=1)return;C.current="horizontal"}else if(ce>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,X(!0),x.current=ye,M(ye),Ce.preventDefault();return}C.current==="vertical"&&(y.current=!0,X(!0),f.current=ce,I(ce),Ce.preventDefault())},ke=()=>{if(!h.current)return;const Ce=C.current,q=y.current;if(q&&Ce==="horizontal")Z(x.current),$e();else if(q&&Ce==="vertical")if(f.current>rb){const ce=window.innerHeight;f.current=ce,L(!0),I(ce),H("closing")}else f.current=0,I(0),$e();else Ce==="horizontal"&&Math.abs(x.current)>0&&(Z(x.current),$e());h.current=null,C.current="none",x.current=0,y.current=!1,X(!1)};return document.addEventListener("touchstart",ae,{passive:!0}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",ke),document.addEventListener("touchcancel",ke),()=>{document.removeEventListener("touchstart",ae),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",ke),document.removeEventListener("touchcancel",ke),fe()}},[T,t.length,d,l,k,G,le]),s.useEffect(()=>{const ue=fe=>{fe.key==="Escape"&&(fe.preventDefault(),fe.stopPropagation(),T!=="closing"&&H("closing"))};return window.addEventListener("keydown",ue,!0),()=>window.removeEventListener("keydown",ue,!0)},[T]);const E=()=>{T!=="closing"&&H("closing")},j=T==="open",me=T==="closing",K=$>0?Math.max(0,1-$/500):1,te=$>0?Math.max(.35,1-$/500):1,O=ue=>{if(ue.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const fe=ue.currentTarget.getBoundingClientRect(),$e=ue.clientY-fe.top,Q=Math.min(52,fe.height*.2);if(!($e>fe.height-Q)){if(ue.clientX-fe.left<fe.width/2){l();return}d()}},J=ue=>{if(t.length<=1)return;const fe=ue.currentTarget.getBoundingClientRect(),$e=ue.clientX-fe.left,Q=ue.clientY-fe.top,Z=Math.min(52,fe.height*.2);if(Q>fe.height-Z){ue.currentTarget.style.cursor="default";return}ue.currentTarget.style.cursor=$e<fe.width/2?"w-resize":"e-resize"},ne=s.useCallback(ue=>{ue.propertyName!=="transform"||!z.current||(le(),k(!1))},[le,k]),Pe=re?`translateX(${P}px)`:$>0?`translateY(${$}px)`:void 0,be={position:"fixed",top:Y==null?void 0:Y.top,left:Y==null?void 0:Y.left,width:Y==null?void 0:Y.width,height:Y==null?void 0:Y.height,objectFit:i==="cover"?"cover":"contain",transform:Pe,opacity:$>0?te:T==="opening"||me?0:1,transition:A&&!g?"none":g?`transform ${An}ms ${yi}`:ie?`transform ${An}ms ${yi}, opacity ${An}ms ${yi}`:T==="opening"||me?`opacity ${An}ms ${yi}`:"none",pointerEvents:se&&j&&!re?"auto":"none",touchAction:se&&j?"none":void 0,zIndex:9998},Re=Y?{position:"fixed",top:Y.top,height:Y.height,width:Y.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:T==="open"?"none":void 0},onClick:E,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:j?K:0,transition:A?"none":`opacity ${An}ms ${yi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:j?1:0,transition:`opacity ${An}ms ${yi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:j?1:0,transition:`opacity ${An}ms ${yi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),Y&&V&&(se?a.jsx(xb,{src:V.url,phase:T,mediaRef:m,mediaStyle:be,onLoadedMetadata:b,onClick:O,onMouseMove:J,onTransitionEnd:ne},`${n}-${V.url}`):a.jsx("img",{ref:m,src:V.url,alt:V.name,onLoad:b,onTransitionEnd:ne,style:be},`${n}-${V.url}`)),j&&Re&&t.length>1&&!se&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Re,left:Y.left,cursor:"w-resize",pointerEvents:re?"none":"auto"},onClick:ue=>{if(S.current){S.current=!1;return}ue.stopPropagation(),l()}}),a.jsx("div",{style:{...Re,left:Y.left+Y.width/2,cursor:"e-resize",pointerEvents:re?"none":"auto"},onClick:ue=>{if(S.current){S.current=!1;return}ue.stopPropagation(),d()}})]})]})}function gc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${ss(t)?"video":"image"}`,w=r.display==="cover",m=yb(r),h=T=>W.scalingValue(T,l??!1),f=n??Oi,x=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},C=i?{borderRadius:h(i)}:{},y={...x,...w?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...C},S={...w?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...w?{}:C},N={className:v,style:S,onClick:p?T=>{T.stopPropagation(),p()}:void 0},Y=Math.max(d,vi),B=ss(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[w?a.jsx("div",{style:y,children:B}):B,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(Y)}})]})}function wb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,w=v>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function Sb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function hc({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function fc({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function Oa({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[v,w]=s.useState(0),m=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>w(f.offsetHeight);x();const C=new ResizeObserver(x);return C.observe(f),()=>C.disconnect()},[m,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${v}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const yc=45;function vc(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function Cb(e){const t=vc(e,"--cntrl-viewport-height",window.innerHeight),n=vc(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function $b(e,t,n){const{top:i,centerY:o}=Cb(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function Tb(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=$b(u,n,c);return Math.exp(-(p*p)/(2*yc*yc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Ib(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(Tb(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function Rb(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function Lb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var tt;const{prefix:l}=W.useScopedStyles(),d=s.useMemo(()=>ib(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??Oi,w=(e==null?void 0:e.titleWidth)??hb,m=fb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??tb,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,S=Sb(e==null?void 0:e.transition),z=(e==null?void 0:e.lightbox)??"on",N=p==="b",Y=S==="fade"||S==="retype",{setTitleRef:B,dominantIndex:T}=Ib(c.length,Y,f),H=((tt=c[T])==null?void 0:tt.title)??"",$=Rb(H,S==="retype"),I=S==="fade"||S==="retype",P=S==="retype"?$:H,M=N?void 0:{width:W.scalingValue(v,n??!1)},g=z==="on"&&(!n||i||o),D=o??!1,A=(e==null?void 0:e.galleryPaddingRight)??0,X=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,L=nt=>W.scalingValue(nt,n??!1),V={width:L(w)},se=p==="a"?A:X,re=N?{width:"100%"}:{width:`calc(100% - ${L(v)} - ${L(se)})`,...p==="c"?{marginLeft:"auto"}:{}},k=Math.max(A,vi),le=Math.max(X,vi),G=Math.max(ie,vi),b=Math.max(x,vi),E=Math.max(C,vi),j=Math.max(y,vi),me=Math.max(0,(u??1)-(v??Oi)),K=p==="a"?Math.max(0,(u??1)-(v??Oi)-A):p==="c"?Math.max(0,(u??1)-(v??Oi)-X):p==="b"?u??1:1,te=D&&(p==="a"||p==="b"||p==="c")&&f==="top",O=D&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),J=D&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),ne=c.length>1,Pe=N?void 0:L((p==="c"?X:A)+(v??Oi)),be=p==="c"&&Pe?{left:Pe}:void 0,Re=p==="a"&&Pe?{right:Pe}:void 0,ue=N?{left:0,width:"100%"}:p==="a"?{right:L(A),width:L(v)}:{left:L(X),width:L(v)},{titleColor:fe,titleFontFamily:$e,titleFontSettings:Q,titleFontSize:Z,titleLineHeight:ae,titleLetterSpacing:xe,titleWordSpacing:ke,titleAlign:Ce,titleTextAppearance:q,lightboxCounterColor:ye,lightboxCounterFontFamily:ce,lightboxCounterFontSettings:U,lightboxCounterFontSize:de,lightboxCounterLineHeight:He,lightboxCounterLetterSpacing:he,lightboxCounterWordSpacing:ee,lightboxCounterTextAppearance:Je}=e??{},Ne={fontSettings:{fontFamily:$e,fontWeight:(Q==null?void 0:Q.fontWeight)??400,fontStyle:(Q==null?void 0:Q.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:ae,letterSpacing:xe??0,wordSpacing:ke??0,textAlign:Ce??"left",textAppearance:q,color:fe??"#000000"},Ke=an(Ut(Ne,n)),ut=V,lt=mc(Z,ae,l,n),Ye=pc(Z,ae,`${l}-title`,`${l}-text-tight-leading`),Le={fontSettings:{fontFamily:ce,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:de??.01,lineHeight:He,letterSpacing:he??0,wordSpacing:ee??0,textAppearance:Je,color:ye??"#DEDDDD"},Be={...an(Ut(Le,n)),...mc(de,He,l,n)},Ue=pc(de,He,`${l}-lightbox-counter`,`${l}-text-tight-leading`),ge=W.buildColorVars(l,{titleColor:fe??"#000000",lightboxCounterColor:ye??"#DEDDDD"},sb,lb),ve=s.useRef(null),[_e,Ze]=s.useState(!1),[we,Te]=s.useState([]),[Xe,ze]=s.useState(0),Ie=s.useCallback((nt,st)=>{g&&(Te(nt),ze(st),Ze(!0))},[g]),Ve=s.useCallback(()=>{Ze(!1)},[]),De=s.useMemo(()=>{const nt={...ge},st=ve.current?getComputedStyle(ve.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(nt["--cntrl-article-width"]=st),nt},[ge,_e]);return s.useEffect(()=>{if(!_e||z!=="on"||typeof document>"u")return;const nt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=nt}},[_e,z]),s.useEffect(()=>{!n||o||i||Ze(!1)},[n,o,i]),s.useEffect(()=>{z==="off"&&Ze(!1)},[z]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:ge,children:a.jsxs("div",{ref:ve,className:`${l}-wrapper`,style:{width:W.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?L(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?L(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?L(y):void 0},children:[I&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Oa,{P:l,title:P,position:f,titleRef:()=>{},titleClassName:`${Ye} ${l}-single-title`,titleContainerStyle:{...lt,...re},titleTextBoxStyle:ut,titleStyle:Ke,showTextBoxOutline:D,topPaddingControl:te?hc({P:l,scaled:L,height:b,paired:!1}):void 0})}),c.map((nt,st)=>{const St=pb(nt.gallery),Bt=st<c.length-1,zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),ft={P:l,position:f,titleRef:B(st),titleClassName:Ye,titleContainerStyle:lt,titleTextBoxStyle:I?{maxWidth:"100%"}:ut,titleStyle:Ke,showTextBoxOutline:D&&!I,topPaddingControl:te&&!I?hc({P:l,scaled:L,height:b,paired:ne}):void 0};return a.jsxs("div",{"data-item-index":st,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Bt?L(ie):void 0},children:[O&&fc({P:l,controlKey:"titleLeftPadding",scaled:L,width:E,maxFraction:K,side:"left",paired:ne,anchorStyle:be}),J&&fc({P:l,controlKey:"titleRightPadding",scaled:L,width:j,maxFraction:K,side:"right",paired:ne,anchorStyle:Re}),D&&Bt&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:L(G),...ue}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const xt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(gc,{P:l,media:wt,imgWidth:v||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:D,onMediaClick:g&&xt>=0?()=>Ie(zt,xt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Oa,{...ft,title:I?"":nt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Oa,{...ft,title:I?"":nt.title}),St.length>0&&a.jsx(wb,{P:l,layoutType:p,galleryWidthStyle:M,galleryPaddingRight:A,galleryPaddingLeft:X,galleryPaddingRightWidth:k,galleryPaddingLeftWidth:le,galleryPaddingMaxFraction:me,showControls:D,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const xt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(gc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:D,onMediaClick:g&&xt>=0?()=>Ie(zt,xt):void 0},`${wt.url}-${At}`)})})]})]},st)})]})}),_e&&z==="on"&&typeof document<"u"&&e&&(()=>{const nt=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:De,"data-selection":"none",children:a.jsx(bb,{prefix:l,items:we,index:Xe,imageDisplay:vb(e.lightboxImageDisplay),isEditor:n,onClose:Ve,onPrev:()=>ze(st=>(st-1+we.length)%we.length),onNext:()=>ze(st=>(st+1)%we.length),counterClassName:Ue,counterStyle:Be,backgroundColor:e.backgroundColor??ob})}),nt)})()]})}const Pb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20964
20964
|
import { createPortal } from 'react-dom';
|
|
20965
20965
|
import type React from 'react';
|
|
20966
20966
|
import { CommonComponentProps } from '../props';
|
|
@@ -23058,7 +23058,7 @@ ${t}
|
|
|
23058
23058
|
`}function Jo(e){return Number(e.toFixed(4))}function bc(e,t,n,i){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,Math.round(r))):t}function za(e,t,n=0,i=9999){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,r)):t}function Ub(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function Kb(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function Zb(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")}function Zd(e,t){return(1-e)/(1-e*Math.cos(t))}function Jb(e){let t=0;for(let n=0;n<360;n+=1){const i=n*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(i)*Zd(e,i)))}return t||1}function Qb(e,t){return e?1:1+Kd*(.35+t)}function ew(e,t,n,i){const o=t*Qb(n,i);return Math.max(0,(e-o)/2)}function Jd(e,t,n){const i=Zd(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function Qd(e,t,n){return e/2+t*n}function tw(e,t,n){return e(t-n/2)}function nw(e,t){return e*t}function eu(e){return Math.round(e*1e3)}function tu(e,t,n){const i=Math.cos(e),o=Math.cos(qb*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Jo(t+(n-t)*r)}function nu(e){return tu(e,jb,Vb)}function iw(e){return tu(e,Gb,Xb)}function iu(e,t){if(!t)return"none";const n=iw(e);return n<=0?"none":`blur(${n}px)`}function ow(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=Jd(i,o,r*Math.PI*2),p=r*Math.PI*2,v=Qd(t,n,c),w=Jo(u),m=`calc(${e(v)} - var(--helix-base-w) * ${w} / 2)`,h=`calc(var(--helix-base-w) * ${w})`,f=l?`height: calc(var(--helix-base-h) * ${w});`:"";return`left: ${m}; width: ${h}; ${f} z-index: ${eu(u)}; transform: translateY(-50%); opacity: ${nu(p)}; filter: ${iu(p,d)};`}function rw(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=xc;u+=1){const p=u/xc;c.push(` ${Jo(p*100)}% { ${ow(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
|
|
23059
23059
|
${c.join(`
|
|
23060
23060
|
`)}
|
|
23061
|
-
}`}function ou(e,t){return(e%t+t)%t}function aw(e,t){return Us(e,t)/t}function Us(e,t){return ou(e,t)}function sw(e,t){return Math.floor(e/t)}function lw(e,t,n,i){return sw(e,t)*n+Us(e,t)*i}function cw(e,t,n){const i=n==="left"?1-e:e;return`${Jo(-i*t)}s`}function wc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function ru(e){const t=e%1;return t<0?t+1:t}function dw(e,t,n){const i=t/Ud,o=n==="left"?-e*i:e*i;return ru(o)}function uw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=W.useScopedStyles(),r=s.useRef(null),l=za((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),_b),d=za(e==null?void 0:e.imageWidth,Nb),c=za(e==null?void 0:e.turnHeight,Wb),u=bc(e==null?void 0:e.itemsPerTurn,Hb,3,40),p=bc(e==null?void 0:e.turns,Db,1,30),v=Math.min(zb,Math.max(0,Ob)),w=Math.min(1,Math.max(0,Bb)),m=Math.max(0,(e==null?void 0:e.speed)??Ud),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",x=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>Ub(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",
|
|
23061
|
+
}`}function ou(e,t){return(e%t+t)%t}function aw(e,t){return Us(e,t)/t}function Us(e,t){return ou(e,t)}function sw(e,t){return Math.floor(e/t)}function lw(e,t,n,i){return sw(e,t)*n+Us(e,t)*i}function cw(e,t,n){const i=n==="left"?1-e:e;return`${Jo(-i*t)}s`}function wc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function ru(e){const t=e%1;return t<0?t+1:t}function dw(e,t,n){const i=t/Ud,o=n==="left"?-e*i:e*i;return ru(o)}function uw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=W.useScopedStyles(),r=s.useRef(null),l=za((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),_b),d=za(e==null?void 0:e.imageWidth,Nb),c=za(e==null?void 0:e.turnHeight,Wb),u=bc(e==null?void 0:e.itemsPerTurn,Hb,3,40),p=bc(e==null?void 0:e.turns,Db,1,30),v=Math.min(zb,Math.max(0,Ob)),w=Math.min(1,Math.max(0,Bb)),m=Math.max(0,(e==null?void 0:e.speed)??Ud),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",x=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>Ub(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",z=re=>W.scalingValue(re,n??!1),N=s.useMemo(()=>Jb(v),[v]),Y=s.useMemo(()=>ew(l,d,S,w),[l,d,S,w]),B=s.useMemo(()=>Yb(o,rw(o,z,l,Y,v,N,S,C)),[o,l,Y,v,N,S,C,n]),T=s.useMemo(()=>(t??[]).filter(re=>{var k;return!!((k=re.image)!=null&&k.url)}),[t]),H=c/u,$=d*Kb(y),I=Math.min(Ab,p*u),P=Fb*u,M=I+P*2,D=Math.max(0,p-1)*c+(u-1)*H,A=m>0,X=f==="scroll"&&A,ie=f==="autoplay"&&A&&(n?!!i:!0),[L,_]=s.useState(0);s.useEffect(()=>{if(!X)return;const re=r.current;if(!re)return;const k=()=>{const G=re.getBoundingClientRect(),b=window.innerHeight||document.documentElement.clientHeight,E=b+G.height;E<=0||_(Math.min(1,Math.max(0,(b-G.top)/E)))};k(),window.addEventListener("scroll",k,{passive:!0}),window.addEventListener("resize",k);const le=new ResizeObserver(k);return le.observe(re),()=>{window.removeEventListener("scroll",k),window.removeEventListener("resize",k),le.disconnect()}},[X]);const V=X?dw(L,m,h):0,se=A&&f==="autoplay"?360/(m*kb):0;return T.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:B}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:z(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:B}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:z(l),height:z(D),marginInline:"auto"},children:Array.from({length:M},(re,k)=>{const le=k-P,b=T[ou(le,T.length)].image,E=Us(le,u),j=aw(le,u),me=X?ru(j+V):j,K=lw(le,u,c,H),te=w===0?0:(wc(E+7.3)-.5)*w*H,O=S?1:1+(wc(E+3.1)-.5)*2*Kd*(.35+w),J=me*Math.PI*2,{offset:ne,scale:Pe}=Jd(v,N,J),be=d*O,Re=nw(be,Pe),ue=Qd(l,Y,ne),fe={"--helix-base-w":z(be),...S?{"--helix-base-h":z($)}:{}},$e={top:z(K+te),transform:"translateY(-50%)",...fe,...ie?{animationDuration:`${Jo(se)}s`,animationDelay:cw(j,se,h),animationDirection:h==="left"?"reverse":"normal"}:{left:tw(z,ue,Re),width:z(Re),...S?{height:z($*Pe)}:{},zIndex:eu(Pe),opacity:nu(J),filter:iu(J,C)}},Q=x>0?{borderRadius:z(x)}:{},Z=S?{...Q,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:Q,ae=Zb(b)?a.jsx("video",{className:`${o}-media`,style:Z,src:b.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:Z,src:b.url,alt:b.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ie?`${o}-item`:`${o}-item ${o}-item-static`,style:$e,children:S?a.jsx("div",{className:`${o}-cover`,style:Q,children:ae}):ae},`${p}-${u}-${le}`)})})]})}const pw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
23062
23062
|
import { CommonComponentProps } from '../props';
|
|
23063
23063
|
import { scalingValue } from '../utils/scalingValue';
|
|
23064
23064
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23596,7 +23596,7 @@ export function Helix({
|
|
|
23596
23596
|
</>
|
|
23597
23597
|
);
|
|
23598
23598
|
}
|
|
23599
|
-
`,mw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],gw={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:mw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},hw={element:uw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:gw,sourceCode:pw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},wr=typeof window>"u"?s.useEffect:s.useLayoutEffect,Bo=120,Sc=3,fw=.12,ja=.25,yw=10,vw=4e3,xw=.12,bw=3,ww=3,au=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Br(e){return e<0?0:e>1?1:e}function Sw(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function Cw(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,v=u.y*t.height;p<n&&(n=p),p>o&&(o=p),v<i&&(i=v),v>r&&(r=v)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function xo(e){return e.map(([t,n])=>({x:t,y:n}))}function Va(e,t=Bo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Pr(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function ls(e,t){switch(e){case"ellipse":return[Va(n=>{const i=n*Math.PI*2;return{x:.5+Math.cos(i)*.5,y:.5+Math.sin(i)*.5}})];case"circle":{const n=t>=1?.5/t:.5,i=t>=1?.5:.5*t;return[Va(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[xo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[xo([[0,0],[1,0],[.5,1]])];case"diamond":return[xo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[xo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Pr([Va(n=>{const i=n*Math.PI*2,o=Math.cos(i);return{x:.5+Math.sin(i)*Math.pow(Math.sin(i/2),2)*.5,y:.5-o*.5}})]);case"leaf":{const n=Math.round(Bo/2),i=[];for(let o=0;o<=n;o+=1){const r=o/n;i.push({x:.5+Math.sin(Math.PI*r)*.5,y:r})}for(let o=n;o>=0;o-=1){const r=o/n;i.push({x:.5-Math.sin(Math.PI*r)*.5,y:r})}return[i]}case"wave":{const o=Bo,r=[];for(let l=0;l<=o;l+=1){const d=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*d)*.09,y:d})}for(let l=o;l>=0;l-=1){const d=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*d+Math.PI/3)*.09,y:d})}return[r]}case"rectangle":case"custom":default:return[xo([[0,0],[1,0],[1,1],[0,1]])]}}const su={x:0,y:0,width:100,height:100};function $w(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?su:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Er(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const cs=16,Tw=12,Iw=16,zr="0 0 100 100",jr=100,Ga=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Rw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Lw(e){const t=e.match(Rw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function gn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function ds(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function Pw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function Pn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Pw)}))}function ei(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Cc(e,t,n,i=n){return ei(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Ew(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),v=Math.sin(u),w=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*w+v*m,f=-v*w+p*m,x=h*h/(d*d)+f*f/(c*c);if(x>1){const ie=Math.sqrt(x);d*=ie,c*=ie}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),B=y===0?0:C*Math.sqrt(S/y),N=B*d*f/c,q=-B*c*h/d,D=p*N-v*q+(e.x+l.x)/2,T=v*N+p*q+(e.y+l.y)/2,H=Math.atan2((f-q)/c,(h-N)/d);let I=Math.atan2((-f-q)/c,(-h-N)/d)-H;!r&&I>0&&(I-=Math.PI*2),r&&I<0&&(I+=Math.PI*2);const P=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2))),E=I/P,g=4/3*Math.tan(E/4),z=(ie,L)=>({x:D+p*d*ie-v*c*L,y:T+v*d*ie+p*c*L}),F=[];let X=H;for(let ie=0;ie<P;ie+=1){const L=X+E,_=Math.cos(X),V=Math.sin(X),ae=Math.cos(L),re=Math.sin(L);F.push({c1:z(_-g*V,V+g*_),c2:z(ae+g*re,re-g*ae),p:ie===P-1?on(l):z(ae,re)}),X=L}return F}function zo(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:h??null,out:null}),r=m},v=m=>{i.length&&(i[i.length-1].out=m)};Ga.lastIndex=0;let w=Ga.exec(t);for(;w!==null;){const m=w[1],h=m.toUpperCase(),f=m!==h,x=Lw(w[2]),C=y=>f?{x:r.x+x[y],y:r.y+x[y+1]}:{x:x[y],y:x[y+1]};if(h==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<x.length;y+=2){const S=C(y);y===0&&(u(),l=on(S)),p(S)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<x.length;y+=2)p(C(y));d=null,c=null}else if(h==="H"){for(const y of x)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of x)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<x.length;y+=6){const S=C(y),B=C(y+2),N=C(y+4);v(S),p(N,B),d=B}c=null}else if(h==="S"){for(let y=0;y+3<x.length;y+=4){const S=d?ds(d,r):on(r),B=C(y),N=C(y+2);v(S),p(N,B),d=B}c=null}else if(h==="Q")for(let y=0;y+3<x.length;y+=4){const S=C(y),B=C(y+2);v(gn(r,S,2/3)),p(B,gn(B,S,2/3)),c=S,d=null}else if(h==="T")for(let y=0;y+1<x.length;y+=2){const S=c?ds(c,r):on(r),B=C(y);v(gn(r,S,2/3)),p(B,gn(B,S,2/3)),c=S,d=null}else if(h==="A")for(let y=0;y+6<x.length;y+=7){const S=f?{x:r.x+x[y+5],y:r.y+x[y+6]}:{x:x[y+5],y:x[y+6]};for(const B of Ew(r,x[y],x[y+1],x[y+2],x[y+3]!==0,x[y+4]!==0,S))v(B.c1),p(B.p,B.c2);d=null,c=null}w=Ga.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function Qo(e,t){return!e.out&&!t.in}function $c(e,t){if(Qo(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function jo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Rn(i.p.x)},${Rn(i.p.y)}`);let r=i;for(const l of o)t.push($c(r,l)),r=l;if(n.closed){const l=$c(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function lu(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function us(e,t,n){if(Qo(e,t))return gn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function Ks(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of lu(n)){if(Qo(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<cs;r+=1)i.push(us(o.from,o.to,r/cs))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function wi(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Ks(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function cu(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function du(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Tw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Iw)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:on(r),...cu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Mw(e){const t={x:0,y:0,width:jr,height:jr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==zr||!e.customPath)return t;const n=zo(e.customPath);if(!n.length)return t;const i=wi(n),o=i.maxX-i.minX,r=i.maxY-i.minY;return!isFinite(i.minX)||!isFinite(i.minY)||!(o>0)||!(r>0)?t:{x:i.minX,y:i.minY,width:o,height:r}}function uu(e,t,n=1){if(!e.length)return!1;const i=wi(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=Math.max(n,t.width*.5),r=Math.max(n,t.height*.5);return i.minX<t.x-o||i.minY<t.y-r||i.maxX>t.x+t.width+o||i.maxY>t.y+t.height+r}function kw(e,t){if(!e.length)return e;const n=wi(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ei(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Aw(e,t=1,n){const i=Mw(n),o=ls(e==="custom"?"rectangle":e,t),r=kw(ei(du(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:jo(r),pathFit:"viewbox",pathViewBox:zr}}function Tc(e,t){return t>0?Math.round(e/t)*t:e}function Fw(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,d=Pn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Ic(e,t,n,i){var r;if(!t.length)return e;const o=Pn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function _w(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=pu(i,r,d)}),i}function Nw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Pn(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=ds(o,c.p)}return d}function Ww(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=Pn(e);return r[t].nodes[n][i]=null,r}function Hw(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const d=Pn(e),c=d[t].nodes,u=n+1;if(Qo(r,l))return c.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,v=l.in??l.p,w=gn(r.p,p,i),m=gn(p,v,i),h=gn(v,l.p,i),f=gn(w,m,i),x=gn(m,h,i),C=gn(f,x,i),y=(n+1)%o.nodes.length;return c[n].out=w,c[y].in=h,c.splice(u,0,{p:C,in:f,out:x}),{contours:d,nodeIndex:u}}function pu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Pn(e);return o[t].nodes.splice(n,1),o}function Rc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Pn(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const d=i.nodes.length,c=i.nodes[(n-1+d)%d].p,u=i.nodes[(n+1)%d].p,p=cu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Dw(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function Ow(e,t){let n=null;return e.forEach((i,o)=>{for(const r of lu(i)){const l=Qo(r.from,r.to)?1:cs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Dw(t,us(r.from,r.to,c),us(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function mu(e){return!e.in&&!e.out}function Bw(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||mu(r)&&n.push(r.p)})}),n}function Lc(e,t,n,i,o){const r=i(t);let l=null,d=o;for(const c of e){const u=i(c),p=Math.abs(u[n]-r[n]);p<=d&&(d=p,l=c[n])}return l}function Pc(e,t="stretch",n=su){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=zo(i),d=Ks(l);if(d.length)return t==="viewbox"?Er(d,n):Pr(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(v=>v.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const v of c){const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d",v),u.appendChild(w);let m=0;try{m=w.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<Bo;f+=1){const x=w.getPointAtLength(f/Bo*m);h.push({x:x.x,y:x.y})}p.push(h)}return p.length?t==="viewbox"?Er(p,n):Pr(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?Er([r],n):Pr([r])}function zw(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=Br(n[o]),l=Br(n[o+1]);l>r&&i.push({x0:r,x1:l})}return jw(i)}function jw(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function Vw(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function Gw(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function Xw(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function qw(e,t,n,i){let o=null;for(let r=0;r<Sc;r+=1){const l=Br(t+(n-t)*r/Math.max(1,Sc-1)),d=zw(e,l),c=i==="avoid"?Gw(d):d;if(o=o===null?c:Vw(o,c),o.length===0)return[]}return o??[]}function gu(e){return!!e&&typeof e=="object"&&e.type==="link"}function Yw(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(gu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const v of p.split(/\s+/))v&&t.push({text:v,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Ec(e){return{...e.fontFamily&&{fontFamily:co(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 Uw(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(gu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Mc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:v}=e,w=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||w<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,m*.5),x=w*fw;let C=0,y=0,S=0,B=t[0].para,N=0,q=0,D=null;for(;C<t.length&&S<vw;){const T=y+w>c;if(T&&!u)break;const H=t[C].para;if(H>B+1){y+=w*(H-B-1),B=H-1,S+=1;continue}let $=T?[{x0:0,x1:d}]:qw(i,(y+x)/c,(y+w-x)/c,o).map(P=>({x0:P.x0*d,x1:P.x1*d}));p>0&&v>0&&!T&&$.length&&(D===null&&(D=S,N=$[0].x0,q=y),S-D<v&&($=Xw($,{x0:N,x1:N+p})));const I=$.reduce((P,E)=>Math.max(P,E.x1-E.x0),0);for(const P of $){const E=P.x1-P.x0;if(E<f)continue;if(C>=t.length||t[C].para!==H)break;const g=C;let z=0;for(;C<t.length&&t[C].para===H;){const F=n[C]*l,X=C===g?F:m+F;if(z+X>E&&!(C===g&&E>=I-.5&&F>d-.5))break;z+=X,C+=1}if(C>g){const F=C>=t.length||t[C].para!==H;h.push({top:y,left:P.x0,width:E,from:g,to:C,justify:r==="justify"&&!F})}if(C>=t.length||t[C].para!==H)break}B=H,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:N,capTop:q}}function Kw(e){return`
|
|
23599
|
+
`,mw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],gw={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:mw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},hw={element:uw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:gw,sourceCode:pw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},wr=typeof window>"u"?s.useEffect:s.useLayoutEffect,Bo=120,Sc=3,fw=.12,ja=.25,yw=10,vw=4e3,xw=.12,bw=3,ww=3,au=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Br(e){return e<0?0:e>1?1:e}function Sw(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function Cw(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,v=u.y*t.height;p<n&&(n=p),p>o&&(o=p),v<i&&(i=v),v>r&&(r=v)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function xo(e){return e.map(([t,n])=>({x:t,y:n}))}function Va(e,t=Bo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Pr(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function ls(e,t){switch(e){case"ellipse":return[Va(n=>{const i=n*Math.PI*2;return{x:.5+Math.cos(i)*.5,y:.5+Math.sin(i)*.5}})];case"circle":{const n=t>=1?.5/t:.5,i=t>=1?.5:.5*t;return[Va(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[xo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[xo([[0,0],[1,0],[.5,1]])];case"diamond":return[xo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[xo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Pr([Va(n=>{const i=n*Math.PI*2,o=Math.cos(i);return{x:.5+Math.sin(i)*Math.pow(Math.sin(i/2),2)*.5,y:.5-o*.5}})]);case"leaf":{const n=Math.round(Bo/2),i=[];for(let o=0;o<=n;o+=1){const r=o/n;i.push({x:.5+Math.sin(Math.PI*r)*.5,y:r})}for(let o=n;o>=0;o-=1){const r=o/n;i.push({x:.5-Math.sin(Math.PI*r)*.5,y:r})}return[i]}case"wave":{const o=Bo,r=[];for(let l=0;l<=o;l+=1){const d=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*d)*.09,y:d})}for(let l=o;l>=0;l-=1){const d=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*d+Math.PI/3)*.09,y:d})}return[r]}case"rectangle":case"custom":default:return[xo([[0,0],[1,0],[1,1],[0,1]])]}}const su={x:0,y:0,width:100,height:100};function $w(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?su:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Er(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const cs=16,Tw=12,Iw=16,zr="0 0 100 100",jr=100,Ga=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Rw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Lw(e){const t=e.match(Rw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function gn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function ds(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function Pw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function Pn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Pw)}))}function ei(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Cc(e,t,n,i=n){return ei(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Ew(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),v=Math.sin(u),w=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*w+v*m,f=-v*w+p*m,x=h*h/(d*d)+f*f/(c*c);if(x>1){const ie=Math.sqrt(x);d*=ie,c*=ie}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),z=y===0?0:C*Math.sqrt(S/y),N=z*d*f/c,Y=-z*c*h/d,B=p*N-v*Y+(e.x+l.x)/2,T=v*N+p*Y+(e.y+l.y)/2,H=Math.atan2((f-Y)/c,(h-N)/d);let I=Math.atan2((-f-Y)/c,(-h-N)/d)-H;!r&&I>0&&(I-=Math.PI*2),r&&I<0&&(I+=Math.PI*2);const P=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2))),M=I/P,g=4/3*Math.tan(M/4),D=(ie,L)=>({x:B+p*d*ie-v*c*L,y:T+v*d*ie+p*c*L}),A=[];let X=H;for(let ie=0;ie<P;ie+=1){const L=X+M,_=Math.cos(X),V=Math.sin(X),se=Math.cos(L),re=Math.sin(L);A.push({c1:D(_-g*V,V+g*_),c2:D(se+g*re,re-g*se),p:ie===P-1?on(l):D(se,re)}),X=L}return A}function zo(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:h??null,out:null}),r=m},v=m=>{i.length&&(i[i.length-1].out=m)};Ga.lastIndex=0;let w=Ga.exec(t);for(;w!==null;){const m=w[1],h=m.toUpperCase(),f=m!==h,x=Lw(w[2]),C=y=>f?{x:r.x+x[y],y:r.y+x[y+1]}:{x:x[y],y:x[y+1]};if(h==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<x.length;y+=2){const S=C(y);y===0&&(u(),l=on(S)),p(S)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<x.length;y+=2)p(C(y));d=null,c=null}else if(h==="H"){for(const y of x)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of x)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<x.length;y+=6){const S=C(y),z=C(y+2),N=C(y+4);v(S),p(N,z),d=z}c=null}else if(h==="S"){for(let y=0;y+3<x.length;y+=4){const S=d?ds(d,r):on(r),z=C(y),N=C(y+2);v(S),p(N,z),d=z}c=null}else if(h==="Q")for(let y=0;y+3<x.length;y+=4){const S=C(y),z=C(y+2);v(gn(r,S,2/3)),p(z,gn(z,S,2/3)),c=S,d=null}else if(h==="T")for(let y=0;y+1<x.length;y+=2){const S=c?ds(c,r):on(r),z=C(y);v(gn(r,S,2/3)),p(z,gn(z,S,2/3)),c=S,d=null}else if(h==="A")for(let y=0;y+6<x.length;y+=7){const S=f?{x:r.x+x[y+5],y:r.y+x[y+6]}:{x:x[y+5],y:x[y+6]};for(const z of Ew(r,x[y],x[y+1],x[y+2],x[y+3]!==0,x[y+4]!==0,S))v(z.c1),p(z.p,z.c2);d=null,c=null}w=Ga.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function Qo(e,t){return!e.out&&!t.in}function $c(e,t){if(Qo(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function jo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Rn(i.p.x)},${Rn(i.p.y)}`);let r=i;for(const l of o)t.push($c(r,l)),r=l;if(n.closed){const l=$c(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function lu(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function us(e,t,n){if(Qo(e,t))return gn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function Ks(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of lu(n)){if(Qo(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<cs;r+=1)i.push(us(o.from,o.to,r/cs))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function wi(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Ks(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function cu(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function du(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Tw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Iw)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:on(r),...cu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Mw(e){const t={x:0,y:0,width:jr,height:jr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==zr||!e.customPath)return t;const n=zo(e.customPath);if(!n.length)return t;const i=wi(n),o=i.maxX-i.minX,r=i.maxY-i.minY;return!isFinite(i.minX)||!isFinite(i.minY)||!(o>0)||!(r>0)?t:{x:i.minX,y:i.minY,width:o,height:r}}function uu(e,t,n=1){if(!e.length)return!1;const i=wi(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=Math.max(n,t.width*.5),r=Math.max(n,t.height*.5);return i.minX<t.x-o||i.minY<t.y-r||i.maxX>t.x+t.width+o||i.maxY>t.y+t.height+r}function kw(e,t){if(!e.length)return e;const n=wi(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ei(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Aw(e,t=1,n){const i=Mw(n),o=ls(e==="custom"?"rectangle":e,t),r=kw(ei(du(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:jo(r),pathFit:"viewbox",pathViewBox:zr}}function Tc(e,t){return t>0?Math.round(e/t)*t:e}function Fw(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,d=Pn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Ic(e,t,n,i){var r;if(!t.length)return e;const o=Pn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function _w(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=pu(i,r,d)}),i}function Nw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Pn(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=ds(o,c.p)}return d}function Ww(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=Pn(e);return r[t].nodes[n][i]=null,r}function Hw(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const d=Pn(e),c=d[t].nodes,u=n+1;if(Qo(r,l))return c.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,v=l.in??l.p,w=gn(r.p,p,i),m=gn(p,v,i),h=gn(v,l.p,i),f=gn(w,m,i),x=gn(m,h,i),C=gn(f,x,i),y=(n+1)%o.nodes.length;return c[n].out=w,c[y].in=h,c.splice(u,0,{p:C,in:f,out:x}),{contours:d,nodeIndex:u}}function pu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Pn(e);return o[t].nodes.splice(n,1),o}function Rc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Pn(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const d=i.nodes.length,c=i.nodes[(n-1+d)%d].p,u=i.nodes[(n+1)%d].p,p=cu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Dw(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function Ow(e,t){let n=null;return e.forEach((i,o)=>{for(const r of lu(i)){const l=Qo(r.from,r.to)?1:cs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Dw(t,us(r.from,r.to,c),us(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function mu(e){return!e.in&&!e.out}function Bw(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||mu(r)&&n.push(r.p)})}),n}function Lc(e,t,n,i,o){const r=i(t);let l=null,d=o;for(const c of e){const u=i(c),p=Math.abs(u[n]-r[n]);p<=d&&(d=p,l=c[n])}return l}function Pc(e,t="stretch",n=su){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=zo(i),d=Ks(l);if(d.length)return t==="viewbox"?Er(d,n):Pr(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(v=>v.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const v of c){const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d",v),u.appendChild(w);let m=0;try{m=w.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<Bo;f+=1){const x=w.getPointAtLength(f/Bo*m);h.push({x:x.x,y:x.y})}p.push(h)}return p.length?t==="viewbox"?Er(p,n):Pr(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?Er([r],n):Pr([r])}function zw(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=Br(n[o]),l=Br(n[o+1]);l>r&&i.push({x0:r,x1:l})}return jw(i)}function jw(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function Vw(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function Gw(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function Xw(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function qw(e,t,n,i){let o=null;for(let r=0;r<Sc;r+=1){const l=Br(t+(n-t)*r/Math.max(1,Sc-1)),d=zw(e,l),c=i==="avoid"?Gw(d):d;if(o=o===null?c:Vw(o,c),o.length===0)return[]}return o??[]}function gu(e){return!!e&&typeof e=="object"&&e.type==="link"}function Yw(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(gu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const v of p.split(/\s+/))v&&t.push({text:v,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Ec(e){return{...e.fontFamily&&{fontFamily:co(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 Uw(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(gu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Mc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:v}=e,w=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||w<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,m*.5),x=w*fw;let C=0,y=0,S=0,z=t[0].para,N=0,Y=0,B=null;for(;C<t.length&&S<vw;){const T=y+w>c;if(T&&!u)break;const H=t[C].para;if(H>z+1){y+=w*(H-z-1),z=H-1,S+=1;continue}let $=T?[{x0:0,x1:d}]:qw(i,(y+x)/c,(y+w-x)/c,o).map(P=>({x0:P.x0*d,x1:P.x1*d}));p>0&&v>0&&!T&&$.length&&(B===null&&(B=S,N=$[0].x0,Y=y),S-B<v&&($=Xw($,{x0:N,x1:N+p})));const I=$.reduce((P,M)=>Math.max(P,M.x1-M.x0),0);for(const P of $){const M=P.x1-P.x0;if(M<f)continue;if(C>=t.length||t[C].para!==H)break;const g=C;let D=0;for(;C<t.length&&t[C].para===H;){const A=n[C]*l,X=C===g?A:m+A;if(D+X>M&&!(C===g&&M>=I-.5&&A>d-.5))break;D+=X,C+=1}if(C>g){const A=C>=t.length||t[C].para!==H;h.push({top:y,left:P.x0,width:M,from:g,to:C,justify:r==="justify"&&!A})}if(C>=t.length||t[C].para!==H)break}z=H,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:N,capTop:Y}}function Kw(e){return`
|
|
23600
23600
|
.${e}-wrapper {
|
|
23601
23601
|
box-sizing: border-box;
|
|
23602
23602
|
display: flex;
|
|
@@ -23809,7 +23809,7 @@ export function Helix({
|
|
|
23809
23809
|
clip-path: inset(50%);
|
|
23810
23810
|
white-space: nowrap;
|
|
23811
23811
|
}
|
|
23812
|
-
`}const bo=7,Zw=3.5,wo=9,Jn=8,Qn=14,kc=10,Jw=24,Ac=14,Qw=1,eS=.05,Vr=1.08;function Gr(e,t){switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}}function hu(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function ps(e,t){const n=Gr(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*kc,y:n.y+o*kc}}const ms=.1,gs=8,tS=4;function hs(e,t){return!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height)}function Si(e,t,n){const i=hs(e,t)*n;return{width:t.width*i,height:t.height*i}}function Ln(e,t,n){return(e-t)*n}function zi(e,t,n){const i=e-t;return Math.abs(i)<tS?.5:Br(n/i)}function nS(e,t,n,i,o,r){const l=Si(e,n,r),d=e.x+Ln(e.width,l.width,i),c=e.y+Ln(e.height,l.height,o),u=hs(e,n),p=hs(t,n),v=Math.min(gs,Math.max(ms,p>0?r*(u/p):r)),w=Si(t,n,v);return{focalX:zi(t.width,w.width,d-t.x),focalY:zi(t.height,w.height,c-t.y),scale:v}}function iS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,stage:l,onStageChange:d,onSelectionChange:c,onChange:u,onCommit:p}){const v=s.useRef(null),w=s.useRef(null),m=s.useRef(i);m.current=i;const h=s.useRef(null),f=s.useRef(null),x=s.useRef(null),C=s.useRef(null),[y,S]=s.useState([]),B=l==="shape";s.useEffect(()=>{var b;B&&((b=v.current)==null||b.focus({preventScroll:!0}))},[B]),s.useEffect(()=>{B||S(b=>b.length?[]:b)},[B]);const N=y.length>0;s.useEffect(()=>{c==null||c(N)},[N,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const q=n.width>0?t.width/n.width:1,D=n.height>0?t.height/n.height:1,T=s.useCallback(b=>r?{x:(b.x-n.x)*q,y:(b.y-n.y)*D}:{x:b.x-n.x,y:b.y-n.y},[r,n,q,D]),H=s.useCallback((b,k)=>{var he;const G=(he=v.current)==null?void 0:he.getBoundingClientRect();return!G||G.width<=0||G.height<=0?{x:0,y:0}:r?{x:n.x+(b-G.left)/G.width*n.width,y:n.y+(k-G.top)/G.height*n.height}:{x:n.x+(b-G.left),y:n.y+(k-G.top)}},[r,n]),$=s.useCallback((b,k)=>{var he;const G=(he=v.current)==null?void 0:he.getBoundingClientRect();return!G||G.width<=0||G.height<=0?{x:0,y:0}:{x:(b-G.left)/G.width*t.width,y:(k-G.top)/G.height*t.height}},[t.width,t.height]),I=s.useCallback((b,k)=>{p(b,k)},[p]),P=b=>{const k=x.current;if(k&&b.pointerId===k.pointerId){if(b.stopPropagation(),b.preventDefault(),k.startDistance<=0)return;const ve=H(b.clientX,b.clientY),Ie=Math.hypot(ve.x-k.origin.x,ve.y-k.origin.y),pe=Math.max(eS,Ie/k.startDistance);if(!k.moved&&Math.abs(pe-1)<1e-4)return;k.moved=!0,u(Cc(k.startContours,k.origin,pe));return}const G=f.current;if(G&&b.pointerId===G.pointerId){b.stopPropagation(),b.preventDefault();const ve=H(b.clientX,b.clientY),{bbox:Ie}=G,pe=Ie.maxX-Ie.minX,oe=Ie.maxY-Ie.minY,ye=ve.x-G.origin.x,U=ve.y-G.origin.y;let ce=ye,le=U;if(isFinite(pe)&&isFinite(oe))if(r){const Ce=Math.min(n.x,n.x+n.width-pe),Fe=Math.max(n.x,n.x+n.width-pe),Ee=Math.min(n.y,n.y+n.height-oe),Y=Math.max(n.y,n.y+n.height-oe),be=Math.min(Fe,Math.max(Ce,Ie.minX+ye)),de=Math.min(Y,Math.max(Ee,Ie.minY+U));ce=be-Ie.minX,le=de-Ie.minY}else{const Ce=Ie.minX-n.x,Fe=Ie.minY-n.y,Ee=Math.min(0,t.width-pe),Y=Math.max(0,t.width-pe),be=Math.min(0,t.height-oe),de=Math.max(0,t.height-oe),K=Math.min(Y,Math.max(Ee,Ce+ye)),ue=Math.min(de,Math.max(be,Fe+U));ce=K-Ce,le=ue-Fe}if(!G.moved&&ce===0&&le===0)return;G.moved=!0,u(ei(G.startContours,Ce=>({x:Ce.x+ce,y:Ce.y+le})),{carryImage:!0});return}const he=C.current;if(he&&b.pointerId===he.pointerId){b.stopPropagation(),b.preventDefault();const ve=H(b.clientX,b.clientY);let Ie=ve.x-he.origin.x,pe=ve.y-he.origin.y;if(b.shiftKey&&(Math.abs(Ie)>Math.abs(pe)?pe=0:Ie=0),!he.moved&&Ie===0&&pe===0)return;he.moved=!0,u(Ic(he.startContours,he.selection,Ie,pe));return}const J=h.current;if(!J||b.pointerId!==J.pointerId)return;b.stopPropagation(),b.preventDefault();const ee=H(b.clientX,b.clientY),O=J.snapEligible?Bw(m.current,{contour:J.contour,node:J.node}):[],Z=J.snapEligible?Lc(O,ee,"x",T,Ac):null,te=J.snapEligible?Lc(O,ee,"y",T,Ac):null,Le={x:Z??Tc(ee.x,o),y:te??Tc(ee.y,o)};if(J.kind==="anchor"){let ve=Le.x-J.origin.x,Ie=Le.y-J.origin.y;if(b.shiftKey&&(Math.abs(ve)>Math.abs(Ie)?Ie=0:ve=0),!J.moved&&ve===0&&Ie===0)return;J.moved=!0,u(Fw(m.current,J.contour,J.node,{x:J.anchor.x+ve,y:J.anchor.y+Ie}));return}J.moved=!0,u(Nw(m.current,J.contour,J.node,J.kind,Le,J.mirror&&!b.altKey))},E=b=>{const k=x.current;if(k&&b.pointerId===k.pointerId){x.current=null,b.stopPropagation();const O=v.current;O!=null&&O.hasPointerCapture(k.pointerId)&&O.releasePointerCapture(k.pointerId),k.moved&&I(m.current,{preserveShape:!0});return}const G=f.current;if(G&&b.pointerId===G.pointerId){f.current=null,b.stopPropagation();const O=v.current;O!=null&&O.hasPointerCapture(G.pointerId)&&O.releasePointerCapture(G.pointerId),G.moved?I(m.current,{preserveShape:!0}):S([]);return}const he=C.current;if(he&&b.pointerId===he.pointerId){C.current=null,b.stopPropagation();const O=v.current;O!=null&&O.hasPointerCapture(he.pointerId)&&O.releasePointerCapture(he.pointerId),he.moved&&I(m.current);return}const J=h.current;if(!J||b.pointerId!==J.pointerId)return;h.current=null,b.stopPropagation();const ee=v.current;ee!=null&&ee.hasPointerCapture(J.pointerId)&&ee.releasePointerCapture(J.pointerId),J.moved&&I(m.current)},g=b=>{b.stopPropagation()},z=b=>{var k,G;b.stopPropagation(),b.preventDefault(),(k=v.current)==null||k.focus({preventScroll:!0}),f.current={pointerId:b.pointerId,origin:H(b.clientX,b.clientY),startContours:Pn(i),bbox:wi(i),moved:!1},(G=v.current)==null||G.setPointerCapture(b.pointerId)},F=(b,k)=>{var O,Z;b.stopPropagation(),b.preventDefault(),(O=v.current)==null||O.focus({preventScroll:!0}),S([]),d("shape");const G=wi(i),he=Gr(G,hu(k)),J=ps(G,k),ee=Math.hypot(J.x-he.x,J.y-he.y);!isFinite(ee)||ee<=0||(x.current={pointerId:b.pointerId,corner:k,origin:he,startDistance:ee,startContours:Pn(i),moved:!1},(Z=v.current)==null||Z.setPointerCapture(b.pointerId))},X=(b,k,G,he)=>{var ee,O,Z,te;b.stopPropagation(),b.preventDefault(),(ee=v.current)==null||ee.focus({preventScroll:!0});const J=(O=i[G])==null?void 0:O.nodes[he];if(J){if(b.altKey){const Le=k==="anchor"?pu(i,G,he):Ww(i,G,he,k);if(Le===i)return;S(k==="anchor"?[]:[{contour:G,node:he}]),u(Le),I(Le);return}if(b.metaKey||b.ctrlKey){const Le=Rc(i,G,he);if(Le===i)return;S([{contour:G,node:he}]),u(Le),I(Le);return}if(k==="anchor"&&b.shiftKey){S(Le=>Le.some(ve=>ve.contour===G&&ve.node===he)?Le.filter(ve=>!(ve.contour===G&&ve.node===he)):[...Le,{contour:G,node:he}]);return}if(k==="anchor"&&y.length>1&&y.some(Le=>Le.contour===G&&Le.node===he)){C.current={pointerId:b.pointerId,origin:H(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(Z=v.current)==null||Z.setPointerCapture(b.pointerId);return}S([{contour:G,node:he}]),h.current={kind:k,contour:G,node:he,pointerId:b.pointerId,origin:H(b.clientX,b.clientY),anchor:J.p,mirror:k!=="anchor"&&!!(J.in&&J.out),snapEligible:k==="anchor"&&mu(J),moved:!1},(te=v.current)==null||te.setPointerCapture(b.pointerId)}},ie=b=>{b.stopPropagation(),b.preventDefault();const k=ei(i,T),G=Ow(k,$(b.clientX,b.clientY));if(!G||G.distance>Jw)return;const{contours:he,nodeIndex:J}=Hw(i,G.contour,G.segment,G.t);J<0||(S([{contour:G.contour,node:J}]),u(he),I(he))},L=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const ee=wi(i);if(!isFinite(ee.minX)||!isFinite(ee.maxX))return;const O={x:(ee.minX+ee.maxX)/2,y:(ee.minY+ee.maxY)/2},te=b.key==="="||b.key==="+"?Vr:1/Vr,Le=Cc(i,O,te);u(Le),I(Le,{preserveShape:!0});return}if(b.key==="Escape"){b.stopPropagation(),S([]),d("none");return}if(!y.length)return;if(b.key==="Backspace"||b.key==="Delete"){b.preventDefault(),b.stopPropagation();const ee=_w(i,y);if(ee===i)return;S([]),u(ee),I(ee);return}const k=o>0?o:Qw,G=b.shiftKey?k*10:k,he={ArrowLeft:[-G,0],ArrowRight:[G,0],ArrowUp:[0,-G],ArrowDown:[0,G]}[b.key];if(!he)return;b.preventDefault(),b.stopPropagation();const J=Ic(i,y,he[0],he[1]);u(J),I(J)},_=s.useMemo(()=>jo(ei(i,T)),[i,T]),V=s.useMemo(()=>wi(i),[i]),ae=T({x:V.minX,y:V.minY}),re={width:T({x:V.maxX,y:V.minY}).x-ae.x,height:T({x:V.minX,y:V.maxY}).y-ae.y},M=B&&y.length===0&&isFinite(V.minX)&&isFinite(V.maxX)&&V.maxX>V.minX&&V.maxY>V.minY,se=y.length>0||B,j=se;return a.jsxs("svg",{ref:v,className:`${e}-editor${se?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:L,onPointerDown:()=>{var b;return(b=v.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:P,onPointerUp:E,onPointerCancel:E,onLostPointerCapture:E,"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{S([]),d("none")},onClick:ie}),j&&a.jsx("path",{className:`${e}-editor-hit`,d:_,onClick:ie}),j&&a.jsx("path",{className:`${e}-editor-outline`,d:_}),a.jsx("path",{ref:w,className:`${e}-editor-body`,d:_,fillRule:"evenodd",onPointerDown:z,onClick:ie}),j&&i.map((b,k)=>b.nodes.map((G,he)=>{const J=y.some(O=>O.contour===k&&O.node===he),ee=T(G.p);return a.jsxs("g",{children:[J&&y.length===1&&["in","out"].map(O=>{const Z=G[O];if(!Z)return null;const te=T(Z);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:ee.x,y1:ee.y,x2:te.x,y2:te.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:te.x,cy:te.y,r:Zw}),a.jsx("circle",{className:`${e}-editor-grab`,cx:te.x,cy:te.y,r:wo,onPointerDown:Le=>X(Le,O,k,he),onClick:g})]},O)}),a.jsx("rect",{className:`${e}-editor-anchor${J?` ${e}-editor-anchor-selected`:""}`,x:ee.x-bo/2,y:ee.y-bo/2,width:bo,height:bo,rx:G.in||G.out?bo/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:ee.x-wo,y:ee.y-wo,width:wo*2,height:wo*2,onPointerDown:O=>X(O,"anchor",k,he),onClick:g,onDoubleClick:O=>{O.stopPropagation(),O.preventDefault();const Z=Rc(i,k,he);u(Z),I(Z)}})]},`${k}-${he}`)})),M&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:ae.x,y:ae.y,width:re.width,height:re.height}),["nw","ne","se","sw"].map(b=>{const k=T(ps(V,b)),G=b==="ne"||b==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:k.x-Jn/2,y:k.y-Jn/2,width:Jn,height:Jn}),a.jsx("rect",{className:`${e}-editor-scale-grab${G?` ${e}-editor-scale-grab-nesw`:""}`,x:k.x-Qn/2,y:k.y-Qn/2,width:Qn,height:Qn,onPointerDown:he=>F(he,b),onClick:g})]},b)})]})]})}function oS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:v,onCommit:w}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),C=s.useRef({focalX:c,focalY:u,scale:p});C.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var E;y&&((E=m.current)==null||E.focus({preventScroll:!0}))},[y]);const S=s.useCallback((E,g)=>{var F;const z=(F=m.current)==null?void 0:F.getBoundingClientRect();return!z||z.width<=0||z.height<=0?{x:0,y:0}:{x:(E-z.left)/z.width*t.width,y:(g-z.top)/z.height*t.height}},[t.width,t.height]),B=E=>{var z,F;if(!i)return;E.stopPropagation(),E.preventDefault(),(z=m.current)==null||z.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:E.pointerId,origin:S(E.clientX,E.clientY),startX:Ln(n.width,g.width,c),startY:Ln(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(F=m.current)==null||F.setPointerCapture(E.pointerId)},N=(E,g)=>{var ae,re;if(!i)return;E.stopPropagation(),E.preventDefault(),(ae=m.current)==null||ae.focus({preventScroll:!0});const z=Si(n,i,p),F=Ln(n.width,z.width,c),X=Ln(n.height,z.height,u),ie={minX:F,minY:X,maxX:F+z.width,maxY:X+z.height},L=Gr(ie,hu(g)),_=Gr(ie,g),V=Math.hypot(_.x-L.x,_.y-L.y);!isFinite(V)||V<=0||(x.current={pointerId:E.pointerId,anchor:L,startDistance:V,startScale:p,startX:F,startY:X,moved:!1},(re=m.current)==null||re.setPointerCapture(E.pointerId))},q=E=>{if(!i)return;const g=x.current;if(g&&E.pointerId===g.pointerId){E.stopPropagation(),E.preventDefault();const F=S(E.clientX,E.clientY),X={x:F.x-n.x,y:F.y-n.y},ie=Math.hypot(X.x-g.anchor.x,X.y-g.anchor.y),L=Math.min(gs,Math.max(ms,g.startScale*(ie/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const _=L/g.startScale,V=g.anchor.x+(g.startX-g.anchor.x)*_,ae=g.anchor.y+(g.startY-g.anchor.y)*_,re=Si(n,i,L);v({focalX:zi(n.width,re.width,V),focalY:zi(n.height,re.height,ae),scale:L});return}const z=f.current;if(z&&E.pointerId===z.pointerId){E.stopPropagation(),E.preventDefault();const F=S(E.clientX,E.clientY),X=F.x-z.origin.x,ie=F.y-z.origin.y;if(!z.moved&&X===0&&ie===0)return;z.moved=!0,v({focalX:zi(n.width,z.width,z.startX+X),focalY:zi(n.height,z.height,z.startY+ie),scale:p})}},D=E=>{var F,X;const g=f.current;if(g&&E.pointerId===g.pointerId){f.current=null,E.stopPropagation(),(F=m.current)!=null&&F.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const z=x.current;z&&E.pointerId===z.pointerId&&(x.current=null,E.stopPropagation(),(X=m.current)!=null&&X.hasPointerCapture(z.pointerId)&&m.current.releasePointerCapture(z.pointerId),z.moved&&w(C.current))},T=E=>{if(E.key==="Escape"){E.stopPropagation(),d("none");return}if(E.key==="="||E.key==="+"||E.key==="-"||E.key==="_"){E.preventDefault(),E.stopPropagation();const g=E.key==="="||E.key==="+",z=Math.min(gs,Math.max(ms,p*(g?Vr:1/Vr))),F={focalX:c,focalY:u,scale:z};v(F),w(F)}},H=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},I=s.useMemo(()=>{const E=i??{width:n.width,height:n.height},g=Si(n,E,p);return!(g.width>0)||!(g.height>0)?null:{x:n.x+Ln(n.width,g.width,c),y:n.y+Ln(n.height,g.height,u),width:g.width,height:g.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),P=I?{minX:I.x,minY:I.y,maxX:I.x+I.width,maxY:I.y+I.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:T,onPointerMove:q,onPointerUp:D,onPointerCancel:D,onLostPointerCapture:D,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&I&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:I.x,y:I.y,width:I.width,height:I.height,children:[a.jsx("rect",{x:I.x,y:I.y,width:I.width,height:I.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:I.x,y:I.y,width:I.width,height:I.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:I.x,y:I.y,width:I.width,height:I.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:B}),H.map(E=>{const g=ps(P,E),z=E==="ne"||E==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-Jn/2,y:g.y-Jn/2,width:Jn,height:Jn}),a.jsx("rect",{className:`${e}-editor-scale-grab${z?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-Qn/2,y:g.y-Qn/2,width:Qn,height:Qn,onPointerDown:F=>N(F,E)})]},E)})]})]})}function rS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function aS(e,t){return Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function sS(e,t){const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const d=rS(e);(!r||!aS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function lS(){return typeof document>"u"?null:document.body}function cS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:v,dropCapLines:w,dropCapSize:m,showGuides:h,typography:f,imageUrl:x,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:B,pathDragActive:N,pathCarryImage:q,onCarryImageConsumed:D,pathEditor:T,imageEditor:H}){var _e,Ze;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[I,P]=s.useState(null),E=s.useRef(null),[g,z]=s.useState({width:0,height:0}),[F,X]=s.useState(null),[ie,L]=s.useState(0),[_,V]=s.useState("none");s.useEffect(()=>{!T&&!H&&V("none")},[T,H]);const[ae,re]=s.useState(null);s.useEffect(()=>{if(!x||typeof Image>"u"){re(null);return}let we=!1;const $e=new Image;return $e.onload=()=>{we||re({width:$e.naturalWidth,height:$e.naturalHeight})},$e.src=x,()=>{we=!0}},[x]);const M=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),se=s.useMemo(()=>Yw(M),[M]),j=s.useMemo(()=>Uw(M),[M]),b=w>0?((Ze=(_e=se[0])==null?void 0:_e.text)==null?void 0:Ze.charAt(0))??"":"",k=g.height>0?g.width/g.height:1,G=(T==null?void 0:T.contours)??null,he=s.useMemo(()=>{if(G){const Xe=Ks(G);if(Xe.length)return Er(Xe,r)}const we=i.trim(),$e=we?Pc(we,o,r):null;return $e&&$e.length?$e:ls(n==="custom"?"rectangle":n,k)},[G,n,i,o,r,Math.round(k*100)/100]),J=T==null?void 0:T.onConvert,ee=(T==null?void 0:T.needsConversion)??!1,O=s.useMemo(()=>{const we=G??(i.trim()?zo(i):null);return!!(we&&uu(we,r))},[G,i,r]),[Z,te]=s.useState(null);wr(()=>{if(!O){Z&&te(null);return}!Z&&g.width>0&&g.height>0&&te({width:g.width,height:g.height})},[O,g.width,g.height,Z]);const Le=s.useMemo(()=>{if(!O||g.width<=0||g.height<=0)return he;const we=Z??g,$e=r.width/we.width,Xe=r.height/we.height;return he.map(ze=>ze.map(Te=>({x:Te.x*$e,y:Te.y*Xe})))},[he,O,Z,r.width,r.height,g.width,g.height]),ve=s.useMemo(()=>{const we=B.trim(),$e=we?Pc(we,o,r):null;return $e&&$e.length?$e:ls(n==="custom"?"rectangle":n,k)},[n,B,o,r,Math.round(k*100)/100]),Ie=s.useMemo(()=>{if(!O||g.width<=0||g.height<=0)return ve;const we=Z??g,$e=r.width/we.width,Xe=r.height/we.height;return ve.map(ze=>ze.map(Te=>({x:Te.x*$e,y:Te.y*Xe})))},[ve,O,Z,r.width,r.height,g.width,g.height]),pe=s.useRef(null);s.useEffect(()=>{if(!(!J||g.width<=0||g.height<=0)){if(O){if(pe.current===i)return;const we=G??(i.trim()?zo(i):null);if(!(we!=null&&we.length))return;const $e=ei(we,Xe=>({x:r.x+(Xe.x-r.x)/g.width*r.width,y:r.y+(Xe.y-r.y)/g.height*r.height}));pe.current=jo($e),J($e);return}!ee||!he.length||J(ei(du(he),we=>({x:we.x*jr,y:we.y*jr})))}},[ee,O,J,he,G,i,r,g.width,g.height]),wr(()=>{const we=I;if(!we||typeof ResizeObserver>"u")return;const $e=()=>{const ze=we.getBoundingClientRect();z(Te=>Math.abs(Te.width-ze.width)<.5&&Math.abs(Te.height-ze.height)<.5?Te:{width:ze.width,height:ze.height})};$e();const Xe=new ResizeObserver($e);return Xe.observe(we),()=>Xe.disconnect()},[I]),s.useEffect(()=>{const we=typeof document<"u"?document.fonts:void 0;we!=null&&we.ready&&we.ready.then(()=>{L($e=>$e+1)})},[]),wr(()=>{const we=E.current;if(!we)return;if(!se.length){X(null);return}const $e=[],Xe=document.createDocumentFragment();for(const zt of se){const ft=document.createElement("span");Object.assign(ft.style,Ec(zt.leaf)),ft.textContent=zt.text,Xe.appendChild(ft),$e.push(ft)}const ze=document.createElement("span");ze.textContent=" ",Xe.appendChild(ze);const Te=document.createElement("span");Te.textContent=b||"H",Te.style.lineHeight="1",Xe.appendChild(Te),we.replaceChildren(Xe);const Ve=window.getComputedStyle(we),De=parseFloat(Ve.fontSize)||16,tt=parseFloat(Ve.lineHeight),nt=Number.isNaN(tt)?De*1.2:tt;Te.style.fontSize=`${nt*m}px`;const st=$e.map(zt=>zt.getBoundingClientRect().width),St=ze.getBoundingClientRect().width,Bt=b?Te.getBoundingClientRect().width:0;we.replaceChildren(),X({widths:st,spaceWidth:St,lineHeight:nt,capWidth:Bt})},[se,f,b,w,m,ie,g.width]);const oe=F&&b?F.capWidth+F.lineHeight*xw:0,ye=Math.max(w,Math.ceil(m)),U=s.useMemo(()=>{if(!F||!se.length||g.width<=0||g.height<=0||!u)return 1;const we=ze=>Mc({tokens:se,widths:F.widths,spaceWidth:F.spaceWidth,lineHeight:F.lineHeight,width:g.width,height:g.height,rings:Le,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:oe*ze,capLines:b?ye:0});if(we(1).placed>=se.length)return 1;if(we(ja).placed<se.length)return ja;let $e=ja,Xe=1;for(let ze=0;ze<yw;ze+=1){const Te=($e+Xe)/2;we(Te).placed>=se.length?$e=Te:Xe=Te}return $e},[F,se,g.width,g.height,Le,l,d,u,oe,b,ye]);s.useEffect(()=>{v(U)},[U,v]);const ce=u?Math.min(p,U):1,le=s.useMemo(()=>!F||!se.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Mc({tokens:se,widths:F.widths,spaceWidth:F.spaceWidth,lineHeight:F.lineHeight,width:g.width,height:g.height,rings:Le,mode:l,align:d,scale:ce,allowOverflow:c,capInset:oe*ce,capLines:b?ye:0}),[F,se,g.width,g.height,Le,l,d,ce,c,oe,b,ye]),Ce=F?F.lineHeight*ce:0,Fe=d==="justify"?"left":d,Ee=!!(T&&G&&g.width>0&&g.height>0),Y=!!H,be=(Ee||Y)&&g.width>0&&g.height>0,de=sS(I,be),K=be&&de?lS():null,ue=s.useRef(!1),He=s.useCallback(we=>{ue.current=we},[]);s.useEffect(()=>{if(!Ee&&!Y)return;const we=$e=>{const Xe=I;if(!Xe)return;const ze=Xe.getBoundingClientRect();$e.clientX>=ze.left&&$e.clientX<=ze.right&&$e.clientY>=ze.top&&$e.clientY<=ze.bottom&&($e.preventDefault(),$e.stopPropagation(),V(Ve=>Ve==="shape"&&ue.current?Ve:Ve==="shape"&&Y?"image":Ee?"shape":"image"))};return document.addEventListener("dblclick",we,!0),()=>document.removeEventListener("dblclick",we,!0)},[Ee,Y,I]);const fe=s.useMemo(()=>x&&g.width>0&&g.height>0?Cw(Ie,g):null,[x,Ie,g.width,g.height]),Q=N&&!q&&_!=="image",Je=s.useRef(null);!N&&x&&fe&&(Je.current={rings:Ie,bounds:fe,focalX:C,focalY:y,scale:S,customPath:B});const Ne=Q?Je.current:null,ct=s.useRef(null),Ke=(()=>{const we=ct.current;return N||q||!H||!ae||!fe||!we||B===we.customPath?null:nS(we.bounds,fe,ae,we.focalX,we.focalY,we.scale)})();wr(()=>{if(N||!H||!ae||!fe)return;const we=ct.current,$e=!!(we&&B!==we.customPath);$e&&Ke&&H.onCommit(Ke),$e&&q&&(D==null||D()),ct.current={rings:Ie,bounds:fe,focalX:(Ke==null?void 0:Ke.focalX)??C,focalY:(Ke==null?void 0:Ke.focalY)??y,scale:(Ke==null?void 0:Ke.scale)??S,customPath:B}},[N,q,B,Ie,fe,H,ae,C,y,S,Ke,D]);const ut=(Ne==null?void 0:Ne.rings)??Ie,lt=(Ne==null?void 0:Ne.bounds)??fe,Ye=(Ne==null?void 0:Ne.focalX)??(Ke==null?void 0:Ke.focalX)??C,Re=(Ne==null?void 0:Ne.focalY)??(Ke==null?void 0:Ke.focalY)??y,We=(Ne==null?void 0:Ne.scale)??(Ke==null?void 0:Ke.scale)??S,Be=s.useMemo(()=>x&&g.width>0&&g.height>0?Sw(ut,g):"",[x,ut,g.width,g.height]),Ue=lt,ge=`${$}-clip`,xe=s.useMemo(()=>{if(!Ue)return null;const we=ae??{width:Ue.width,height:Ue.height},$e=Si(Ue,we,We);return{x:Ln(Ue.width,$e.width,Ye),y:Ln(Ue.height,$e.height,Re),width:$e.width,height:$e.height}},[Ue,ae,Ye,Re,We]);return a.jsxs("div",{className:`${e}-column`,ref:P,children:[x&&Be&&Ue&&xe?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${g.width} ${g.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("clipPath",{id:ge,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Be,fillRule:"evenodd"})})}),a.jsx("image",{href:x,x:Ue.x+xe.x,y:Ue.y+xe.y,width:xe.width,height:xe.height,preserveAspectRatio:"none",clipPath:`url(#${ge})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:ce},children:[a.jsx("div",{className:`${e}-measure`,ref:E,style:f,"aria-hidden":!0}),le.segments.map((we,$e)=>{const Xe=se.slice(we.from,we.to),ze=$e===0;return a.jsx("div",{className:`${e}-line${we.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${we.top}px`,left:`${we.left}px`,width:`${we.width}px`,textAlign:we.justify?void 0:Fe},children:Xe.map((Te,Ve)=>{const tt=b&&ze&&we.from===0&&Ve===0?Te.text.slice(1):Te.text,nt=Ec(Te.leaf),st=Te.href?a.jsx("a",{className:`${e}-link`,href:Te.href,target:Te.target,style:nt,children:tt}):a.jsx("span",{style:nt,children:tt});return a.jsxs("span",{children:[!we.justify&&Ve>0?" ":null,st]},Ve)})},`${we.from}-${we.to}-${$e}`)}),h&&!G&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Le.map((we,$e)=>a.jsx("polygon",{points:we.map(Xe=>`${Xe.x},${Xe.y}`).join(" ")},$e))})]}),b&&F&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${le.capTop}px`,left:`${le.capLeft}px`,fontSize:`${Ce*m}px`,lineHeight:`${Ce*m}px`},children:b}),K&&de&&(G&&T||H)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:de.top,left:de.left,width:de.width,height:de.height,zIndex:ww,pointerEvents:"none"},children:[G&&T&&a.jsx(iS,{P:e,box:{width:de.width,height:de.height},viewBox:r,contours:G,snap:T.snap,stretchToBox:!O,stage:_,onStageChange:V,onSelectionChange:He,onChange:T.onChange,onCommit:T.onCommit}),H&&Ue&&a.jsx(oS,{P:e,box:{width:de.width,height:de.height},bounds:Ue,natural:ae,imageUrl:x,maskPath:Be,stage:_,onStageChange:V,focalX:Ye,focalY:Re,scale:We,onChange:H.onChange,onCommit:H.onCommit})]}),K),a.jsx("div",{className:`${e}-a11y`,children:j.map((we,$e)=>a.jsx("p",{children:we},$e))})]})}function dS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>Kw(d),[d]),u=n??!1,p=!!r||!!o,v=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),w=(e==null?void 0:e.shape)??"rectangle",m=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>$w(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),x=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",C=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",B=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,N=(e==null?void 0:e.dropCapSize)??bw,q=u&&p&&!i,[D,T]=s.useState(!1);s.useEffect(()=>{if(!u||!p){T(!1);return}const oe=()=>T(!0),ye=()=>T(!1),U=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ce=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const le of U)window.addEventListener(le,oe);for(const le of ce)window.addEventListener(le,ye);return()=>{for(const le of U)window.removeEventListener(le,oe);for(const le of ce)window.removeEventListener(le,ye)}},[u,p]);const H=u&&p&&!i&&typeof l=="function",$=!D,I=Math.max(0,(e==null?void 0:e.pathSnap)??0),[P,E]=s.useState(null),[g,z]=s.useState(!1),[F,X]=s.useState(!1),ie=s.useCallback(()=>X(!1),[]),L=s.useMemo(()=>!P||P.serialized===m?m:P.serialized,[P,m]);s.useEffect(()=>{H||(z(!1),X(!1))},[H]);const _=s.useMemo(()=>{if(!H)return null;if(P&&(P.base===m||P.serialized===m))return P.contours;const oe=zo(m);return oe.length?oe:null},[H,P,m]),V=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===zr&&!!(_&&!uu(_,f)),ae=s.useCallback((oe,ye,U)=>{const ce=jo(oe);if(E(le=>({base:le&&(le.base===m||le.serialized===m)?le.base:m,serialized:ce,contours:oe})),ye){const le=U!=null&&U.preserveShape?e==null?void 0:e.shape:"custom";l==null||l({...e,shape:le,customPath:ce})}},[m,l,e]),re=s.useMemo(()=>H?{contours:V?_:null,snap:I,needsConversion:!V,onConvert:oe=>{const ye=jo(oe);E({base:ye,serialized:ye,contours:oe}),l==null||l({...e,pathFit:"viewbox",pathViewBox:zr,customPath:ye})},onChange:(oe,ye)=>{z(!0),X(!!(ye!=null&&ye.carryImage)),ae(oe,!1)},onCommit:(oe,ye)=>{ae(oe,!0,ye),z(!1)}}:null,[H,V,_,I,l,e,ae]),M=x==="avoid"&&!!(e!=null&&e.image),se=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[j,b]=s.useState(null),k=j??se,G=s.useCallback(oe=>b(oe),[]),he=s.useCallback(oe=>{b(oe),l==null||l({...e,imageFocalX:oe.focalX,imageFocalY:oe.focalY,imageScale:oe.scale})},[l,e]);s.useEffect(()=>{j&&Math.abs(j.focalX-se.focalX)<1e-9&&Math.abs(j.focalY-se.focalY)<1e-9&&Math.abs(j.scale-se.scale)<1e-9&&b(null)},[j,se]);const J=s.useMemo(()=>!H||!M?null:{onChange:G,onCommit:he},[H,M,G,he]),[ee,O]=s.useState(void 0),Z=s.useRef(void 0),te=s.useCallback(oe=>{const ye=Z.current;ye!==void 0&&Math.abs(ye-oe)<.005||(Z.current=oe,O(oe))},[]),Le=s.useMemo(()=>S&&typeof ee=="number"?ee:1,[ee,S]),ve=oe=>`calc(${oe} * var(--${d}-fit, 1))`,Ie=s.useMemo(()=>{var oe,ye,U,ce,le;return{fontFamily:co(e==null?void 0:e.textFontFamily),fontWeight:(oe=e==null?void 0:e.textFontSettings)==null?void 0:oe.fontWeight,fontStyle:(ye=e==null?void 0:e.textFontSettings)==null?void 0:ye.fontStyle,fontSize:ve(W.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:ve(W.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:ve(W.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ve(W.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(U=e==null?void 0:e.textTextAppearance)==null?void 0:U.textTransform,textDecoration:(ce=e==null?void 0:e.textTextAppearance)==null?void 0:ce.textDecoration,fontVariant:(le=e==null?void 0:e.textTextAppearance)==null?void 0:le.fontVariant}},[e,u,d]),pe={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...pe},children:a.jsx(cS,{P:d,item:v,shape:w,customPath:m,pathFit:h,viewBox:f,mode:x,align:C,allowOverflow:y,fitEnabled:S,scale:Le,onFitScale:te,dropCapLines:B,dropCapSize:N,showGuides:(q||H)&&$,typography:Ie,imageUrl:x==="avoid"?e==null?void 0:e.image:null,imageFocalX:k.focalX,imageFocalY:k.focalY,imageScale:k.scale,imageCustomPath:L,pathDragActive:g,pathCarryImage:F,onCarryImageConsumed:ie,pathEditor:$?re:null,imageEditor:$?J:null})})]})}const uS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23812
|
+
`}const bo=7,Zw=3.5,wo=9,Jn=8,Qn=14,kc=10,Jw=24,Ac=14,Qw=1,eS=.05,Vr=1.08;function Gr(e,t){switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}}function hu(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function ps(e,t){const n=Gr(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*kc,y:n.y+o*kc}}const ms=.1,gs=8,tS=4;function hs(e,t){return!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height)}function Si(e,t,n){const i=hs(e,t)*n;return{width:t.width*i,height:t.height*i}}function Ln(e,t,n){return(e-t)*n}function zi(e,t,n){const i=e-t;return Math.abs(i)<tS?.5:Br(n/i)}function nS(e,t,n,i,o,r){const l=Si(e,n,r),d=e.x+Ln(e.width,l.width,i),c=e.y+Ln(e.height,l.height,o),u=hs(e,n),p=hs(t,n),v=Math.min(gs,Math.max(ms,p>0?r*(u/p):r)),w=Si(t,n,v);return{focalX:zi(t.width,w.width,d-t.x),focalY:zi(t.height,w.height,c-t.y),scale:v}}function iS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,stage:l,onStageChange:d,onSelectionChange:c,onChange:u,onCommit:p}){const v=s.useRef(null),w=s.useRef(null),m=s.useRef(i);m.current=i;const h=s.useRef(null),f=s.useRef(null),x=s.useRef(null),C=s.useRef(null),[y,S]=s.useState([]),z=l==="shape";s.useEffect(()=>{var b;z&&((b=v.current)==null||b.focus({preventScroll:!0}))},[z]),s.useEffect(()=>{z||S(b=>b.length?[]:b)},[z]);const N=y.length>0;s.useEffect(()=>{c==null||c(N)},[N,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const Y=n.width>0?t.width/n.width:1,B=n.height>0?t.height/n.height:1,T=s.useCallback(b=>r?{x:(b.x-n.x)*Y,y:(b.y-n.y)*B}:{x:b.x-n.x,y:b.y-n.y},[r,n,Y,B]),H=s.useCallback((b,E)=>{var me;const j=(me=v.current)==null?void 0:me.getBoundingClientRect();return!j||j.width<=0||j.height<=0?{x:0,y:0}:r?{x:n.x+(b-j.left)/j.width*n.width,y:n.y+(E-j.top)/j.height*n.height}:{x:n.x+(b-j.left),y:n.y+(E-j.top)}},[r,n]),$=s.useCallback((b,E)=>{var me;const j=(me=v.current)==null?void 0:me.getBoundingClientRect();return!j||j.width<=0||j.height<=0?{x:0,y:0}:{x:(b-j.left)/j.width*t.width,y:(E-j.top)/j.height*t.height}},[t.width,t.height]),I=s.useCallback((b,E)=>{p(b,E)},[p]),P=b=>{const E=x.current;if(E&&b.pointerId===E.pointerId){if(b.stopPropagation(),b.preventDefault(),E.startDistance<=0)return;const be=H(b.clientX,b.clientY),Re=Math.hypot(be.x-E.origin.x,be.y-E.origin.y),ue=Math.max(eS,Re/E.startDistance);if(!E.moved&&Math.abs(ue-1)<1e-4)return;E.moved=!0,u(Cc(E.startContours,E.origin,ue));return}const j=f.current;if(j&&b.pointerId===j.pointerId){b.stopPropagation(),b.preventDefault();const be=H(b.clientX,b.clientY),{bbox:Re}=j,ue=Re.maxX-Re.minX,fe=Re.maxY-Re.minY,$e=be.x-j.origin.x,Q=be.y-j.origin.y;let Z=$e,ae=Q;if(isFinite(ue)&&isFinite(fe))if(r){const xe=Math.min(n.x,n.x+n.width-ue),ke=Math.max(n.x,n.x+n.width-ue),Ce=Math.min(n.y,n.y+n.height-fe),q=Math.max(n.y,n.y+n.height-fe),ye=Math.min(ke,Math.max(xe,Re.minX+$e)),ce=Math.min(q,Math.max(Ce,Re.minY+Q));Z=ye-Re.minX,ae=ce-Re.minY}else{const xe=Re.minX-n.x,ke=Re.minY-n.y,Ce=Math.min(0,t.width-ue),q=Math.max(0,t.width-ue),ye=Math.min(0,t.height-fe),ce=Math.max(0,t.height-fe),U=Math.min(q,Math.max(Ce,xe+$e)),de=Math.min(ce,Math.max(ye,ke+Q));Z=U-xe,ae=de-ke}if(!j.moved&&Z===0&&ae===0)return;j.moved=!0,u(ei(j.startContours,xe=>({x:xe.x+Z,y:xe.y+ae})),{carryImage:!0});return}const me=C.current;if(me&&b.pointerId===me.pointerId){b.stopPropagation(),b.preventDefault();const be=H(b.clientX,b.clientY);let Re=be.x-me.origin.x,ue=be.y-me.origin.y;if(b.shiftKey&&(Math.abs(Re)>Math.abs(ue)?ue=0:Re=0),!me.moved&&Re===0&&ue===0)return;me.moved=!0,u(Ic(me.startContours,me.selection,Re,ue));return}const K=h.current;if(!K||b.pointerId!==K.pointerId)return;b.stopPropagation(),b.preventDefault();const te=H(b.clientX,b.clientY),O=K.snapEligible?Bw(m.current,{contour:K.contour,node:K.node}):[],J=K.snapEligible?Lc(O,te,"x",T,Ac):null,ne=K.snapEligible?Lc(O,te,"y",T,Ac):null,Pe={x:J??Tc(te.x,o),y:ne??Tc(te.y,o)};if(K.kind==="anchor"){let be=Pe.x-K.origin.x,Re=Pe.y-K.origin.y;if(b.shiftKey&&(Math.abs(be)>Math.abs(Re)?Re=0:be=0),!K.moved&&be===0&&Re===0)return;K.moved=!0,u(Fw(m.current,K.contour,K.node,{x:K.anchor.x+be,y:K.anchor.y+Re}));return}K.moved=!0,u(Nw(m.current,K.contour,K.node,K.kind,Pe,K.mirror&&!b.altKey))},M=b=>{const E=x.current;if(E&&b.pointerId===E.pointerId){x.current=null,b.stopPropagation();const O=v.current;O!=null&&O.hasPointerCapture(E.pointerId)&&O.releasePointerCapture(E.pointerId),E.moved&&I(m.current,{preserveShape:!0});return}const j=f.current;if(j&&b.pointerId===j.pointerId){f.current=null,b.stopPropagation();const O=v.current;O!=null&&O.hasPointerCapture(j.pointerId)&&O.releasePointerCapture(j.pointerId),j.moved?I(m.current,{preserveShape:!0}):S([]);return}const me=C.current;if(me&&b.pointerId===me.pointerId){C.current=null,b.stopPropagation();const O=v.current;O!=null&&O.hasPointerCapture(me.pointerId)&&O.releasePointerCapture(me.pointerId),me.moved&&I(m.current);return}const K=h.current;if(!K||b.pointerId!==K.pointerId)return;h.current=null,b.stopPropagation();const te=v.current;te!=null&&te.hasPointerCapture(K.pointerId)&&te.releasePointerCapture(K.pointerId),K.moved&&I(m.current)},g=b=>{b.stopPropagation()},D=b=>{var E,j;b.stopPropagation(),b.preventDefault(),(E=v.current)==null||E.focus({preventScroll:!0}),f.current={pointerId:b.pointerId,origin:H(b.clientX,b.clientY),startContours:Pn(i),bbox:wi(i),moved:!1},(j=v.current)==null||j.setPointerCapture(b.pointerId)},A=(b,E)=>{var O,J;b.stopPropagation(),b.preventDefault(),(O=v.current)==null||O.focus({preventScroll:!0}),S([]),d("shape");const j=wi(i),me=Gr(j,hu(E)),K=ps(j,E),te=Math.hypot(K.x-me.x,K.y-me.y);!isFinite(te)||te<=0||(x.current={pointerId:b.pointerId,corner:E,origin:me,startDistance:te,startContours:Pn(i),moved:!1},(J=v.current)==null||J.setPointerCapture(b.pointerId))},X=(b,E,j,me)=>{var te,O,J,ne;b.stopPropagation(),b.preventDefault(),(te=v.current)==null||te.focus({preventScroll:!0});const K=(O=i[j])==null?void 0:O.nodes[me];if(K){if(b.altKey){const Pe=E==="anchor"?pu(i,j,me):Ww(i,j,me,E);if(Pe===i)return;S(E==="anchor"?[]:[{contour:j,node:me}]),u(Pe),I(Pe);return}if(b.metaKey||b.ctrlKey){const Pe=Rc(i,j,me);if(Pe===i)return;S([{contour:j,node:me}]),u(Pe),I(Pe);return}if(E==="anchor"&&b.shiftKey){S(Pe=>Pe.some(be=>be.contour===j&&be.node===me)?Pe.filter(be=>!(be.contour===j&&be.node===me)):[...Pe,{contour:j,node:me}]);return}if(E==="anchor"&&y.length>1&&y.some(Pe=>Pe.contour===j&&Pe.node===me)){C.current={pointerId:b.pointerId,origin:H(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(J=v.current)==null||J.setPointerCapture(b.pointerId);return}S([{contour:j,node:me}]),h.current={kind:E,contour:j,node:me,pointerId:b.pointerId,origin:H(b.clientX,b.clientY),anchor:K.p,mirror:E!=="anchor"&&!!(K.in&&K.out),snapEligible:E==="anchor"&&mu(K),moved:!1},(ne=v.current)==null||ne.setPointerCapture(b.pointerId)}},ie=b=>{b.stopPropagation(),b.preventDefault();const E=ei(i,T),j=Ow(E,$(b.clientX,b.clientY));if(!j||j.distance>Jw)return;const{contours:me,nodeIndex:K}=Hw(i,j.contour,j.segment,j.t);K<0||(S([{contour:j.contour,node:K}]),u(me),I(me))},L=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const te=wi(i);if(!isFinite(te.minX)||!isFinite(te.maxX))return;const O={x:(te.minX+te.maxX)/2,y:(te.minY+te.maxY)/2},ne=b.key==="="||b.key==="+"?Vr:1/Vr,Pe=Cc(i,O,ne);u(Pe),I(Pe,{preserveShape:!0});return}if(b.key==="Escape"){b.stopPropagation(),S([]),d("none");return}if(!y.length)return;if(b.key==="Backspace"||b.key==="Delete"){b.preventDefault(),b.stopPropagation();const te=_w(i,y);if(te===i)return;S([]),u(te),I(te);return}const E=o>0?o:Qw,j=b.shiftKey?E*10:E,me={ArrowLeft:[-j,0],ArrowRight:[j,0],ArrowUp:[0,-j],ArrowDown:[0,j]}[b.key];if(!me)return;b.preventDefault(),b.stopPropagation();const K=Ic(i,y,me[0],me[1]);u(K),I(K)},_=s.useMemo(()=>jo(ei(i,T)),[i,T]),V=s.useMemo(()=>wi(i),[i]),se=T({x:V.minX,y:V.minY}),re={width:T({x:V.maxX,y:V.minY}).x-se.x,height:T({x:V.minX,y:V.maxY}).y-se.y},k=z&&y.length===0&&isFinite(V.minX)&&isFinite(V.maxX)&&V.maxX>V.minX&&V.maxY>V.minY,le=y.length>0||z,G=le;return a.jsxs("svg",{ref:v,className:`${e}-editor${le?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:L,onPointerDown:()=>{var b;return(b=v.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:P,onPointerUp:M,onPointerCancel:M,onLostPointerCapture:M,"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{S([]),d("none")},onClick:ie}),G&&a.jsx("path",{className:`${e}-editor-hit`,d:_,onClick:ie}),G&&a.jsx("path",{className:`${e}-editor-outline`,d:_}),a.jsx("path",{ref:w,className:`${e}-editor-body`,d:_,fillRule:"evenodd",onPointerDown:D,onClick:ie}),G&&i.map((b,E)=>b.nodes.map((j,me)=>{const K=y.some(O=>O.contour===E&&O.node===me),te=T(j.p);return a.jsxs("g",{children:[K&&y.length===1&&["in","out"].map(O=>{const J=j[O];if(!J)return null;const ne=T(J);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:te.x,y1:te.y,x2:ne.x,y2:ne.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ne.x,cy:ne.y,r:Zw}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ne.x,cy:ne.y,r:wo,onPointerDown:Pe=>X(Pe,O,E,me),onClick:g})]},O)}),a.jsx("rect",{className:`${e}-editor-anchor${K?` ${e}-editor-anchor-selected`:""}`,x:te.x-bo/2,y:te.y-bo/2,width:bo,height:bo,rx:j.in||j.out?bo/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:te.x-wo,y:te.y-wo,width:wo*2,height:wo*2,onPointerDown:O=>X(O,"anchor",E,me),onClick:g,onDoubleClick:O=>{O.stopPropagation(),O.preventDefault();const J=Rc(i,E,me);u(J),I(J)}})]},`${E}-${me}`)})),k&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:se.x,y:se.y,width:re.width,height:re.height}),["nw","ne","se","sw"].map(b=>{const E=T(ps(V,b)),j=b==="ne"||b==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:E.x-Jn/2,y:E.y-Jn/2,width:Jn,height:Jn}),a.jsx("rect",{className:`${e}-editor-scale-grab${j?` ${e}-editor-scale-grab-nesw`:""}`,x:E.x-Qn/2,y:E.y-Qn/2,width:Qn,height:Qn,onPointerDown:me=>A(me,b),onClick:g})]},b)})]})]})}function oS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:v,onCommit:w}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),C=s.useRef({focalX:c,focalY:u,scale:p});C.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var M;y&&((M=m.current)==null||M.focus({preventScroll:!0}))},[y]);const S=s.useCallback((M,g)=>{var A;const D=(A=m.current)==null?void 0:A.getBoundingClientRect();return!D||D.width<=0||D.height<=0?{x:0,y:0}:{x:(M-D.left)/D.width*t.width,y:(g-D.top)/D.height*t.height}},[t.width,t.height]),z=M=>{var D,A;if(!i)return;M.stopPropagation(),M.preventDefault(),(D=m.current)==null||D.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:M.pointerId,origin:S(M.clientX,M.clientY),startX:Ln(n.width,g.width,c),startY:Ln(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(A=m.current)==null||A.setPointerCapture(M.pointerId)},N=(M,g)=>{var se,re;if(!i)return;M.stopPropagation(),M.preventDefault(),(se=m.current)==null||se.focus({preventScroll:!0});const D=Si(n,i,p),A=Ln(n.width,D.width,c),X=Ln(n.height,D.height,u),ie={minX:A,minY:X,maxX:A+D.width,maxY:X+D.height},L=Gr(ie,hu(g)),_=Gr(ie,g),V=Math.hypot(_.x-L.x,_.y-L.y);!isFinite(V)||V<=0||(x.current={pointerId:M.pointerId,anchor:L,startDistance:V,startScale:p,startX:A,startY:X,moved:!1},(re=m.current)==null||re.setPointerCapture(M.pointerId))},Y=M=>{if(!i)return;const g=x.current;if(g&&M.pointerId===g.pointerId){M.stopPropagation(),M.preventDefault();const A=S(M.clientX,M.clientY),X={x:A.x-n.x,y:A.y-n.y},ie=Math.hypot(X.x-g.anchor.x,X.y-g.anchor.y),L=Math.min(gs,Math.max(ms,g.startScale*(ie/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const _=L/g.startScale,V=g.anchor.x+(g.startX-g.anchor.x)*_,se=g.anchor.y+(g.startY-g.anchor.y)*_,re=Si(n,i,L);v({focalX:zi(n.width,re.width,V),focalY:zi(n.height,re.height,se),scale:L});return}const D=f.current;if(D&&M.pointerId===D.pointerId){M.stopPropagation(),M.preventDefault();const A=S(M.clientX,M.clientY),X=A.x-D.origin.x,ie=A.y-D.origin.y;if(!D.moved&&X===0&&ie===0)return;D.moved=!0,v({focalX:zi(n.width,D.width,D.startX+X),focalY:zi(n.height,D.height,D.startY+ie),scale:p})}},B=M=>{var A,X;const g=f.current;if(g&&M.pointerId===g.pointerId){f.current=null,M.stopPropagation(),(A=m.current)!=null&&A.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const D=x.current;D&&M.pointerId===D.pointerId&&(x.current=null,M.stopPropagation(),(X=m.current)!=null&&X.hasPointerCapture(D.pointerId)&&m.current.releasePointerCapture(D.pointerId),D.moved&&w(C.current))},T=M=>{if(M.key==="Escape"){M.stopPropagation(),d("none");return}if(M.key==="="||M.key==="+"||M.key==="-"||M.key==="_"){M.preventDefault(),M.stopPropagation();const g=M.key==="="||M.key==="+",D=Math.min(gs,Math.max(ms,p*(g?Vr:1/Vr))),A={focalX:c,focalY:u,scale:D};v(A),w(A)}},H=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},I=s.useMemo(()=>{const M=i??{width:n.width,height:n.height},g=Si(n,M,p);return!(g.width>0)||!(g.height>0)?null:{x:n.x+Ln(n.width,g.width,c),y:n.y+Ln(n.height,g.height,u),width:g.width,height:g.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),P=I?{minX:I.x,minY:I.y,maxX:I.x+I.width,maxY:I.y+I.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:T,onPointerMove:Y,onPointerUp:B,onPointerCancel:B,onLostPointerCapture:B,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&I&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:I.x,y:I.y,width:I.width,height:I.height,children:[a.jsx("rect",{x:I.x,y:I.y,width:I.width,height:I.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:I.x,y:I.y,width:I.width,height:I.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:I.x,y:I.y,width:I.width,height:I.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:z}),H.map(M=>{const g=ps(P,M),D=M==="ne"||M==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-Jn/2,y:g.y-Jn/2,width:Jn,height:Jn}),a.jsx("rect",{className:`${e}-editor-scale-grab${D?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-Qn/2,y:g.y-Qn/2,width:Qn,height:Qn,onPointerDown:A=>N(A,M)})]},M)})]})]})}function rS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function aS(e,t){return Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function sS(e,t){const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const d=rS(e);(!r||!aS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function lS(){return typeof document>"u"?null:document.body}function cS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:v,dropCapLines:w,dropCapSize:m,showGuides:h,typography:f,imageUrl:x,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:z,pathDragActive:N,pathCarryImage:Y,onCarryImageConsumed:B,pathEditor:T,imageEditor:H}){var _e,Ze;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[I,P]=s.useState(null),M=s.useRef(null),[g,D]=s.useState({width:0,height:0}),[A,X]=s.useState(null),[ie,L]=s.useState(0),[_,V]=s.useState("none");s.useEffect(()=>{!T&&!H&&V("none")},[T,H]);const[se,re]=s.useState(null);s.useEffect(()=>{if(!x||typeof Image>"u"){re(null);return}let we=!1;const Te=new Image;return Te.onload=()=>{we||re({width:Te.naturalWidth,height:Te.naturalHeight})},Te.src=x,()=>{we=!0}},[x]);const k=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),le=s.useMemo(()=>Yw(k),[k]),G=s.useMemo(()=>Uw(k),[k]),b=w>0?((Ze=(_e=le[0])==null?void 0:_e.text)==null?void 0:Ze.charAt(0))??"":"",E=g.height>0?g.width/g.height:1,j=(T==null?void 0:T.contours)??null,me=s.useMemo(()=>{if(j){const Xe=Ks(j);if(Xe.length)return Er(Xe,r)}const we=i.trim(),Te=we?Pc(we,o,r):null;return Te&&Te.length?Te:ls(n==="custom"?"rectangle":n,E)},[j,n,i,o,r,Math.round(E*100)/100]),K=T==null?void 0:T.onConvert,te=(T==null?void 0:T.needsConversion)??!1,O=s.useMemo(()=>{const we=j??(i.trim()?zo(i):null);return!!(we&&uu(we,r))},[j,i,r]),[J,ne]=s.useState(null);wr(()=>{if(!O){J&&ne(null);return}!J&&g.width>0&&g.height>0&&ne({width:g.width,height:g.height})},[O,g.width,g.height,J]);const Pe=s.useMemo(()=>{if(!O||g.width<=0||g.height<=0)return me;const we=J??g,Te=r.width/we.width,Xe=r.height/we.height;return me.map(ze=>ze.map(Ie=>({x:Ie.x*Te,y:Ie.y*Xe})))},[me,O,J,r.width,r.height,g.width,g.height]),be=s.useMemo(()=>{const we=z.trim(),Te=we?Pc(we,o,r):null;return Te&&Te.length?Te:ls(n==="custom"?"rectangle":n,E)},[n,z,o,r,Math.round(E*100)/100]),Re=s.useMemo(()=>{if(!O||g.width<=0||g.height<=0)return be;const we=J??g,Te=r.width/we.width,Xe=r.height/we.height;return be.map(ze=>ze.map(Ie=>({x:Ie.x*Te,y:Ie.y*Xe})))},[be,O,J,r.width,r.height,g.width,g.height]),ue=s.useRef(null);s.useEffect(()=>{if(!(!K||g.width<=0||g.height<=0)){if(O){if(ue.current===i)return;const we=j??(i.trim()?zo(i):null);if(!(we!=null&&we.length))return;const Te=ei(we,Xe=>({x:r.x+(Xe.x-r.x)/g.width*r.width,y:r.y+(Xe.y-r.y)/g.height*r.height}));ue.current=jo(Te),K(Te);return}!te||!me.length||K(ei(du(me),we=>({x:we.x*jr,y:we.y*jr})))}},[te,O,K,me,j,i,r,g.width,g.height]),wr(()=>{const we=I;if(!we||typeof ResizeObserver>"u")return;const Te=()=>{const ze=we.getBoundingClientRect();D(Ie=>Math.abs(Ie.width-ze.width)<.5&&Math.abs(Ie.height-ze.height)<.5?Ie:{width:ze.width,height:ze.height})};Te();const Xe=new ResizeObserver(Te);return Xe.observe(we),()=>Xe.disconnect()},[I]),s.useEffect(()=>{const we=typeof document<"u"?document.fonts:void 0;we!=null&&we.ready&&we.ready.then(()=>{L(Te=>Te+1)})},[]),wr(()=>{const we=M.current;if(!we)return;if(!le.length){X(null);return}const Te=[],Xe=document.createDocumentFragment();for(const zt of le){const ft=document.createElement("span");Object.assign(ft.style,Ec(zt.leaf)),ft.textContent=zt.text,Xe.appendChild(ft),Te.push(ft)}const ze=document.createElement("span");ze.textContent=" ",Xe.appendChild(ze);const Ie=document.createElement("span");Ie.textContent=b||"H",Ie.style.lineHeight="1",Xe.appendChild(Ie),we.replaceChildren(Xe);const Ve=window.getComputedStyle(we),De=parseFloat(Ve.fontSize)||16,tt=parseFloat(Ve.lineHeight),nt=Number.isNaN(tt)?De*1.2:tt;Ie.style.fontSize=`${nt*m}px`;const st=Te.map(zt=>zt.getBoundingClientRect().width),St=ze.getBoundingClientRect().width,Bt=b?Ie.getBoundingClientRect().width:0;we.replaceChildren(),X({widths:st,spaceWidth:St,lineHeight:nt,capWidth:Bt})},[le,f,b,w,m,ie,g.width]);const fe=A&&b?A.capWidth+A.lineHeight*xw:0,$e=Math.max(w,Math.ceil(m)),Q=s.useMemo(()=>{if(!A||!le.length||g.width<=0||g.height<=0||!u)return 1;const we=ze=>Mc({tokens:le,widths:A.widths,spaceWidth:A.spaceWidth,lineHeight:A.lineHeight,width:g.width,height:g.height,rings:Pe,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:fe*ze,capLines:b?$e:0});if(we(1).placed>=le.length)return 1;if(we(ja).placed<le.length)return ja;let Te=ja,Xe=1;for(let ze=0;ze<yw;ze+=1){const Ie=(Te+Xe)/2;we(Ie).placed>=le.length?Te=Ie:Xe=Ie}return Te},[A,le,g.width,g.height,Pe,l,d,u,fe,b,$e]);s.useEffect(()=>{v(Q)},[Q,v]);const Z=u?Math.min(p,Q):1,ae=s.useMemo(()=>!A||!le.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Mc({tokens:le,widths:A.widths,spaceWidth:A.spaceWidth,lineHeight:A.lineHeight,width:g.width,height:g.height,rings:Pe,mode:l,align:d,scale:Z,allowOverflow:c,capInset:fe*Z,capLines:b?$e:0}),[A,le,g.width,g.height,Pe,l,d,Z,c,fe,b,$e]),xe=A?A.lineHeight*Z:0,ke=d==="justify"?"left":d,Ce=!!(T&&j&&g.width>0&&g.height>0),q=!!H,ye=(Ce||q)&&g.width>0&&g.height>0,ce=sS(I,ye),U=ye&&ce?lS():null,de=s.useRef(!1),He=s.useCallback(we=>{de.current=we},[]);s.useEffect(()=>{if(!Ce&&!q)return;const we=Te=>{const Xe=I;if(!Xe)return;const ze=Xe.getBoundingClientRect();Te.clientX>=ze.left&&Te.clientX<=ze.right&&Te.clientY>=ze.top&&Te.clientY<=ze.bottom&&(Te.preventDefault(),Te.stopPropagation(),V(Ve=>Ve==="shape"&&de.current?Ve:Ve==="shape"&&q?"image":Ce?"shape":"image"))};return document.addEventListener("dblclick",we,!0),()=>document.removeEventListener("dblclick",we,!0)},[Ce,q,I]);const he=s.useMemo(()=>x&&g.width>0&&g.height>0?Cw(Re,g):null,[x,Re,g.width,g.height]),ee=N&&!Y&&_!=="image",Je=s.useRef(null);!N&&x&&he&&(Je.current={rings:Re,bounds:he,focalX:C,focalY:y,scale:S,customPath:z});const Ne=ee?Je.current:null,ct=s.useRef(null),Ke=(()=>{const we=ct.current;return N||Y||!H||!se||!he||!we||z===we.customPath?null:nS(we.bounds,he,se,we.focalX,we.focalY,we.scale)})();wr(()=>{if(N||!H||!se||!he)return;const we=ct.current,Te=!!(we&&z!==we.customPath);Te&&Ke&&H.onCommit(Ke),Te&&Y&&(B==null||B()),ct.current={rings:Re,bounds:he,focalX:(Ke==null?void 0:Ke.focalX)??C,focalY:(Ke==null?void 0:Ke.focalY)??y,scale:(Ke==null?void 0:Ke.scale)??S,customPath:z}},[N,Y,z,Re,he,H,se,C,y,S,Ke,B]);const ut=(Ne==null?void 0:Ne.rings)??Re,lt=(Ne==null?void 0:Ne.bounds)??he,Ye=(Ne==null?void 0:Ne.focalX)??(Ke==null?void 0:Ke.focalX)??C,Le=(Ne==null?void 0:Ne.focalY)??(Ke==null?void 0:Ke.focalY)??y,We=(Ne==null?void 0:Ne.scale)??(Ke==null?void 0:Ke.scale)??S,Be=s.useMemo(()=>x&&g.width>0&&g.height>0?Sw(ut,g):"",[x,ut,g.width,g.height]),Ue=lt,ge=`${$}-clip`,ve=s.useMemo(()=>{if(!Ue)return null;const we=se??{width:Ue.width,height:Ue.height},Te=Si(Ue,we,We);return{x:Ln(Ue.width,Te.width,Ye),y:Ln(Ue.height,Te.height,Le),width:Te.width,height:Te.height}},[Ue,se,Ye,Le,We]);return a.jsxs("div",{className:`${e}-column`,ref:P,children:[x&&Be&&Ue&&ve?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${g.width} ${g.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("clipPath",{id:ge,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Be,fillRule:"evenodd"})})}),a.jsx("image",{href:x,x:Ue.x+ve.x,y:Ue.y+ve.y,width:ve.width,height:ve.height,preserveAspectRatio:"none",clipPath:`url(#${ge})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:Z},children:[a.jsx("div",{className:`${e}-measure`,ref:M,style:f,"aria-hidden":!0}),ae.segments.map((we,Te)=>{const Xe=le.slice(we.from,we.to),ze=Te===0;return a.jsx("div",{className:`${e}-line${we.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${we.top}px`,left:`${we.left}px`,width:`${we.width}px`,textAlign:we.justify?void 0:ke},children:Xe.map((Ie,Ve)=>{const tt=b&&ze&&we.from===0&&Ve===0?Ie.text.slice(1):Ie.text,nt=Ec(Ie.leaf),st=Ie.href?a.jsx("a",{className:`${e}-link`,href:Ie.href,target:Ie.target,style:nt,children:tt}):a.jsx("span",{style:nt,children:tt});return a.jsxs("span",{children:[!we.justify&&Ve>0?" ":null,st]},Ve)})},`${we.from}-${we.to}-${Te}`)}),h&&!j&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Pe.map((we,Te)=>a.jsx("polygon",{points:we.map(Xe=>`${Xe.x},${Xe.y}`).join(" ")},Te))})]}),b&&A&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${ae.capTop}px`,left:`${ae.capLeft}px`,fontSize:`${xe*m}px`,lineHeight:`${xe*m}px`},children:b}),U&&ce&&(j&&T||H)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:ce.top,left:ce.left,width:ce.width,height:ce.height,zIndex:ww,pointerEvents:"none"},children:[j&&T&&a.jsx(iS,{P:e,box:{width:ce.width,height:ce.height},viewBox:r,contours:j,snap:T.snap,stretchToBox:!O,stage:_,onStageChange:V,onSelectionChange:He,onChange:T.onChange,onCommit:T.onCommit}),H&&Ue&&a.jsx(oS,{P:e,box:{width:ce.width,height:ce.height},bounds:Ue,natural:se,imageUrl:x,maskPath:Be,stage:_,onStageChange:V,focalX:Ye,focalY:Le,scale:We,onChange:H.onChange,onCommit:H.onCommit})]}),U),a.jsx("div",{className:`${e}-a11y`,children:G.map((we,Te)=>a.jsx("p",{children:we},Te))})]})}function dS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>Kw(d),[d]),u=n??!1,p=!!r||!!o,v=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),w=(e==null?void 0:e.shape)??"rectangle",m=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>$w(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),x=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",C=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",z=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,N=(e==null?void 0:e.dropCapSize)??bw,Y=u&&p&&!i,[B,T]=s.useState(!1);s.useEffect(()=>{if(!u||!p){T(!1);return}const Z=()=>T(!0),ae=()=>T(!1),xe=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ke=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const Ce of xe)window.addEventListener(Ce,Z);for(const Ce of ke)window.addEventListener(Ce,ae);return()=>{for(const Ce of xe)window.removeEventListener(Ce,Z);for(const Ce of ke)window.removeEventListener(Ce,ae)}},[u,p]);const H=u&&p&&!i&&typeof l=="function",$=!B,I=Math.max(0,(e==null?void 0:e.pathSnap)??0),P=s.useRef(e??{}),M=s.useRef(""),g=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");g!==M.current&&(M.current=g,P.current=e??{});const[D,A]=s.useState(null),[X,ie]=s.useState(!1),[L,_]=s.useState(!1),V=s.useCallback(()=>_(!1),[]),se=s.useMemo(()=>!D||D.serialized===m?m:D.serialized,[D,m]);s.useEffect(()=>{H||(ie(!1),_(!1))},[H]);const re=s.useMemo(()=>{if(!H)return null;if(D&&(D.base===m||D.serialized===m))return D.contours;const Z=zo(m);return Z.length?Z:null},[H,D,m]),k=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===zr&&!!(re&&!uu(re,f)),le=s.useCallback((Z,ae,xe)=>{const ke=jo(Z);if(A(Ce=>({base:Ce&&(Ce.base===m||Ce.serialized===m)?Ce.base:m,serialized:ke,contours:Z})),ae){const Ce=P.current,q=xe!=null&&xe.preserveShape?Ce.shape:"custom",ye={...Ce,shape:q,customPath:ke};P.current=ye,l==null||l(ye)}},[m,l]),G=s.useMemo(()=>H?{contours:k?re:null,snap:I,needsConversion:!k,onConvert:Z=>{const ae=jo(Z);A({base:ae,serialized:ae,contours:Z});const xe={...P.current,pathFit:"viewbox",pathViewBox:zr,customPath:ae};P.current=xe,l==null||l(xe)},onChange:(Z,ae)=>{ie(!0),_(!!(ae!=null&&ae.carryImage)),le(Z,!1)},onCommit:(Z,ae)=>{le(Z,!0,ae),ie(!1)}}:null,[H,k,re,I,l,le]),b=x==="avoid"&&!!(e!=null&&e.image),E=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[j,me]=s.useState(null),K=j??E,te=s.useCallback(Z=>me(Z),[]),O=s.useCallback(Z=>{me(Z);const ae={...P.current,imageFocalX:Z.focalX,imageFocalY:Z.focalY,imageScale:Z.scale};P.current=ae,l==null||l(ae)},[l]);s.useEffect(()=>{j&&Math.abs(j.focalX-E.focalX)<1e-9&&Math.abs(j.focalY-E.focalY)<1e-9&&Math.abs(j.scale-E.scale)<1e-9&&me(null)},[j,E]);const J=s.useMemo(()=>!H||!b?null:{onChange:te,onCommit:O},[H,b,te,O]),[ne,Pe]=s.useState(void 0),be=s.useRef(void 0),Re=s.useCallback(Z=>{const ae=be.current;ae!==void 0&&Math.abs(ae-Z)<.005||(be.current=Z,Pe(Z))},[]),ue=s.useMemo(()=>S&&typeof ne=="number"?ne:1,[ne,S]),fe=Z=>`calc(${Z} * var(--${d}-fit, 1))`,$e=s.useMemo(()=>{var Z,ae,xe,ke,Ce;return{fontFamily:co(e==null?void 0:e.textFontFamily),fontWeight:(Z=e==null?void 0:e.textFontSettings)==null?void 0:Z.fontWeight,fontStyle:(ae=e==null?void 0:e.textFontSettings)==null?void 0:ae.fontStyle,fontSize:fe(W.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:fe(W.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:fe(W.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:fe(W.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(xe=e==null?void 0:e.textTextAppearance)==null?void 0:xe.textTransform,textDecoration:(ke=e==null?void 0:e.textTextAppearance)==null?void 0:ke.textDecoration,fontVariant:(Ce=e==null?void 0:e.textTextAppearance)==null?void 0:Ce.fontVariant}},[e,u,d]),Q={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...Q},children:a.jsx(cS,{P:d,item:v,shape:w,customPath:m,pathFit:h,viewBox:f,mode:x,align:C,allowOverflow:y,fitEnabled:S,scale:ue,onFitScale:Re,dropCapLines:z,dropCapSize:N,showGuides:(Y||H)&&$,typography:$e,imageUrl:x==="avoid"?e==null?void 0:e.image:null,imageFocalX:K.focalX,imageFocalY:K.focalY,imageScale:K.scale,imageCustomPath:se,pathDragActive:X,pathCarryImage:L,onCarryImageConsumed:V,pathEditor:$?G:null,imageEditor:$?J:null})})]})}const uS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23813
23813
|
import type React from 'react';
|
|
23814
23814
|
import { createPortal } from 'react-dom';
|
|
23815
23815
|
import { CommonComponentProps } from '../props';
|
|
@@ -27290,8 +27290,6 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
27290
27290
|
const dropCapSize = settings?.dropCapSize ?? DROP_CAP_SIZE_DEFAULT;
|
|
27291
27291
|
const showGuides = editor && selected && !isPreviewMode;
|
|
27292
27292
|
|
|
27293
|
-
// Host editor signals item drag/resize/nudge on window — hide the shape overlay
|
|
27294
|
-
// for the same stretch so it doesn't float over the moving selection chrome.
|
|
27295
27293
|
const [isItemTransforming, setIsItemTransforming] = useState(false);
|
|
27296
27294
|
useEffect(() => {
|
|
27297
27295
|
if (!editor || !selected) {
|
|
@@ -27324,10 +27322,22 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
27324
27322
|
&& typeof onUpdateSettings === 'function';
|
|
27325
27323
|
const shapeOverlayVisible = !isItemTransforming;
|
|
27326
27324
|
const pathSnap = Math.max(0, settings?.pathSnap ?? 0);
|
|
27327
|
-
|
|
27328
|
-
|
|
27329
|
-
|
|
27330
|
-
|
|
27325
|
+
const settingsRef = useRef(settings ?? {});
|
|
27326
|
+
const settingsPropsKeyRef = useRef('');
|
|
27327
|
+
const settingsPropsKey = [
|
|
27328
|
+
settings?.customPath,
|
|
27329
|
+
settings?.shape,
|
|
27330
|
+
settings?.pathFit,
|
|
27331
|
+
settings?.pathViewBox,
|
|
27332
|
+
settings?.imageScale,
|
|
27333
|
+
settings?.imageFocalX,
|
|
27334
|
+
settings?.imageFocalY,
|
|
27335
|
+
settings?.image,
|
|
27336
|
+
].join('\\0');
|
|
27337
|
+
if (settingsPropsKey !== settingsPropsKeyRef.current) {
|
|
27338
|
+
settingsPropsKeyRef.current = settingsPropsKey;
|
|
27339
|
+
settingsRef.current = settings ?? {};
|
|
27340
|
+
}
|
|
27331
27341
|
const [draft, setDraft] = useState<{ base: string; serialized: string; contours: VecContour[] } | null>(null);
|
|
27332
27342
|
const [pathDragActive, setPathDragActive] = useState(false);
|
|
27333
27343
|
// Latched by the drag that set it and deliberately *not* cleared on commit —
|
|
@@ -27369,12 +27379,14 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
27369
27379
|
contours: next,
|
|
27370
27380
|
}));
|
|
27371
27381
|
if (commit) {
|
|
27372
|
-
|
|
27373
|
-
|
|
27374
|
-
const nextShape = options?.preserveShape ?
|
|
27375
|
-
|
|
27382
|
+
|
|
27383
|
+
const latest = settingsRef.current;
|
|
27384
|
+
const nextShape = options?.preserveShape ? latest.shape : 'custom';
|
|
27385
|
+
const nextSettings = { ...latest, shape: nextShape, customPath: serialized };
|
|
27386
|
+
settingsRef.current = nextSettings;
|
|
27387
|
+
onUpdateSettings?.(nextSettings);
|
|
27376
27388
|
}
|
|
27377
|
-
}, [customPath, onUpdateSettings
|
|
27389
|
+
}, [customPath, onUpdateSettings]);
|
|
27378
27390
|
|
|
27379
27391
|
const pathEditor = useMemo<PathEditorBinding | null>(() => {
|
|
27380
27392
|
if (!pathEditing) return null;
|
|
@@ -27385,12 +27397,14 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
27385
27397
|
onConvert: (next: VecContour[]) => {
|
|
27386
27398
|
const serialized = serializeContours(next);
|
|
27387
27399
|
setDraft({ base: serialized, serialized, contours: next });
|
|
27388
|
-
|
|
27389
|
-
...
|
|
27390
|
-
pathFit: 'viewbox',
|
|
27400
|
+
const nextSettings = {
|
|
27401
|
+
...settingsRef.current,
|
|
27402
|
+
pathFit: 'viewbox' as const,
|
|
27391
27403
|
pathViewBox: EDIT_VIEW_BOX,
|
|
27392
27404
|
customPath: serialized,
|
|
27393
|
-
}
|
|
27405
|
+
};
|
|
27406
|
+
settingsRef.current = nextSettings;
|
|
27407
|
+
onUpdateSettings?.(nextSettings);
|
|
27394
27408
|
},
|
|
27395
27409
|
onChange: (next: VecContour[], options?: PathChangeOptions) => {
|
|
27396
27410
|
setPathDragActive(true);
|
|
@@ -27402,7 +27416,7 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
27402
27416
|
setPathDragActive(false);
|
|
27403
27417
|
},
|
|
27404
27418
|
};
|
|
27405
|
-
}, [pathEditing, isEditablePath, editContours, pathSnap, onUpdateSettings,
|
|
27419
|
+
}, [pathEditing, isEditablePath, editContours, pathSnap, onUpdateSettings, writePath]);
|
|
27406
27420
|
|
|
27407
27421
|
/* -- shape-image pan/zoom ------------------------------------------------ */
|
|
27408
27422
|
|
|
@@ -27412,17 +27426,21 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
27412
27426
|
focalY: settings?.imageFocalY ?? 0.5,
|
|
27413
27427
|
scale: settings?.imageScale ?? 1,
|
|
27414
27428
|
}), [settings?.imageFocalX, settings?.imageFocalY, settings?.imageScale]);
|
|
27415
|
-
// Same draft split as the path: live values while dragging, committed once released.
|
|
27416
27429
|
const [imageDraft, setImageDraft] = useState<ImageTransform | null>(null);
|
|
27417
27430
|
const liveImageTransform = imageDraft ?? committedImageTransform;
|
|
27418
27431
|
|
|
27419
27432
|
const handleImageChange = useCallback((next: ImageTransform) => setImageDraft(next), []);
|
|
27420
27433
|
const handleImageCommit = useCallback((next: ImageTransform) => {
|
|
27421
|
-
// Keep the draft pinned to \`next\` so clearing it never reveals the stale
|
|
27422
|
-
// committed transform for a frame before onUpdateSettings lands.
|
|
27423
27434
|
setImageDraft(next);
|
|
27424
|
-
|
|
27425
|
-
|
|
27435
|
+
const nextSettings = {
|
|
27436
|
+
...settingsRef.current,
|
|
27437
|
+
imageFocalX: next.focalX,
|
|
27438
|
+
imageFocalY: next.focalY,
|
|
27439
|
+
imageScale: next.scale,
|
|
27440
|
+
};
|
|
27441
|
+
settingsRef.current = nextSettings;
|
|
27442
|
+
onUpdateSettings?.(nextSettings);
|
|
27443
|
+
}, [onUpdateSettings]);
|
|
27426
27444
|
|
|
27427
27445
|
useEffect(() => {
|
|
27428
27446
|
if (!imageDraft) return;
|