@cntrl-site/components 1.0.66-alpha.6 → 1.0.66-alpha.8
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 +54 -50
- package/dist/index.mjs +6211 -6209
- 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"),O=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function Tu(e){return e.type==="object"&&e.version===1}const Iu="ControlSlider-module__wrapper___sHEkd",Ru="ControlSlider-module__hoverArrow___A-dOH",Lu="ControlSlider-module__sliderItem___QQSkR",Pu="ControlSlider-module__sliderImage___9hRl-",Eu="ControlSlider-module__arrow___05ghY",Mu="ControlSlider-module__arrowVertical___tBfVN",ku="ControlSlider-module__nextArrow___-30Yc",Au="ControlSlider-module__arrowInner___aEra3",Fu="ControlSlider-module__arrowIcon___S4ztF",_u="ControlSlider-module__arrowImg___2dwJW",Nu="ControlSlider-module__mirror___brd6U",Wu="ControlSlider-module__pagination___bicLF",Hu="ControlSlider-module__paginationInner___bT-P-",Du="ControlSlider-module__paginationVertical___zYqKw",Ou="ControlSlider-module__paginationItem___nTRbk",Bu="ControlSlider-module__dot___p1Qun",zu="ControlSlider-module__activeDot___LHFaj",ju="ControlSlider-module__paginationInsideBottom___R3FWn",Vu="ControlSlider-module__paginationInsideTop___V-qb-",Gu="ControlSlider-module__paginationOutsideBottom___14w8D",Xu="ControlSlider-module__paginationOutsideTop___SCLqB",Yu="ControlSlider-module__paginationInsideLeft___yOBRZ",qu="ControlSlider-module__paginationInsideRight___Rtt3o",Uu="ControlSlider-module__paginationOutsideLeft___lahaw",Ku="ControlSlider-module__paginationOutsideRight___EtuQa",Zu="ControlSlider-module__imgWrapper___UjEgB",Ju="ControlSlider-module__captionBlock___dJ6-j",Qu="ControlSlider-module__captionTextWrapper___HFlpf",ep="ControlSlider-module__captionText___uGBVc",tp="ControlSlider-module__active___WZK4G",np="ControlSlider-module__withPointerEvents___t-18M",ip="ControlSlider-module__topLeftAlignment___zjnGM",op="ControlSlider-module__topCenterAlignment___gD1xW",rp="ControlSlider-module__topRightAlignment___NMapS",ap="ControlSlider-module__middleLeftAlignment___OnUrY",sp="ControlSlider-module__middleCenterAlignment___Tdkl0",lp="ControlSlider-module__middleRightAlignment___wEbfX",cp="ControlSlider-module__bottomLeftAlignment___cTP2-",dp="ControlSlider-module__bottomCenterAlignment___c54fB",up="ControlSlider-module__bottomRightAlignment___kEwrz",pp="ControlSlider-module__clickOverlay___DZA28",mp="ControlSlider-module__contain___pLyq7",gp="ControlSlider-module__cover___KdDat",ut={wrapper:Iu,hoverArrow:Ru,sliderItem:Lu,sliderImage:Pu,arrow:Eu,arrowVertical:Mu,nextArrow:ku,arrowInner:Au,arrowIcon:Fu,arrowImg:_u,mirror:Nu,pagination:Wu,paginationInner:Hu,paginationVertical:Du,paginationItem:Ou,dot:Bu,activeDot:zu,paginationInsideBottom:ju,paginationInsideTop:Vu,paginationOutsideBottom:Gu,paginationOutsideTop:Xu,paginationInsideLeft:Yu,paginationInsideRight:qu,paginationOutsideLeft:Uu,paginationOutsideRight:Ku,imgWrapper:Zu,captionBlock:Ju,captionTextWrapper:Qu,captionText:ep,active:tp,withPointerEvents:np,topLeftAlignment:ip,topCenterAlignment:op,topRightAlignment:rp,middleLeftAlignment:ap,middleCenterAlignment:sp,middleRightAlignment:lp,bottomLeftAlignment:cp,bottomCenterAlignment:dp,bottomRightAlignment:up,clickOverlay:pp,contain:mp,cover:gp};function hp(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 fp(e,t,n){return t&&hp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ol="(prefers-reduced-motion: reduce)",Bi=1,yp=2,Ui=3,lo=4,Xo=5,Ir=6,_r=7,xp={CREATED:Bi,MOUNTED:yp,IDLE:Ui,MOVING:lo,SCROLLING:Xo,DRAGGING:Ir,DESTROYED:_r};function On(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Xt(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var jc=setTimeout,Ka=function(){};function rl(e){return requestAnimationFrame(e)}function Kr(e,t){return typeof t===e}function Mo(e){return!Cs(e)&&Kr("object",e)}var Ss=Array.isArray,Vc=Xt(Kr,"function"),ni=Xt(Kr,"string"),Yo=Xt(Kr,"undefined");function Cs(e){return e===null}function Gc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function qo(e){return Ss(e)?e:[e]}function vn(e,t){qo(e).forEach(t)}function $s(e,t){return e.indexOf(t)>-1}function Rr(e,t){return e.push.apply(e,qo(t)),e}function _n(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function En(e,t){_n(e,ni(t)?t.split(" "):t,!0)}function Uo(e,t){vn(t,e.appendChild.bind(e))}function Ts(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ko(e,t){return Gc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Xc(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return ko(i,t)}):n}function Ko(e,t){return t?Xc(e,t)[0]:e.firstElementChild}var Ao=Object.keys;function Ci(e,t,n){return e&&(n?Ao(e).reverse():Ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Fo(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){Ss(n)?e[i]=n.slice():Mo(n)?e[i]=qn({},Mo(e[i])?e[i]:{},n):e[i]=n})}),e}function al(e,t){vn(t||Ao(e),function(n){delete e[n]})}function Mn(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Mo(t)?Ci(t,function(i,o){$t(e,o,i)}):vn(e,function(i){Cs(n)||n===""?Mn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ni(t)?En(i,t):$t(i,t)),n&&Uo(n,i),i}function wn(e,t,n){if(Yo(n))return getComputedStyle(e)[t];Cs(n)||(e.style[t]=""+n)}function _o(e,t){wn(e,"display",t)}function Yc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function sl(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function Ti(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function qc(e){return Ko(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Uc(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Nn(e,t){_n(e,t,!1)}function Za(e){return e.timeStamp}function pi(e){return ni(e)?e:e?e+"px":""}var Zo="splide",Rs="data-"+Zo;function Ro(e,t){if(!e)throw new Error("["+Zo+"] "+(t||""))}var ii=Math.min,Nr=Math.max,Wr=Math.floor,No=Math.ceil,dn=Math.abs;function Kc(e,t,n){return dn(e-t)<n}function Lr(e,t,n,i){var o=ii(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Wi(e,t,n){var i=ii(t,n),o=Nr(t,n);return ii(Nr(i,e),o)}function Ja(e){return+(e>0)-+(e<0)}function Qa(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ls(e){return e<10?"0"+e:""+e}var ll={};function vp(e){return""+e+Ls(ll[e]=(ll[e]||0)+1)}function Zc(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,w){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===x&&(!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){vn(l,function(u){u&&vn(d,function(p){p.split(" ").forEach(function(x){var w=x.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 si="mounted",es="ready",Bn="move",co="moved",Ps="click",Jc="active",Qc="inactive",ed="visible",td="hidden",en="refresh",ln="updated",Ki="resize",Zr="resized",nd="drag",id="dragging",od="dragged",Jr="scroll",Li="scrolled",bp="overflow",Es="destroy",rd="arrows:mounted",ad="arrows:updated",sd="pagination:mounted",ld="pagination:updated",Ms="navigation:mounted",ks="autoplay:play",cd="autoplay:playing",As="autoplay:pause",Fs="lazyload:loaded",dd="sk",ud="sh",Hr="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Zc();function i(r,l){n.bind(t,qo(r).join(" "),function(d){l.apply(l,Ss(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(Es,n.destroy),Fo(n,{bus:t,on:i,off:Xt(n.unbind,t),emit:o})}function Qr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ii((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return w();d=rl(p)}}function x(C){C||h(),r=o()-(C?l*e:0),c=!1,d=rl(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 v(){return c}return{start:x,rewind:m,pause:w,cancel:h,set:f,isPaused:v}}function wp(e){var t=e;function n(o){t=o}function i(o){return $s(qo(o),t)}return{set:n,is:i}}function Sp(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Cp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Zc(),d=[];function c(){var h=n.mediaQuery==="min";Ao(o).sort(function(f,v){return h?+f-+v:+v-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,ol),x()}function u(h){h&&l.destroy()}function p(h,f){var v=matchMedia(f);l.bind(v,"change",x),d.push([h,v])}function x(){var h=i.is(_r),f=n.direction,v=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});al(n),m(v),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function w(h){matchMedia(ol).matches&&(h?qn(n,r):al(n,Ao(r)))}function m(h,f,v){qn(n,h),f&&qn(Object.getPrototypeOf(n),h),(v||!i.is(Bi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:w,set:m}}var ea="Arrow",ta=ea+"Left",na=ea+"Right",pd=ea+"Up",md=ea+"Down",cl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[pd,na],ArrowRight:[md,ta]};function $p(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===cl&&!l?1:d===ia?0:-1;return fa[r]&&fa[r][c]||r.replace(/width|left|right/i,function(u,p){var x=fa[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===cl?1:-1)}return{resolve:i,orient:o}}var Wn="role",Xi="tabindex",Tp="disabled",Cn="aria-",Jo=Cn+"controls",gd=Cn+"current",dl=Cn+"selected",yn=Cn+"label",_s=Cn+"labelledby",hd=Cn+"hidden",Ns=Cn+"orientation",Wo=Cn+"roledescription",ul=Cn+"live",pl=Cn+"busy",ml=Cn+"atomic",Ws=[Wn,Xi,Tp,Jo,gd,yn,_s,hd,Ns,Wo],kn=Zo+"__",li="is-",ya=Zo,gl=kn+"track",Ip=kn+"list",oa=kn+"slide",fd=oa+"--clone",Rp=oa+"__container",Hs=kn+"arrows",ra=kn+"arrow",yd=ra+"--prev",xd=ra+"--next",aa=kn+"pagination",vd=aa+"__page",Lp=kn+"progress",Pp=Lp+"__bar",Ep=kn+"toggle",Mp=kn+"spinner",kp=kn+"sr",Ap=li+"initialized",Ii=li+"active",bd=li+"prev",wd=li+"next",ts=li+"visible",ns=li+"loading",Sd=li+"focus-in",Cd=li+"overflow",Fp=[Ii,ts,bd,wd,ns,Sd,Cd],_p={slide:oa,clone:fd,arrows:Hs,arrow:ra,prev:yd,next:xd,pagination:aa,page:vd,spinner:Mp};function Np(e,t){if(Vc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ko(n,t);)n=n.parentElement;return n}var Wp=5,hl=200,$d="touchstart mousedown",xa="touchmove mousemove",va="touchend touchcancel mouseup click";function Hp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],w,m,h;function f(){S(),G(),y()}function v(){o(en,C),o(en,f),o(ln,y),r(document,$d+" keydown",function(H){h=H.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,Sd,!!h)})}function C(H){var I=Ws.concat("style");On(u),Nn(l,p),Nn(w,x),Mn([w,m],I),Mn(l,H?I:["style",Wo])}function y(){Nn(l,p),Nn(w,x),p=U(ya),x=U(gl),En(l,p),En(w,x),$t(l,yn,n.label),$t(l,_s,n.labelledby)}function S(){w=W("."+gl),m=Ko(w,"."+Ip),Ro(w&&m,"A track/list element is missing."),Rr(u,Xc(m,"."+oa+":not(."+fd+")")),Ci({arrows:Hs,pagination:aa,prev:yd,next:xd,bar:Pp,toggle:Ep},function(H,I){c[I]=W("."+H)}),Fo(c,{root:l,track:w,list:m,slides:u})}function G(){var H=l.id||vp(Zo),I=n.role;l.id=H,w.id=w.id||H+"-track",m.id=m.id||H+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&I&&$t(l,Wn,I),$t(l,Wo,d.carousel),$t(m,Wn,"presentation")}function W(H){var I=Uc(l,H);return I&&Np(I,"."+ya)===l?I:void 0}function U(H){return[H+"--"+n.type,H+"--"+n.direction,n.drag&&H+"--draggable",n.isNavigation&&H+"--nav",H===ya&&Ii]}return Fo(c,{setup:f,mount:v,destroy:C})}var Zi="slide",uo="loop",Qo="fade";function Dp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,w=p.updateOnMove,m=p.i18n,h=p.pagination,f=p.slideFocus,v=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),S=n>-1,G=Ko(i,"."+Rp),W;function U(){S||(i.id=u.id+"-slide"+Ls(t+1),$t(i,Wn,h?"tabpanel":"group"),$t(i,Wo,m.slide),$t(i,yn,y||Qa(m.slideLabel,[t+1,e.length]))),H()}function H(){d(i,"click",Xt(l,Ps,ie)),d(i,"keydown",Xt(l,dd,ie)),r([co,ud,Li],T),r(Ms,z),w&&r(Bn,$)}function I(){W=!0,o.destroy(),Nn(i,Fp),Mn(i,Ws),$t(i,"style",C),$t(i,yn,y||"")}function z(){var L=e.splides.map(function(B){var K=B.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");$t(i,yn,Qa(m.slideX,(S?n:t)+1)),$t(i,Jo,L),$t(i,Wn,f?"button":""),f&&Mn(i,Wo)}function $(){W||T()}function T(){if(!W){var L=e.index;k(),_(),_n(i,bd,t===L-1),_n(i,wd,t===L+1)}}function k(){var L=D();L!==sl(i,Ii)&&(_n(i,Ii,L),$t(i,gd,x&&L||""),l(L?Jc:Qc,ie))}function _(){var L=P(),B=!L&&(!D()||S);if(e.state.is([lo,Xo])||$t(i,hd,B||""),$t(Is(i,p.focusableNodes||""),Xi,B?-1:""),f&&$t(i,Xi,B?-1:0),L!==sl(i,ts)&&(_n(i,ts,L),l(L?ed:td,ie)),!L&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Yc(K.slide)}}function g(L,B,K){wn(K&&G||i,L,B)}function D(){var L=e.index;return L===t||p.cloneStatus&&L===n}function P(){if(e.is(Qo))return D();var L=hn(c.Elements.track),B=hn(i),K=v("left",!0),ue=v("right",!0);return Wr(L[K])<=No(B[K])&&Wr(B[ue])<=No(L[ue])}function q(L,B){var K=dn(L-t);return!S&&(p.rewind||e.is(uo))&&(K=ii(K,e.length-K)),K<=B}var ie={index:t,slideIndex:n,slide:i,container:G,isClone:S,mount:U,destroy:I,update:T,style:g,isWithin:q};return ie}function Op(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){w(),o(en,m),o(en,w)}function w(){c.forEach(function(T,k){f(T,k,-1)})}function m(){W(function(T){T.destroy()}),On(p)}function h(){W(function(T){T.update()})}function f(T,k,_){var g=Dp(e,k,_,T);g.mount(),p.push(g),p.sort(function(D,P){return D.index-P.index})}function v(T){return T?U(function(k){return!k.isClone}):p}function C(T){var k=t.Controller,_=k.toIndex(T),g=k.hasFocus()?1:n.perPage;return U(function(D){return Lr(D.index,_,_+g-1)})}function y(T){return U(T)[0]}function S(T,k){vn(T,function(_){if(ni(_)&&(_=qc(_)),Gc(_)){var g=c[k];g?Ts(_,g):Uo(u,_),En(_,n.classes.slide),I(_,Xt(r,Ki))}}),r(en)}function G(T){Ti(U(T).map(function(k){return k.slide})),r(en)}function W(T,k){v(k).forEach(T)}function U(T){return p.filter(Vc(T)?T:function(k){return ni(T)?ko(k.slide,T):$s(qo(T),k.index)})}function H(T,k,_){W(function(g){g.style(T,k,_)})}function I(T,k){var _=Is(T,"img"),g=_.length;g?_.forEach(function(D){l(D,"load error",function(){--g||k()})}):k()}function z(T){return T?c.length:p.length}function $(){return p.length>n.perPage}return{mount:x,destroy:m,update:h,register:f,get:v,getIn:C,getAt:y,add:S,remove:G,forEach:W,filter:U,style:H,getLength:z,isEnough:$}}function Bp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,w=u.list,m=d.getAt,h=d.style,f,v,C;function y(){S(),r(window,"resize load",Sp(Xt(l,Ki))),o([ln,en],S),o(Ki,G)}function S(){f=n.direction===ia,wn(p,"maxWidth",pi(n.width)),wn(x,c("paddingLeft"),W(!1)),wn(x,c("paddingRight"),W(!0)),G(!0)}function G(ie){var L=hn(p);(ie||v.width!==L.width||v.height!==L.height)&&(wn(x,"height",U()),h(c("marginRight"),pi(n.gap)),h("width",I()),h("height",z(),!0),v=L,l(Zr),C!==(C=q())&&(_n(p,Cd,C),l(bp,C)))}function W(ie){var L=n.padding,B=c(ie?"right":"left");return L&&pi(L[B]||(Mo(L)?0:L))||"0px"}function U(){var ie="";return f&&(ie=H(),Ro(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+W(!1)+" - "+W(!0)+")"),ie}function H(){return pi(n.height||hn(w).width*n.heightRatio)}function I(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function z(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():H())}function $(){var ie=pi(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function T(){return hn(w)[c("width")]}function k(ie,L){var B=m(ie||0);return B?hn(B.slide)[c("width")]+(L?0:D()):0}function _(ie,L){var B=m(ie);if(B){var K=hn(B.slide)[c("right")],ue=hn(w)[c("left")];return dn(K-ue)+(L?0:D())}return 0}function g(ie){return _(e.length-1)-_(0)+k(0,ie)}function D(){var ie=m(0);return ie&&parseFloat(wn(ie.slide,c("marginRight")))||0}function P(ie){return parseFloat(wn(x,c("padding"+(ie?"Right":"Left"))))||0}function q(){return e.is(Qo)||g(!0)>T()}return{mount:y,resize:G,listSize:T,slideSize:k,sliderSize:g,totalSize:_,getPadding:P,isOverflow:q}}var zp=2;function jp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,x),o([ln,Ki],m),(u=v())&&(h(u),t.Layout.resize(!0))}function x(){w(),p()}function w(){Ti(c),On(c),i.destroy()}function m(){var C=v();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;)Rr(y,y);Rr(y.slice(-C),y.slice(0,C)).forEach(function(G,W){var U=W<C,H=f(G.slide,W);U?Ts(H,y[0].slide):Uo(r.list,H),Rr(c,H),l.register(H,W-C+(U?0:S),G.index)})}}function f(C,y){var S=C.cloneNode(!0);return En(S,n.classes.clone),S.id=e.root.id+"-clone"+Ls(y+1),S}function v(){var C=n.clones;if(!e.is(uo))C=0;else if(Yo(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=y&&No(hn(r.track)[d("width")]/y);C=S||n[d("autoWidth")]&&e.length||n.perPage*zp}return C}return{mount:p,destroy:w}}function Vp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,w=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,v=t.Elements,C=v.list,y=v.track,S;function G(){S=t.Transition,o([si,Zr,ln,en],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),H(e.index),t.Slides.update())}function U(B,K,ue,le){B!==K&&ie(B>ue)&&(T(),I($(g(),B>ue),!0)),l(lo),r(Bn,K,ue,B),S.start(K,function(){l(Ui),r(co,K,ue,B),le&&le()})}function H(B){I(_(B,!0))}function I(B,K){if(!e.is(Qo)){var ue=K?B:z(B);wn(C,"transform","translate"+h("X")+"("+ue+"px)"),B!==ue&&r(ud)}}function z(B){if(e.is(uo)){var K=k(B),ue=K>t.Controller.getEnd(),le=K<0;(le||ue)&&(B=$(B,ue))}return B}function $(B,K){var ue=B-q(K),le=w();return B-=f(le*(No(dn(ue)/le)||1))*(K?1:-1),B}function T(){I(g(),!0),S.cancel()}function k(B){for(var K=t.Slides.get(),ue=0,le=1/0,F=0;F<K.length;F++){var pe=K[F].index,j=dn(_(pe,!0)-B);if(j<=le)le=j,ue=pe;else break}return ue}function _(B,K){var ue=f(p(B-1)-P(B));return K?D(ue):ue}function g(){var B=h("left");return hn(C)[B]-hn(y)[B]+f(u(!1))}function D(B){return n.trimSpace&&e.is(Zi)&&(B=Wi(B,0,f(w(!0)-x()))),B}function P(B){var K=n.focus;return K==="center"?(x()-c(B,!0))/2:+K*c(B)||0}function q(B){return _(B?t.Controller.getEnd():0,!!n.trimSpace)}function ie(B){var K=f($(g(),B));return B?K>=0:K<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(B,K){K=Yo(K)?g():K;var ue=B!==!0&&f(K)<f(q(!1)),le=B!==!1&&f(K)>f(q(!0));return ue||le}return{mount:G,move:U,jump:H,translate:I,shift:$,cancel:T,toIndex:k,toPosition:_,getPosition:g,getLimit:q,exceededLimit:L,reposition:W}}function Gp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,w=p.getLength,m=n.omitEnd,h=e.is(uo),f=e.is(Zi),v=Xt(g,!1),C=Xt(g,!0),y=n.start||0,S,G=y,W,U,H;function I(){z(),o([ln,en,Hr],z),o(Zr,$)}function z(){W=w(!0),U=n.perMove,H=n.perPage,S=ie();var j=Wi(y,0,m?S:W-1);j!==y&&(y=j,l.reposition())}function $(){S!==ie()&&r(Hr)}function T(j,se,ne){if(!pe()){var ve=_(j),ke=q(ve);ke>-1&&(se||ke!==y)&&(ue(ke),l.move(ve,ke,G,ne))}}function k(j,se,ne,ve){t.Scroll.scroll(j,se,ne,function(){var ke=q(l.toIndex(d()));ue(m?ii(ke,S):ke),ve&&ve()})}function _(j){var se=y;if(ni(j)){var ne=j.match(/([+\-<>])(\d+)?/)||[],ve=ne[1],ke=ne[2];ve==="+"||ve==="-"?se=D(y+ +(""+ve+(+ke||1)),y):ve===">"?se=ke?L(+ke):v(!0):ve==="<"&&(se=C(!0))}else se=h?j:Wi(j,0,S);return se}function g(j,se){var ne=U||(F()?1:H),ve=D(y+ne*(j?-1:1),y,!(U||F()));return ve===-1&&f&&!Kc(d(),c(!j),1)?j?0:S:se?ve:q(ve)}function D(j,se,ne){if(x()||F()){var ve=P(j);ve!==j&&(se=j,j=ve,ne=!1),j<0||j>S?!U&&(Lr(0,j,se,!0)||Lr(S,se,j,!0))?j=L(B(j)):h?j=ne?j<0?-(W%H||H):W:j:n.rewind?j=j<0?S:0:j=-1:ne&&j!==se&&(j=L(B(se)+(j<se?-1:1)))}else j=-1;return j}function P(j){if(f&&n.trimSpace==="move"&&j!==y)for(var se=d();se===u(j,!0)&&Lr(j,0,e.length-1,!n.rewind);)j<y?--j:++j;return j}function q(j){return h?(j+W)%W||0:j}function ie(){for(var j=W-(F()||h&&U?1:H);m&&j-- >0;)if(u(W-1,!0)!==u(j,!0)){j++;break}return Wi(j,0,W-1)}function L(j){return Wi(F()?j:H*j,0,S)}function B(j){return F()?ii(j,S):Wr((j>=S?W-1:j)/H)}function K(j){var se=l.toIndex(j);return f?Wi(se,0,S):se}function ue(j){j!==y&&(G=y,y=j)}function le(j){return j?G:y}function F(){return!Yo(n.focus)||n.isNavigation}function pe(){return e.state.is([lo,Xo])&&!!n.waitForTransition}return{mount:I,go:T,scroll:k,getNext:v,getPrev:C,getAdjacent:g,getEnd:ie,setIndex:ue,getIndex:le,toIndex:L,toPage:B,toDest:K,hasFocus:F,isBusy:pe}}var Xp="http://www.w3.org/2000/svg",Yp="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",sr=40;function qp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,w=u.track,m=x,h=u.prev,f=u.next,v,C,y={};function S(){W(),o(ln,G)}function G(){U(),S()}function W(){var k=n.arrows;k&&!(h&&f)&&z(),h&&f&&(Fo(y,{prev:h,next:f}),_o(m,k?"":"none"),En(m,C=Hs+"--"+n.direction),k&&(H(),T(),$t([h,f],Jo,w.id),l(rd,h,f)))}function U(){i.destroy(),Nn(m,C),v?(Ti(x?[h,f]:m),h=f=null):Mn([h,f],Ws)}function H(){o([si,co,en,Li,Hr],T),r(f,"click",Xt(I,">")),r(h,"click",Xt(I,"<"))}function I(k){p.go(k,!0)}function z(){m=x||Gi("div",d.arrows),h=$(!0),f=$(!1),v=!0,Uo(m,[h,f]),!x&&Ts(m,w)}function $(k){var _='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Xp+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||Yp)+'" />';return qc(_)}function T(){if(h&&f){var k=e.index,_=p.getPrev(),g=p.getNext(),D=_>-1&&k<_?c.last:c.prev,P=g>-1&&k>g?c.first:c.next;h.disabled=_<0,f.disabled=g<0,$t(h,yn,D),$t(f,yn,P),l(ad,h,f,_,g)}}return{arrows:y,mount:S,destroy:U,update:T}}var Up=Rs+"-interval";function Kp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),H),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,w=p.toggle,m=n.autoplay,h,f,v=m==="pause";function C(){m&&(y(),w&&$t(w,Jo,u.track.id),v||S(),U())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(z){h=z.type==="mouseenter",W()}),n.pauseOnFocus&&r(x,"focusin focusout",function(z){f=z.type==="focusin",W()}),w&&r(w,"click",function(){v?S():G(!0)}),o([Bn,Jr,en],d.rewind),o(Bn,I)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=v=!1,U(),l(ks))}function G(z){z===void 0&&(z=!0),v=!!z,U(),c()||(d.pause(),l(As))}function W(){v||(h||f?G(!1):S())}function U(){w&&(_n(w,Ii,!v),$t(w,yn,n.i18n[v?"play":"pause"]))}function H(z){var $=u.bar;$&&wn($,"width",z*100+"%"),l(cd,z)}function I(z){var $=t.Slides.getAt(z);d.set($&&+Sn($.slide,Up)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:G,isPaused:c}}function Zp(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Fs,Xt(d,!0)),o([si,ln,en],Xt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Ko(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),_o(u,c?"none":"")}return{mount:r,destroy:Xt(l,!1)}}var Jp=10,Qp=600,em=.6,tm=1.5,nm=800;function im(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,w=e.is(Zi),m,h,f=1;function v(){o(Bn,G),o([ln,en],W)}function C(H,I,z,$,T){var k=c();if(G(),z&&(!w||!p())){var _=t.Layout.sliderSize(),g=Ja(H)*_*Wr(dn(H)/_)||0;H=d.toPosition(t.Controller.toDest(H%_))+g}var D=Kc(k,H,1);f=1,I=D?0:I||Nr(dn(H-k)/tm,nm),h=$,m=Qr(I,y,Xt(S,k,H,T),1),l(Xo),r(Jr),m.start()}function y(){l(Ui),h&&h(),r(Li)}function S(H,I,z,$){var T=c(),k=H+(I-H)*U($),_=(k-T)*f;x(T+_),w&&!z&&p()&&(f*=em,dn(_)<Jp&&C(u(p(!0)),Qp,!1,h,!0))}function G(){m&&m.cancel()}function W(){m&&!m.isPaused()&&(G(),y())}function U(H){var I=n.easingFunc;return I?I(H):1-Math.pow(1-H,4)}return{mount:v,destroy:G,scroll:C,cancel:W}}var Hi={passive:!1,capture:!0};function om(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,w=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,v=h.orient,C=u.getPosition,y=u.exceededLimit,S,G,W,U,H,I=!1,z,$,T;function k(){l(w,xa,Ka,Hi),l(w,va,Ka,Hi),l(w,$d,g,Hi),l(w,"click",q,{capture:!0}),l(w,"dragstart",Fn),o([si,ln],_)}function _(){var M=n.drag;b(!M),U=M==="free"}function g(M){if(z=!1,!$){var E=ke(M);ve(M.target)&&(E||!M.button)&&(x.isBusy()?Fn(M,!0):(T=E?w:window,H=c.is([lo,Xo]),W=null,l(T,xa,D,Hi),l(T,va,P,Hi),u.cancel(),p.cancel(),ie(M)))}}function D(M){if(c.is(Ir)||(c.set(Ir),r(nd)),M.cancelable)if(H){u.translate(S+ne(F(M)));var E=pe(M)>hl,V=I!==(I=y());(E||V)&&ie(M),z=!0,r(id),Fn(M)}else K(M)&&(H=B(M),Fn(M))}function P(M){c.is(Ir)&&(c.set(Ui),r(od)),H&&(L(M),Fn(M)),d(T,xa,D),d(T,va,P),H=!1}function q(M){!$&&z&&Fn(M,!0)}function ie(M){W=G,G=M,S=C()}function L(M){var E=ue(M),V=le(E),Ce=n.rewind&&n.rewindByDrag;m(!1),U?x.scroll(V,0,n.snap):e.is(Qo)?x.go(v(Ja(E))<0?Ce?"<":"-":Ce?">":"+"):e.is(Zi)&&I&&Ce?x.go(y(!0)?">":"<"):x.go(x.toDest(V),!0),m(!0)}function B(M){var E=n.dragMinThreshold,V=Mo(E),Ce=V&&E.mouse||0,te=(V?E.touch:+E)||10;return dn(F(M))>(ke(M)?te:Ce)}function K(M){return dn(F(M))>dn(F(M,!0))}function ue(M){if(e.is(uo)||!I){var E=pe(M);if(E&&E<hl)return F(M)/E}return 0}function le(M){return C()+Ja(M)*ii(dn(M)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(M,E){return se(M,E)-se(j(M),E)}function pe(M){return Za(M)-Za(j(M))}function j(M){return G===M&&W||G}function se(M,E){return(ke(M)?M.changedTouches[0]:M)["page"+f(E?"Y":"X")]}function ne(M){return M/(I&&e.is(Zi)?Wp:1)}function ve(M){var E=n.noDrag;return!ko(M,"."+vd+", ."+ra)&&(!E||!ko(M,E))}function ke(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function xe(){return H}function b(M){$=M}return{mount:k,disable:b,isDragging:xe}}var rm={Spacebar:" ",Right:na,Left:ta,Up:pd,Down:md};function Ds(e){return e=ni(e)?e:e.key,rm[e]||e}var fl="keydown";function am(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){w(),o(ln,m),o(ln,w),o(Bn,f)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,fl,v))}function m(){l(u,fl)}function h(C){p=C}function f(){var C=p;p=!0,jc(function(){p=C})}function v(C){if(!p){var y=Ds(C);y===c(ta)?e.go("<"):y===c(na)&&e.go(">")}}return{mount:x,destroy:m,disable:h}}var Lo=Rs+"-lazy",Pr=Lo+"-srcset",sm="["+Lo+"], ["+Pr+"]";function lm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[co,Li],p=[];function x(){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){Is(y.slide,sm).forEach(function(S){var G=Sn(S,Lo),W=Sn(S,Pr);if(G!==S.src||W!==S.srcset){var U=n.classes.spinner,H=S.parentElement,I=Ko(H,"."+U)||Gi("span",U,H);p.push([S,y,I]),S.src||_o(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,ns),l(S,"load error",Xt(v,y)),$t(S,"src",Sn(S,Lo)),$t(S,"srcset",Sn(S,Pr)),Mn(S,Lo),Mn(S,Pr)}function v(y,S){var G=y[0],W=y[1];Nn(W.slide,ns),S.type!=="error"&&(Ti(y[2]),_o(G,""),d(Fs,G,W),d(Ki)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:x,destroy:Xt(On,p),check:h}}function cm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,w=u.go,m=t.Direction.resolve,h=c.pagination,f=[],v,C;function y(){S(),o([ln,en,Hr],y);var $=n.pagination;h&&_o(h,$?"":"none"),$&&(o([Bn,Jr,Li],z),G(),z(),r(sd,{list:v,items:f},I(e.index)))}function S(){v&&(Ti(h?ai(v.children):v),Nn(v,C),On(f),v=null),i.destroy()}function G(){var $=e.length,T=n.classes,k=n.i18n,_=n.perPage,g=p()?u.getEnd()+1:No($/_);v=h||Gi("ul",T.pagination,c.track.parentElement),En(v,C=aa+"--"+H()),$t(v,Wn,"tablist"),$t(v,yn,k.select),$t(v,Ns,H()===ia?"vertical":"");for(var D=0;D<g;D++){var P=Gi("li",null,v),q=Gi("button",{class:T.page,type:"button"},P),ie=d.getIn(D).map(function(B){return B.slide.id}),L=!p()&&_>1?k.pageX:k.slideX;l(q,"click",Xt(W,D)),n.paginationKeyboard&&l(q,"keydown",Xt(U,D)),$t(P,Wn,"presentation"),$t(q,Wn,"tab"),$t(q,Jo,ie.join(" ")),$t(q,yn,Qa(L,D+1)),$t(q,Xi,-1),f.push({li:P,button:q,page:D})}}function W($){w(">"+$,!0)}function U($,T){var k=f.length,_=Ds(T),g=H(),D=-1;_===m(na,!1,g)?D=++$%k:_===m(ta,!1,g)?D=(--$+k)%k:_==="Home"?D=0:_==="End"&&(D=k-1);var P=f[D];P&&(Yc(P.button),w(">"+D),Fn(T,!0))}function H(){return n.paginationDirection||n.direction}function I($){return f[u.toPage($)]}function z(){var $=I(x(!0)),T=I(x());if($){var k=$.button;Nn(k,Ii),Mn(k,dl),$t(k,Xi,-1)}if(T){var _=T.button;En(_,Ii),$t(_,dl,!0),$t(_,Xi,"")}r(ld,{list:v,items:f},$,T)}return{items:f,mount:y,destroy:S,getAt:I,update:z}}var dm=[" ","Enter"];function um(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 v=Kt(h);v.on(Bn,function(C,y,S){f.go(f.is(uo)?S:C)}),r.push(v)}function p(){var h=Kt(e),f=h.on;f(Ps,w),f(dd,m),f([si,ln],x),r.push(h),h.emit(Ms,e.splides)}function x(){$t(t.Elements.list,Ns,n.direction===ia?"vertical":"")}function w(h){e.go(h.index)}function m(h,f){$s(dm,Ds(f))&&(w(h),Fn(f))}return{setup:Xt(t.Media.set,{slideFocus:Yo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function pm(e,t,n){var i=Kt(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,x=p<0,w=Za(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&w-r>h&&(e.go(x?"<":">"),r=w),c(x)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(lo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var mm=90;function gm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",kp),c=Qr(mm,Xt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,ml,!0),d.textContent="…",o(ks,Xt(w,!0)),o(As,Xt(w,!1)),o([co,Li],Xt(p,!0)))}function p(m){$t(r,pl,m),m?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function x(){Mn(r,[ul,ml,pl]),Ti(d)}function w(m){l&&$t(r,ul,m?"off":"polite")}return{mount:u,disable:w,destroy:x}}var hm=Object.freeze({__proto__:null,Media:Cp,Direction:$p,Elements:Hp,Slides:Op,Layout:Bp,Clones:jp,Move:Vp,Controller:Gp,Arrows:qp,Autoplay:Kp,Cover:Zp,Scroll:im,Drag:om,Keyboard:am,LazyLoad:lm,Pagination:cm,Sync:um,Wheel:pm,Live:gm}),fm={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"},ym={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:_p,i18n:fm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function xm(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,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),jc(c)}return{mount:o,start:l,cancel:Ka}}function vm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Xt(wn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,h){var f=i.toPosition(m,!0),v=i.getPosition(),C=w(m);dn(f-v)>=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 x(){d(""),r.cancel()}function w(m){var h=n.rewindSpeed;if(e.is(Zi)&&h){var f=o.getIndex(!0),v=o.getEnd();if(f===0&&m>=v||f>=v&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:x}}var bm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=wp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?Uc(document,n):n;Ro(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,_s)||""},ym,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,Rs)))}catch{Ro(!1,"Invalid JSON")}this._o=Object.create(qn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Ro(l.is([Bi,_r]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(Qo)?xm:vm),this._E=i||this._E;var c=Fo({},hm,this._E,{Transition:this._T});return Ci(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(si),En(this.root,Ap),l.set(Ui),this.emit(es),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ui)&&(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(ai(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)?Kt(this).on(es,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Es),o.destroy(),i&&On(this.splides),r.set(_r)),this},fp(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})(),Os=bm;Os.defaults={};Os.STATES=xp;var yl=[[si,"onMounted"],[es,"onReady"],[Bn,"onMove"],[co,"onMoved"],[Ps,"onClick"],[Jc,"onActive"],[Qc,"onInactive"],[ed,"onVisible"],[td,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Ki,"onResize"],[Zr,"onResized"],[nd,"onDrag"],[id,"onDragging"],[od,"onDragged"],[Jr,"onScroll"],[Li,"onScrolled"],[Es,"onDestroy"],[rd,"onArrowsMounted"],[ad,"onArrowsUpdated"],[sd,"onPaginationMounted"],[ld,"onPaginationUpdated"],[Ms,"onNavigationMounted"],[ks,"onAutoplayPlay"],[cd,"onAutoplayPlaying"],[As,"onAutoplayPause"],[Fs,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function is(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!is(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!is(e[o],t[o]))}return e===t}function wm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Sm(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 os(e,t){const n=e;return Sm(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=os(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Cm=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),zs=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 Os(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=os({},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&&!is(this.options,e)&&(this.splide.options=e,this.options=os({},e));const t=this.getSlides();wm(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){yl.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:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...yl.map(r=>r[1])])},n?s.createElement(Cm,null,i):i)}},js=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("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"),D=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function Iu(e){return e.type==="object"&&e.version===1}const Ru="ControlSlider-module__wrapper___sHEkd",Lu="ControlSlider-module__hoverArrow___A-dOH",Pu="ControlSlider-module__sliderItem___QQSkR",Eu="ControlSlider-module__sliderImage___9hRl-",Mu="ControlSlider-module__arrow___05ghY",ku="ControlSlider-module__arrowVertical___tBfVN",Au="ControlSlider-module__nextArrow___-30Yc",Fu="ControlSlider-module__arrowInner___aEra3",_u="ControlSlider-module__arrowIcon___S4ztF",Nu="ControlSlider-module__arrowImg___2dwJW",Wu="ControlSlider-module__mirror___brd6U",Hu="ControlSlider-module__pagination___bicLF",Du="ControlSlider-module__paginationInner___bT-P-",Ou="ControlSlider-module__paginationVertical___zYqKw",Bu="ControlSlider-module__paginationItem___nTRbk",zu="ControlSlider-module__dot___p1Qun",ju="ControlSlider-module__activeDot___LHFaj",Vu="ControlSlider-module__paginationInsideBottom___R3FWn",Gu="ControlSlider-module__paginationInsideTop___V-qb-",Xu="ControlSlider-module__paginationOutsideBottom___14w8D",Yu="ControlSlider-module__paginationOutsideTop___SCLqB",qu="ControlSlider-module__paginationInsideLeft___yOBRZ",Uu="ControlSlider-module__paginationInsideRight___Rtt3o",Ku="ControlSlider-module__paginationOutsideLeft___lahaw",Zu="ControlSlider-module__paginationOutsideRight___EtuQa",Ju="ControlSlider-module__imgWrapper___UjEgB",Qu="ControlSlider-module__captionBlock___dJ6-j",ep="ControlSlider-module__captionTextWrapper___HFlpf",tp="ControlSlider-module__captionText___uGBVc",np="ControlSlider-module__active___WZK4G",ip="ControlSlider-module__withPointerEvents___t-18M",op="ControlSlider-module__topLeftAlignment___zjnGM",rp="ControlSlider-module__topCenterAlignment___gD1xW",ap="ControlSlider-module__topRightAlignment___NMapS",sp="ControlSlider-module__middleLeftAlignment___OnUrY",lp="ControlSlider-module__middleCenterAlignment___Tdkl0",cp="ControlSlider-module__middleRightAlignment___wEbfX",dp="ControlSlider-module__bottomLeftAlignment___cTP2-",up="ControlSlider-module__bottomCenterAlignment___c54fB",pp="ControlSlider-module__bottomRightAlignment___kEwrz",mp="ControlSlider-module__clickOverlay___DZA28",gp="ControlSlider-module__contain___pLyq7",hp="ControlSlider-module__cover___KdDat",ut={wrapper:Ru,hoverArrow:Lu,sliderItem:Pu,sliderImage:Eu,arrow:Mu,arrowVertical:ku,nextArrow:Au,arrowInner:Fu,arrowIcon:_u,arrowImg:Nu,mirror:Wu,pagination:Hu,paginationInner:Du,paginationVertical:Ou,paginationItem:Bu,dot:zu,activeDot:ju,paginationInsideBottom:Vu,paginationInsideTop:Gu,paginationOutsideBottom:Xu,paginationOutsideTop:Yu,paginationInsideLeft:qu,paginationInsideRight:Uu,paginationOutsideLeft:Ku,paginationOutsideRight:Zu,imgWrapper:Ju,captionBlock:Qu,captionTextWrapper:ep,captionText:tp,active:np,withPointerEvents:ip,topLeftAlignment:op,topCenterAlignment:rp,topRightAlignment:ap,middleLeftAlignment:sp,middleCenterAlignment:lp,middleRightAlignment:cp,bottomLeftAlignment:dp,bottomCenterAlignment:up,bottomRightAlignment:pp,clickOverlay:mp,contain:gp,cover:hp};function fp(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 yp(e,t,n){return t&&fp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ol="(prefers-reduced-motion: reduce)",Bi=1,xp=2,Ui=3,lo=4,Xo=5,Ir=6,_r=7,vp={CREATED:Bi,MOUNTED:xp,IDLE:Ui,MOVING:lo,SCROLLING:Xo,DRAGGING:Ir,DESTROYED:_r};function On(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Yt(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var jc=setTimeout,Ka=function(){};function rl(e){return requestAnimationFrame(e)}function Kr(e,t){return typeof t===e}function Mo(e){return!Cs(e)&&Kr("object",e)}var Ss=Array.isArray,Vc=Yt(Kr,"function"),ni=Yt(Kr,"string"),Yo=Yt(Kr,"undefined");function Cs(e){return e===null}function Gc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function qo(e){return Ss(e)?e:[e]}function vn(e,t){qo(e).forEach(t)}function $s(e,t){return e.indexOf(t)>-1}function Rr(e,t){return e.push.apply(e,qo(t)),e}function _n(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function En(e,t){_n(e,ni(t)?t.split(" "):t,!0)}function Uo(e,t){vn(t,e.appendChild.bind(e))}function Ts(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ko(e,t){return Gc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Xc(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return ko(i,t)}):n}function Ko(e,t){return t?Xc(e,t)[0]:e.firstElementChild}var Ao=Object.keys;function Ci(e,t,n){return e&&(n?Ao(e).reverse():Ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Fo(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){Ss(n)?e[i]=n.slice():Mo(n)?e[i]=qn({},Mo(e[i])?e[i]:{},n):e[i]=n})}),e}function al(e,t){vn(t||Ao(e),function(n){delete e[n]})}function Mn(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Mo(t)?Ci(t,function(i,o){$t(e,o,i)}):vn(e,function(i){Cs(n)||n===""?Mn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ni(t)?En(i,t):$t(i,t)),n&&Uo(n,i),i}function wn(e,t,n){if(Yo(n))return getComputedStyle(e)[t];Cs(n)||(e.style[t]=""+n)}function _o(e,t){wn(e,"display",t)}function Yc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function sl(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function Ti(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function qc(e){return Ko(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Uc(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Nn(e,t){_n(e,t,!1)}function Za(e){return e.timeStamp}function pi(e){return ni(e)?e:e?e+"px":""}var Zo="splide",Rs="data-"+Zo;function Ro(e,t){if(!e)throw new Error("["+Zo+"] "+(t||""))}var ii=Math.min,Nr=Math.max,Wr=Math.floor,No=Math.ceil,dn=Math.abs;function Kc(e,t,n){return dn(e-t)<n}function Lr(e,t,n,i){var o=ii(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Wi(e,t,n){var i=ii(t,n),o=Nr(t,n);return ii(Nr(i,e),o)}function Ja(e){return+(e>0)-+(e<0)}function Qa(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ls(e){return e<10?"0"+e:""+e}var ll={};function bp(e){return""+e+Ls(ll[e]=(ll[e]||0)+1)}function Zc(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,w){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===x&&(!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){vn(l,function(u){u&&vn(d,function(p){p.split(" ").forEach(function(x){var w=x.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 si="mounted",es="ready",Bn="move",co="moved",Ps="click",Jc="active",Qc="inactive",ed="visible",td="hidden",en="refresh",ln="updated",Ki="resize",Zr="resized",nd="drag",id="dragging",od="dragged",Jr="scroll",Li="scrolled",wp="overflow",Es="destroy",rd="arrows:mounted",ad="arrows:updated",sd="pagination:mounted",ld="pagination:updated",Ms="navigation:mounted",ks="autoplay:play",cd="autoplay:playing",As="autoplay:pause",Fs="lazyload:loaded",dd="sk",ud="sh",Hr="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Zc();function i(r,l){n.bind(t,qo(r).join(" "),function(d){l.apply(l,Ss(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(Es,n.destroy),Fo(n,{bus:t,on:i,off:Yt(n.unbind,t),emit:o})}function Qr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ii((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return w();d=rl(p)}}function x(C){C||h(),r=o()-(C?l*e:0),c=!1,d=rl(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 v(){return c}return{start:x,rewind:m,pause:w,cancel:h,set:f,isPaused:v}}function Sp(e){var t=e;function n(o){t=o}function i(o){return $s(qo(o),t)}return{set:n,is:i}}function Cp(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function $p(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Zc(),d=[];function c(){var h=n.mediaQuery==="min";Ao(o).sort(function(f,v){return h?+f-+v:+v-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,ol),x()}function u(h){h&&l.destroy()}function p(h,f){var v=matchMedia(f);l.bind(v,"change",x),d.push([h,v])}function x(){var h=i.is(_r),f=n.direction,v=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});al(n),m(v),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function w(h){matchMedia(ol).matches&&(h?qn(n,r):al(n,Ao(r)))}function m(h,f,v){qn(n,h),f&&qn(Object.getPrototypeOf(n),h),(v||!i.is(Bi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:w,set:m}}var ea="Arrow",ta=ea+"Left",na=ea+"Right",pd=ea+"Up",md=ea+"Down",cl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[pd,na],ArrowRight:[md,ta]};function Tp(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===cl&&!l?1:d===ia?0:-1;return fa[r]&&fa[r][c]||r.replace(/width|left|right/i,function(u,p){var x=fa[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===cl?1:-1)}return{resolve:i,orient:o}}var Wn="role",Xi="tabindex",Ip="disabled",Cn="aria-",Jo=Cn+"controls",gd=Cn+"current",dl=Cn+"selected",yn=Cn+"label",_s=Cn+"labelledby",hd=Cn+"hidden",Ns=Cn+"orientation",Wo=Cn+"roledescription",ul=Cn+"live",pl=Cn+"busy",ml=Cn+"atomic",Ws=[Wn,Xi,Ip,Jo,gd,yn,_s,hd,Ns,Wo],kn=Zo+"__",li="is-",ya=Zo,gl=kn+"track",Rp=kn+"list",oa=kn+"slide",fd=oa+"--clone",Lp=oa+"__container",Hs=kn+"arrows",ra=kn+"arrow",yd=ra+"--prev",xd=ra+"--next",aa=kn+"pagination",vd=aa+"__page",Pp=kn+"progress",Ep=Pp+"__bar",Mp=kn+"toggle",kp=kn+"spinner",Ap=kn+"sr",Fp=li+"initialized",Ii=li+"active",bd=li+"prev",wd=li+"next",ts=li+"visible",ns=li+"loading",Sd=li+"focus-in",Cd=li+"overflow",_p=[Ii,ts,bd,wd,ns,Sd,Cd],Np={slide:oa,clone:fd,arrows:Hs,arrow:ra,prev:yd,next:xd,pagination:aa,page:vd,spinner:kp};function Wp(e,t){if(Vc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ko(n,t);)n=n.parentElement;return n}var Hp=5,hl=200,$d="touchstart mousedown",xa="touchmove mousemove",va="touchend touchcancel mouseup click";function Dp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],w,m,h;function f(){S(),X(),y()}function v(){o(en,C),o(en,f),o(ln,y),r(document,$d+" keydown",function(W){h=W.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,Sd,!!h)})}function C(W){var I=Ws.concat("style");On(u),Nn(l,p),Nn(w,x),Mn([w,m],I),Mn(l,W?I:["style",Wo])}function y(){Nn(l,p),Nn(w,x),p=U(ya),x=U(gl),En(l,p),En(w,x),$t(l,yn,n.label),$t(l,_s,n.labelledby)}function S(){w=N("."+gl),m=Ko(w,"."+Rp),Ro(w&&m,"A track/list element is missing."),Rr(u,Xc(m,"."+oa+":not(."+fd+")")),Ci({arrows:Hs,pagination:aa,prev:yd,next:xd,bar:Ep,toggle:Mp},function(W,I){c[I]=N("."+W)}),Fo(c,{root:l,track:w,list:m,slides:u})}function X(){var W=l.id||bp(Zo),I=n.role;l.id=W,w.id=w.id||W+"-track",m.id=m.id||W+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&I&&$t(l,Wn,I),$t(l,Wo,d.carousel),$t(m,Wn,"presentation")}function N(W){var I=Uc(l,W);return I&&Wp(I,"."+ya)===l?I:void 0}function U(W){return[W+"--"+n.type,W+"--"+n.direction,n.drag&&W+"--draggable",n.isNavigation&&W+"--nav",W===ya&&Ii]}return Fo(c,{setup:f,mount:v,destroy:C})}var Zi="slide",uo="loop",Qo="fade";function Op(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,w=p.updateOnMove,m=p.i18n,h=p.pagination,f=p.slideFocus,v=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),S=n>-1,X=Ko(i,"."+Lp),N;function U(){S||(i.id=u.id+"-slide"+Ls(t+1),$t(i,Wn,h?"tabpanel":"group"),$t(i,Wo,m.slide),$t(i,yn,y||Qa(m.slideLabel,[t+1,e.length]))),W()}function W(){d(i,"click",Yt(l,Ps,ne)),d(i,"keydown",Yt(l,dd,ne)),r([co,ud,Li],T),r(Ms,B),w&&r(Bn,$)}function I(){N=!0,o.destroy(),Nn(i,_p),Mn(i,Ws),$t(i,"style",C),$t(i,yn,y||"")}function B(){var L=e.splides.map(function(O){var Z=O.splide.Components.Slides.getAt(t);return Z?Z.slide.id:""}).join(" ");$t(i,yn,Qa(m.slideX,(S?n:t)+1)),$t(i,Jo,L),$t(i,Wn,f?"button":""),f&&Mn(i,Wo)}function $(){N||T()}function T(){if(!N){var L=e.index;k(),F(),_n(i,bd,t===L-1),_n(i,wd,t===L+1)}}function k(){var L=H();L!==sl(i,Ii)&&(_n(i,Ii,L),$t(i,gd,x&&L||""),l(L?Jc:Qc,ne))}function F(){var L=P(),O=!L&&(!H()||S);if(e.state.is([lo,Xo])||$t(i,hd,O||""),$t(Is(i,p.focusableNodes||""),Xi,O?-1:""),f&&$t(i,Xi,O?-1:0),L!==sl(i,ts)&&(_n(i,ts,L),l(L?ed:td,ne)),!L&&document.activeElement===i){var Z=c.Slides.getAt(e.index);Z&&Yc(Z.slide)}}function g(L,O,Z){wn(Z&&X||i,L,O)}function H(){var L=e.index;return L===t||p.cloneStatus&&L===n}function P(){if(e.is(Qo))return H();var L=hn(c.Elements.track),O=hn(i),Z=v("left",!0),ue=v("right",!0);return Wr(L[Z])<=No(O[Z])&&Wr(O[ue])<=No(L[ue])}function q(L,O){var Z=dn(L-t);return!S&&(p.rewind||e.is(uo))&&(Z=ii(Z,e.length-Z)),Z<=O}var ne={index:t,slideIndex:n,slide:i,container:X,isClone:S,mount:U,destroy:I,update:T,style:g,isWithin:q};return ne}function Bp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){w(),o(en,m),o(en,w)}function w(){c.forEach(function(T,k){f(T,k,-1)})}function m(){N(function(T){T.destroy()}),On(p)}function h(){N(function(T){T.update()})}function f(T,k,F){var g=Op(e,k,F,T);g.mount(),p.push(g),p.sort(function(H,P){return H.index-P.index})}function v(T){return T?U(function(k){return!k.isClone}):p}function C(T){var k=t.Controller,F=k.toIndex(T),g=k.hasFocus()?1:n.perPage;return U(function(H){return Lr(H.index,F,F+g-1)})}function y(T){return U(T)[0]}function S(T,k){vn(T,function(F){if(ni(F)&&(F=qc(F)),Gc(F)){var g=c[k];g?Ts(F,g):Uo(u,F),En(F,n.classes.slide),I(F,Yt(r,Ki))}}),r(en)}function X(T){Ti(U(T).map(function(k){return k.slide})),r(en)}function N(T,k){v(k).forEach(T)}function U(T){return p.filter(Vc(T)?T:function(k){return ni(T)?ko(k.slide,T):$s(qo(T),k.index)})}function W(T,k,F){N(function(g){g.style(T,k,F)})}function I(T,k){var F=Is(T,"img"),g=F.length;g?F.forEach(function(H){l(H,"load error",function(){--g||k()})}):k()}function B(T){return T?c.length:p.length}function $(){return p.length>n.perPage}return{mount:x,destroy:m,update:h,register:f,get:v,getIn:C,getAt:y,add:S,remove:X,forEach:N,filter:U,style:W,getLength:B,isEnough:$}}function zp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,w=u.list,m=d.getAt,h=d.style,f,v,C;function y(){S(),r(window,"resize load",Cp(Yt(l,Ki))),o([ln,en],S),o(Ki,X)}function S(){f=n.direction===ia,wn(p,"maxWidth",pi(n.width)),wn(x,c("paddingLeft"),N(!1)),wn(x,c("paddingRight"),N(!0)),X(!0)}function X(ne){var L=hn(p);(ne||v.width!==L.width||v.height!==L.height)&&(wn(x,"height",U()),h(c("marginRight"),pi(n.gap)),h("width",I()),h("height",B(),!0),v=L,l(Zr),C!==(C=q())&&(_n(p,Cd,C),l(wp,C)))}function N(ne){var L=n.padding,O=c(ne?"right":"left");return L&&pi(L[O]||(Mo(L)?0:L))||"0px"}function U(){var ne="";return f&&(ne=W(),Ro(ne,"height or heightRatio is missing."),ne="calc("+ne+" - "+N(!1)+" - "+N(!0)+")"),ne}function W(){return pi(n.height||hn(w).width*n.heightRatio)}function I(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function B(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():W())}function $(){var ne=pi(n.gap);return"calc((100%"+(ne&&" + "+ne)+")/"+(n.perPage||1)+(ne&&" - "+ne)+")"}function T(){return hn(w)[c("width")]}function k(ne,L){var O=m(ne||0);return O?hn(O.slide)[c("width")]+(L?0:H()):0}function F(ne,L){var O=m(ne);if(O){var Z=hn(O.slide)[c("right")],ue=hn(w)[c("left")];return dn(Z-ue)+(L?0:H())}return 0}function g(ne){return F(e.length-1)-F(0)+k(0,ne)}function H(){var ne=m(0);return ne&&parseFloat(wn(ne.slide,c("marginRight")))||0}function P(ne){return parseFloat(wn(x,c("padding"+(ne?"Right":"Left"))))||0}function q(){return e.is(Qo)||g(!0)>T()}return{mount:y,resize:X,listSize:T,slideSize:k,sliderSize:g,totalSize:F,getPadding:P,isOverflow:q}}var jp=2;function Vp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,x),o([ln,Ki],m),(u=v())&&(h(u),t.Layout.resize(!0))}function x(){w(),p()}function w(){Ti(c),On(c),i.destroy()}function m(){var C=v();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;)Rr(y,y);Rr(y.slice(-C),y.slice(0,C)).forEach(function(X,N){var U=N<C,W=f(X.slide,N);U?Ts(W,y[0].slide):Uo(r.list,W),Rr(c,W),l.register(W,N-C+(U?0:S),X.index)})}}function f(C,y){var S=C.cloneNode(!0);return En(S,n.classes.clone),S.id=e.root.id+"-clone"+Ls(y+1),S}function v(){var C=n.clones;if(!e.is(uo))C=0;else if(Yo(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=y&&No(hn(r.track)[d("width")]/y);C=S||n[d("autoWidth")]&&e.length||n.perPage*jp}return C}return{mount:p,destroy:w}}function Gp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,w=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,v=t.Elements,C=v.list,y=v.track,S;function X(){S=t.Transition,o([si,Zr,ln,en],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),W(e.index),t.Slides.update())}function U(O,Z,ue,ae){O!==Z&&ne(O>ue)&&(T(),I($(g(),O>ue),!0)),l(lo),r(Bn,Z,ue,O),S.start(Z,function(){l(Ui),r(co,Z,ue,O),ae&&ae()})}function W(O){I(F(O,!0))}function I(O,Z){if(!e.is(Qo)){var ue=Z?O:B(O);wn(C,"transform","translate"+h("X")+"("+ue+"px)"),O!==ue&&r(ud)}}function B(O){if(e.is(uo)){var Z=k(O),ue=Z>t.Controller.getEnd(),ae=Z<0;(ae||ue)&&(O=$(O,ue))}return O}function $(O,Z){var ue=O-q(Z),ae=w();return O-=f(ae*(No(dn(ue)/ae)||1))*(Z?1:-1),O}function T(){I(g(),!0),S.cancel()}function k(O){for(var Z=t.Slides.get(),ue=0,ae=1/0,A=0;A<Z.length;A++){var pe=Z[A].index,z=dn(F(pe,!0)-O);if(z<=ae)ae=z,ue=pe;else break}return ue}function F(O,Z){var ue=f(p(O-1)-P(O));return Z?H(ue):ue}function g(){var O=h("left");return hn(C)[O]-hn(y)[O]+f(u(!1))}function H(O){return n.trimSpace&&e.is(Zi)&&(O=Wi(O,0,f(w(!0)-x()))),O}function P(O){var Z=n.focus;return Z==="center"?(x()-c(O,!0))/2:+Z*c(O)||0}function q(O){return F(O?t.Controller.getEnd():0,!!n.trimSpace)}function ne(O){var Z=f($(g(),O));return O?Z>=0:Z<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(O,Z){Z=Yo(Z)?g():Z;var ue=O!==!0&&f(Z)<f(q(!1)),ae=O!==!1&&f(Z)>f(q(!0));return ue||ae}return{mount:X,move:U,jump:W,translate:I,shift:$,cancel:T,toIndex:k,toPosition:F,getPosition:g,getLimit:q,exceededLimit:L,reposition:N}}function Xp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,w=p.getLength,m=n.omitEnd,h=e.is(uo),f=e.is(Zi),v=Yt(g,!1),C=Yt(g,!0),y=n.start||0,S,X=y,N,U,W;function I(){B(),o([ln,en,Hr],B),o(Zr,$)}function B(){N=w(!0),U=n.perMove,W=n.perPage,S=ne();var z=Wi(y,0,m?S:N-1);z!==y&&(y=z,l.reposition())}function $(){S!==ne()&&r(Hr)}function T(z,re,te){if(!pe()){var be=F(z),Ae=q(be);Ae>-1&&(re||Ae!==y)&&(ue(Ae),l.move(be,Ae,X,te))}}function k(z,re,te,be){t.Scroll.scroll(z,re,te,function(){var Ae=q(l.toIndex(d()));ue(m?ii(Ae,S):Ae),be&&be()})}function F(z){var re=y;if(ni(z)){var te=z.match(/([+\-<>])(\d+)?/)||[],be=te[1],Ae=te[2];be==="+"||be==="-"?re=H(y+ +(""+be+(+Ae||1)),y):be===">"?re=Ae?L(+Ae):v(!0):be==="<"&&(re=C(!0))}else re=h?z:Wi(z,0,S);return re}function g(z,re){var te=U||(A()?1:W),be=H(y+te*(z?-1:1),y,!(U||A()));return be===-1&&f&&!Kc(d(),c(!z),1)?z?0:S:re?be:q(be)}function H(z,re,te){if(x()||A()){var be=P(z);be!==z&&(re=z,z=be,te=!1),z<0||z>S?!U&&(Lr(0,z,re,!0)||Lr(S,re,z,!0))?z=L(O(z)):h?z=te?z<0?-(N%W||W):N:z:n.rewind?z=z<0?S:0:z=-1:te&&z!==re&&(z=L(O(re)+(z<re?-1:1)))}else z=-1;return z}function P(z){if(f&&n.trimSpace==="move"&&z!==y)for(var re=d();re===u(z,!0)&&Lr(z,0,e.length-1,!n.rewind);)z<y?--z:++z;return z}function q(z){return h?(z+N)%N||0:z}function ne(){for(var z=N-(A()||h&&U?1:W);m&&z-- >0;)if(u(N-1,!0)!==u(z,!0)){z++;break}return Wi(z,0,N-1)}function L(z){return Wi(A()?z:W*z,0,S)}function O(z){return A()?ii(z,S):Wr((z>=S?N-1:z)/W)}function Z(z){var re=l.toIndex(z);return f?Wi(re,0,S):re}function ue(z){z!==y&&(X=y,y=z)}function ae(z){return z?X:y}function A(){return!Yo(n.focus)||n.isNavigation}function pe(){return e.state.is([lo,Xo])&&!!n.waitForTransition}return{mount:I,go:T,scroll:k,getNext:v,getPrev:C,getAdjacent:g,getEnd:ne,setIndex:ue,getIndex:ae,toIndex:L,toPage:O,toDest:Z,hasFocus:A,isBusy:pe}}var Yp="http://www.w3.org/2000/svg",qp="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",sr=40;function Up(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,w=u.track,m=x,h=u.prev,f=u.next,v,C,y={};function S(){N(),o(ln,X)}function X(){U(),S()}function N(){var k=n.arrows;k&&!(h&&f)&&B(),h&&f&&(Fo(y,{prev:h,next:f}),_o(m,k?"":"none"),En(m,C=Hs+"--"+n.direction),k&&(W(),T(),$t([h,f],Jo,w.id),l(rd,h,f)))}function U(){i.destroy(),Nn(m,C),v?(Ti(x?[h,f]:m),h=f=null):Mn([h,f],Ws)}function W(){o([si,co,en,Li,Hr],T),r(f,"click",Yt(I,">")),r(h,"click",Yt(I,"<"))}function I(k){p.go(k,!0)}function B(){m=x||Gi("div",d.arrows),h=$(!0),f=$(!1),v=!0,Uo(m,[h,f]),!x&&Ts(m,w)}function $(k){var F='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Yp+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||qp)+'" />';return qc(F)}function T(){if(h&&f){var k=e.index,F=p.getPrev(),g=p.getNext(),H=F>-1&&k<F?c.last:c.prev,P=g>-1&&k>g?c.first:c.next;h.disabled=F<0,f.disabled=g<0,$t(h,yn,H),$t(f,yn,P),l(ad,h,f,F,g)}}return{arrows:y,mount:S,destroy:U,update:T}}var Kp=Rs+"-interval";function Zp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),W),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,w=p.toggle,m=n.autoplay,h,f,v=m==="pause";function C(){m&&(y(),w&&$t(w,Jo,u.track.id),v||S(),U())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(B){h=B.type==="mouseenter",N()}),n.pauseOnFocus&&r(x,"focusin focusout",function(B){f=B.type==="focusin",N()}),w&&r(w,"click",function(){v?S():X(!0)}),o([Bn,Jr,en],d.rewind),o(Bn,I)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=v=!1,U(),l(ks))}function X(B){B===void 0&&(B=!0),v=!!B,U(),c()||(d.pause(),l(As))}function N(){v||(h||f?X(!1):S())}function U(){w&&(_n(w,Ii,!v),$t(w,yn,n.i18n[v?"play":"pause"]))}function W(B){var $=u.bar;$&&wn($,"width",B*100+"%"),l(cd,B)}function I(B){var $=t.Slides.getAt(B);d.set($&&+Sn($.slide,Kp)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:X,isPaused:c}}function Jp(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Fs,Yt(d,!0)),o([si,ln,en],Yt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Ko(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),_o(u,c?"none":"")}return{mount:r,destroy:Yt(l,!1)}}var Qp=10,em=600,tm=.6,nm=1.5,im=800;function om(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,w=e.is(Zi),m,h,f=1;function v(){o(Bn,X),o([ln,en],N)}function C(W,I,B,$,T){var k=c();if(X(),B&&(!w||!p())){var F=t.Layout.sliderSize(),g=Ja(W)*F*Wr(dn(W)/F)||0;W=d.toPosition(t.Controller.toDest(W%F))+g}var H=Kc(k,W,1);f=1,I=H?0:I||Nr(dn(W-k)/nm,im),h=$,m=Qr(I,y,Yt(S,k,W,T),1),l(Xo),r(Jr),m.start()}function y(){l(Ui),h&&h(),r(Li)}function S(W,I,B,$){var T=c(),k=W+(I-W)*U($),F=(k-T)*f;x(T+F),w&&!B&&p()&&(f*=tm,dn(F)<Qp&&C(u(p(!0)),em,!1,h,!0))}function X(){m&&m.cancel()}function N(){m&&!m.isPaused()&&(X(),y())}function U(W){var I=n.easingFunc;return I?I(W):1-Math.pow(1-W,4)}return{mount:v,destroy:X,scroll:C,cancel:N}}var Hi={passive:!1,capture:!0};function rm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,w=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,v=h.orient,C=u.getPosition,y=u.exceededLimit,S,X,N,U,W,I=!1,B,$,T;function k(){l(w,xa,Ka,Hi),l(w,va,Ka,Hi),l(w,$d,g,Hi),l(w,"click",q,{capture:!0}),l(w,"dragstart",Fn),o([si,ln],F)}function F(){var M=n.drag;b(!M),U=M==="free"}function g(M){if(B=!1,!$){var E=Ae(M);be(M.target)&&(E||!M.button)&&(x.isBusy()?Fn(M,!0):(T=E?w:window,W=c.is([lo,Xo]),N=null,l(T,xa,H,Hi),l(T,va,P,Hi),u.cancel(),p.cancel(),ne(M)))}}function H(M){if(c.is(Ir)||(c.set(Ir),r(nd)),M.cancelable)if(W){u.translate(S+te(A(M)));var E=pe(M)>hl,j=I!==(I=y());(E||j)&&ne(M),B=!0,r(id),Fn(M)}else Z(M)&&(W=O(M),Fn(M))}function P(M){c.is(Ir)&&(c.set(Ui),r(od)),W&&(L(M),Fn(M)),d(T,xa,H),d(T,va,P),W=!1}function q(M){!$&&B&&Fn(M,!0)}function ne(M){N=X,X=M,S=C()}function L(M){var E=ue(M),j=ae(E),Ce=n.rewind&&n.rewindByDrag;m(!1),U?x.scroll(j,0,n.snap):e.is(Qo)?x.go(v(Ja(E))<0?Ce?"<":"-":Ce?">":"+"):e.is(Zi)&&I&&Ce?x.go(y(!0)?">":"<"):x.go(x.toDest(j),!0),m(!0)}function O(M){var E=n.dragMinThreshold,j=Mo(E),Ce=j&&E.mouse||0,ee=(j?E.touch:+E)||10;return dn(A(M))>(Ae(M)?ee:Ce)}function Z(M){return dn(A(M))>dn(A(M,!0))}function ue(M){if(e.is(uo)||!I){var E=pe(M);if(E&&E<hl)return A(M)/E}return 0}function ae(M){return C()+Ja(M)*ii(dn(M)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(M,E){return re(M,E)-re(z(M),E)}function pe(M){return Za(M)-Za(z(M))}function z(M){return X===M&&N||X}function re(M,E){return(Ae(M)?M.changedTouches[0]:M)["page"+f(E?"Y":"X")]}function te(M){return M/(I&&e.is(Zi)?Hp:1)}function be(M){var E=n.noDrag;return!ko(M,"."+vd+", ."+ra)&&(!E||!ko(M,E))}function Ae(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function ve(){return W}function b(M){$=M}return{mount:k,disable:b,isDragging:ve}}var am={Spacebar:" ",Right:na,Left:ta,Up:pd,Down:md};function Ds(e){return e=ni(e)?e:e.key,am[e]||e}var fl="keydown";function sm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){w(),o(ln,m),o(ln,w),o(Bn,f)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,fl,v))}function m(){l(u,fl)}function h(C){p=C}function f(){var C=p;p=!0,jc(function(){p=C})}function v(C){if(!p){var y=Ds(C);y===c(ta)?e.go("<"):y===c(na)&&e.go(">")}}return{mount:x,destroy:m,disable:h}}var Lo=Rs+"-lazy",Pr=Lo+"-srcset",lm="["+Lo+"], ["+Pr+"]";function cm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[co,Li],p=[];function x(){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){Is(y.slide,lm).forEach(function(S){var X=Sn(S,Lo),N=Sn(S,Pr);if(X!==S.src||N!==S.srcset){var U=n.classes.spinner,W=S.parentElement,I=Ko(W,"."+U)||Gi("span",U,W);p.push([S,y,I]),S.src||_o(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,ns),l(S,"load error",Yt(v,y)),$t(S,"src",Sn(S,Lo)),$t(S,"srcset",Sn(S,Pr)),Mn(S,Lo),Mn(S,Pr)}function v(y,S){var X=y[0],N=y[1];Nn(N.slide,ns),S.type!=="error"&&(Ti(y[2]),_o(X,""),d(Fs,X,N),d(Ki)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:x,destroy:Yt(On,p),check:h}}function dm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,w=u.go,m=t.Direction.resolve,h=c.pagination,f=[],v,C;function y(){S(),o([ln,en,Hr],y);var $=n.pagination;h&&_o(h,$?"":"none"),$&&(o([Bn,Jr,Li],B),X(),B(),r(sd,{list:v,items:f},I(e.index)))}function S(){v&&(Ti(h?ai(v.children):v),Nn(v,C),On(f),v=null),i.destroy()}function X(){var $=e.length,T=n.classes,k=n.i18n,F=n.perPage,g=p()?u.getEnd()+1:No($/F);v=h||Gi("ul",T.pagination,c.track.parentElement),En(v,C=aa+"--"+W()),$t(v,Wn,"tablist"),$t(v,yn,k.select),$t(v,Ns,W()===ia?"vertical":"");for(var H=0;H<g;H++){var P=Gi("li",null,v),q=Gi("button",{class:T.page,type:"button"},P),ne=d.getIn(H).map(function(O){return O.slide.id}),L=!p()&&F>1?k.pageX:k.slideX;l(q,"click",Yt(N,H)),n.paginationKeyboard&&l(q,"keydown",Yt(U,H)),$t(P,Wn,"presentation"),$t(q,Wn,"tab"),$t(q,Jo,ne.join(" ")),$t(q,yn,Qa(L,H+1)),$t(q,Xi,-1),f.push({li:P,button:q,page:H})}}function N($){w(">"+$,!0)}function U($,T){var k=f.length,F=Ds(T),g=W(),H=-1;F===m(na,!1,g)?H=++$%k:F===m(ta,!1,g)?H=(--$+k)%k:F==="Home"?H=0:F==="End"&&(H=k-1);var P=f[H];P&&(Yc(P.button),w(">"+H),Fn(T,!0))}function W(){return n.paginationDirection||n.direction}function I($){return f[u.toPage($)]}function B(){var $=I(x(!0)),T=I(x());if($){var k=$.button;Nn(k,Ii),Mn(k,dl),$t(k,Xi,-1)}if(T){var F=T.button;En(F,Ii),$t(F,dl,!0),$t(F,Xi,"")}r(ld,{list:v,items:f},$,T)}return{items:f,mount:y,destroy:S,getAt:I,update:B}}var um=[" ","Enter"];function pm(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 v=Kt(h);v.on(Bn,function(C,y,S){f.go(f.is(uo)?S:C)}),r.push(v)}function p(){var h=Kt(e),f=h.on;f(Ps,w),f(dd,m),f([si,ln],x),r.push(h),h.emit(Ms,e.splides)}function x(){$t(t.Elements.list,Ns,n.direction===ia?"vertical":"")}function w(h){e.go(h.index)}function m(h,f){$s(um,Ds(f))&&(w(h),Fn(f))}return{setup:Yt(t.Media.set,{slideFocus:Yo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function mm(e,t,n){var i=Kt(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,x=p<0,w=Za(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&w-r>h&&(e.go(x?"<":">"),r=w),c(x)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(lo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var gm=90;function hm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",Ap),c=Qr(gm,Yt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,ml,!0),d.textContent="…",o(ks,Yt(w,!0)),o(As,Yt(w,!1)),o([co,Li],Yt(p,!0)))}function p(m){$t(r,pl,m),m?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function x(){Mn(r,[ul,ml,pl]),Ti(d)}function w(m){l&&$t(r,ul,m?"off":"polite")}return{mount:u,disable:w,destroy:x}}var fm=Object.freeze({__proto__:null,Media:$p,Direction:Tp,Elements:Dp,Slides:Bp,Layout:zp,Clones:Vp,Move:Gp,Controller:Xp,Arrows:Up,Autoplay:Zp,Cover:Jp,Scroll:om,Drag:rm,Keyboard:sm,LazyLoad:cm,Pagination:dm,Sync:pm,Wheel:mm,Live:hm}),ym={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"},xm={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:Np,i18n:ym,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function vm(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,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),jc(c)}return{mount:o,start:l,cancel:Ka}}function bm(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(){Kt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,h){var f=i.toPosition(m,!0),v=i.getPosition(),C=w(m);dn(f-v)>=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 x(){d(""),r.cancel()}function w(m){var h=n.rewindSpeed;if(e.is(Zi)&&h){var f=o.getIndex(!0),v=o.getEnd();if(f===0&&m>=v||f>=v&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:x}}var wm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=Sp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?Uc(document,n):n;Ro(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,_s)||""},xm,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,Rs)))}catch{Ro(!1,"Invalid JSON")}this._o=Object.create(qn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Ro(l.is([Bi,_r]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(Qo)?vm:bm),this._E=i||this._E;var c=Fo({},fm,this._E,{Transition:this._T});return Ci(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(si),En(this.root,Fp),l.set(Ui),this.emit(es),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ui)&&(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(ai(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)?Kt(this).on(es,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Es),o.destroy(),i&&On(this.splides),r.set(_r)),this},yp(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})(),Os=wm;Os.defaults={};Os.STATES=vp;var yl=[[si,"onMounted"],[es,"onReady"],[Bn,"onMove"],[co,"onMoved"],[Ps,"onClick"],[Jc,"onActive"],[Qc,"onInactive"],[ed,"onVisible"],[td,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Ki,"onResize"],[Zr,"onResized"],[nd,"onDrag"],[id,"onDragging"],[od,"onDragged"],[Jr,"onScroll"],[Li,"onScrolled"],[Es,"onDestroy"],[rd,"onArrowsMounted"],[ad,"onArrowsUpdated"],[sd,"onPaginationMounted"],[ld,"onPaginationUpdated"],[Ms,"onNavigationMounted"],[ks,"onAutoplayPlay"],[cd,"onAutoplayPlaying"],[As,"onAutoplayPause"],[Fs,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function is(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!is(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!is(e[o],t[o]))}return e===t}function Sm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Cm(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 os(e,t){const n=e;return Cm(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=os(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var $m=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),zs=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 Os(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=os({},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&&!is(this.options,e)&&(this.splide.options=e,this.options=os({},e));const t=this.getSlides();Sm(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){yl.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:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...yl.map(r=>r[1])])},n?s.createElement($m,null,i):i)}},js=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("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 $m="RichTextRenderer-module__link___BWeZ2",Tm={link:$m},Im=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))},po=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Im(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:po(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:O.scalingValue(e.letterSpacing,t),wordSpacing:O.scalingValue(e.wordSpacing,t),fontSize:O.scalingValue(n,t),lineHeight:i!==void 0?O.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:Tm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Rm(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 Rm(e){return{...e.fontFamily&&{fontFamily:po(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 Lm="SvgImage-module__svg___q3xE-",Pm="SvgImage-module__img___VsTm-",xl={svg:Lm,img:Pm},Em=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Mm=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)}},[]),!Em(e)||!r?a.jsx("img",{src:e,alt:"",className:pt(xl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:pt(xl.svg,i),style:{"--svg":Mm(e),"--fill":t,"--hover-fill":n,...o??{}}})},km={"top-left":ut.topLeftAlignment,"top-center":ut.topCenterAlignment,"top-right":ut.topRightAlignment,"middle-left":ut.middleLeftAlignment,"middle-center":ut.middleCenterAlignment,"middle-right":ut.middleRightAlignment,"bottom-left":ut.bottomLeftAlignment,"bottom-center":ut.bottomCenterAlignment,"bottom-right":ut.bottomRightAlignment};function Am({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:x,textAppearance:w,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[v,C]=s.useState(null),[y,S]=s.useState(0),[G,W]=s.useState(0),{direction:U,transition:H,controls:I,pagination:z,imageCaption:$,triggers:T}=e,k=s.useRef(H.type),{x:_,y:g}=e.controls.offset,D=P=>{o&&o.go(P)};return s.useEffect(()=>{if(!v)return;const P=new ResizeObserver(q=>{if(!o)return;const[ie]=q;f({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return P.observe(v),()=>P.unobserve(v)},[v]),s.useEffect(()=>{!o||k.current===H.type||(W(P=>P+1),k.current=H.type)},[H.type]),a.jsx("div",{className:pt(ut.wrapper,{[ut.editor]:i}),ref:C,children:a.jsxs("div",{className:ut.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:H.backgroundColor&&H.type==="fade in"?H.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(ut.captionBlock),children:a.jsx("div",{className:ut.captionTextWrapper,children:t.map((P,q)=>a.jsx("div",{className:pt(ut.captionText,km[$.alignment],{[ut.withPointerEvents]:q===y&&i,[ut.active]:q===y}),style:{fontFamily:po(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":O.scalingValue(l.width,i),letterSpacing:O.scalingValue(c,i),wordSpacing:O.scalingValue(p,i),textAlign:u,fontSize:O.scalingValue(x.fontSize,i),lineHeight:O.scalingValue(x.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:m,transitionDuration:H.duration?`${Math.round(parseInt(H.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ut.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:O.scalingValue($.offset.y,i),left:O.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:P.imageCaption})})},q))})}),a.jsx(zs,{onMove:P=>{S(P.index)},ref:r,options:{arrows:!1,speed:H.duration?parseInt(H.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:U==="horiz"||H.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:H.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((P,q)=>a.jsx(js,{children:a.jsx("div",{className:ut.sliderItem,children:a.jsx("div",{className:ut.imgWrapper,children:a.jsx("img",{className:pt(ut.sliderImage,{[ut.contain]:P.image.objectFit==="contain",[ut.cover]:P.image.objectFit==="cover"}),src:P.image.url,alt:P.image.name??""})})})},q))},G),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(ut.arrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{onClick:()=>{D("-1")},className:ut.arrowInner,style:{transform:`translate(${O.scalingValue(_,i)}, ${O.scalingValue(g*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:pt(ut.arrowImg,ut.mirror)}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg,ut.mirror)})]})}),a.jsx("div",{className:pt(ut.arrow,ut.nextArrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:ut.arrowInner,onClick:()=>D("+1"),style:{transform:`translate(${O.scalingValue(_*(U==="horiz"?-1:1),i)}, ${O.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ut.arrowImg}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:ut.clickOverlay,onClick:()=>{o&&o.go("+1")}}),z.isActive&&a.jsx("div",{className:pt(ut.pagination,{[ut.paginationInsideBottom]:z.position==="inside-1"&&U==="horiz",[ut.paginationInsideTop]:z.position==="inside-2"&&U==="horiz",[ut.paginationOutsideBottom]:z.position==="outside-1"&&U==="horiz",[ut.paginationOutsideTop]:z.position==="outside-2"&&U==="horiz",[ut.paginationInsideLeft]:z.position==="inside-1"&&U==="vert",[ut.paginationInsideRight]:z.position==="inside-2"&&U==="vert",[ut.paginationOutsideLeft]:z.position==="outside-1"&&U==="vert",[ut.paginationOutsideRight]:z.position==="outside-2"&&U==="vert",[ut.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ut.paginationInner,style:{backgroundColor:z.colors[2],transform:`scale(${z.scale/100}) translate(${O.scalingValue(z.offset.x,i)}, ${O.scalingValue(z.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((P,q)=>a.jsx("button",{onClick:()=>{o&&o.go(q)},className:pt(ut.paginationItem),children:a.jsx("div",{className:pt(ut.dot,{[ut.activeDot]:q===y}),style:{backgroundColor:q===y?z.colors[0]:z.colors[1],"--pagination-hover-color":z.hover}})},q))})})]})})}function vl({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 Fm={element:Am,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"]}},_m="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Nm="ImageRevealSlider-module__image___Qjt-e",Wm="ImageRevealSlider-module__link___N-iLG",Hm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:_m,image:Nm,link:Wm,cursor:Hm};function bl(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 ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Dm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ba(e);r=l.height/l.width*o}else{const l=await ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Om({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,x]=s.useState({x:0,y:0}),[w,m]=s.useState(1),[h,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:G,randomRangeImageWidth:W}=e.imageSize,{revealPosition:U,visible:H}=e.position,{cursorType:I,target:z,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:k,hoverCursor:_}=e.cursor;s.useEffect(()=>{if(!i)return;const P=(L,B)=>{const K=i.getBoundingClientRect(),ue=L-K.left,le=B-K.top;if(x({x:ue,y:le}),I==="system"){f("none"),m(1);return}const F=ue,pe=le,j=document.elementFromPoint(K.left+F,K.top+pe);if(j&&j.closest("a")){f("none"),m(1);return}const se=bl(F,pe,r)||z==="area"?{img:_??"none",scale:k}:{img:T??"none",scale:$};f(se.img),m(se.scale)},q=L=>{L.stopPropagation(),v.current={x:L.clientX,y:L.clientY},P(L.clientX,L.clientY)},ie=()=>{C&&P(v.current.x,v.current.y)};return i.addEventListener("mousemove",q),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",q),window.removeEventListener("scroll",ie,!0)}},[i,C,p,I,z,_,T,k,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(P,q,ie,L={})=>{const{width:B,height:K,finalWidth:ue}=await Dm(P.image.url,S,G,W);let le=0,F=0;U==="same"?(le=q/2,F=ie/2):(le=L.x??Math.random()*q,F=L.y??Math.random()*ie);const pe=Math.min(Math.max(le,B/2),q-B/2),j=Math.min(Math.max(F,K/2),ie-K/2);return{id:u.current++,url:P.image.url,link:P.link,name:P.image.name,x:pe,y:j,width:ue}};s.useEffect(()=>{if(!i||t.length===0)return;const P=i.getBoundingClientRect(),q=P.width,ie=P.height,L=[];(async()=>{const K=t[0],ue=await g(K,q,ie);L.push(ue),l(L),c(1)})()},[S,G,W,U,i]),s.useEffect(()=>{H==="last One"&&l(P=>P.length>0?[P[P.length-1]]:[])},[H]);const D=async P=>{if(!i)return;const q=i.getBoundingClientRect(),ie=P.clientX-q.left,L=P.clientY-q.top;if(z==="image"&&!bl(ie,L,r))return;let B=0,K=0;U==="on Click"?(B=ie,K=L):U==="same"?(B=q.width/2,K=q.height/2):(B=Math.random()*q.width,K=Math.random()*q.height);const ue=t[d],le=await g(ue,q.width,q.height,{x:B,y:K});l(F=>H==="all"?[...F,le]:[le]),c(F=>F>=t.length-1?0:F+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(P=>a.jsx("div",{className:Mi.wrapper,style:{top:`${P.y}px`,left:`${P.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:P.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:z==="area"&&P.link?a.jsx("a",{href:P.link,target:"_blank",className:Mi.link,children:a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)}):a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)},P.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 Bm={element:Om,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:""}]}}}},zm="LightBox-module__hidden___9s-9x",jm="LightBox-module__heroImage___sTxNF",Vm="LightBox-module__background___rm9ml",Gm="LightBox-module__editor___4ACaY",Xm="LightBox-module__contentStyle___Bgnsq",Ym="LightBox-module__imageStyle___tLIlB",qm="LightBox-module__imgWrapper___LuFUp",Um="LightBox-module__contain___8-yaS",Km="LightBox-module__cover___hNvOG",Zm="LightBox-module__caption___b6L2I",Jm="LightBox-module__captionTextInner___rCGNH",Qm="LightBox-module__lightboxSplide___XFuWC",eg="LightBox-module__arrow___iz38X",tg="LightBox-module__arrowVertical___Zfz81",ng="LightBox-module__nextArrow___zkAQN",ig="LightBox-module__arrowInner___p48sW",og="LightBox-module__arrowIcon___3VaFf",rg="LightBox-module__arrowImg___pNV88",ag="LightBox-module__mirror___pjeXc",sg="LightBox-module__thumbsWrapper___GB-nU",lg="LightBox-module__thumbsContainerVertical___wttk5",cg="LightBox-module__thumbsContainer___osSma",dg="LightBox-module__thumbsAlignStart___MO6tY",ug="LightBox-module__thumbsAlignCenter___Q4sUx",pg="LightBox-module__thumbsAlignEnd___p4y9R",mg="LightBox-module__thumbItem___HvnF3",gg="LightBox-module__closeButton___g2khP",hg="LightBox-module__fadeIn___0m5GW",fg="LightBox-module__slideInLeft___gPYwC",yg="LightBox-module__slideInRight___S-pPp",xg="LightBox-module__slideInTop___DFdAj",vg="LightBox-module__slideInBottom___m27kZ",bg="LightBox-module__fadeOut___55qBR",wg="LightBox-module__slideOutLeft___NvU7P",Sg="LightBox-module__slideOutRight___SK7eC",Cg="LightBox-module__slideOutTop___Vgg0z",$g="LightBox-module__slideOutBottom___nJ0Ef",Tg="LightBox-module__scaleSlide___vZriG",Ke={hidden:zm,heroImage:jm,background:Vm,editor:Gm,contentStyle:Xm,imageStyle:Ym,imgWrapper:qm,contain:Um,cover:Km,caption:Zm,captionTextInner:Jm,lightboxSplide:Qm,arrow:eg,arrowVertical:tg,nextArrow:ng,arrowInner:ig,arrowIcon:og,arrowImg:rg,mirror:ag,thumbsWrapper:sg,thumbsContainerVertical:lg,thumbsContainer:cg,thumbsAlignStart:dg,thumbsAlignCenter:ug,thumbsAlignEnd:pg,thumbItem:mg,closeButton:gg,fadeIn:hg,slideInLeft:fg,slideInRight:yg,slideInTop:xg,slideInBottom:vg,fadeOut:bg,slideOutLeft:wg,slideOutRight:Sg,slideOutTop:Cg,slideOutBottom:$g,scaleSlide:Tg},lr=(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% + ${O.scalingValue(t.x,n)}), calc(-50% + ${O.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${O.scalingValue(t.x,n)}, calc(-50% + ${O.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${O.scalingValue(t.x,n)}), ${O.scalingValue(t.y,n)})`:i.transform=`translate(${O.scalingValue(t.x,n)}, ${O.scalingValue(t.y,n)})`,i};function Td(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 Ig(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 Id(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 Rg(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 Rd(e,t,n,i,o){const{x:r,y:l}=Ig(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Lg(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"?Rg:Id,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:w}=Rd(n,i,u,p,d),m=(x+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Pg(e){return Lg(e)}function Or(e){const t=e.getBoundingClientRect(),n=Td(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}=Id(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Rd(i,o,d,c,u),w=t.left+n.left,m=t.top+n.top;return{x:p+w,y:x+m,width:d,height:c}}function wl(e){const t=e.getBoundingClientRect(),n=Td(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Sl(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 Eg(e,t){const n=(()=>{if(e==="fade in")return Ke.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeIn;if(e==="slide in")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeOut;if(e==="slide in")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})(),r=(()=>{if(e==="fade in")return Ke.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Mg=({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:Ke.heroImage,onClick:()=>c(!0)}),a.jsx(kg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},kg=({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:x,wordSpacing:w,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[v,C]=s.useState(0),[y,S]=s.useState(0),[G,W]=s.useState(!1),[U,H]=s.useState(!1),[I,z]=s.useState({}),$=s.useRef(null),T=s.useRef(null),k=s.useRef(null),_=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),P=s.useRef(null),q=s.useRef(null),ie=s.useRef(!1),L=s.useRef(null),[B,K]=s.useState(!1),{appear:ue,triggers:le,slider:F,thumbnail:pe,controls:j,area:se,caption:ne,layout:ve}=o.lightboxBlock,{appearClass:ke,backdropAppearClass:xe,backdropDisappearClass:b,disappearClass:M}=Eg(ue.type,ue.direction),E=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const Z=()=>{setTimeout(()=>{var de,be;(be=(de=$.current)==null?void 0:de.splide)==null||be.refresh()},16)},J=()=>{S(de=>de+1)};return window.addEventListener("ArticleEditor.Layout:change",Z),window.addEventListener("ArticleEditor.ComponentContent:change",J),()=>{window.removeEventListener("ArticleEditor.Layout:change",Z),window.removeEventListener("ArticleEditor.ComponentContent:change",J)}},[]),s.useEffect(()=>{if(!e||!pe.isActive){K(!1);return}const Z=L.current;if(!Z)return;const J=()=>{F.direction==="horiz"?K(Z.scrollWidth>Z.clientWidth):K(Z.scrollHeight>Z.clientHeight)};J();const de=new ResizeObserver(J);return de.observe(Z),()=>de.disconnect()},[e,pe.isActive,n.length,I,F.direction]);const V=s.useCallback(()=>{const Z=window.matchMedia("(max-width: 768px)").matches,J=Sl(se.color);Z&&!l&&J>.9&&(document.body.style.backgroundColor=""),W(!0),_.current=!0;const de=be=>{be.target===g.current&&be.animationName&&(g.current&&D.current&&g.current.removeEventListener("animationend",D.current),D.current=null,_.current&&(_.current=!1,t()),W(!1))};g.current&&(D.current=de,g.current.addEventListener("animationend",de))},[t,se.color,l]),Ce=(Z,J,de)=>{var be,Pe;if(Z){if(le.type==="click"&&le.switch==="image")le.repeat==="close"&&v===n.length-1?V():(be=$.current)==null||be.go("+1");else if(le.type==="click"&&le.switch==="50/50"){const Se=Z.getBoundingClientRect(),X=J-Se.left,me=de-Se.top,re=Se.width,Y=Se.height;let ce;F.direction==="horiz"?ce=X<re/2?"-1":"+1":ce=me<Y/2?"-1":"+1",(Pe=$.current)==null||Pe.go(ce)}}},te=Z=>{if(ie.current){ie.current=!1;return}const J=n[v],de=(J==null?void 0:J.image.objectFit)==="cover";let be,Pe;if("changedTouches"in Z&&Z.changedTouches.length>0)be=Z.changedTouches[0].clientX,Pe=Z.changedTouches[0].clientY;else if("clientX"in Z)be=Z.clientX,Pe=Z.clientY;else return;let Se;if(de&&k.current){const X=wl(k.current);Se=be>=X.left&&be<=X.right&&Pe>=X.top&&Pe<=X.bottom}else{const X=k.current?Or(k.current):null;if(!X){Z.target===Z.currentTarget&&V();return}Se=be>=X.x&&be<=X.x+X.width&&Pe>=X.y&&Pe<=X.y+X.height}Se?Ce(k.current,be,Pe):V()},$e=Z=>{const J=Z.target;(J.classList.contains(Ke.thumbsWrapper)||J.classList.contains(Ke.thumbsContainer))&&te(Z)};s.useEffect(()=>{if(!e)return;const Z=J=>{var de,be;if(J.key==="Escape"){V();return}if(J.key==="ArrowRight"){C(Pe=>(Pe+1)%Math.max(n.length,1)),(de=$.current)==null||de.go("+1");return}J.key==="ArrowLeft"&&(C(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(be=$.current)==null||be.go("-1"))};return window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)}},[e,V,n.length]),s.useEffect(()=>{if(e){if(C(0),S(J=>J+1),_.current=!1,W(!1),H(!1),z({}),!E)return;const Z=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(Z)}return()=>{g.current&&D.current&&(g.current.removeEventListener("animationend",D.current),D.current=null),H(!1)}},[e,E]),s.useEffect(()=>{T.current!==null&&T.current!==F.type&&S(Z=>Z+1),T.current=F.type},[F.type]),s.useEffect(()=>{if(!e)return;const Z=document.body.style.overflow,J=window.matchMedia("(max-width: 768px)").matches,de=Sl(se.color);document.body.style.overflow="hidden",H(!1);const be=Se=>{Se.target===g.current&&!_.current&&Se.animationName&&(J&&!l&&de>.9&&(document.body.style.backgroundColor=se.color),H(!0),g.current&&P.current&&g.current.removeEventListener("animationend",P.current),P.current=null)};g.current&&(P.current=be,g.current.addEventListener("animationend",be));const Pe=Se=>{const X=Se.target;X&&(X.closest(`.${Ke.thumbsWrapper}`)||X.closest(`.${Ke.thumbsContainer}`))||F.type!=="slide"&&Se.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=Z,document.removeEventListener("touchmove",Pe),g.current&&P.current&&(g.current.removeEventListener("animationend",P.current),P.current=null),H(!1)}},[e,l,se.color,F.type]),s.useEffect(()=>{if(!e)return;const Z=J=>{var be,Pe;if(_.current){J.stopPropagation();return}if(ie.current){ie.current=!1;return}const de=J.target;if(!(de&&(de.closest(`.${Ke.thumbsContainer}`)||de.closest(`.${Ke.thumbItem}`)||de.closest(`.${Ke.arrow}`)||de.closest(`.${Ke.closeButton}`)||de.closest(`.${Ke.caption}`)))){if(F.type==="slide"&&le.type==="drag"&&((Pe=(be=$.current)==null?void 0:be.splide)!=null&&Pe.root)){const Se=$.current.splide.root;if(de&&(Se.contains(de)||Se===de))return}if(J.touches.length===0&&J.changedTouches.length>0){const Se=n[v],X=(Se==null?void 0:Se.image.objectFit)==="cover",me=J.changedTouches[0];let re;if(X&&k.current){const Y=wl(k.current);re=me.clientX>=Y.left&&me.clientX<=Y.right&&me.clientY>=Y.top&&me.clientY<=Y.bottom}else{const Y=k.current?Or(k.current):null;if(!Y)return;re=me.clientX>=Y.x&&me.clientX<=Y.x+Y.width&&me.clientY>=Y.y&&me.clientY<=Y.y+Y.height}if(!re){J.stopPropagation(),_.current=!0;const Y=ce=>{ce.stopPropagation(),ce.preventDefault(),document.removeEventListener("click",Y,!0)};document.addEventListener("click",Y,!0),V()}}}};return document.addEventListener("touchend",Z,{passive:!0}),()=>{document.removeEventListener("touchend",Z)}},[e,V,v,n]);const ae=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&le.type==="drag";s.useEffect(()=>{var ce,Ee;if(!e||!ae||!((Ee=(ce=$.current)==null?void 0:ce.splide)!=null&&Ee.root))return;const Z=$.current.splide.root,J=30,de=(he,Q)=>{if(q.current){const Ne=Math.abs(he-q.current.x),Fe=Math.abs(Q-q.current.y);(Ne>0||Fe>0)&&(ie.current=!0)}},be=he=>{q.current&&(he.preventDefault(),de(he.clientX,he.clientY))},Pe=he=>{q.current&&he.touches.length>0&&(he.preventDefault(),de(he.touches[0].clientX,he.touches[0].clientY))},Se=(he,Q)=>{if(!q.current||!$.current){q.current=null;return}const Ne=Math.abs(he-q.current.x),Fe=Math.abs(Q-q.current.y);Fe>J&&Fe>Ne&&$.current.go(Q<q.current.y?"+1":"-1"),q.current=null},X=he=>{q.current&&Se(he.clientX,he.clientY),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("pointermove",be)},me=he=>{if(q.current){if(he.changedTouches.length>0){const Q=he.changedTouches[0];Se(Q.clientX,Q.clientY)}document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),document.removeEventListener("touchmove",Pe)}},re=he=>{q.current={x:he.clientX,y:he.clientY},ie.current=!1,document.addEventListener("pointermove",be,{passive:!1}),document.addEventListener("pointerup",X),document.addEventListener("pointercancel",X)},Y=he=>{he.touches.length>0&&(q.current={x:he.touches[0].clientX,y:he.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me))};return Z.addEventListener("pointerdown",re),Z.addEventListener("touchstart",Y),()=>{Z.removeEventListener("pointerdown",re),Z.removeEventListener("touchstart",Y),document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),q.current=null,ie.current=!1}},[e,ae,y]);const ge={backgroundColor:se.color,backdropFilter:`blur(${se.blur}px)`,animationDuration:`${parseInt(ue.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(Ke.background,G?b:xe,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{...ge,...U&&!l&&!G?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Ke.contentStyle,G?M:ke,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{animationDuration:`${parseInt(ue.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(zs,{onMove:Z=>C(Z.index),ref:$,className:Ke.lightboxSplide,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,direction:F.direction==="horiz"||F.type==="fade"||F.type==="scale"?"ltr":"ttb",pagination:!1,drag:le.type==="drag"&&!ae,perPage:1,width:"100%",height:"100%",type:F.type==="fade"||F.type==="scale"?"fade":"loop",padding:0,rewind:le.repeat!=="close",start:0},style:{"--splide-speed":F.duration},children:n.map((Z,J)=>{const de=lr(ve.position,ve.offset,l),be=`${O.scalingValue(ve.padding.top,l)} ${O.scalingValue(ve.padding.right,l)} ${O.scalingValue(ve.padding.bottom,l)} ${O.scalingValue(ve.padding.left,l)}`,Pe=F.type==="scale"?(()=>{const{transform:Se,...X}=de;return{...X,position:"absolute",padding:be,boxSizing:"border-box","--position-transform":Se||"none"}})():{...de,position:"absolute",padding:be,boxSizing:"border-box"};return a.jsx(js,{children:a.jsx("div",{className:Ke.imgWrapper,onClick:te,children:a.jsx("img",{ref:J===v?k:null,className:pt(Ke.imageStyle,{[Ke.contain]:Z.image.objectFit==="contain",[Ke.cover]:Z.image.objectFit==="cover",[Ke.scaleSlide]:F.type==="scale"}),src:Z.image.url,alt:Z.image.name??"",style:{...Pe,pointerEvents:Z.image.objectFit==="contain"?"none":"auto"}})})},J)})},y),j.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Ke.arrow,{[Ke.arrowVertical]:F.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${O.scalingValue(j.offset.x,l)}, ${O.scalingValue(j.offset.y*(F.direction==="horiz"?1:-1),l)}) scale(${j.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.go("-1")},"aria-label":"Previous",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:pt(Ke.arrowImg,Ke.mirror)}),!j.arrowsImgUrl&&a.jsx(Cl,{color:j.color,className:pt(Ke.arrowIcon,Ke.arrowImg,Ke.mirror)})]})}),a.jsx("div",{className:pt(Ke.arrow,Ke.nextArrow,{[Ke.arrowVertical]:F.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${O.scalingValue(j.offset.x*(F.direction==="horiz"?-1:1),l)}, ${O.scalingValue(j.offset.y,l)}) scale(${j.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.go("+1")},"aria-label":"Next",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:Ke.arrowImg}),!j.arrowsImgUrl&&a.jsx(Cl,{color:j.color,className:pt(Ke.arrowIcon,Ke.arrowImg)})]})})]}),se.closeIconUrl&&(()=>{const Z=lr(se.closeIconAlign,se.closeIconOffset,l),J=`scale(${se.closeIconScale})`,de=Z.transform?`${Z.transform} ${J}`:J;return a.jsx("button",{className:Ke.closeButton,style:{...Z,transform:de},onClick:V,"aria-label":"Close lightbox",children:a.jsx(sn,{url:se.closeIconUrl,fill:se.closeIconColor??"#000000",hoverFill:se.closeIconHover??"#cccccc"})})})(),ne&&ne.isActive&&i.imageCaption&&((ye=n[v])==null?void 0:ye.imageCaption)&&a.jsx("div",{className:Ke.caption,style:{...lr(ne.alignment,ne.offset,l),fontFamily:po(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":O.scalingValue(c.width,l),letterSpacing:O.scalingValue(p,l),wordSpacing:O.scalingValue(w,l),textAlign:x,fontSize:O.scalingValue(m.fontSize,l),lineHeight:O.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:Z=>Z.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ke.captionTextInner,style:{"--link-color":ne.linkColor,"--link-hover-color":ne.linkHoverColor},children:a.jsx(Ri,{content:n[v].imageCaption})})}),pe.isActive&&(()=>{const[Z,J]=pe.position.split("-"),de=F.direction==="horiz"?`${Z}-left`:pe.position,be=lr(de,pe.offset,l),Pe=()=>{if(F.direction==="horiz"){if(J==="left")return"flex-start";if(J==="center")return"center";if(J==="right")return"flex-end"}else{if(Z==="top")return"flex-start";if(Z==="middle")return"center";if(Z==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Ke.thumbsWrapper,onClick:Se=>$e(Se),style:{position:l?"absolute":"fixed",...be,...F.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Ke.thumbsContainer,{[Ke.thumbsContainerVertical]:F.direction==="vert",[Ke.thumbsAlignStart]:pe.align==="start",[Ke.thumbsAlignCenter]:pe.align==="center",[Ke.thumbsAlignEnd]:pe.align==="end"}),style:{gap:O.scalingValue(pe.grid.gap,l),justifyContent:B?"flex-start":Pe()},children:n.map((Se,X)=>{const me=X===v,re=I[X],ce=pe.grid.size*(me?pe.activeState.scale:1),Ee=()=>{if(pe.fit!=="fit")return{};if(!re)return F.direction==="horiz"?{height:O.scalingValue(ce,l)}:{width:O.scalingValue(ce,l)};const he=re.width/re.height;if(F.direction==="horiz"){const Q=ce,Ne=Q*he;return{width:O.scalingValue(Ne,l),height:O.scalingValue(Q,l)}}else{const Q=ce,Ne=Q/he;return{width:O.scalingValue(Q,l),height:O.scalingValue(Ne,l)}}};return a.jsx("button",{className:Ke.thumbItem,style:{...F.direction==="horiz"&&pe.fit!=="fit"?{height:O.scalingValue(ce,l)}:{},...F.direction==="vert"&&pe.fit!=="fit"?{width:O.scalingValue(ce,l)}:{},...pe.fit==="cover"?{width:O.scalingValue(ce,l),height:O.scalingValue(ce,l)}:{},...Ee(),transition:me?"all 0.25s ease-out":"none",opacity:me?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:he=>{var Q;he.stopPropagation(),C(X),(Q=$.current)==null||Q.go(X)},onMouseEnter:()=>{var he;pe.triggers==="hov"&&((he=$.current)==null||he.go(X))},children:a.jsx("img",{src:Se.image.url,alt:Se.image.name??"",onLoad:he=>{const Q=he.currentTarget;Q.naturalWidth&&Q.naturalHeight&&z(Ne=>({...Ne,[X]:{width:Q.naturalWidth,height:Q.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Se.image.name}-${X}`)})})})})()]})]}),document.getElementById(r))};function Cl({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 Ag={element:Mg,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 cr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Fg(e){return`
|
|
6
|
+
*/const Tm="RichTextRenderer-module__link___BWeZ2",Im={link:Tm},Rm=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))},po=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Rm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:po(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:D.scalingValue(e.letterSpacing,t),wordSpacing:D.scalingValue(e.wordSpacing,t),fontSize:D.scalingValue(n,t),lineHeight:i!==void 0?D.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:Im.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Lm(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 Lm(e){return{...e.fontFamily&&{fontFamily:po(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 Pm="SvgImage-module__svg___q3xE-",Em="SvgImage-module__img___VsTm-",xl={svg:Pm,img:Em},Mm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},km=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)}},[]),!Mm(e)||!r?a.jsx("img",{src:e,alt:"",className:pt(xl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:pt(xl.svg,i),style:{"--svg":km(e),"--fill":t,"--hover-fill":n,...o??{}}})},Am={"top-left":ut.topLeftAlignment,"top-center":ut.topCenterAlignment,"top-right":ut.topRightAlignment,"middle-left":ut.middleLeftAlignment,"middle-center":ut.middleCenterAlignment,"middle-right":ut.middleRightAlignment,"bottom-left":ut.bottomLeftAlignment,"bottom-center":ut.bottomCenterAlignment,"bottom-right":ut.bottomRightAlignment};function Fm({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:x,textAppearance:w,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[v,C]=s.useState(null),[y,S]=s.useState(0),[X,N]=s.useState(0),{direction:U,transition:W,controls:I,pagination:B,imageCaption:$,triggers:T}=e,k=s.useRef(W.type),{x:F,y:g}=e.controls.offset,H=P=>{o&&o.go(P)};return s.useEffect(()=>{if(!v)return;const P=new ResizeObserver(q=>{if(!o)return;const[ne]=q;f({width:Math.round(ne.contentRect.width),height:Math.round(ne.contentRect.height)})});return P.observe(v),()=>P.unobserve(v)},[v]),s.useEffect(()=>{!o||k.current===W.type||(N(P=>P+1),k.current=W.type)},[W.type]),a.jsx("div",{className:pt(ut.wrapper,{[ut.editor]:i}),ref:C,children:a.jsxs("div",{className:ut.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:W.backgroundColor&&W.type==="fade in"?W.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(ut.captionBlock),children:a.jsx("div",{className:ut.captionTextWrapper,children:t.map((P,q)=>a.jsx("div",{className:pt(ut.captionText,Am[$.alignment],{[ut.withPointerEvents]:q===y&&i,[ut.active]:q===y}),style:{fontFamily:po(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":D.scalingValue(l.width,i),letterSpacing:D.scalingValue(c,i),wordSpacing:D.scalingValue(p,i),textAlign:u,fontSize:D.scalingValue(x.fontSize,i),lineHeight:D.scalingValue(x.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:m,transitionDuration:W.duration?`${Math.round(parseInt(W.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ut.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:D.scalingValue($.offset.y,i),left:D.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:P.imageCaption})})},q))})}),a.jsx(zs,{onMove:P=>{S(P.index)},ref:r,options:{arrows:!1,speed:W.duration?parseInt(W.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:U==="horiz"||W.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:W.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((P,q)=>a.jsx(js,{children:a.jsx("div",{className:ut.sliderItem,children:a.jsx("div",{className:ut.imgWrapper,children:a.jsx("img",{className:pt(ut.sliderImage,{[ut.contain]:P.image.objectFit==="contain",[ut.cover]:P.image.objectFit==="cover"}),src:P.image.url,alt:P.image.name??""})})})},q))},X),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(ut.arrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{onClick:()=>{H("-1")},className:ut.arrowInner,style:{transform:`translate(${D.scalingValue(F,i)}, ${D.scalingValue(g*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:pt(ut.arrowImg,ut.mirror)}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg,ut.mirror)})]})}),a.jsx("div",{className:pt(ut.arrow,ut.nextArrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:ut.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${D.scalingValue(F*(U==="horiz"?-1:1),i)}, ${D.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ut.arrowImg}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:ut.clickOverlay,onClick:()=>{o&&o.go("+1")}}),B.isActive&&a.jsx("div",{className:pt(ut.pagination,{[ut.paginationInsideBottom]:B.position==="inside-1"&&U==="horiz",[ut.paginationInsideTop]:B.position==="inside-2"&&U==="horiz",[ut.paginationOutsideBottom]:B.position==="outside-1"&&U==="horiz",[ut.paginationOutsideTop]:B.position==="outside-2"&&U==="horiz",[ut.paginationInsideLeft]:B.position==="inside-1"&&U==="vert",[ut.paginationInsideRight]:B.position==="inside-2"&&U==="vert",[ut.paginationOutsideLeft]:B.position==="outside-1"&&U==="vert",[ut.paginationOutsideRight]:B.position==="outside-2"&&U==="vert",[ut.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ut.paginationInner,style:{backgroundColor:B.colors[2],transform:`scale(${B.scale/100}) translate(${D.scalingValue(B.offset.x,i)}, ${D.scalingValue(B.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((P,q)=>a.jsx("button",{onClick:()=>{o&&o.go(q)},className:pt(ut.paginationItem),children:a.jsx("div",{className:pt(ut.dot,{[ut.activeDot]:q===y}),style:{backgroundColor:q===y?B.colors[0]:B.colors[1],"--pagination-hover-color":B.hover}})},q))})})]})})}function vl({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 _m={element:Fm,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"]}},Nm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Wm="ImageRevealSlider-module__image___Qjt-e",Hm="ImageRevealSlider-module__link___N-iLG",Dm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:Nm,image:Wm,link:Hm,cursor:Dm};function bl(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 ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Om(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ba(e);r=l.height/l.width*o}else{const l=await ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Bm({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,x]=s.useState({x:0,y:0}),[w,m]=s.useState(1),[h,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:X,randomRangeImageWidth:N}=e.imageSize,{revealPosition:U,visible:W}=e.position,{cursorType:I,target:B,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:k,hoverCursor:F}=e.cursor;s.useEffect(()=>{if(!i)return;const P=(L,O)=>{const Z=i.getBoundingClientRect(),ue=L-Z.left,ae=O-Z.top;if(x({x:ue,y:ae}),I==="system"){f("none"),m(1);return}const A=ue,pe=ae,z=document.elementFromPoint(Z.left+A,Z.top+pe);if(z&&z.closest("a")){f("none"),m(1);return}const re=bl(A,pe,r)||B==="area"?{img:F??"none",scale:k}:{img:T??"none",scale:$};f(re.img),m(re.scale)},q=L=>{L.stopPropagation(),v.current={x:L.clientX,y:L.clientY},P(L.clientX,L.clientY)},ne=()=>{C&&P(v.current.x,v.current.y)};return i.addEventListener("mousemove",q),window.addEventListener("scroll",ne,!0),()=>{i.removeEventListener("mousemove",q),window.removeEventListener("scroll",ne,!0)}},[i,C,p,I,B,F,T,k,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(P,q,ne,L={})=>{const{width:O,height:Z,finalWidth:ue}=await Om(P.image.url,S,X,N);let ae=0,A=0;U==="same"?(ae=q/2,A=ne/2):(ae=L.x??Math.random()*q,A=L.y??Math.random()*ne);const pe=Math.min(Math.max(ae,O/2),q-O/2),z=Math.min(Math.max(A,Z/2),ne-Z/2);return{id:u.current++,url:P.image.url,link:P.link,name:P.image.name,x:pe,y:z,width:ue}};s.useEffect(()=>{if(!i||t.length===0)return;const P=i.getBoundingClientRect(),q=P.width,ne=P.height,L=[];(async()=>{const Z=t[0],ue=await g(Z,q,ne);L.push(ue),l(L),c(1)})()},[S,X,N,U,i]),s.useEffect(()=>{W==="last One"&&l(P=>P.length>0?[P[P.length-1]]:[])},[W]);const H=async P=>{if(!i)return;const q=i.getBoundingClientRect(),ne=P.clientX-q.left,L=P.clientY-q.top;if(B==="image"&&!bl(ne,L,r))return;let O=0,Z=0;U==="on Click"?(O=ne,Z=L):U==="same"?(O=q.width/2,Z=q.height/2):(O=Math.random()*q.width,Z=Math.random()*q.height);const ue=t[d],ae=await g(ue,q.width,q.height,{x:O,y:Z});l(A=>W==="all"?[...A,ae]:[ae]),c(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Mi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(P=>a.jsx("div",{className:Mi.wrapper,style:{top:`${P.y}px`,left:`${P.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:P.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:B==="area"&&P.link?a.jsx("a",{href:P.link,target:"_blank",className:Mi.link,children:a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)}):a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)},P.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 zm={element:Bm,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:""}]}}}},jm="LightBox-module__hidden___9s-9x",Vm="LightBox-module__heroImage___sTxNF",Gm="LightBox-module__background___rm9ml",Xm="LightBox-module__editor___4ACaY",Ym="LightBox-module__contentStyle___Bgnsq",qm="LightBox-module__imageStyle___tLIlB",Um="LightBox-module__imgWrapper___LuFUp",Km="LightBox-module__contain___8-yaS",Zm="LightBox-module__cover___hNvOG",Jm="LightBox-module__caption___b6L2I",Qm="LightBox-module__captionTextInner___rCGNH",eg="LightBox-module__lightboxSplide___XFuWC",tg="LightBox-module__arrow___iz38X",ng="LightBox-module__arrowVertical___Zfz81",ig="LightBox-module__nextArrow___zkAQN",og="LightBox-module__arrowInner___p48sW",rg="LightBox-module__arrowIcon___3VaFf",ag="LightBox-module__arrowImg___pNV88",sg="LightBox-module__mirror___pjeXc",lg="LightBox-module__thumbsWrapper___GB-nU",cg="LightBox-module__thumbsContainerVertical___wttk5",dg="LightBox-module__thumbsContainer___osSma",ug="LightBox-module__thumbsAlignStart___MO6tY",pg="LightBox-module__thumbsAlignCenter___Q4sUx",mg="LightBox-module__thumbsAlignEnd___p4y9R",gg="LightBox-module__thumbItem___HvnF3",hg="LightBox-module__closeButton___g2khP",fg="LightBox-module__fadeIn___0m5GW",yg="LightBox-module__slideInLeft___gPYwC",xg="LightBox-module__slideInRight___S-pPp",vg="LightBox-module__slideInTop___DFdAj",bg="LightBox-module__slideInBottom___m27kZ",wg="LightBox-module__fadeOut___55qBR",Sg="LightBox-module__slideOutLeft___NvU7P",Cg="LightBox-module__slideOutRight___SK7eC",$g="LightBox-module__slideOutTop___Vgg0z",Tg="LightBox-module__slideOutBottom___nJ0Ef",Ig="LightBox-module__scaleSlide___vZriG",Ke={hidden:jm,heroImage:Vm,background:Gm,editor:Xm,contentStyle:Ym,imageStyle:qm,imgWrapper:Um,contain:Km,cover:Zm,caption:Jm,captionTextInner:Qm,lightboxSplide:eg,arrow:tg,arrowVertical:ng,nextArrow:ig,arrowInner:og,arrowIcon:rg,arrowImg:ag,mirror:sg,thumbsWrapper:lg,thumbsContainerVertical:cg,thumbsContainer:dg,thumbsAlignStart:ug,thumbsAlignCenter:pg,thumbsAlignEnd:mg,thumbItem:gg,closeButton:hg,fadeIn:fg,slideInLeft:yg,slideInRight:xg,slideInTop:vg,slideInBottom:bg,fadeOut:wg,slideOutLeft:Sg,slideOutRight:Cg,slideOutTop:$g,slideOutBottom:Tg,scaleSlide:Ig},lr=(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% + ${D.scalingValue(t.x,n)}), calc(-50% + ${D.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${D.scalingValue(t.x,n)}, calc(-50% + ${D.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), ${D.scalingValue(t.y,n)})`:i.transform=`translate(${D.scalingValue(t.x,n)}, ${D.scalingValue(t.y,n)})`,i};function Td(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 Rg(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 Id(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 Lg(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 Rd(e,t,n,i,o){const{x:r,y:l}=Rg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Pg(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"?Lg:Id,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:w}=Rd(n,i,u,p,d),m=(x+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Eg(e){return Pg(e)}function Or(e){const t=e.getBoundingClientRect(),n=Td(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}=Id(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Rd(i,o,d,c,u),w=t.left+n.left,m=t.top+n.top;return{x:p+w,y:x+m,width:d,height:c}}function wl(e){const t=e.getBoundingClientRect(),n=Td(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Sl(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 Mg(e,t){const n=(()=>{if(e==="fade in")return Ke.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeIn;if(e==="slide in")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeOut;if(e==="slide in")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})(),r=(()=>{if(e==="fade in")return Ke.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const kg=({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:Ke.heroImage,onClick:()=>c(!0)}),a.jsx(Ag,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Ag=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var xe;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:w,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[v,C]=s.useState(0),[y,S]=s.useState(0),[X,N]=s.useState(!1),[U,W]=s.useState(!1),[I,B]=s.useState({}),$=s.useRef(null),T=s.useRef(null),k=s.useRef(null),F=s.useRef(!1),g=s.useRef(null),H=s.useRef(null),P=s.useRef(null),q=s.useRef(null),ne=s.useRef(!1),L=s.useRef(null),[O,Z]=s.useState(!1),{appear:ue,triggers:ae,slider:A,thumbnail:pe,controls:z,area:re,caption:te,layout:be}=o.lightboxBlock,{appearClass:Ae,backdropAppearClass:ve,backdropDisappearClass:b,disappearClass:M}=Mg(ue.type,ue.direction),E=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const J=()=>{setTimeout(()=>{var se,we;(we=(se=$.current)==null?void 0:se.splide)==null||we.refresh()},16)},Q=()=>{S(se=>se+1)};return window.addEventListener("ArticleEditor.Layout:change",J),window.addEventListener("ArticleEditor.ComponentContent:change",Q),()=>{window.removeEventListener("ArticleEditor.Layout:change",J),window.removeEventListener("ArticleEditor.ComponentContent:change",Q)}},[]),s.useEffect(()=>{if(!e||!pe.isActive){Z(!1);return}const J=L.current;if(!J)return;const Q=()=>{A.direction==="horiz"?Z(J.scrollWidth>J.clientWidth):Z(J.scrollHeight>J.clientHeight)};Q();const se=new ResizeObserver(Q);return se.observe(J),()=>se.disconnect()},[e,pe.isActive,n.length,I,A.direction]);const j=s.useCallback(()=>{const J=window.matchMedia("(max-width: 768px)").matches,Q=Sl(re.color);J&&!l&&Q>.9&&(document.body.style.backgroundColor=""),N(!0),F.current=!0;const se=we=>{we.target===g.current&&we.animationName&&(g.current&&H.current&&g.current.removeEventListener("animationend",H.current),H.current=null,F.current&&(F.current=!1,t()),N(!1))};g.current&&(H.current=se,g.current.addEventListener("animationend",se))},[t,re.color,l]),Ce=(J,Q,se)=>{var we,Ee;if(J){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&v===n.length-1?j():(we=$.current)==null||we.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const Te=J.getBoundingClientRect(),Y=Q-Te.left,de=se-Te.top,ce=Te.width,G=Te.height;let le;A.direction==="horiz"?le=Y<ce/2?"-1":"+1":le=de<G/2?"-1":"+1",(Ee=$.current)==null||Ee.go(le)}}},ee=J=>{if(ne.current){ne.current=!1;return}const Q=n[v],se=(Q==null?void 0:Q.image.objectFit)==="cover";let we,Ee;if("changedTouches"in J&&J.changedTouches.length>0)we=J.changedTouches[0].clientX,Ee=J.changedTouches[0].clientY;else if("clientX"in J)we=J.clientX,Ee=J.clientY;else return;let Te;if(se&&k.current){const Y=wl(k.current);Te=we>=Y.left&&we<=Y.right&&Ee>=Y.top&&Ee<=Y.bottom}else{const Y=k.current?Or(k.current):null;if(!Y){J.target===J.currentTarget&&j();return}Te=we>=Y.x&&we<=Y.x+Y.width&&Ee>=Y.y&&Ee<=Y.y+Y.height}Te?Ce(k.current,we,Ee):j()},Ie=J=>{const Q=J.target;(Q.classList.contains(Ke.thumbsWrapper)||Q.classList.contains(Ke.thumbsContainer))&&ee(J)};s.useEffect(()=>{if(!e)return;const J=Q=>{var se,we;if(Q.key==="Escape"){j();return}if(Q.key==="ArrowRight"){C(Ee=>(Ee+1)%Math.max(n.length,1)),(se=$.current)==null||se.go("+1");return}Q.key==="ArrowLeft"&&(C(Ee=>(Ee-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=$.current)==null||we.go("-1"))};return window.addEventListener("keydown",J),()=>{window.removeEventListener("keydown",J)}},[e,j,n.length]),s.useEffect(()=>{if(e){if(C(0),S(Q=>Q+1),F.current=!1,N(!1),W(!1),B({}),!E)return;const J=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(J)}return()=>{g.current&&H.current&&(g.current.removeEventListener("animationend",H.current),H.current=null),W(!1)}},[e,E]),s.useEffect(()=>{T.current!==null&&T.current!==A.type&&S(J=>J+1),T.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const J=document.body.style.overflow,Q=window.matchMedia("(max-width: 768px)").matches,se=Sl(re.color);document.body.style.overflow="hidden",W(!1);const we=Te=>{Te.target===g.current&&!F.current&&Te.animationName&&(Q&&!l&&se>.9&&(document.body.style.backgroundColor=re.color),W(!0),g.current&&P.current&&g.current.removeEventListener("animationend",P.current),P.current=null)};g.current&&(P.current=we,g.current.addEventListener("animationend",we));const Ee=Te=>{const Y=Te.target;Y&&(Y.closest(`.${Ke.thumbsWrapper}`)||Y.closest(`.${Ke.thumbsContainer}`))||A.type!=="slide"&&Te.preventDefault()};return document.addEventListener("touchmove",Ee,{passive:!1}),()=>{document.body.style.overflow=J,document.removeEventListener("touchmove",Ee),g.current&&P.current&&(g.current.removeEventListener("animationend",P.current),P.current=null),W(!1)}},[e,l,re.color,A.type]),s.useEffect(()=>{if(!e)return;const J=Q=>{var we,Ee;if(F.current){Q.stopPropagation();return}if(ne.current){ne.current=!1;return}const se=Q.target;if(!(se&&(se.closest(`.${Ke.thumbsContainer}`)||se.closest(`.${Ke.thumbItem}`)||se.closest(`.${Ke.arrow}`)||se.closest(`.${Ke.closeButton}`)||se.closest(`.${Ke.caption}`)))){if(A.type==="slide"&&ae.type==="drag"&&((Ee=(we=$.current)==null?void 0:we.splide)!=null&&Ee.root)){const Te=$.current.splide.root;if(se&&(Te.contains(se)||Te===se))return}if(Q.touches.length===0&&Q.changedTouches.length>0){const Te=n[v],Y=(Te==null?void 0:Te.image.objectFit)==="cover",de=Q.changedTouches[0];let ce;if(Y&&k.current){const G=wl(k.current);ce=de.clientX>=G.left&&de.clientX<=G.right&&de.clientY>=G.top&&de.clientY<=G.bottom}else{const G=k.current?Or(k.current):null;if(!G)return;ce=de.clientX>=G.x&&de.clientX<=G.x+G.width&&de.clientY>=G.y&&de.clientY<=G.y+G.height}if(!ce){Q.stopPropagation(),F.current=!0;const G=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",G,!0)};document.addEventListener("click",G,!0),j()}}}};return document.addEventListener("touchend",J,{passive:!0}),()=>{document.removeEventListener("touchend",J)}},[e,j,v,n]);const oe=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&ae.type==="drag";s.useEffect(()=>{var le,Me;if(!e||!oe||!((Me=(le=$.current)==null?void 0:le.splide)!=null&&Me.root))return;const J=$.current.splide.root,Q=30,se=(fe,K)=>{if(q.current){const Xe=Math.abs(fe-q.current.x),Le=Math.abs(K-q.current.y);(Xe>0||Le>0)&&(ne.current=!0)}},we=fe=>{q.current&&(fe.preventDefault(),se(fe.clientX,fe.clientY))},Ee=fe=>{q.current&&fe.touches.length>0&&(fe.preventDefault(),se(fe.touches[0].clientX,fe.touches[0].clientY))},Te=(fe,K)=>{if(!q.current||!$.current){q.current=null;return}const Xe=Math.abs(fe-q.current.x),Le=Math.abs(K-q.current.y);Le>Q&&Le>Xe&&$.current.go(K<q.current.y?"+1":"-1"),q.current=null},Y=fe=>{q.current&&Te(fe.clientX,fe.clientY),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("pointermove",we)},de=fe=>{if(q.current){if(fe.changedTouches.length>0){const K=fe.changedTouches[0];Te(K.clientX,K.clientY)}document.removeEventListener("touchend",de),document.removeEventListener("touchcancel",de),document.removeEventListener("touchmove",Ee)}},ce=fe=>{q.current={x:fe.clientX,y:fe.clientY},ne.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",Y),document.addEventListener("pointercancel",Y)},G=fe=>{fe.touches.length>0&&(q.current={x:fe.touches[0].clientX,y:fe.touches[0].clientY},ne.current=!1,document.addEventListener("touchmove",Ee,{passive:!1}),document.addEventListener("touchend",de),document.addEventListener("touchcancel",de))};return J.addEventListener("pointerdown",ce),J.addEventListener("touchstart",G),()=>{J.removeEventListener("pointerdown",ce),J.removeEventListener("touchstart",G),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("touchmove",Ee),document.removeEventListener("touchend",de),document.removeEventListener("touchcancel",de),q.current=null,ne.current=!1}},[e,oe,y]);const me={backgroundColor:re.color,backdropFilter:`blur(${re.blur}px)`,animationDuration:`${parseInt(ue.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(Ke.background,X?b:ve,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{...me,...U&&!l&&!X?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Ke.contentStyle,X?M:Ae,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{animationDuration:`${parseInt(ue.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(zs,{onMove:J=>C(J.index),ref:$,className:Ke.lightboxSplide,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,direction:A.direction==="horiz"||A.type==="fade"||A.type==="scale"?"ltr":"ttb",pagination:!1,drag:ae.type==="drag"&&!oe,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((J,Q)=>{const se=lr(be.position,be.offset,l),we=`${D.scalingValue(be.padding.top,l)} ${D.scalingValue(be.padding.right,l)} ${D.scalingValue(be.padding.bottom,l)} ${D.scalingValue(be.padding.left,l)}`,Ee=A.type==="scale"?(()=>{const{transform:Te,...Y}=se;return{...Y,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Te||"none"}})():{...se,position:"absolute",padding:we,boxSizing:"border-box"};return a.jsx(js,{children:a.jsx("div",{className:Ke.imgWrapper,onClick:ee,children:a.jsx("img",{ref:Q===v?k:null,className:pt(Ke.imageStyle,{[Ke.contain]:J.image.objectFit==="contain",[Ke.cover]:J.image.objectFit==="cover",[Ke.scaleSlide]:A.type==="scale"}),src:J.image.url,alt:J.image.name??"",style:{...Ee,pointerEvents:J.image.objectFit==="contain"?"none":"auto"}})})},Q)})},y),z.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Ke.arrow,{[Ke.arrowVertical]:A.direction==="vert"}),style:{color:z.color,"--arrow-hover-color":z.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${D.scalingValue(z.offset.x,l)}, ${D.scalingValue(z.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${z.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var J;return(J=$.current)==null?void 0:J.go("-1")},"aria-label":"Previous",children:[z.arrowsImgUrl&&a.jsx(sn,{url:z.arrowsImgUrl,fill:z.color,hoverFill:z.hover,className:pt(Ke.arrowImg,Ke.mirror)}),!z.arrowsImgUrl&&a.jsx(Cl,{color:z.color,className:pt(Ke.arrowIcon,Ke.arrowImg,Ke.mirror)})]})}),a.jsx("div",{className:pt(Ke.arrow,Ke.nextArrow,{[Ke.arrowVertical]:A.direction==="vert"}),style:{color:z.color,"--arrow-hover-color":z.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${D.scalingValue(z.offset.x*(A.direction==="horiz"?-1:1),l)}, ${D.scalingValue(z.offset.y,l)}) scale(${z.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var J;return(J=$.current)==null?void 0:J.go("+1")},"aria-label":"Next",children:[z.arrowsImgUrl&&a.jsx(sn,{url:z.arrowsImgUrl,fill:z.color,hoverFill:z.hover,className:Ke.arrowImg}),!z.arrowsImgUrl&&a.jsx(Cl,{color:z.color,className:pt(Ke.arrowIcon,Ke.arrowImg)})]})})]}),re.closeIconUrl&&(()=>{const J=lr(re.closeIconAlign,re.closeIconOffset,l),Q=`scale(${re.closeIconScale})`,se=J.transform?`${J.transform} ${Q}`:Q;return a.jsx("button",{className:Ke.closeButton,style:{...J,transform:se},onClick:j,"aria-label":"Close lightbox",children:a.jsx(sn,{url:re.closeIconUrl,fill:re.closeIconColor??"#000000",hoverFill:re.closeIconHover??"#cccccc"})})})(),te&&te.isActive&&i.imageCaption&&((xe=n[v])==null?void 0:xe.imageCaption)&&a.jsx("div",{className:Ke.caption,style:{...lr(te.alignment,te.offset,l),fontFamily:po(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":D.scalingValue(c.width,l),letterSpacing:D.scalingValue(p,l),wordSpacing:D.scalingValue(w,l),textAlign:x,fontSize:D.scalingValue(m.fontSize,l),lineHeight:D.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:J=>J.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ke.captionTextInner,style:{"--link-color":te.linkColor,"--link-hover-color":te.linkHoverColor},children:a.jsx(Ri,{content:n[v].imageCaption})})}),pe.isActive&&(()=>{const[J,Q]=pe.position.split("-"),se=A.direction==="horiz"?`${J}-left`:pe.position,we=lr(se,pe.offset,l),Ee=()=>{if(A.direction==="horiz"){if(Q==="left")return"flex-start";if(Q==="center")return"center";if(Q==="right")return"flex-end"}else{if(J==="top")return"flex-start";if(J==="middle")return"center";if(J==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Ke.thumbsWrapper,onClick:Te=>Ie(Te),style:{position:l?"absolute":"fixed",...we,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Ke.thumbsContainer,{[Ke.thumbsContainerVertical]:A.direction==="vert",[Ke.thumbsAlignStart]:pe.align==="start",[Ke.thumbsAlignCenter]:pe.align==="center",[Ke.thumbsAlignEnd]:pe.align==="end"}),style:{gap:D.scalingValue(pe.grid.gap,l),justifyContent:O?"flex-start":Ee()},children:n.map((Te,Y)=>{const de=Y===v,ce=I[Y],le=pe.grid.size*(de?pe.activeState.scale:1),Me=()=>{if(pe.fit!=="fit")return{};if(!ce)return A.direction==="horiz"?{height:D.scalingValue(le,l)}:{width:D.scalingValue(le,l)};const fe=ce.width/ce.height;if(A.direction==="horiz"){const K=le,Xe=K*fe;return{width:D.scalingValue(Xe,l),height:D.scalingValue(K,l)}}else{const K=le,Xe=K/fe;return{width:D.scalingValue(K,l),height:D.scalingValue(Xe,l)}}};return a.jsx("button",{className:Ke.thumbItem,style:{...A.direction==="horiz"&&pe.fit!=="fit"?{height:D.scalingValue(le,l)}:{},...A.direction==="vert"&&pe.fit!=="fit"?{width:D.scalingValue(le,l)}:{},...pe.fit==="cover"?{width:D.scalingValue(le,l),height:D.scalingValue(le,l)}:{},...Me(),transition:de?"all 0.25s ease-out":"none",opacity:de?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:fe=>{var K;fe.stopPropagation(),C(Y),(K=$.current)==null||K.go(Y)},onMouseEnter:()=>{var fe;pe.triggers==="hov"&&((fe=$.current)==null||fe.go(Y))},children:a.jsx("img",{src:Te.image.url,alt:Te.image.name??"",onLoad:fe=>{const K=fe.currentTarget;K.naturalWidth&&K.naturalHeight&&B(Xe=>({...Xe,[Y]:{width:K.naturalWidth,height:K.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Te.image.name}-${Y}`)})})})})()]})]}),document.getElementById(r))};function Cl({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 Fg={element:kg,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 cr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _g(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
|
|
158
|
+
`}function Ng({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=D.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:x=[],buttonLabel:w,gap:m,fieldsGap:h,buttonCorners:f,buttonStroke:v,buttonPadding:C,isButtonFullWidth:y,inputCorners:S,inputStroke:X,inputPadding:N,inputColor:U,inputTextColor:W,inputBorderColor:I,placeholderColor:B,buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:F,successColor:g,errorColor:H,fontFamily:P,inputFontSettings:q,inputFontSize:ne,inputLineHeight:L,inputLetterSpacing:O,inputWordSpacing:Z,inputTextAppearance:ue,buttonFontSettings:ae,buttonFontSize:A,buttonLineHeight:pe,buttonLetterSpacing:z,buttonWordSpacing:re,buttonTextAppearance:te,labelFontSettings:be,labelFontSize:Ae,labelLineHeight:ve,labelLetterSpacing:b,labelWordSpacing:M,labelTextAppearance:E,statusFontSettings:j,statusFontSize:Ce,statusLineHeight:ee,statusLetterSpacing:Ie,statusWordSpacing:oe,statusTextAppearance:me,successMessage:xe,errorMessage:J,stateOverrides:Q}=e,se=u==="B",we=x.slice(0,Math.min(p,x.length)),Ee={fontSettings:{fontFamily:P,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:L,letterSpacing:O??0,wordSpacing:Z??0,textAppearance:ue,color:W},Te=an(qt(Ee,t)),Y=D.scalingValue(X??0,t),de=D.scalingValue((L??ne??.01)+((N==null?void 0:N.top)??0)+((N==null?void 0:N.bottom)??0)+(u==="C"?X??0:(X??0)*2),t),ce={...Te,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Y,borderLeftWidth:0}:{borderWidth:Y},paddingTop:D.scalingValue((N==null?void 0:N.top)??0,t),paddingRight:D.scalingValue((N==null?void 0:N.right)??0,t),paddingBottom:D.scalingValue((N==null?void 0:N.bottom)??0,t),paddingLeft:D.scalingValue((N==null?void 0:N.left)??0,t),height:de,minHeight:de},G={fontSettings:{fontFamily:P,fontWeight:(ae==null?void 0:ae.fontWeight)??400,fontStyle:(ae==null?void 0:ae.fontStyle)??"normal"},fontSize:A??.01,lineHeight:pe,letterSpacing:z??0,wordSpacing:re??0,textAppearance:te,color:T},le=an(qt(G,t)),Me=D.scalingValue(v??0,t),fe={fontSettings:{fontFamily:P,fontWeight:(be==null?void 0:be.fontWeight)??400,fontStyle:(be==null?void 0:be.fontStyle)??"normal"},fontSize:Ae??.01,lineHeight:ve,letterSpacing:b??0,wordSpacing:M??0,textAppearance:E,color:F},K=qt(fe,t),Xe={fontSettings:{fontFamily:P,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:Ce??.01,lineHeight:ee,letterSpacing:Ie??0,wordSpacing:oe??0,textAppearance:me,color:g},Le=an(qt(Xe,t)),Ze=D.buildColorVars(c,{inputColor:U,inputTextColor:W,inputBorderColor:I,placeholderColor:B!=null&&B.trim()?B:"#cccccc",buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:F,successColor:g,errorColor:H},Wg,Hg,Q),[Qe,ct]=s.useState(()=>Object.fromEntries(we.map(_e=>[_e.name,""]))),[nt,Ve]=s.useState("idle"),[$e,He]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":nt,Ue=r==="error"?J:$e,he=r==="filled",V=s.useMemo(()=>{if(!he)return Qe;let _e=null;for(const qe of we)(Qe[qe.name]??"").trim().length>0||(_e=_e??{...Qe},_e[qe.name]="Filled");return _e??Qe},[Qe,he,we]),ye=Be==="error"?D.getFormFieldValidationError(we,V):null,ze=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),We=o==null?void 0:o.submitUrl,et=(_e,qe)=>{ct(De=>({...De,[_e]:qe}))},Je=async _e=>{if(_e.preventDefault(),!d)return;const qe=Object.fromEntries(we.map(it=>{var at;return[it.name,((at=Qe[it.name])==null?void 0:at.trim())??""]}).filter(([,it])=>it));if(!We){Ve("error"),He("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const De=D.getFormFieldValidationError(we,Qe);if(De){Ve("error"),He(De);return}Ve("submitting"),He(null);try{const it=await fetch(We,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!it.ok){const at=await it.text();throw new Error(at||`Request failed: ${it.status}`)}Ve("success"),ct(Object.fromEntries(we.map(at=>[at.name,""])))}catch(it){Ve("error"),He(it instanceof Error?it.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ze}`.trim(),style:Ze,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_g(c)}}),a.jsxs("form",{onSubmit:Je,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:we.map((_e,qe)=>a.jsxs(s.Fragment,{children:[qe>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${se?` ${c}-labeled`:""}`,children:[se&&a.jsx("span",{className:`${c}-field-label`,style:K?{...K,lineHeight:K.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?a.jsx("textarea",{name:_e.name,autoComplete:"off",value:V[_e.name]??"",onChange:De=>et(_e.name,De.target.value),placeholder:_e.placeholder,className:`${c}-input`,style:ce,rows:1,"data-filled":he||(V[_e.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:_e.type==="phone"?"tel":_e.type==="email"?"email":"text",name:_e.name,autoComplete:"off",value:V[_e.name]??"",onChange:De=>et(_e.name,De.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${c}-input`,style:ce,"data-filled":he||(V[_e.name]??"").trim().length>0})]})]},qe))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:D.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:D.scalingValue(f??0,t),borderWidth:Me,paddingTop:D.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:D.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:D.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:D.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...le,...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:nt==="submitting"?"...":w})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Le},children:xe}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Le},role:"alert",children:ye??Ue??J})]})}const Wg={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"},Hg=["hover","focus","filled","success","error"],Dg=`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';
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,Dg=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Og=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Bg={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...dr.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...dr.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...dr.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...dr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:Dg,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Og],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},zg={element:_g,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:Bg,sourceCode:Hg,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function ur(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function jg(e){return`
|
|
792
|
+
`,Og=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bg=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],zg={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...dr.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...dr.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...dr.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...dr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:Og,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Bg],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},jg={element:Ng,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:zg,sourceCode:Dg,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function ur(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Vg(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -982,7 +982,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
982
982
|
font-size: ${ur(14)};
|
|
983
983
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
984
984
|
}
|
|
985
|
-
`}const
|
|
985
|
+
`}const Gg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=D.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:w,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:v,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:S,buttonLineHeight:X,buttonLetterSpacing:N,buttonWordSpacing:U,buttonTextAppearance:W,statusFontSettings:I,statusFontSize:B,statusLineHeight:$,statusLetterSpacing:T,statusWordSpacing:k,statusTextAppearance:F,iconMaxWidth:g,minHeight:H,corners:P,stroke:q,stateOverrides:ne,inputPadding:L,buttonPadding:O,successMessage:Z="Thanks for subscribing!",errorMessage:ue="Please, fill all required fields."}=e,ae=d.slice(0,Math.min(p,d.length)),[A,pe]=s.useState(()=>Object.fromEntries(ae.map(fe=>[fe.name,""]))),[z,re]=s.useState("idle"),[te,be]=s.useState(null),Ae=o==="success"?"success":o==="error"?"error":z,ve=o==="error"?ue:te,b=o==="filled",M=s.useMemo(()=>{if(!b)return A;let fe=null;for(const K of ae)(A[K.name]??"").trim().length>0||(fe=fe??{...A},fe[K.name]="Filled");return fe??A},[b,A,ae]),E=Ae==="error"?D.getFormFieldValidationError(ae,M):null,j=o&&o!=="default"?`${r}-state-${o}`:"",Ce=ae.some(fe=>(M[fe.name]??"").trim().length>0),ee=j!==`${r}-state-filled`&&Ce?`${r}-state-filled`:"",Ie=`${j} ${ee}`.trim(),oe=i==null?void 0:i.submitUrl,me=u??"",xe=(c==null?void 0:c.icon)??"",J=(c==null?void 0:c.mode)==="On",Q=me||"Submit",se={fontSettings:{fontFamily:x,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:v??0,textAppearance:C,color:e.inputTextColor??"#111111"},we={fontSettings:{fontFamily:x,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:S??.01,lineHeight:X,letterSpacing:N??0,wordSpacing:U??0,textAppearance:W,color:e.buttonTextColor??"#ffffff"},Ee={fontSettings:{fontFamily:x,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:B??.01,lineHeight:$,letterSpacing:T??0,wordSpacing:k??0,textAppearance:F,color:e.successColor??"#22c55e"},Te=an(qt(se,t)),Y=an(qt(we,t)),de=an(qt(Ee,t)),ce=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(se==null?void 0:se.color)??"#111111",buttonTextColor:e.buttonTextColor??(we==null?void 0:we.color)??"#ffffff"},Xg,Yg,ne),G={borderRadius:D.scalingValue(P,t),borderWidth:D.scalingValue(q,t),borderStyle:"solid"},le={borderLeftWidth:D.scalingValue(q,t)},Me=async fe=>{if(fe.preventDefault(),!l)return;const K=Object.fromEntries(ae.map(Le=>{var Ze;return[Le.name,((Ze=A[Le.name])==null?void 0:Ze.trim())??""]}).filter(([,Le])=>Le));if(!oe){re("error"),be("No integrations were found for this form.");return}if(Object.keys(K).length===0)return;const Xe=D.getFormFieldValidationError(ae,A);if(Xe){re("error"),be(Xe);return}re("submitting"),be(null);try{const Le=await fetch(oe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)});if(!Le.ok){const Ze=await Le.text();throw new Error(Ze||`Request failed: ${Le.status}`)}re("success"),pe(Object.fromEntries(ae.map(Ze=>[Ze.name,""])))}catch(Le){re("error"),be(Le instanceof Error?Le.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Ie}`.trim(),style:ce,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Vg(r)}}),a.jsxs("form",{onSubmit:Me,className:`${r}-form`,style:{...G,height:D.scalingValue(H,t),minHeight:D.scalingValue(H,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ae.map(fe=>a.jsx("input",{type:fe.type==="email"?"email":fe.type==="phone"?"tel":"text",name:fe.name,autoComplete:"off",value:M[fe.name]??"",onChange:K=>pe(Xe=>({...Xe,[fe.name]:K.target.value})),placeholder:fe.placeholder,required:fe.isRequired??fe.type==="email",className:`${r}-input`,style:{...Te,paddingRight:D.scalingValue(L.right,t),paddingLeft:D.scalingValue(L.left,t),paddingTop:D.scalingValue(L.top,t),paddingBottom:D.scalingValue(L.bottom,t)}},fe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":Q,style:{...Y,...le,paddingRight:D.scalingValue(O.right,t),paddingLeft:D.scalingValue(O.left,t),paddingTop:D.scalingValue(O.top,t),paddingBottom:D.scalingValue(O.bottom,t),pointerEvents:l?"auto":void 0},children:z==="submitting"?"...":J?xe&&a.jsx(sn,{url:xe,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(g??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):me})})]}),Ae==="success"&&a.jsx("p",{className:`${r}-success`,style:{...de},children:Z}),Ae==="error"&&a.jsx("p",{className:`${r}-error`,style:{...de},role:"alert",children:E??ve??ue})]})},Xg={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"},Yg=["hover","focus","filled","success","error"],qg=`import React, { useMemo, useState } from 'react';
|
|
986
986
|
import { CommonComponentProps } from '../props';
|
|
987
987
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
988
988
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1561,7 +1561,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1561
1561
|
};
|
|
1562
1562
|
|
|
1563
1563
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1564
|
-
`,qg="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Ug=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],wa={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Kg=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Zg={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...wa.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...wa.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...wa.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Ug,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:qg},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Kg],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Jg={element:Vg,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Zg,sourceCode:Yg};function Qg(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1564
|
+
`,Ug="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Kg=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],wa={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Zg=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Jg={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...wa.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...wa.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...wa.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Kg,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Ug},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Zg],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Qg={element:Gg,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Jg,sourceCode:qg};function eh(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1565
1565
|
.${e}-marquee-wrapper {
|
|
1566
1566
|
overflow: hidden;
|
|
1567
1567
|
width: 100%;
|
|
@@ -1693,7 +1693,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1693
1693
|
.${e}-image-hover-grayscale:hover video {
|
|
1694
1694
|
filter: grayscale(100%);
|
|
1695
1695
|
}
|
|
1696
|
-
`}const
|
|
1696
|
+
`}const th=30,nh=20,Sa=3,ih=12,oh=32,rh=3,ah=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")},sh=(e,t)=>Array.from({length:t},()=>e).flat(),lh=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},Ld=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),$l=(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=Ld(d);return c<=0?0:c+r*Math.max(0,t-1)},ch=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Ld(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},dh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},uh=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>dh(i,e))},ph=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??"")},mh=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,gh=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,F,g,H;const p=s.useRef(null),x=!!((k=e.image)!=null&&k.url&&ph(e.image));s.useLayoutEffect(()=>{d&&mh(p.current)&&(u==null||u())},[d,(F=e.image)==null?void 0:F.url,u]);const w=n.display==="cover",m=n.ratioValue??"1:1",h=n.reversed??!1,[f,v]=m.split(":").map(Number),S=(h?v:f)/(h?f:v),X=i/S,N=X>o?o:X,U=X>o?o*S:i,W=c(U),I=c(N),B={borderRadius:c(r)},$=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...B}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...B},T=((g=e.image)==null?void 0:g.url)&&(x?a.jsx("video",{ref:P=>{p.current=P},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:P=>{p.current=P},src:e.image.url,alt:((H=e.image)==null?void 0:H.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:W}:{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:W,height:I,overflow:"hidden",...B}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:T&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:pt(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:T}):T})})},hh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>eh(r,c),[r,c]),{speed:p,direction:x,pauseOnHover:w,gap:m,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:v,cornerRadius:C=0}=e,y=s.useMemo(()=>lh(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,X=!!o,N=!n||!!i,U=N&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,W=n?!!i:!0,B=((t==null?void 0:t.length)??0)>0&&(W||!!n),$=Math.max(0,p)*th,T=ee=>D.scalingValue(ee,n??!1),k=s.useRef(null),F=s.useRef(null),g=s.useRef(null),[H,P]=s.useState(0),q=W&&w==="on",[ne,L]=s.useState(!1),[O,Z]=s.useState({}),ue=s.useRef(O);ue.current=O;const ae=s.useRef(null),A=s.useRef(0),pe=s.useRef(null),z=s.useMemo(()=>(t??[]).map(ee=>{var Ie;return((Ie=ee.image)==null?void 0:Ie.url)??""}).join("\0"),[t]),[re,te]=s.useState(Sa),be=s.useMemo(()=>{const ee=t??[];return ee.length===0||!(W||!!n)?ee:sh(ee,re)},[t,W,re,n]),Ae=s.useMemo(()=>(t??[]).filter(ee=>{var Ie;return!!((Ie=ee.image)!=null&&Ie.url)}).length,[t]),ve=B?rh:1;s.useLayoutEffect(()=>{A.current=0,Z({}),ae.current=null,te(Sa),d(0)},[z]),s.useEffect(()=>{if(!N||v!=="randomize")return;const ee=k.current;if(!ee)return;const Ie=J=>{Z(Q=>{const se=Array.from(J).filter(Ee=>Ee in Q&&!uh(ee,Ee));if(se.length===0)return Q;const we={...Q};return se.forEach(Ee=>{delete we[Ee]}),we})},oe=new IntersectionObserver(J=>{const Q=new Set;for(const se of J){const we=se.target.dataset.marqueeItemIndex,Ee=we!==void 0?Number(we):NaN;Number.isNaN(Ee)||Q.add(Ee)}Q.size>0&&Ie(Q)},{root:ee,threshold:0});Object.keys(O).forEach(J=>{const Q=Number(J);ee.querySelectorAll(`[data-marquee-item-index="${Q}"]`).forEach(se=>oe.observe(se))});const me={current:0},xe=()=>{const J=Object.keys(ue.current);J.length!==0&&(Ie(J.map(Number)),me.current=requestAnimationFrame(xe))};return Object.keys(ue.current).length>0&&(me.current=requestAnimationFrame(xe)),()=>{cancelAnimationFrame(me.current),oe.disconnect()}},[v,O,N]),s.useLayoutEffect(()=>{if(!B)return;const ee=k.current,Ie=g.current;if(!ee||!Ie)return;const oe={current:0},me=()=>{const Q=ee.getBoundingClientRect().width||ee.offsetWidth,se=ch(Ie),we=ae.current,Ee=typeof we=="number"&&Math.abs(we-se)<=.25;ae.current=se;let Te=re,Y=0;if((W||n)&&S>0&&Q>0){const G=$l(Ie,S);if(G>=oh){Y=G;const le=Math.min(ih,Math.max(Sa,Math.ceil(Q/G)+1));Te=le,le!==re&&te(le)}}const ce=Te!==re&&Y>0?Y*Te:se>0?se:Y>0?Y*Te:(()=>{const G=$l(Ie,S);return G>0?G*Te:0})();ce>0?d(G=>G<=0?ce:!Ee||Math.round(G)===Math.round(ce)?G:ce):!Ee&&l<=0&&(cancelAnimationFrame(oe.current),oe.current=requestAnimationFrame(me))},xe=()=>{cancelAnimationFrame(oe.current),oe.current=requestAnimationFrame(me)};pe.current=xe,xe();const J=new ResizeObserver(xe);return J.observe(ee),J.observe(Ie),()=>{pe.current=null,cancelAnimationFrame(oe.current),J.disconnect()}},[W,B,l,z,re,S,n]),s.useLayoutEffect(()=>{if(!B||c<=0)return;const ee=F.current;ee&&ah(ee)},[B,c,x,$]),s.useLayoutEffect(()=>{if(!B||l<=0){P(0);return}const ee=F.current,Ie=g.current;if(!ee||!Ie)return;const oe=()=>{const xe=ee.offsetHeight||ee.getBoundingClientRect().height,J=Array.from(Ie.children).reduce((se,we)=>Math.max(se,we.offsetHeight||we.getBoundingClientRect().height),0),Q=xe>0?xe:J;P(Q>0?Q:0)};oe();const me=new ResizeObserver(oe);return me.observe(ee),me.observe(Ie),()=>me.disconnect()},[B,ve,be,n,m,h,f,l,y,O]),s.useLayoutEffect(()=>{if(!n||!X||!B||typeof window>"u")return;const ee=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(ee)},[n,X,B,x,l,H,m,be]);const b=()=>{q&&L(!0)},M=()=>{q&&L(!1)},E=s.useCallback(()=>{var ee;A.current=Math.min(Ae,A.current+1),(ee=pe.current)==null||ee.call(pe)},[Ae]),j=s.useCallback((ee,Ie)=>{Z(oe=>{const me=oe[ee]??Ie,xe=(t??[]).filter(Q=>Q!==me);if(xe.length===0)return oe;const J=xe[Math.floor(Math.random()*xe.length)];return{...oe,[ee]:J}})},[t]),Ce=(ee,Ie,oe,me)=>{const xe=N&&v==="randomize"&&y.display==="cover"?O[oe]??ee:ee,J=`max(${T(m)}, ${nh}px)`,Q=`calc(-0.5 * (${J} + ${T(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":oe,onMouseEnter:N&&v==="randomize"&&y.display==="cover"?()=>j(oe,ee):void 0,children:[a.jsx(gh,{item:xe,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:C,imageHoverClass:U,isEditor:n,isFirstSet:me,scaled:T,onFirstSetImageDone:E}),X&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:Q,width:J,height:"100%"}})]},`${Ie}-${oe}`)};if(B){const ee=W?q&&ne?"paused":"running":"paused",Ie=c>0&&$>0?c/$*1e3:0,oe=`${Math.max(0,Ie)/1e3}s`;return a.jsxs("div",{ref:k,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:H>0?{height:H}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:F,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:b,onMouseLeave:M,style:{WebkitAnimationDuration:oe,animationDuration:oe,WebkitAnimationPlayState:ee,animationPlayState:ee},children:Array.from({length:ve},(me,xe)=>a.jsx("div",{ref:xe===0?g:void 0,className:pt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:T(m),paddingRight:T(m)},"aria-hidden":xe>0,children:be.map((J,Q)=>Ce(J,xe,Q,xe===0&&Q<S))},`set-${xe}`))})]})}return a.jsxs("div",{ref:k,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:pt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:T(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((ee,Ie)=>Ce(ee,0,Ie))},"marquee-static")]})},fh=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1697
1697
|
import cn from 'classnames';
|
|
1698
1698
|
import { CommonComponentProps } from '../props';
|
|
1699
1699
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2476,7 +2476,7 @@ type MarqueeProps = {
|
|
|
2476
2476
|
isPreviewMode?: boolean;
|
|
2477
2477
|
isEditMode?: boolean;
|
|
2478
2478
|
} & CommonComponentProps;
|
|
2479
|
-
`,
|
|
2479
|
+
`,yh={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{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",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},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"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},xh={element:hh,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:yh,sourceCode:fh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function vh(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
|
|
2480
2480
|
.${e}-item-image-wrap {
|
|
2481
2481
|
display: flex;
|
|
2482
2482
|
flex: 0 0 auto;
|
|
@@ -2605,7 +2605,7 @@ ${o}
|
|
|
2605
2605
|
left: -9999px;
|
|
2606
2606
|
top: 0;
|
|
2607
2607
|
}
|
|
2608
|
-
`}const vh=30,Ca=3,bh=12,wh=3,rs=.72,Sh=100,Ch=10,$h=e=>Math.max(0,e)/Sh,Th=e=>Math.max(0,e)/Ch,Ih=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")},Rh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Lh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Ph=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Eh=e=>{e.style.transform=""},Mh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},kh=(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)},Ah=96,Fh=(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 x=p*c,w=x+c;o[p+1]=w,r[p+1]=r[p]+(d(x)+d(w))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},_h=(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),x=l[p]-l[u],w=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*w)},Nh=(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,x)=>{const w=x/c*e,m=(x+1)/c*e,h=m-w,f=l(w),v=l(m),C=w+h/3,y=f+d(w)*h/3,S=m-h/3,G=v-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${G.toFixed(2)} ${m.toFixed(2)} ${v.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Wh=({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:`${rs}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),x=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,x]});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})},Hh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=O.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:w,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:v,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:G,textTextAppearance:W,textColor:U,backgroundColor:H,ribbonWidth:I}=e,z=I??y,$=w==="curve",T=$h(m),k=Th(h),_=s.useMemo(()=>xh(o,d,$),[o,d,$]),g=s.useMemo(()=>qt({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:S,wordSpacing:G,fontSize:C,lineHeight:y,textAppearance:W,color:U},n),[f,v,S,G,C,y,W,U,n]),D=A=>O.scalingValue(A,n??!1),P=((t==null?void 0:t.length)??0)>0,q=n?!!i:!0,ie=P&&(q||!!n),L=Math.max(0,c)*vh,B=q&&p==="on",[K,ue]=s.useState(!1),le=q?B&&K?"paused":"running":"paused",F=le==="running"&&L>0&&d>0,pe=s.useRef(null),j=s.useRef(null),se=s.useRef(null),ne=s.useRef(null),ve=s.useRef(null),ke=s.useRef(null),xe=s.useRef(F),b=s.useRef(null);xe.current=F;const[M,E]=s.useState(0),[V,Ce]=s.useState(0),[te,$e]=s.useState(0),[ae,ge]=s.useState(0),[ye,Z]=s.useState(0),J=s.useMemo(()=>(t??[]).map(A=>{var ee;return`${A.text}\0${((ee=A.image)==null?void 0:ee.url)??""}`}).join("\0"),[t]),[de,be]=s.useState(Ca),Pe=s.useMemo(()=>{const A=t??[];return A.length===0||!(q||n)?A:Rh(A,de)},[t,q,de,n]),Se=ie?wh:1;s.useLayoutEffect(()=>{be(Ca),l(0)},[J]),s.useLayoutEffect(()=>{var Be;const A=ke.current;if(!A)return;const ee=()=>{const Ve=getComputedStyle(A),rt=parseFloat(Ve.fontSize)||0;if(rt<=0)return;const Ze=Lh();if(!Ze){E(rt*rs),Ce(0);return}Ze.font=`${Ve.fontStyle} ${Ve.fontWeight} ${rt}px ${Ve.fontFamily}`;const _e=Ze.measureText("H"),qe=_e.actualBoundingBoxAscent>0?_e.actualBoundingBoxAscent:rt*rs,Oe=Math.max(0,_e.actualBoundingBoxDescent||0),nt=_e.fontBoundingBoxAscent||0,at=_e.fontBoundingBoxDescent||0;E(St=>Math.abs(St-qe)>.5?qe:St);const st=nt>0||at>0?(at-Oe-(nt-qe))/2:0;Ce(St=>Math.abs(St-st)>.25?st:St)};ee();const Te=typeof document<"u"?document.fonts:void 0;(Be=Te==null?void 0:Te.ready)==null||Be.then(ee).catch(()=>{});const He=new ResizeObserver(ee);return He.observe(A),()=>He.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!ie)return;const A=pe.current,ee=ne.current;if(!A||!ee)return;const Te={id:0},He=()=>{const Ve=A.offsetWidth||A.getBoundingClientRect().width,rt=ee.offsetWidth||ee.getBoundingClientRect().width;if(P&&Ve>0&&rt>0){const Ze=rt/de;if(Ze>0){const _e=Math.min(bh,Math.max(Ca,Math.ceil(Ve/Ze)+1));if(_e!==de){be(_e);return}}}rt>0&&l(rt)};Te.id=requestAnimationFrame(He);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Te.id),Te.id=requestAnimationFrame(He)});return Be.observe(A),Be.observe(ee),()=>{cancelAnimationFrame(Te.id),Be.disconnect()}},[ie,J,de,P,M]),s.useLayoutEffect(()=>{const A=ve.current;if(!A)return;const ee={id:0},Te=()=>{const Be=A.offsetHeight;Be>0&&Z(Ve=>Math.abs(Ve-Be)>.5?Be:Ve)};ee.id=requestAnimationFrame(Te);const He=new ResizeObserver(()=>{cancelAnimationFrame(ee.id),ee.id=requestAnimationFrame(Te)});return He.observe(A),()=>{cancelAnimationFrame(ee.id),He.disconnect()}},[z,n]),s.useLayoutEffect(()=>{if(!$){$e(0),ge(0);return}const A=pe.current,ee=ne.current;if(!A||!ee)return;const Te={id:0},He=()=>{const Ve=A.offsetWidth,rt=ee.offsetHeight;Ve>0&&ge(Ze=>Math.abs(Ze-Ve)>.5?Ve:Ze),rt>0&&$e(Ze=>Math.abs(Ze-rt)>.5?rt:Ze)};Te.id=requestAnimationFrame(He);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Te.id),Te.id=requestAnimationFrame(He)});return Be.observe(A),Be.observe(ee),()=>{cancelAnimationFrame(Te.id),Be.disconnect()}},[$,J,M,y,C,ie]),s.useLayoutEffect(()=>{if(!ie||d<=0)return;const A=se.current;A&&Ih(A)},[ie,d,u,L]),s.useLayoutEffect(()=>{if(!$||!P)return;const A=pe.current;if(!A)return;const ee={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Te=()=>{for(const _e of ee.itemsCache)for(const qe of _e.glyphs)Eh(qe.inner)},He=()=>{const _e=j.current??A;ee.itemsCache=Array.from(A.querySelectorAll("[data-marquee-text-item]"),qe=>{const Oe=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(nt=>{const at=nt.firstElementChild;at&&Oe.push({inner:at,layoutLocalX:kh(nt,_e)})}),{item:qe,glyphs:Oe}}),ee.cacheDirty=!1},Be=()=>{ee.cacheDirty&&He();const qe=(j.current??A).offsetWidth||1,Oe=qe*T,nt=2*Math.PI*k/qe,at=`${qe}|${Oe}|${nt}`;at!==ee.lutKey&&(ee.lutKey=at,ee.lut=Fh(Oe,nt,Ah));const st=se.current,St=st?Mh(getComputedStyle(st).transform):0,Yt=A.getBoundingClientRect(),Zt=Yt.left,vt=Yt.right,wt=ee.lut&&ee.lut.wavelength>0?Math.max(0,(ee.lut.periodArc/ee.lut.wavelength-1)*qe):0;for(const{item:Bt,glyphs:At}of ee.itemsCache){const xt=Bt.getBoundingClientRect();if(!(xt.right<Zt||xt.left>vt+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Ut=ee.lut?_h(ee.lut,Nt):Nt,Jt=nt*Ut,Tt=Oe*Math.sin(Jt),Wt=Oe*nt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Ph(Ft.inner,Ut-Nt,Tt,rn)}}},Ve=()=>{ee.cancelled||(ee.raf=0,Be(),xe.current&&!document.hidden&&(ee.raf=requestAnimationFrame(Ve)))},rt=()=>{ee.cancelled||ee.raf||(ee.raf=requestAnimationFrame(Ve))};b.current=rt,rt();const Ze=()=>{if(document.hidden){cancelAnimationFrame(ee.raf),ee.raf=0;return}rt()};return document.addEventListener("visibilitychange",Ze),()=>{ee.cancelled=!0,b.current=null,cancelAnimationFrame(ee.raf),document.removeEventListener("visibilitychange",Ze),Te()}},[$,T,k,P,r,J,de,M]),s.useLayoutEffect(()=>{var A;(A=b.current)==null||A.call(b)},[F]);const X=()=>{B&&ue(!0)},me=()=>{B&&ue(!1)},re=$?T*100:0,Y=D(z),ce={minHeight:Y,...$?{paddingTop:`${re}%`,paddingBottom:`${re}%`}:{}},Ee={height:Y,...$?{visibility:"hidden"}:{backgroundColor:H}},he={gap:D(x),minHeight:Y},Q=ae*T,Ne=ye>0?ye:te,Fe=Math.max(te,Ne),et=$&&ae>0&&Fe>0?Nh(ae,Q,k,Q+Fe/2):"",Je=Q*2+Fe,dt=et?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${ae} ${Je}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:et,fill:"none",stroke:H,strokeWidth:Ne,strokeLinecap:"round",strokeLinejoin:"round"})}):null,tt=a.jsx("div",{ref:ve,className:`${o}-ribbon`,style:Ee,"aria-hidden":!0}),De=(A,ee,Te)=>a.jsx(Wh,{item:A,prefix:o,textCss:g,capHeightPx:M,opticalOffsetY:V,imageGapPx:D(x),isCurve:$},`${ee}-${Te}`),Ie=a.jsx("span",{ref:ke,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),We=d>0&&L>0?d/L*1e3:0,je=`${Math.max(0,We)/1e3}s`,Ue=ie?a.jsx("div",{ref:se,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:X,onMouseLeave:me,style:{WebkitAnimationDuration:je,animationDuration:je,WebkitAnimationPlayState:le,animationPlayState:le},children:Array.from({length:Se},(A,ee)=>a.jsx("div",{ref:ee===0?ne:void 0,className:`${o}-marquee-set`,style:{...he,paddingRight:D(x)},"aria-hidden":ee>0,children:Pe.map((Te,He)=>De(Te,ee,He))},`set-${ee}`))}):a.jsx("div",{ref:ne,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:he,children:t==null?void 0:t.map((A,ee)=>De(A,0,ee))});return a.jsxs("div",{ref:pe,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),Ie,a.jsxs("div",{ref:j,className:`${o}-marquee-wrapper`,style:ce,children:[tt,dt,Ue]})]})},Dh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2608
|
+
`}const bh=30,Ca=3,wh=12,Sh=3,rs=.72,Ch=100,$h=10,Th=e=>Math.max(0,e)/Ch,Ih=e=>Math.max(0,e)/$h,Rh=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")},Lh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Ph=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Eh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Mh=e=>{e.style.transform=""},kh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Ah=(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)},Fh=96,_h=(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 x=p*c,w=x+c;o[p+1]=w,r[p+1]=r[p]+(d(x)+d(w))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Nh=(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),x=l[p]-l[u],w=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*w)},Wh=(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,x)=>{const w=x/c*e,m=(x+1)/c*e,h=m-w,f=l(w),v=l(m),C=w+h/3,y=f+d(w)*h/3,S=m-h/3,X=v-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${X.toFixed(2)} ${m.toFixed(2)} ${v.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Hh=({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:`${rs}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),x=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,x]});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})},Dh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=D.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:w,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:v,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:X,textTextAppearance:N,textColor:U,backgroundColor:W,ribbonWidth:I}=e,B=I??y,$=w==="curve",T=Th(m),k=Ih(h),F=s.useMemo(()=>vh(o,d,$),[o,d,$]),g=s.useMemo(()=>qt({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:S,wordSpacing:X,fontSize:C,lineHeight:y,textAppearance:N,color:U},n),[f,v,S,X,C,y,N,U,n]),H=he=>D.scalingValue(he,n??!1),P=((t==null?void 0:t.length)??0)>0,q=n?!!i:!0,ne=P&&(q||!!n),L=Math.max(0,c)*bh,O=q&&p==="on",[Z,ue]=s.useState(!1),ae=q?O&&Z?"paused":"running":"paused",A=ae==="running"&&L>0&&d>0,pe=s.useRef(null),z=s.useRef(null),re=s.useRef(null),te=s.useRef(null),be=s.useRef(null),Ae=s.useRef(null),ve=s.useRef(A),b=s.useRef(null);ve.current=A;const[M,E]=s.useState(0),[j,Ce]=s.useState(0),[ee,Ie]=s.useState(0),[oe,me]=s.useState(0),[xe,J]=s.useState(0),Q=s.useMemo(()=>(t??[]).map(he=>{var V;return`${he.text}\0${((V=he.image)==null?void 0:V.url)??""}`}).join("\0"),[t]),[se,we]=s.useState(Ca),Ee=s.useMemo(()=>{const he=t??[];return he.length===0||!(q||n)?he:Lh(he,se)},[t,q,se,n]),Te=ne?Sh:1;s.useLayoutEffect(()=>{we(Ca),l(0)},[Q]),s.useLayoutEffect(()=>{var ze;const he=Ae.current;if(!he)return;const V=()=>{const We=getComputedStyle(he),et=parseFloat(We.fontSize)||0;if(et<=0)return;const Je=Ph();if(!Je){E(et*rs),Ce(0);return}Je.font=`${We.fontStyle} ${We.fontWeight} ${et}px ${We.fontFamily}`;const _e=Je.measureText("H"),qe=_e.actualBoundingBoxAscent>0?_e.actualBoundingBoxAscent:et*rs,De=Math.max(0,_e.actualBoundingBoxDescent||0),it=_e.fontBoundingBoxAscent||0,at=_e.fontBoundingBoxDescent||0;E(St=>Math.abs(St-qe)>.5?qe:St);const dt=it>0||at>0?(at-De-(it-qe))/2:0;Ce(St=>Math.abs(St-dt)>.25?dt:St)};V();const ye=typeof document<"u"?document.fonts:void 0;(ze=ye==null?void 0:ye.ready)==null||ze.then(V).catch(()=>{});const Ne=new ResizeObserver(V);return Ne.observe(he),()=>Ne.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!ne)return;const he=pe.current,V=te.current;if(!he||!V)return;const ye={id:0},Ne=()=>{const We=he.offsetWidth||he.getBoundingClientRect().width,et=V.offsetWidth||V.getBoundingClientRect().width;if(P&&We>0&&et>0){const Je=et/se;if(Je>0){const _e=Math.min(wh,Math.max(Ca,Math.ceil(We/Je)+1));if(_e!==se){we(_e);return}}}et>0&&l(et)};ye.id=requestAnimationFrame(Ne);const ze=new ResizeObserver(()=>{cancelAnimationFrame(ye.id),ye.id=requestAnimationFrame(Ne)});return ze.observe(he),ze.observe(V),()=>{cancelAnimationFrame(ye.id),ze.disconnect()}},[ne,Q,se,P,M]),s.useLayoutEffect(()=>{const he=be.current;if(!he)return;const V={id:0},ye=()=>{const ze=he.offsetHeight;ze>0&&J(We=>Math.abs(We-ze)>.5?ze:We)};V.id=requestAnimationFrame(ye);const Ne=new ResizeObserver(()=>{cancelAnimationFrame(V.id),V.id=requestAnimationFrame(ye)});return Ne.observe(he),()=>{cancelAnimationFrame(V.id),Ne.disconnect()}},[B,n]),s.useLayoutEffect(()=>{if(!$){Ie(0),me(0);return}const he=pe.current,V=te.current;if(!he||!V)return;const ye={id:0},Ne=()=>{const We=he.offsetWidth,et=V.offsetHeight;We>0&&me(Je=>Math.abs(Je-We)>.5?We:Je),et>0&&Ie(Je=>Math.abs(Je-et)>.5?et:Je)};ye.id=requestAnimationFrame(Ne);const ze=new ResizeObserver(()=>{cancelAnimationFrame(ye.id),ye.id=requestAnimationFrame(Ne)});return ze.observe(he),ze.observe(V),()=>{cancelAnimationFrame(ye.id),ze.disconnect()}},[$,Q,M,y,C,ne]),s.useLayoutEffect(()=>{if(!ne||d<=0)return;const he=re.current;he&&Rh(he)},[ne,d,u,L]),s.useLayoutEffect(()=>{if(!$||!P)return;const he=pe.current;if(!he)return;const V={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},ye=()=>{for(const _e of V.itemsCache)for(const qe of _e.glyphs)Mh(qe.inner)},Ne=()=>{const _e=z.current??he;V.itemsCache=Array.from(he.querySelectorAll("[data-marquee-text-item]"),qe=>{const De=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(it=>{const at=it.firstElementChild;at&&De.push({inner:at,layoutLocalX:Ah(it,_e)})}),{item:qe,glyphs:De}}),V.cacheDirty=!1},ze=()=>{V.cacheDirty&&Ne();const qe=(z.current??he).offsetWidth||1,De=qe*T,it=2*Math.PI*k/qe,at=`${qe}|${De}|${it}`;at!==V.lutKey&&(V.lutKey=at,V.lut=_h(De,it,Fh));const dt=re.current,St=dt?kh(getComputedStyle(dt).transform):0,At=he.getBoundingClientRect(),Zt=At.left,vt=At.right,wt=V.lut&&V.lut.wavelength>0?Math.max(0,(V.lut.periodArc/V.lut.wavelength-1)*qe):0;for(const{item:zt,glyphs:Ft}of V.itemsCache){const xt=zt.getBoundingClientRect();if(!(xt.right<Zt||xt.left>vt+wt))for(const _t of Ft){const Wt=_t.layoutLocalX+St,Ut=V.lut?Nh(V.lut,Wt):Wt,Jt=it*Ut,Tt=De*Math.sin(Jt),Ht=De*it*Math.cos(Jt),rn=Math.atan(Ht)*(180/Math.PI);Eh(_t.inner,Ut-Wt,Tt,rn)}}},We=()=>{V.cancelled||(V.raf=0,ze(),ve.current&&!document.hidden&&(V.raf=requestAnimationFrame(We)))},et=()=>{V.cancelled||V.raf||(V.raf=requestAnimationFrame(We))};b.current=et,et();const Je=()=>{if(document.hidden){cancelAnimationFrame(V.raf),V.raf=0;return}et()};return document.addEventListener("visibilitychange",Je),()=>{V.cancelled=!0,b.current=null,cancelAnimationFrame(V.raf),document.removeEventListener("visibilitychange",Je),ye()}},[$,T,k,P,r,Q,se,M]),s.useLayoutEffect(()=>{var he;(he=b.current)==null||he.call(b)},[A]);const Y=()=>{O&&ue(!0)},de=()=>{O&&ue(!1)},ce=$?T*100:0,G=H(B),le={minHeight:G,...$?{paddingTop:`${ce}%`,paddingBottom:`${ce}%`}:{}},Me={height:G,...$?{visibility:"hidden"}:{backgroundColor:W}},fe={gap:H(x),minHeight:G},K=oe*T,Xe=xe>0?xe:ee,Le=Math.max(ee,Xe),Ze=$&&oe>0&&Le>0?Wh(oe,K,k,K+Le/2):"",Qe=K*2+Le,ct=Ze?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${oe} ${Qe}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Ze,fill:"none",stroke:W,strokeWidth:Xe,strokeLinecap:"round",strokeLinejoin:"round"})}):null,nt=a.jsx("div",{ref:be,className:`${o}-ribbon`,style:Me,"aria-hidden":!0}),Ve=(he,V,ye)=>a.jsx(Hh,{item:he,prefix:o,textCss:g,capHeightPx:M,opticalOffsetY:j,imageGapPx:H(x),isCurve:$},`${V}-${ye}`),$e=a.jsx("span",{ref:Ae,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),He=d>0&&L>0?d/L*1e3:0,Be=`${Math.max(0,He)/1e3}s`,Ue=ne?a.jsx("div",{ref:re,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:Y,onMouseLeave:de,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:ae,animationPlayState:ae},children:Array.from({length:Te},(he,V)=>a.jsx("div",{ref:V===0?te:void 0,className:`${o}-marquee-set`,style:{...fe,paddingRight:H(x)},"aria-hidden":V>0,children:Ee.map((ye,Ne)=>Ve(ye,V,Ne))},`set-${V}`))}):a.jsx("div",{ref:te,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:fe,children:t==null?void 0:t.map((he,V)=>Ve(he,0,V))});return a.jsxs("div",{ref:pe,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),$e,a.jsxs("div",{ref:z,className:`${o}-marquee-wrapper`,style:le,children:[nt,ct,Ue]})]})},Oh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2609
2609
|
import cn from 'classnames';
|
|
2610
2610
|
import { CommonComponentProps } from '../props';
|
|
2611
2611
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -3446,7 +3446,7 @@ type MarqueeTextProps = {
|
|
|
3446
3446
|
isPreviewMode?: boolean;
|
|
3447
3447
|
isEditMode?: boolean;
|
|
3448
3448
|
} & CommonComponentProps;
|
|
3449
|
-
`,
|
|
3449
|
+
`,Bh={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},zh={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},ribbonWidth:{type:"number",scope:"layout",title:"Ribbon Width",min:0,display:{type:"numeric-input"}},layoutType:{type:"string",scope:"common",title:"Path Type",display:{type:"toggle-cycle",enum:["straight","curve"]}},curveAmplitude:{type:"number",scope:"layout",title:"Amplitude",min:0,max:30,step:1,display:{type:"common-numeric-input",visible:!1}},curveFrequency:{type:"number",scope:"layout",title:"Frequency",min:0,max:100,step:1,display:{type:"common-numeric-input",visible:!1}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Bh.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"},backgroundColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Ribbon Color"}},defaults:{direction:"left",pauseOnHover:"off",layoutType:"curve",textFontFamily:"Antique Série",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#FFFFFF",backgroundColor:"#2E12F0"},layoutDefaults:{m:{speed:.55,gap:.04,ribbonWidth:.08,curveAmplitude:6,curveFrequency:15,textFontSize:.08,textLineHeight:.08},t:{speed:1.3,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:15,textFontSize:.07,textLineHeight:.05},d:{speed:2.5,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:18,textFontSize:.071,textLineHeight:.035}},displayRules:[{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveAmplitude.display.visible",value:!0}},{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveFrequency.display.visible",value:!0}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","ribbonWidth","layoutType","curveAmplitude","curveFrequency"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction","speed"]},{type:"row",items:["ribbonWidth","gap"]},{type:"row",items:["pauseOnHover","layoutType"]},{type:"row",items:["curveAmplitude","curveFrequency"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}],paletteBookmark:{items:["textColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{text:{placeholder:"Add text...",label:"Text",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-input"}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}}},default:[{text:"NEW WORK",image:{url:"https://cdn.cntrl.site/component-assets/marquee_text_icon.svg",name:""},link:""}]}},jh={element:Dh,id:"marquee-text",name:"Marquee Text",category:"typography",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Text_Marquee.mp4"},schema:zh,sourceCode:Oh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function Vh(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
3450
3450
|
.${e}-marquee-wrapper {
|
|
3451
3451
|
overflow: hidden;
|
|
3452
3452
|
width: 100%;
|
|
@@ -3535,7 +3535,7 @@ type MarqueeTextProps = {
|
|
|
3535
3535
|
pointer-events: auto;
|
|
3536
3536
|
z-index: 10;
|
|
3537
3537
|
}
|
|
3538
|
-
`}const
|
|
3538
|
+
`}const Gh=30,Tl=2,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")},Yh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:w,stroke:m,strokeColor:h,bgColor:f,padding:v,logoMarginTop:C,logoWidth:y,logoHeight:S,captionMarginTop:X}=e,N=!!o,U=((t==null?void 0:t.length)??0)>0,W=d>0&&(!n||i),I=U&&(W||n),B=Math.max(0,d)*Gh,$=Y=>D.scalingValue(Y,n??!1),T=s.useRef(null),k=s.useRef(null),F=s.useRef(null),[g,H]=s.useState(0),[P,q]=s.useState(0),ne=P>0?P:0,L=s.useMemo(()=>Vh(r,ne),[r,ne]),[O,Z]=s.useState(0),ue=W&&u==="on",[ae,A]=s.useState(!1),pe=s.useRef(null),[z,re]=s.useState(0),[te,be]=s.useState(0),Ae=s.useRef(null),ve=Y=>{var ce,G,le,Me,fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${Y}FontFamily`])??"Arial",fontWeight:((ce=e==null?void 0:e[`${Y}FontSettings`])==null?void 0:ce.fontWeight)??400,fontStyle:((G=e==null?void 0:e[`${Y}FontSettings`])==null?void 0:G.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${Y}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((Me=e==null?void 0:e[`${Y}TextAppearance`])==null?void 0:Me.textDecoration)??"none",fontVariant:((fe=e==null?void 0:e[`${Y}TextAppearance`])==null?void 0:fe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${Y}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${Y}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${Y}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${Y}LineHeight`])??.01,color:(e==null?void 0:e[`${Y}Color`])??"#000000"}},b=ve("text"),M=ve("caption"),E=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(Y=>{var de,ce;return(((de=Y.text)==null?void 0:de.length)??0)>0||(((ce=Y.caption)==null?void 0:ce.length)??0)>0}),[t]),j=s.useMemo(()=>!I||(t==null?void 0:t.length)===0?1:P<=0||g<=0?Tl:Math.max(Tl,Math.ceil(g/P)+1),[I,t==null?void 0:t.length,P,g]);s.useLayoutEffect(()=>{if(!I)return;const Y=T.current,de=F.current;if(!Y||!de)return;let ce=0;const G=()=>{const fe=Y.getBoundingClientRect().width,K=de.getBoundingClientRect().width,Xe=Ae.current,Le=typeof Xe=="number"&&Math.abs(Xe-K)<=.25;if(Ae.current=K,H(fe),typeof K=="number"&&K>0&&P<=0){q(K);return}Le&&K!==P?q(K):!Le&&P<=0&&(cancelAnimationFrame(ce),ce=requestAnimationFrame(G))},le=()=>{cancelAnimationFrame(ce),ce=requestAnimationFrame(G)};le();const Me=new ResizeObserver(le);return Me.observe(Y),Me.observe(de),()=>{cancelAnimationFrame(ce),Me.disconnect()}},[W,I,P]);const Ce=ne>0&&B>0?ne/B*1e3:0,ee=`${Math.max(0,Ce)/1e3}s`;s.useLayoutEffect(()=>{if(!I||ne<=0)return;const Y=k.current;Y&&Xh(Y)},[I,ne,c]),s.useLayoutEffect(()=>{if(!I){Z(0);return}const Y=F.current,de=k.current;if(!Y||!de)return;const ce=()=>{let le=0;for(let Me=0;Me<Y.children.length;Me++){const K=Y.children[Me].firstElementChild;K&&(le=Math.max(le,K.offsetHeight))}le<=0&&(le=de.offsetHeight),Z(le>0?le:0)};ce();const G=new ResizeObserver(ce);return G.observe(Y),G.observe(de),()=>{G.disconnect()}},[I,j,t,n,p,x,v,m,w,y,S,z,te]);const Ie=()=>{ue&&A(!0)},oe=()=>{ue&&A(!1)},me=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),xe=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),J=s.useCallback((Y,de,ce,G)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:me,width:"100%"},children:[a.jsx("div",{"data-controls":N?G==null?void 0:G.controlsName:void 0,"data-controls-axis":N?"y":void 0,className:N?`${r}-control`:void 0,style:{height:$((G==null?void 0:G.marginTop)??0)}}),a.jsx("div",{...G!=null&&G.dataMeasureKind?{"data-testimonial-measure":G.dataMeasureKind}:{},style:{...qt(Y,n),textAlign:xe,pointerEvents:"auto",...typeof(G==null?void 0:G.minHeightPx)=="number"&&G.minHeightPx>0?{minHeight:G.minHeightPx}:{}},children:a.jsx(Ri,{content:de})})]},ce),[me,xe,n,N,r,$]),Q=s.useCallback((Y,de,ce)=>{var G,le,Me;return a.jsxs("div",{style:{padding:`${$(v.top)} ${$(v.right)} ${$(v.bottom)} ${$(v.left)}`,width:$(x+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:me,textAlign:xe},children:[Y.text&&J(b,Y.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:me,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:((G=Y.logo)==null?void 0:G.url)&&a.jsx("img",{src:Y.logo.url,alt:((le=Y.logo)==null?void 0:le.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Me=Y.logo)==null?void 0:Me.objectFit)||"contain"}})})]}),Y.caption&&J(M,Y.caption,"caption",{...ce!=null&&ce.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:X,...ce!=null&&ce.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ce==null?void 0:ce.captionMinHeightPx)=="number"&&ce.captionMinHeightPx>0?{minHeightPx:ce.captionMinHeightPx}:{}})]})]},de)},[f,X,M,x,w,S,C,y,me,xe,v.bottom,v.left,v.right,v.top,J,m,h,b,n,N,r]),se=s.useCallback(Y=>{re(Y.maxTextPx),be(Y.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!E){se({maxTextPx:0,maxCaptionPx:0});return}const Y=pe.current;if(!Y)return;const de=()=>{D.readTestimonialTextMeasure(Y,se)};de();const ce=new ResizeObserver(de);return ce.observe(Y),()=>{ce.disconnect()}},[E,se,t,Q]);const we=E?{textMinHeightPx:z,captionMinHeightPx:te}:void 0,Ee=E?a.jsx("div",{ref:pe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((Y,de)=>Q(Y,`measure-${de}`,{dataMeasureAttrs:!0}))}):null,Te=(Y,de)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Q(Y,`card-${de}`,we),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}})]},de);if(I){const Y=W?ue&&ae?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...O>0?{height:O}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Ee,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Ie,onMouseLeave:oe,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:ee,WebkitAnimationDuration:ee,animationPlayState:Y,WebkitAnimationPlayState:Y},children:Array.from({length:j},(de,ce)=>a.jsx("div",{ref:ce===0?F: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((G,le)=>Te(G,`${ce}-${le}`))},`set-${ce}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Ee,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((Y,de)=>Te(Y,de))})]})},qh=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3539
3539
|
import cn from 'classnames';
|
|
3540
3540
|
import { CommonComponentProps } from '../props';
|
|
3541
3541
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4166,7 +4166,7 @@ type TestimonialsSettings = {
|
|
|
4166
4166
|
logoHeight: number;
|
|
4167
4167
|
captionMarginTop: number;
|
|
4168
4168
|
};
|
|
4169
|
-
`,Il={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},
|
|
4169
|
+
`,Il={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Uh={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Il.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Il.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.069,textLineHeight:.093,captionFontSize:.053,captionLineHeight:.069},t:{speed:1.64,gap:.02,cardWidth:.44,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.065,left:.01},logoMarginTop:.1,logoWidth:.052,logoHeight:.052,captionMarginTop:.005,textFontSize:.035,textLineHeight:.04,captionFontSize:.023,captionLineHeight:.029},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Kh={element:Yh,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:Uh,sourceCode:qh,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Zh(e){return`
|
|
4170
4170
|
.${e}-container {
|
|
4171
4171
|
position: relative;
|
|
4172
4172
|
overflow-x: clip;
|
|
@@ -4290,7 +4290,7 @@ type TestimonialsSettings = {
|
|
|
4290
4290
|
width: 100%;
|
|
4291
4291
|
height: 100%;
|
|
4292
4292
|
}
|
|
4293
|
-
`}const
|
|
4293
|
+
`}const Jh=3e3,Qh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:w,imageWidth:m,imageHeight:h,controlsWidth:f,controlsColor:v,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[S,X]=s.useState(0),[N,U]=s.useState(null),[W,I]=s.useState(!1),B=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),T=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{X(0),U(null),I(!1)},[l.length]);const k=l[S],F=N===null?null:l[N],g=ve=>{var M,E,j,Ce,ee;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ve}FontFamily`])??"Arial",fontWeight:((M=e==null?void 0:e[`${ve}FontSettings`])==null?void 0:M.fontWeight)??400,fontStyle:((E=e==null?void 0:e[`${ve}FontSettings`])==null?void 0:E.fontStyle)??"normal"},textAppearance:{textTransform:((j=e==null?void 0:e[`${ve}TextAppearance`])==null?void 0:j.textTransform)??"none",textDecoration:((Ce=e==null?void 0:e[`${ve}TextAppearance`])==null?void 0:Ce.textDecoration)??"none",fontVariant:((ee=e==null?void 0:e[`${ve}TextAppearance`])==null?void 0:ee.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ve}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ve}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ve}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ve}WordSpacing`])??0,color:(e==null?void 0:e[`${ve}Color`])??"#000000"}},H=g("text"),P=g("caption"),q=l.length>1&&l.some(ve=>{var b,M;return(((b=ve.text)==null?void 0:b.length)??0)>0||(((M=ve.caption)==null?void 0:M.length)??0)>0}),ne=s.useRef(null),[L,O]=s.useState(0),[Z,ue]=s.useState(0),ae=e.controls??{mode:"Off",icon:null},A=l.length>1,pe=s.useCallback((ve,b)=>!A||b===ve?ve:(B.current&&window.clearTimeout(B.current),U(ve),I(!0),B.current=window.setTimeout(()=>{U(null),I(!1),B.current=null},300),b),[A]),z=s.useCallback(()=>{A&&X(ve=>pe(ve,(ve-1+l.length)%l.length))},[A,pe,l.length]),re=s.useCallback(()=>{A&&X(ve=>pe(ve,(ve+1)%l.length))},[A,pe,l.length]);s.useEffect(()=>{if(!y||!A)return;const ve=Math.max(300,Jh/d),b=window.setInterval(()=>{X(M=>pe(M,(M+1)%l.length))},ve);return()=>{window.clearInterval(b)}},[y,A,pe,l.length,d]),s.useEffect(()=>()=>{B.current&&window.clearTimeout(B.current)},[]);const te=(ve,b)=>{var ee,Ie,oe,me;const M=b==null?void 0:b.textMinHeightPx,E=b==null?void 0:b.captionMinHeightPx,j=b==null?void 0:b.dataMeasureAttrs,Ce=o&&!(b!=null&&b.dataMeasureAttrs)&&!(b!=null&&b.hideControls);return a.jsxs(a.Fragment,{children:[ve.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"textMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:D.scalingValue(x??0,n??!1)}}),a.jsx("div",{...j&&{"data-testimonial-measure":"text"},style:{...qt(H,n),...M&&M>0?{minHeight:M}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:ve.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"imageMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:D.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:D.scalingValue(m??0,n??!1),height:D.scalingValue(h??0,n??!1)},children:((ee=ve.image)==null?void 0:ee.url)&&a.jsx("img",{src:(Ie=ve.image)==null?void 0:Ie.url,alt:((oe=ve.image)==null?void 0:oe.name)??"",className:`${r}-icon`,style:{objectFit:((me=ve.image)==null?void 0:me.objectFit)||"contain"}})})]}),ve.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"captionMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:D.scalingValue(w??0,n??!1)}}),a.jsx("div",{...j?{"data-testimonial-measure":"caption"}:{},style:{...qt(P,n),...E&&E>0?{minHeight:E}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:ve.caption})})]})]})},be=s.useCallback(ve=>{O(ve.maxTextPx),ue(ve.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!q){be({maxTextPx:0,maxCaptionPx:0});return}const ve=ne.current;if(!ve)return;const b=()=>{D.readTestimonialTextMeasure(ve,be)};b();const M=new ResizeObserver(b);return M.observe(ve),()=>{M.disconnect()}},[q,be,t]),!k)return a.jsx(a.Fragment,{});const Ae=q?{textMinHeightPx:L,captionMinHeightPx:Z}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Zh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[q&&a.jsx("div",{ref:ne,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((ve,b)=>a.jsx("div",{style:{width:"100%"},children:te(ve,{dataMeasureAttrs:!0})},b))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[F&&W&&a.jsx("div",{className:pt(`${r}-fade-item-prev`,`${r}-fade-out`),children:te(F,{...Ae,hideControls:!0})}),a.jsx("div",{className:pt(`${r}-fade-item-current`,W?`${r}-fade-in`:void 0),children:te(k,Ae)})]})]}),ae.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:z,disabled:!A,"aria-label":"Previous testimonial",children:ae.icon&&a.jsx(sn,{url:ae.icon,fill:v,hoverFill:C,className:pt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:pt(`${r}-arrow`,`${r}-next-arrow`),style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:re,disabled:!A,"aria-label":"Next testimonial",children:ae.icon&&a.jsx(sn,{url:ae.icon,fill:v,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},ef=`import cn from 'classnames';
|
|
4294
4294
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4295
4295
|
import { CommonComponentProps } from '../props';
|
|
4296
4296
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4786,12 +4786,12 @@ type TestimonialsSettings = {
|
|
|
4786
4786
|
icon?: string | null;
|
|
4787
4787
|
};
|
|
4788
4788
|
};
|
|
4789
|
-
`,
|
|
4789
|
+
`,tf="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" 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" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Rl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},nf={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:tf},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},of={element:Qh,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:nf,sourceCode:ef,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function rf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ll(e){return((e==null?void 0:e.trim().length)??0)>0}function $a(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ta(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function af(e){return`
|
|
4790
4790
|
.${e}-wrapper {
|
|
4791
4791
|
display: grid;
|
|
4792
4792
|
align-items: start;
|
|
4793
4793
|
justify-content: center;
|
|
4794
|
-
min-height: ${
|
|
4794
|
+
min-height: ${rf(48)};
|
|
4795
4795
|
}
|
|
4796
4796
|
.${e}-item {
|
|
4797
4797
|
display: flex;
|
|
@@ -5133,7 +5133,7 @@ type TestimonialsSettings = {
|
|
|
5133
5133
|
z-index: 2;
|
|
5134
5134
|
width: 100%;
|
|
5135
5135
|
}
|
|
5136
|
-
`}function af(){return Math.random()<.5?"ltr":"ttb"}function sf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function lf(e){const t=af();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{sf(e)})})}const bn=500,cf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",df=72,uf=50;function pf(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 mf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function gf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Pd(e){return!Array.isArray(e)||e.length===0?[]:pf(e)?e.flatMap(t=>{const n=mf(t);if(!n)return[];const i=gf(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 hf(e){const t=new Set,n=[];for(const i of e){const o=Pd(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 ff({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 yf(e){e.pause(),e.removeAttribute("src"),e.load()}function Pl({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 El(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function xf(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 vf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{yf(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 bf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),G=s.useRef(null),W=s.useRef(0),U=s.useRef(null),H=s.useRef(!1),I=s.useRef(null),z=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[k,_]=s.useState(null),[g,D]=s.useState(null),[P,q]=s.useState("opening"),[ie,L]=s.useState(0),[B,K]=s.useState(0),[ue,le]=s.useState(null),[F,pe]=s.useState(!1),[j,se]=s.useState(!1),[ne,ve]=s.useState(!1),[ke,xe]=s.useState(null),b=s.useRef(n),M=s.useRef(void 0),E=t[n],V=E?$i(E):!1,Ce=B!==0||F,te=ue!==null,$e=s.useCallback(A=>{const ee=A.currentTarget,Te=ee instanceof HTMLVideoElement?{width:ee.videoWidth,height:ee.videoHeight}:{width:ee.naturalWidth,height:ee.naturalHeight};!Te.width||!Te.height||xe(Te)},[]);s.useEffect(()=>{G.current=g},[g]),s.useEffect(()=>{const A=x.current;if(!A)return;const ee=()=>D(El(A));ee();const Te=new ResizeObserver(ee);return Te.observe(A),()=>Te.disconnect()},[]);const ae=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),ge=s.useCallback(()=>{const A=z.current;z.current=null,ae(),U.current=null,H.current=!1,le(null),pe(!1),K(0),W.current=0,se(!1),y.current=!1,v.current=0,C.current="none",A===1?d():A===-1&&l()},[ae,d,l]),ye=s.useCallback(()=>{ae(),z.current=null,U.current=null,H.current=!1,le(null),pe(!1),K(0),W.current=0},[ae]),Z=s.useCallback(()=>{ae(),I.current=window.setTimeout(()=>{z.current!==null&&ge()},bn+32)},[ae,ge]),J=s.useCallback((A,ee)=>{var He;const Te=((He=G.current)==null?void 0:He.width)??0;if(ae(),U.current=A,le(A),H.current=!0,pe(!0),ee){z.current=A;const Be=-A*Te;W.current=Be,K(Be),Z();return}W.current=0,K(0),I.current=window.setTimeout(()=>{I.current=null,ye()},bn+32)},[ae,ye,Z]),de=s.useCallback(A=>{if(!(t.length<=1)){if(H.current){if(z.current===A){$.current=A,ge();return}ye()}ae(),U.current=A,le(A),H.current=!1,pe(!1),W.current=0,K(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{J(A,!0)})})}},[t.length,J,ge,ye,ae]);T.current=de;const be=s.useCallback(A=>{A.propertyName!=="transform"||!H.current||z.current!==null&&ge()},[ge]),Pe=s.useCallback(()=>{const A=w.current;if(!A)return;const ee=El(A);!ee.width||!ee.height||_(ee)},[]);s.useEffect(()=>{Pe();const A=w.current;if(!A)return;const ee=new ResizeObserver(()=>Pe());return ee.observe(A),()=>ee.disconnect()},[Pe]),s.useEffect(()=>{P==="opening"&&k&&q("open")},[P,k]),s.useEffect(()=>{if(P!=="closing")return;const A=setTimeout(()=>r(),bn);return()=>clearTimeout(A)},[P,r]),s.useEffect(()=>()=>{ae()},[ae]),s.useLayoutEffect(()=>{b.current===n&&M.current===(E==null?void 0:E.url)||(ae(),z.current=null,le(null),L(0),K(0),pe(!1),ve(!1),se(!1),xe(null),f.current=0,v.current=0,C.current="none",y.current=!1,H.current=!1,W.current=0,U.current=null,h.current=null,S.current=!1,b.current=n,M.current=E==null?void 0:E.url)},[n,E==null?void 0:E.url,ae]),s.useLayoutEffect(()=>{const A=$.current;A!==null&&($.current=null,requestAnimationFrame(()=>{T.current(A)}))},[n,E==null?void 0:E.url]),s.useEffect(()=>{if(P!=="open")return;let A=null;const ee=()=>{A&&(document.removeEventListener("click",A,!0),A=null)},Te=()=>{ee(),A=Ze=>{Ze.stopPropagation(),Ze.preventDefault(),ee()},document.addEventListener("click",A,!0)},He=Ze=>{const _e=Ze<0?1:-1;if(Math.abs(Ze)>uf&&t.length>1){J(_e,!0);return}J(_e,!1)},Be=Ze=>{if(Ze.touches.length!==1||H.current)return;const _e=Ze.touches[0];S.current=!0,h.current={x:_e.clientX,y:_e.clientY},C.current="none",v.current=0,y.current=!1},Ve=Ze=>{if(!h.current||Ze.touches.length!==1||H.current)return;const _e=Ze.touches[0],qe=_e.clientX-h.current.x,Oe=_e.clientY-h.current.y;if(C.current==="none"){if(Math.abs(qe)<10&&Math.abs(Oe)<10)return;if(Math.abs(qe)>Math.abs(Oe)){if(t.length<=1)return;C.current="horizontal"}else if(Oe>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,se(!0),v.current=qe;const nt=qe<0?1:-1;U.current!==nt&&(U.current=nt,le(nt)),W.current=qe,K(qe),Ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,se(!0),f.current=Oe,L(Oe),Ze.preventDefault())},rt=()=>{if(!h.current)return;const Ze=C.current,_e=y.current;if(_e&&Ze==="horizontal")He(v.current),Te();else if(_e&&Ze==="vertical")if(f.current>df){const Oe=window.innerHeight;f.current=Oe,ve(!0),L(Oe),q("closing")}else f.current=0,L(0),Te();else Ze==="horizontal"&&Math.abs(v.current)>0&&(He(v.current),Te());h.current=null,C.current="none",v.current=0,y.current=!1,se(!1)};return document.addEventListener("touchstart",Be,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",rt),document.addEventListener("touchcancel",rt),()=>{document.removeEventListener("touchstart",Be),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",rt),document.removeEventListener("touchcancel",rt),ee()}},[P,t.length,J]),s.useEffect(()=>{const A=ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),P!=="closing"&&q("closing"))};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[P]);const Se=()=>{P!=="closing"&&q("closing")},X=P==="open",me=P==="closing",re=ie>0?Math.max(0,1-ie/500):1,Y=ie>0?Math.max(.35,1-ie/500):1,ce=k?p?k:xf(k,ke):null,Ee=A=>{if(A.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ee=ce??A.currentTarget.getBoundingClientRect(),Te=A.clientY-ee.top,He=Math.min(52,ee.height*.2);if(!(Te>ee.height-He)){if(A.clientX-ee.left<ee.width/2){de(-1);return}de(1)}},he=A=>{if(t.length<=1)return;const ee=ce??A.currentTarget.getBoundingClientRect(),Te=A.clientX-ee.left,He=A.clientY-ee.top,Be=Math.min(52,ee.height*.2);if(He>ee.height-Be){A.currentTarget.style.cursor="default";return}A.currentTarget.style.cursor=Te<ee.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},Ne=p?"cover":"contain",Fe=B!==0||ie>0?`translate(${B}px, ${ie}px)`:void 0,et=j&&!F?"none":F?`transform ${bn}ms ${jn}`:ne?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:P==="opening"||me?`opacity ${bn}ms ${jn}`:"none",Je={...Q,transform:Fe,opacity:ie>0?Y:P==="opening"||me?0:1,transition:et,pointerEvents:"none"},dt={position:"absolute",top:((ce==null?void 0:ce.top)??0)-((g==null?void 0:g.top)??0),left:((ce==null?void 0:ce.left)??0)-((g==null?void 0:g.left)??0),width:ce==null?void 0:ce.width,height:ce==null?void 0:ce.height,objectFit:Ne,pointerEvents:V&&X&&!Ce?"auto":"none",touchAction:V&&X?"none":void 0},tt=(g==null?void 0:g.width)??0,De=te?(n+ue+t.length)%t.length:null,Ie=De!==null?t[De]:null,We={...Q,transform:te?`translateX(${ue*tt+B}px)`:void 0,opacity:1,transition:F?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},je={position:"absolute",top:((k==null?void 0:k.top)??0)-((g==null?void 0:g.top)??0),left:((k==null?void 0:k.left)??0)-((g==null?void 0:g.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Ne,pointerEvents:"none"},Ue=ce?{position:"fixed",top:ce.top,height:ce.height,width:ce.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:P==="open"?"none":void 0},onClick:Se,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:X?re: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:X?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:X?1:0,transition:`opacity ${bn}ms ${jn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&g&&Ie&&a.jsx("div",{style:We,onTransitionEnd:be,children:$i(Ie)?a.jsx("video",{src:Ie.url,muted:!0,playsInline:!0,preload:"auto",style:je},`neighbor-${De}-${Ie.url}`):a.jsx("img",{src:Ie.url,alt:Ie.name,style:je},`neighbor-${De}-${Ie.url}`)}),k&&g&&E&&a.jsx("div",{style:Je,onTransitionEnd:be,children:V?a.jsx(vf,{src:E.url,phase:P,mediaRef:m,mediaStyle:dt,onLoadedMetadata:$e,onClick:Ee,onMouseMove:he},`${n}-${E.url}`):a.jsx("img",{ref:m,src:E.url,alt:E.name,onLoad:$e,style:dt},`${n}-${E.url}`)}),X&&Ue&&t.length>1&&!V&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:ce.left,cursor:"w-resize",pointerEvents:j?"none":"auto"},onClick:A=>{if(S.current){S.current=!1;return}A.stopPropagation(),de(-1)}}),a.jsx("div",{style:{...Ue,left:ce.left+ce.width/2,cursor:"e-resize",pointerEvents:j?"none":"auto"},onClick:A=>{if(S.current){S.current=!1;return}A.stopPropagation(),de(1)}})]})]})}function wf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Sf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=O.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:w=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:v,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:G,direction:W,transition:U,titleMarginTop:H,subtitleMarginTop:I,titleColor:z,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:k,titleFontSettings:_,titleFontSize:g,titleLineHeight:D,titleLetterSpacing:P,titleWordSpacing:q,titleTextAppearance:ie,subtitleFontFamily:L,subtitleFontSettings:B,subtitleFontSize:K,subtitleLineHeight:ue,subtitleLetterSpacing:le,subtitleWordSpacing:F,subtitleTextAppearance:pe,lightboxCounterFontFamily:j,lightboxCounterFontSettings:se,lightboxCounterFontSize:ne,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:ke,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:b,showText:M="always",alignEntries:E="off",align:V="top"}=e,Ce={fontSettings:{fontFamily:k,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:g??.01,lineHeight:D,letterSpacing:P??0,wordSpacing:q??0,textAppearance:ie,color:z},$e={...an(qt(Ce,n))},ae={fontSettings:{fontFamily:L,fontWeight:(B==null?void 0:B.fontWeight)??400,fontStyle:(B==null?void 0:B.fontStyle)??"normal"},fontSize:K??.01,lineHeight:ue,letterSpacing:le??0,wordSpacing:F??0,textAppearance:pe,color:$},ye={...an(qt(ae,n))},Z={fontSettings:{fontFamily:j,fontWeight:(se==null?void 0:se.fontWeight)??400,fontStyle:(se==null?void 0:se.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:ve,letterSpacing:ke??0,wordSpacing:xe??0,textAppearance:b,color:T},de={...an(qt(Z,n)),...Ta(ne,ve,u,n)},be=$a(g,D,`${u}-item-title`,`${u}-text-tight-leading`),Pe=$a(K,ue,`${u}-item-subtitle`,`${u}-text-tight-leading`),Se=Ta(g,D,u,n),X=Ta(K,ue,u,n),me=$a(ne,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),re=O.buildColorVars(u,{titleColor:z,subtitleColor:$,lightboxCounterColor:T},Cf,$f),Ee=`${l&&l!=="default"?`${u}-state-${l}`:""}${M==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),he=h===0?1/0:h,Q=(t??[]).slice(0,he),Ne=s.useMemo(()=>f==="on"?hf(Q):[],[Q,f]),Fe=x.entryWidth??.2,et=(v==null?void 0:v.display)==="cover",Je=(v==null?void 0:v.ratioValue)??"1:1",dt=(v==null?void 0:v.reversed)??!1,[tt,De]=Je.split(":").map(Number),je=`${dt?De:tt} / ${dt?tt:De}`,Ue=x.columnsCount,A=O.scalingValue(Fe??0,n),ee=A,Te=!et&&S!=="off",He=Q.length%Ue||Ue,Be=He<Ue&&Q.length>0,Ve=Q.length-He,rt=Be?Math.floor((Ue-He)/2)+1:1,Ze=C?O.scalingValue(C,n):void 0,_e={width:ee,...et?{aspectRatio:je,height:"auto",overflow:"hidden"}:{height:"auto"},...Ze?{borderRadius:Ze,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Te?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",nt=E==="on",at=`calc(${O.scalingValue(Fe??0,n)} * (${w} / 100))`,st=O.scalingValue(Fe*w/100,n),St=et?{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}:{}},[Yt,Zt]=s.useState(0),vt=s.useRef(null),wt=U==="fade"||W==="horizontal"?"ltr":W==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=vt.current;if(!gt)return;const Me=new ResizeObserver(Xe=>{Zt(Math.round(Xe[0].contentRect.width))});return Me.observe(gt),()=>Me.disconnect()},[]);const Bt=(()=>{const gt={...re},Me=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Me&&(gt["--cntrl-article-width"]=Me),gt})(),[At,xt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Ut,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,Me)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(Me),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(()=>rf(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(ff,{mediaList:Ne}),a.jsx("div",{style:re,children:a.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${V} ${Ee}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${A})`,rowGap:nt?0:O.scalingValue(m??0,n),columnGap:O.scalingValue(x.horizontalGap??0,n),width:O.scalingValue(x.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:O.scalingValue(m??0,n)}:{}},children:Q.map((gt,Me)=>{var _t;const Xe=Ll(gt.title),lt=Ll(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,ft=Math.floor(Me/Ue)===Math.ceil(Q.length/Ue)-1,Lt=Be&&Me>=Ve?`${rt+(Me-Ve)}`:void 0,mt=Oe?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:be,style:{width:at,...$e,...Se},children:gt.title}),Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(H??0,n),width:st}}),lt&&a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle}),lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(I??0,n),width:st}})]}):null,zt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?O.scalingValue(H??0,n):0,width:st}}),Xe&&a.jsx("p",{className:be,style:{width:at,...$e,...Se},children:gt.title}),Oe&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(H??0,n),width:st}})]}):null,kt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&<?"subtitleMarginTop":void 0,className:o&<?`${u}-control`:void 0,style:{height:lt?O.scalingValue(I??0,n):0,width:st}}),lt&&a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle}),Oe&<&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(I??0,n),width:st}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[zt,kt]}):a.jsxs(a.Fragment,{children:[zt,kt]}),Vt=Pd(gt.gallery),Gt=Vt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:qe,style:_e,children:Vt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:N}=Vt[0],Re=N?Gt.findIndex(Ae=>Ae.url===N.url):-1;return a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Re>=0?()=>Wt(Gt,Re):void 0})})():a.jsxs(a.Fragment,{children:[Te&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.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(zs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:G*1e3,width:"100%",height:"100%",speed:cf,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{W!=="random"||U==="fade"||lf(Ct)},children:Vt.map(({displayMedia:Ct,lightboxMedia:N},Re)=>{const Ae=N?Gt.findIndex(ze=>ze.url===N.url):-1;return a.jsx(js,{children:a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ae>=0?()=>Wt(Gt,Ae):void 0})},Re)})},`${U}-${Fe}-${W}-${G}-${Yt}-${d}`)]})}),Dt=Oe?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?O.scalingValue(H??0,n):0,width:st}}),a.jsx("p",{className:be,style:{width:at,...$e,...Se},children:gt.title}),a.jsx("div",{"data-controls":o&<?"subtitleMarginTop":void 0,className:o&<?`${u}-control`:void 0,style:{height:lt?O.scalingValue(I??0,n):0,width:st}}),a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!nt?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${A} * (${w} / 100))`:A,...Lt&&nt?{gridColumn:Lt}:{}},children:nt?a.jsx(a.Fragment,{children:Oe?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]}),!Oe&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},Me)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:Bt,"data-selection":"none",children:a.jsx(bf,{prefix:u,items:Ft,index:Ut,imageDisplay:wf(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Jt(Me=>(Me-1+Ft.length)%Ft.length),onNext:()=>Jt(Me=>(Me+1)%Ft.length),counterClassName:me,counterStyle:de})}),gt)})()]})}const Cf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},$f=["hover","focus","filled","success","error"],Tf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5136
|
+
`}function sf(){return Math.random()<.5?"ltr":"ttb"}function lf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function cf(e){const t=sf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{lf(e)})})}const bn=500,df=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",uf=72,pf=50;function mf(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 gf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function hf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Pd(e){return!Array.isArray(e)||e.length===0?[]:mf(e)?e.flatMap(t=>{const n=gf(t);if(!n)return[];const i=hf(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 ff(e){const t=new Set,n=[];for(const i of e){const o=Pd(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 yf({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 xf(e){e.pause(),e.removeAttribute("src"),e.load()}function Pl({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 El(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function vf(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 bf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{xf(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 wf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),X=s.useRef(null),N=s.useRef(0),U=s.useRef(null),W=s.useRef(!1),I=s.useRef(null),B=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[k,F]=s.useState(null),[g,H]=s.useState(null),[P,q]=s.useState("opening"),[ne,L]=s.useState(0),[O,Z]=s.useState(0),[ue,ae]=s.useState(null),[A,pe]=s.useState(!1),[z,re]=s.useState(!1),[te,be]=s.useState(!1),[Ae,ve]=s.useState(null),b=s.useRef(n),M=s.useRef(void 0),E=t[n],j=E?$i(E):!1,Ce=O!==0||A,ee=ue!==null,Ie=s.useCallback(he=>{const V=he.currentTarget,ye=V instanceof HTMLVideoElement?{width:V.videoWidth,height:V.videoHeight}:{width:V.naturalWidth,height:V.naturalHeight};!ye.width||!ye.height||ve(ye)},[]);s.useEffect(()=>{X.current=g},[g]),s.useEffect(()=>{const he=x.current;if(!he)return;const V=()=>H(El(he));V();const ye=new ResizeObserver(V);return ye.observe(he),()=>ye.disconnect()},[]);const oe=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),me=s.useCallback(()=>{const he=B.current;B.current=null,oe(),U.current=null,W.current=!1,ae(null),pe(!1),Z(0),N.current=0,re(!1),y.current=!1,v.current=0,C.current="none",he===1?d():he===-1&&l()},[oe,d,l]),xe=s.useCallback(()=>{oe(),B.current=null,U.current=null,W.current=!1,ae(null),pe(!1),Z(0),N.current=0},[oe]),J=s.useCallback(()=>{oe(),I.current=window.setTimeout(()=>{B.current!==null&&me()},bn+32)},[oe,me]),Q=s.useCallback((he,V)=>{var Ne;const ye=((Ne=X.current)==null?void 0:Ne.width)??0;if(oe(),U.current=he,ae(he),W.current=!0,pe(!0),V){B.current=he;const ze=-he*ye;N.current=ze,Z(ze),J();return}N.current=0,Z(0),I.current=window.setTimeout(()=>{I.current=null,xe()},bn+32)},[oe,xe,J]),se=s.useCallback(he=>{if(!(t.length<=1)){if(W.current){if(B.current===he){$.current=he,me();return}xe()}oe(),U.current=he,ae(he),W.current=!1,pe(!1),N.current=0,Z(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(he,!0)})})}},[t.length,Q,me,xe,oe]);T.current=se;const we=s.useCallback(he=>{he.propertyName!=="transform"||!W.current||B.current!==null&&me()},[me]),Ee=s.useCallback(()=>{const he=w.current;if(!he)return;const V=El(he);!V.width||!V.height||F(V)},[]);s.useEffect(()=>{Ee();const he=w.current;if(!he)return;const V=new ResizeObserver(()=>Ee());return V.observe(he),()=>V.disconnect()},[Ee]),s.useEffect(()=>{P==="opening"&&k&&q("open")},[P,k]),s.useEffect(()=>{if(P!=="closing")return;const he=setTimeout(()=>r(),bn);return()=>clearTimeout(he)},[P,r]),s.useEffect(()=>()=>{oe()},[oe]),s.useLayoutEffect(()=>{b.current===n&&M.current===(E==null?void 0:E.url)||(oe(),B.current=null,ae(null),L(0),Z(0),pe(!1),be(!1),re(!1),ve(null),f.current=0,v.current=0,C.current="none",y.current=!1,W.current=!1,N.current=0,U.current=null,h.current=null,S.current=!1,b.current=n,M.current=E==null?void 0:E.url)},[n,E==null?void 0:E.url,oe]),s.useLayoutEffect(()=>{const he=$.current;he!==null&&($.current=null,requestAnimationFrame(()=>{T.current(he)}))},[n,E==null?void 0:E.url]),s.useEffect(()=>{if(P!=="open")return;let he=null;const V=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},ye=()=>{V(),he=Je=>{Je.stopPropagation(),Je.preventDefault(),V()},document.addEventListener("click",he,!0)},Ne=Je=>{const _e=Je<0?1:-1;if(Math.abs(Je)>pf&&t.length>1){Q(_e,!0);return}Q(_e,!1)},ze=Je=>{if(Je.touches.length!==1||W.current)return;const _e=Je.touches[0];S.current=!0,h.current={x:_e.clientX,y:_e.clientY},C.current="none",v.current=0,y.current=!1},We=Je=>{if(!h.current||Je.touches.length!==1||W.current)return;const _e=Je.touches[0],qe=_e.clientX-h.current.x,De=_e.clientY-h.current.y;if(C.current==="none"){if(Math.abs(qe)<10&&Math.abs(De)<10)return;if(Math.abs(qe)>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,re(!0),v.current=qe;const it=qe<0?1:-1;U.current!==it&&(U.current=it,ae(it)),N.current=qe,Z(qe),Je.preventDefault();return}C.current==="vertical"&&(y.current=!0,re(!0),f.current=De,L(De),Je.preventDefault())},et=()=>{if(!h.current)return;const Je=C.current,_e=y.current;if(_e&&Je==="horizontal")Ne(v.current),ye();else if(_e&&Je==="vertical")if(f.current>uf){const De=window.innerHeight;f.current=De,be(!0),L(De),q("closing")}else f.current=0,L(0),ye();else Je==="horizontal"&&Math.abs(v.current)>0&&(Ne(v.current),ye());h.current=null,C.current="none",v.current=0,y.current=!1,re(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",We,{passive:!1}),document.addEventListener("touchend",et),document.addEventListener("touchcancel",et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",We),document.removeEventListener("touchend",et),document.removeEventListener("touchcancel",et),V()}},[P,t.length,Q]),s.useEffect(()=>{const he=V=>{V.key==="Escape"&&(V.preventDefault(),V.stopPropagation(),P!=="closing"&&q("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[P]);const Te=()=>{P!=="closing"&&q("closing")},Y=P==="open",de=P==="closing",ce=ne>0?Math.max(0,1-ne/500):1,G=ne>0?Math.max(.35,1-ne/500):1,le=k?p?k:vf(k,Ae):null,Me=he=>{if(he.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const V=le??he.currentTarget.getBoundingClientRect(),ye=he.clientY-V.top,Ne=Math.min(52,V.height*.2);if(!(ye>V.height-Ne)){if(he.clientX-V.left<V.width/2){se(-1);return}se(1)}},fe=he=>{if(t.length<=1)return;const V=le??he.currentTarget.getBoundingClientRect(),ye=he.clientX-V.left,Ne=he.clientY-V.top,ze=Math.min(52,V.height*.2);if(Ne>V.height-ze){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=ye<V.width/2?"w-resize":"e-resize"},K={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},Xe=p?"cover":"contain",Le=O!==0||ne>0?`translate(${O}px, ${ne}px)`:void 0,Ze=z&&!A?"none":A?`transform ${bn}ms ${jn}`:te?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:P==="opening"||de?`opacity ${bn}ms ${jn}`:"none",Qe={...K,transform:Le,opacity:ne>0?G:P==="opening"||de?0:1,transition:Ze,pointerEvents:"none"},ct={position:"absolute",top:((le==null?void 0:le.top)??0)-((g==null?void 0:g.top)??0),left:((le==null?void 0:le.left)??0)-((g==null?void 0:g.left)??0),width:le==null?void 0:le.width,height:le==null?void 0:le.height,objectFit:Xe,pointerEvents:j&&Y&&!Ce?"auto":"none",touchAction:j&&Y?"none":void 0},nt=(g==null?void 0:g.width)??0,Ve=ee?(n+ue+t.length)%t.length:null,$e=Ve!==null?t[Ve]:null,He={...K,transform:ee?`translateX(${ue*nt+O}px)`:void 0,opacity:1,transition:A?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((g==null?void 0:g.top)??0),left:((k==null?void 0:k.left)??0)-((g==null?void 0:g.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Xe,pointerEvents:"none"},Ue=le?{position:"fixed",top:le.top,height:le.height,width:le.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:P==="open"?"none":void 0},onClick:Te,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Y?ce:0,transition:z?"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]})})]})}),k&&g&&$e&&a.jsx("div",{style:He,onTransitionEnd:we,children:$i($e)?a.jsx("video",{src:$e.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${Ve}-${$e.url}`):a.jsx("img",{src:$e.url,alt:$e.name,style:Be},`neighbor-${Ve}-${$e.url}`)}),k&&g&&E&&a.jsx("div",{style:Qe,onTransitionEnd:we,children:j?a.jsx(bf,{src:E.url,phase:P,mediaRef:m,mediaStyle:ct,onLoadedMetadata:Ie,onClick:Me,onMouseMove:fe},`${n}-${E.url}`):a.jsx("img",{ref:m,src:E.url,alt:E.name,onLoad:Ie,style:ct},`${n}-${E.url}`)}),Y&&Ue&&t.length>1&&!j&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:le.left,cursor:"w-resize",pointerEvents:z?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),se(-1)}}),a.jsx("div",{style:{...Ue,left:le.left+le.width/2,cursor:"e-resize",pointerEvents:z?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),se(1)}})]})]})}function Sf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Cf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=D.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:w=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:v,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:X,direction:N,transition:U,titleMarginTop:W,subtitleMarginTop:I,titleColor:B,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:k,titleFontSettings:F,titleFontSize:g,titleLineHeight:H,titleLetterSpacing:P,titleWordSpacing:q,titleTextAppearance:ne,subtitleFontFamily:L,subtitleFontSettings:O,subtitleFontSize:Z,subtitleLineHeight:ue,subtitleLetterSpacing:ae,subtitleWordSpacing:A,subtitleTextAppearance:pe,lightboxCounterFontFamily:z,lightboxCounterFontSettings:re,lightboxCounterFontSize:te,lightboxCounterLineHeight:be,lightboxCounterLetterSpacing:Ae,lightboxCounterWordSpacing:ve,lightboxCounterTextAppearance:b,showText:M="always",alignEntries:E="off",align:j="top"}=e,Ce={fontSettings:{fontFamily:k,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:g??.01,lineHeight:H,letterSpacing:P??0,wordSpacing:q??0,textAppearance:ne,color:B},Ie={...an(qt(Ce,n))},oe={fontSettings:{fontFamily:L,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:ue,letterSpacing:ae??0,wordSpacing:A??0,textAppearance:pe,color:$},xe={...an(qt(oe,n))},J={fontSettings:{fontFamily:z,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:te??.01,lineHeight:be,letterSpacing:Ae??0,wordSpacing:ve??0,textAppearance:b,color:T},se={...an(qt(J,n)),...Ta(te,be,u,n)},we=$a(g,H,`${u}-item-title`,`${u}-text-tight-leading`),Ee=$a(Z,ue,`${u}-item-subtitle`,`${u}-text-tight-leading`),Te=Ta(g,H,u,n),Y=Ta(Z,ue,u,n),de=$a(te,be,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ce=D.buildColorVars(u,{titleColor:B,subtitleColor:$,lightboxCounterColor:T},$f,Tf),Me=`${l&&l!=="default"?`${u}-state-${l}`:""}${M==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),fe=h===0?1/0:h,K=(t??[]).slice(0,fe),Xe=s.useMemo(()=>f==="on"?ff(K):[],[K,f]),Le=x.entryWidth??.2,Ze=(v==null?void 0:v.display)==="cover",Qe=(v==null?void 0:v.ratioValue)??"1:1",ct=(v==null?void 0:v.reversed)??!1,[nt,Ve]=Qe.split(":").map(Number),Be=`${ct?Ve:nt} / ${ct?nt:Ve}`,Ue=x.columnsCount,he=D.scalingValue(Le??0,n),V=he,ye=!Ze&&S!=="off",Ne=K.length%Ue||Ue,ze=Ne<Ue&&K.length>0,We=K.length-Ne,et=ze?Math.floor((Ue-Ne)/2)+1:1,Je=C?D.scalingValue(C,n):void 0,_e={width:V,...Ze?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Je?{borderRadius:Je,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${ye?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",it=E==="on",at=`calc(${D.scalingValue(Le??0,n)} * (${w} / 100))`,dt=D.scalingValue(Le*w/100,n),St=Ze?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Je?{borderRadius:Je}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Je?{borderRadius:Je}:{}},[At,Zt]=s.useState(0),vt=s.useRef(null),wt=U==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=vt.current;if(!gt)return;const ke=new ResizeObserver(Ge=>{Zt(Math.round(Ge[0].contentRect.width))});return ke.observe(gt),()=>ke.disconnect()},[]);const zt=(()=>{const gt={...ce},ke=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return ke&&(gt["--cntrl-article-width"]=ke),gt})(),[Ft,xt]=s.useState(!1),[_t,Wt]=s.useState([]),[Ut,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Ht=(gt,ke)=>{n&&!i||f!=="off"&&(Wt(gt),Jt(ke),xt(!0))};s.useEffect(()=>{if(!Ft||f!=="on"||typeof document>"u")return;const gt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=gt}},[Ft,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const rn=s.useMemo(()=>af(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(yf,{mediaList:Xe}),a.jsx("div",{style:ce,children:a.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${it?` ${u}-align-entries`:""} ${u}-image-align-${j} ${Me}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${he})`,rowGap:it?0:D.scalingValue(m??0,n),columnGap:D.scalingValue(x.horizontalGap??0,n),width:D.scalingValue(x.wrapperWidth??0,n),...it?{[`--${u}-align-entries-row-gap`]:D.scalingValue(m??0,n)}:{}},children:K.map((gt,ke)=>{var Nt;const Ge=Ll(gt.title),st=Ll(gt.subtitle),ht=(((Nt=gt.link)==null?void 0:Nt.length)??0)>0&&f==="off"?gt.link:void 0,ft=Math.floor(ke/Ue)===Math.ceil(K.length/Ue)-1,Lt=ze&&ke>=We?`${et+(ke-We)}`:void 0,mt=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Ge&&a.jsx("p",{className:we,style:{width:at,...Ie,...Te},children:gt.title}),Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(W??0,n),width:dt}}),st&&a.jsx("p",{className:Ee,style:{width:at,...xe,...Y},children:gt.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:dt}})]}):null,jt=it?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?D.scalingValue(W??0,n):0,width:dt}}),Ge&&a.jsx("p",{className:we,style:{width:at,...Ie,...Te},children:gt.title}),De&&Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(W??0,n),width:dt}})]}):null,kt=it?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(I??0,n):0,width:dt}}),st&&a.jsx("p",{className:Ee,style:{width:at,...xe,...Y},children:gt.subtitle}),De&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:dt}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[jt,kt]}):a.jsxs(a.Fragment,{children:[jt,kt]}),Gt=Pd(gt.gallery),Xt=Gt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Dt=a.jsx("div",{className:qe,style:_e,children:Gt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:_}=Gt[0],Re=_?Xt.findIndex(Fe=>Fe.url===_.url):-1;return a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Re>=0?()=>Ht(Xt,Re):void 0})})():a.jsxs(a.Fragment,{children:[ye&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Gt.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(zs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:X*1e3,width:"100%",height:"100%",speed:df,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{N!=="random"||U==="fade"||cf(Ct)},children:Gt.map(({displayMedia:Ct,lightboxMedia:_},Re)=>{const Fe=_?Xt.findIndex(Oe=>Oe.url===_.url):-1;return a.jsx(js,{children:a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Fe>=0?()=>Ht(Xt,Fe):void 0})},Re)})},`${U}-${Le}-${N}-${X}-${At}-${d}`)]})}),Ot=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?D.scalingValue(W??0,n):0,width:dt}}),a.jsx("p",{className:we,style:{width:at,...Ie,...Te},children:gt.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(I??0,n):0,width:dt}}),a.jsx("p",{className:Ee,style:{width:at,...xe,...Y},children:gt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!it?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${it&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${he} * (${w} / 100))`:he,...Lt&&it?{gridColumn:Lt}:{}},children:it?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:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Dt}),Mt]})}):ht?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[mt,Dt]}),!De&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Ot})]}):a.jsxs(a.Fragment,{children:[mt,Dt,Ot]})})},ke)})})}),(!n||i)&&Ft&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:zt,"data-selection":"none",children:a.jsx(wf,{prefix:u,items:_t,index:Ut,imageDisplay:Sf(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Jt(ke=>(ke-1+_t.length)%_t.length),onNext:()=>Jt(ke=>(ke+1)%_t.length),counterClassName:de,counterStyle:se})}),gt)})()]})}const $f={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Tf=["hover","focus","filled","success","error"],If=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5137
5137
|
import '@splidejs/react-splide/css/core';
|
|
5138
5138
|
import { CommonComponentProps } from '../props';
|
|
5139
5139
|
import {
|
|
@@ -7186,12 +7186,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7186
7186
|
};
|
|
7187
7187
|
|
|
7188
7188
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7189
|
-
`,Ia={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},If=["titleColor","subtitleColor","lightboxCounterColor"],Rf={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:{...Ia.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:{...Ia.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:{...Ia.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:[...If],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Lf={element:Sf,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:Rf,sourceCode:Tf},Pf=50,Ml=10,Vs="cntrl-lightbox-journal",sa=Vs,as=`${Vs}-`,la=e=>`${Vs}-${e}`,Gs=e=>e===sa||e.startsWith(as),kl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Al=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=kl(t.get(la(e)));if(i)return i}const n=kl(t.get(sa));if(n)return n;for(const[i]of t){if(!i.startsWith(as))continue;const o=i.slice(as.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Fl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Ed=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Gs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(la(t),String(e)):i.searchParams.set(sa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Ef=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===la(e)||i===sa:Gs(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)}},Md=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(la(e)):[...t.keys()].some(n=>Gs(n))},Mf=(e,t)=>{if(Md(t)){if(e){window.history.back();return}Ef(t)}},kf=20,Af=2,Ra=e=>`max(${e}, ${kf}px)`,Ji=e=>((e==null?void 0:e.image)??[]).slice(0,Af),kd=e=>e.reduce((t,n)=>t+Ji(n).length,0),Ff=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Ji(r).length,1),i=Ji(e[t]).length;return{start:n,end:n+i-1}},_f=(e,t)=>{const n=kd(e),{start:i,end:o}=Ff(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Er=(e,t)=>t==="B"?e.flatMap((n,i)=>Ji(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Ji(n)})),Nf=(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 _f(i,o)},_l=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Wf=(e,t,n)=>e==="B"?t.length>1:kd(n)>1,fn=.004,Un=.004,Yi={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},Qi=(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},Ho=(e,t)=>Qi(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:Qi(e.length,n),effective:Ho(e.length,n)}},Ad=(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),Fd=(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),oi=["title1","title2","title3","count"],ot=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xs={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=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")],Hf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Xs[e],Ys(e)]))}),Df={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Of={title1:.02,title2:.02,title3:.02,count:.017},bi=(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[Df[t]]}},wi=(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??Of[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)};function _d({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:x=0,title3MarginLeft:w=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:G="#cccccc"}=n,W=O.scalingValue(f,i),U=O.scalingValue(v,i),H=O.scalingValue(m,i),I=h==="mobile",z=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),T=wi("title3",bi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Yi.title1Width,title2Width:c??Yi.title2Width,title3Width:u??Yi.title3Width}),[d,c,u]),_=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:w}),[x,w]),g=s.useMemo(()=>Kn(e,t,z,$,T),[e,t,z,$,T]),D=s.useMemo(()=>g.map(Y=>k[Y.widthKey]),[g,k]),P=s.useMemo(()=>Qi(g.length,D),[g.length,D]),q=s.useMemo(()=>Ho(g.length,D),[g.length,D]),ie=s.useMemo(()=>g.filter(Y=>Y.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(Y=>Y.prefix==="title2"||Y.prefix==="title3"),[g]),B=s.useMemo(()=>Zn(ie,k),[ie,k]),K=s.useMemo(()=>Zn(L,k),[L,k]),ue=!!(t.title1||t.title2||t.title3),le=C!==null;if(!(ue||le))return null;const pe=(p??0)>0||o,j=(Y,ce)=>{const Ee=g.findIndex(Q=>Q.prefix===Y.prefix);if(!I||ce==="single-row")return{effectiveWidth:q[Ee]??0,resolvedWidth:P[Ee]??0,maxWidth:cn(Ee,P)};if(ce==="two-row-top"){const Q=ie.findIndex(Ne=>Ne.prefix===Y.prefix);return{effectiveWidth:B.effective[Q]??0,resolvedWidth:B.resolved[Q]??0,maxWidth:cn(Q,B.resolved)}}const he=L.findIndex(Q=>Q.prefix===Y.prefix);return{effectiveWidth:K.effective[he]??0,resolvedWidth:K.resolved[he]??0,maxWidth:cn(he,K.resolved)}},se=(Y,ce,Ee)=>{if(!I||Ee==="single-row"){const et=Y.findIndex(De=>De.prefix===ce.prefix),Je=Y.map(De=>k[De.widthKey]),dt=Qi(Y.length,Je);return{effectiveWidth:Ho(Y.length,Je)[et]??0,resolvedWidth:dt[et]??0,maxWidth:cn(et,dt)}}if(Ee==="two-row-top"){const et=Y.filter(De=>De.prefix==="title1"),Je=et.findIndex(De=>De.prefix===ce.prefix),{resolved:dt,effective:tt}=Zn(et,k);return{effectiveWidth:tt[Je]??0,resolvedWidth:dt[Je]??0,maxWidth:cn(Je,dt)}}const he=Y.filter(et=>et.prefix==="title2"||et.prefix==="title3"),Q=he.findIndex(et=>et.prefix===ce.prefix),{resolved:Ne,effective:Fe}=Zn(he,k);return{effectiveWidth:Fe[Q]??0,resolvedWidth:Ne[Q]??0,maxWidth:cn(Q,Ne)}},ne=Y=>Fd(g,P,_,Y)+(I?0:p??0),ve=()=>I?0:p??0,ke=Y=>L.slice(0,Y).reduce((ce,Ee,he)=>ce+(Ee.marginLeftKey?_[Ee.marginLeftKey]??0:0)+(K.resolved[he]??0),0),xe=Y=>{const ce=L[Y];return ke(Y)+(ce.marginLeftKey?_[ce.marginLeftKey]??0:0)+(K.resolved[Y]??0)},b=(Y,ce,Ee)=>{const he=Y.marginLeftKey?_[Y.marginLeftKey]??0:0,{effectiveWidth:Q,resolvedWidth:Ne,maxWidth:Fe}=Ee??j(Y,ce),et=Math.max(he,Un),Je=o&&ce==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Y.prefix,style:{width:O.scalingValue(Q,i),...he>0?{marginLeft:O.scalingValue(he,i)}:{}},children:[a.jsx("p",{className:Y.className,style:Y.style,children:Y.text}),Je&&Y.marginLeftKey?a.jsx("div",{"data-controls":Y.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:O.scalingValue(-he,i),width:O.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Je?a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:O.scalingValue(-fn/2,i),width:O.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},Y.className)},M=(Y="two-row")=>{const ce=g.findIndex(Q=>Q.prefix==="title1"),Ee=ce>=0?P[ce]:k.title1Width,he=Y==="two-row"&&o;return a.jsx("div",{...he?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee)}:{},style:{width:O.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...he?{pointerEvents:"auto"}:{}}})},E=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:z,"aria-hidden":"true",children:" "}),V=Y=>{const ce=Kn(e,Y,z,$,T);return a.jsx(a.Fragment,{children:ce.map(Ee=>b(Ee,"single-row",se(ce,Ee,"single-row")))})},Ce=Y=>{const ce=Kn(e,Y,z,$,T),Ee=ce.find(he=>he.prefix==="title1");return Ee?b(Ee,"two-row-top",se(ce,Ee,"two-row-top")):null},te=(Y,ce=!1)=>{const Ee=Kn(e,Y,z,$,T),he=Ee.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),Q=o&&ce;return he.length>0||Q||(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(Fe=>b(Fe,"two-row-bottom",se(Ee,Fe,"two-row-bottom")))}),ce&&o?a.jsxs(a.Fragment,{children:[be(),Pe()]}):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:H,width:"100%",flexShrink:0,pointerEvents:Q?"auto":"none"}}):null]}):null},$e=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:O.scalingValue(y??0,i),height:O.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":G},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Y=>{Y.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:S,hoverFill:i&&!r?S: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:U,height:"100%",pointerEvents:"auto"}})]}),ae=()=>le?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:$e()}):null,ge=Y=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Y})}),ye=Y=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[le||ue?E():null,pe?M("two-row"):null,ge(Y),ae()]}),Z=(Y,ce=!1)=>a.jsxs(a.Fragment,{children:[ye(Ce(Y)),te(Y,ce)]}),J=()=>{const Y=I?-1:g.findIndex(he=>he.prefix==="title1"),ce=!I&&(o||(p??0)>0)?(()=>{const he=p??0,Q=Y>=0?P[Y]:k.title1Width,Ne=Math.max(he,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:O.scalingValue(Ne,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ee=g.flatMap((he,Q)=>{if(!he.marginLeftKey)return[];const Ne=_[he.marginLeftKey]??0,Fe=Ad(g,P,_,Q)+ve(),et=Math.max(Ne,Un);return a.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P[Q]),style:{position:"absolute",top:0,left:O.scalingValue(Fe,i),width:O.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return ce?[ce,...Ee]:Ee},de=()=>g.map((Y,ce)=>{const Ee=cn(ce,P),Q=ne(ce)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O.scalingValue(Q,i),width:O.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)}),be=()=>L.flatMap((Y,ce)=>{if(!Y.marginLeftKey)return[];const Ee=_[Y.marginLeftKey]??0,he=ke(ce),Q=Math.max(Ee,Un),{resolvedWidth:Ne}=j(Y,"two-row-bottom");return a.jsx("div",{"data-controls":Y.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:O.scalingValue(he,i),width:O.scalingValue(Q,i),height:"100%",pointerEvents:"auto"}},Y.marginLeftKey)}),Pe=()=>L.map((Y,ce)=>{const{maxWidth:Ee}=j(Y,"two-row-bottom"),Q=xe(ce)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O.scalingValue(Q,i),width:O.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)}),Se=()=>!o||I?null:a.jsxs(a.Fragment,{children:[J(),de()]}),X=!!(t.title2||t.title3||(m??0)>0||o),me=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[le||ue?E():null,pe?M("single-row"):null,ue?ge(V(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ae(),Se()]}),re=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...X?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:X?void 0:{flex:"0 0 auto",height:"auto"},children:Z(t,!0)}),Se()]});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:W,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...I?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${I?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${I?` ${e}-text-bar-cell-stacked`:""}`,style:I?void 0:{flex:1,minWidth:0,width:"100%"},children:I?re():me()})})})]})}function Bf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zf(e){return`
|
|
7189
|
+
`,Ia={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Rf=["titleColor","subtitleColor","lightboxCounterColor"],Lf={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:{...Ia.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:{...Ia.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:{...Ia.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:[...Rf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Pf={element:Cf,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:Lf,sourceCode:If},Ef=50,Ml=10,Vs="cntrl-lightbox-journal",sa=Vs,as=`${Vs}-`,la=e=>`${Vs}-${e}`,Gs=e=>e===sa||e.startsWith(as),kl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Al=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=kl(t.get(la(e)));if(i)return i}const n=kl(t.get(sa));if(n)return n;for(const[i]of t){if(!i.startsWith(as))continue;const o=i.slice(as.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Fl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Ed=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Gs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(la(t),String(e)):i.searchParams.set(sa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Mf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===la(e)||i===sa:Gs(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)}},Md=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(la(e)):[...t.keys()].some(n=>Gs(n))},kf=(e,t)=>{if(Md(t)){if(e){window.history.back();return}Mf(t)}},Af=20,Ff=2,Ra=e=>`max(${e}, ${Af}px)`,Ji=e=>((e==null?void 0:e.image)??[]).slice(0,Ff),kd=e=>e.reduce((t,n)=>t+Ji(n).length,0),_f=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Ji(r).length,1),i=Ji(e[t]).length;return{start:n,end:n+i-1}},Nf=(e,t)=>{const n=kd(e),{start:i,end:o}=_f(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Er=(e,t)=>t==="B"?e.flatMap((n,i)=>Ji(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Ji(n)})),Wf=(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 Nf(i,o)},_l=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Hf=(e,t,n)=>e==="B"?t.length>1:kd(n)>1,fn=.004,Un=.004,Yi={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},Qi=(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},Ho=(e,t)=>Qi(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:Qi(e.length,n),effective:Ho(e.length,n)}},Ad=(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),Fd=(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),oi=["title1","title2","title3","count"],rt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xs={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[rt(e,"fontFamily"),rt(e,"fontSettings"),{type:"row",items:[rt(e,"fontSize"),rt(e,"lineHeight"),rt(e,"letterSpacing"),rt(e,"wordSpacing")]},rt(e,"textAlign"),rt(e,"textAppearance")],Df=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Xs[e],Ys(e)]))}),Of={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Bf={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=rt(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[Of[t]]}},wi=(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??Bf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)};function _d({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:x=0,title3MarginLeft:w=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:X="#cccccc"}=n,N=D.scalingValue(f,i),U=D.scalingValue(v,i),W=D.scalingValue(m,i),I=h==="mobile",B=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),T=wi("title3",bi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Yi.title1Width,title2Width:c??Yi.title2Width,title3Width:u??Yi.title3Width}),[d,c,u]),F=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:w}),[x,w]),g=s.useMemo(()=>Kn(e,t,B,$,T),[e,t,B,$,T]),H=s.useMemo(()=>g.map(G=>k[G.widthKey]),[g,k]),P=s.useMemo(()=>Qi(g.length,H),[g.length,H]),q=s.useMemo(()=>Ho(g.length,H),[g.length,H]),ne=s.useMemo(()=>g.filter(G=>G.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(G=>G.prefix==="title2"||G.prefix==="title3"),[g]),O=s.useMemo(()=>Zn(ne,k),[ne,k]),Z=s.useMemo(()=>Zn(L,k),[L,k]),ue=!!(t.title1||t.title2||t.title3),ae=C!==null;if(!(ue||ae))return null;const pe=(p??0)>0||o,z=(G,le)=>{const Me=g.findIndex(K=>K.prefix===G.prefix);if(!I||le==="single-row")return{effectiveWidth:q[Me]??0,resolvedWidth:P[Me]??0,maxWidth:cn(Me,P)};if(le==="two-row-top"){const K=ne.findIndex(Xe=>Xe.prefix===G.prefix);return{effectiveWidth:O.effective[K]??0,resolvedWidth:O.resolved[K]??0,maxWidth:cn(K,O.resolved)}}const fe=L.findIndex(K=>K.prefix===G.prefix);return{effectiveWidth:Z.effective[fe]??0,resolvedWidth:Z.resolved[fe]??0,maxWidth:cn(fe,Z.resolved)}},re=(G,le,Me)=>{if(!I||Me==="single-row"){const Ze=G.findIndex(Ve=>Ve.prefix===le.prefix),Qe=G.map(Ve=>k[Ve.widthKey]),ct=Qi(G.length,Qe);return{effectiveWidth:Ho(G.length,Qe)[Ze]??0,resolvedWidth:ct[Ze]??0,maxWidth:cn(Ze,ct)}}if(Me==="two-row-top"){const Ze=G.filter(Ve=>Ve.prefix==="title1"),Qe=Ze.findIndex(Ve=>Ve.prefix===le.prefix),{resolved:ct,effective:nt}=Zn(Ze,k);return{effectiveWidth:nt[Qe]??0,resolvedWidth:ct[Qe]??0,maxWidth:cn(Qe,ct)}}const fe=G.filter(Ze=>Ze.prefix==="title2"||Ze.prefix==="title3"),K=fe.findIndex(Ze=>Ze.prefix===le.prefix),{resolved:Xe,effective:Le}=Zn(fe,k);return{effectiveWidth:Le[K]??0,resolvedWidth:Xe[K]??0,maxWidth:cn(K,Xe)}},te=G=>Fd(g,P,F,G)+(I?0:p??0),be=()=>I?0:p??0,Ae=G=>L.slice(0,G).reduce((le,Me,fe)=>le+(Me.marginLeftKey?F[Me.marginLeftKey]??0:0)+(Z.resolved[fe]??0),0),ve=G=>{const le=L[G];return Ae(G)+(le.marginLeftKey?F[le.marginLeftKey]??0:0)+(Z.resolved[G]??0)},b=(G,le,Me)=>{const fe=G.marginLeftKey?F[G.marginLeftKey]??0:0,{effectiveWidth:K,resolvedWidth:Xe,maxWidth:Le}=Me??z(G,le),Ze=Math.max(fe,Un),Qe=o&&le==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":G.prefix,style:{width:D.scalingValue(K,i),...fe>0?{marginLeft:D.scalingValue(fe,i)}:{}},children:[a.jsx("p",{className:G.className,style:G.style,children:G.text}),Qe&&G.marginLeftKey?a.jsx("div",{"data-controls":G.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:D.scalingValue(-fe,i),width:D.scalingValue(Ze,i),height:"100%",pointerEvents:"auto"}}):null,Qe?a.jsx("div",{"data-controls":G.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D.scalingValue(-fn/2,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},G.className)},M=(G="two-row")=>{const le=g.findIndex(K=>K.prefix==="title1"),Me=le>=0?P[le]:k.title1Width,fe=G==="two-row"&&o;return a.jsx("div",{...fe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...fe?{pointerEvents:"auto"}:{}}})},E=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:B,"aria-hidden":"true",children:" "}),j=G=>{const le=Kn(e,G,B,$,T);return a.jsx(a.Fragment,{children:le.map(Me=>b(Me,"single-row",re(le,Me,"single-row")))})},Ce=G=>{const le=Kn(e,G,B,$,T),Me=le.find(fe=>fe.prefix==="title1");return Me?b(Me,"two-row-top",re(le,Me,"two-row-top")):null},ee=(G,le=!1)=>{const Me=Kn(e,G,B,$,T),fe=Me.filter(Le=>Le.prefix==="title2"||Le.prefix==="title3"),K=o&≤return fe.length>0||K||(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(Le=>b(Le,"two-row-bottom",re(Me,Le,"two-row-bottom")))}),le&&o?a.jsxs(a.Fragment,{children:[we(),Ee()]}):null]}):null,(m??0)>0||K?a.jsx("div",{"data-controls":K?"titleRowMarginBottom":void 0,"data-controls-axis":K?"y":void 0,"data-controls-reverse":K?"":void 0,className:K?`${e}-control`:void 0,style:{height:W,width:"100%",flexShrink:0,pointerEvents:K?"auto":"none"}}):null]}):null},Ie=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(y??0,i),height:D.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":X},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:G=>{G.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:S,hoverFill:i&&!r?S:X,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:U,height:"100%",pointerEvents:"auto"}})]}),oe=()=>ae?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Ie()}):null,me=G=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:G})}),xe=G=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ae||ue?E():null,pe?M("two-row"):null,me(G),oe()]}),J=(G,le=!1)=>a.jsxs(a.Fragment,{children:[xe(Ce(G)),ee(G,le)]}),Q=()=>{const G=I?-1:g.findIndex(fe=>fe.prefix==="title1"),le=!I&&(o||(p??0)>0)?(()=>{const fe=p??0,K=G>=0?P[G]:k.title1Width,Xe=Math.max(fe,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K),style:{position:"absolute",top:0,left:0,width:D.scalingValue(Xe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Me=g.flatMap((fe,K)=>{if(!fe.marginLeftKey)return[];const Xe=F[fe.marginLeftKey]??0,Le=Ad(g,P,F,K)+be(),Ze=Math.max(Xe,Un);return a.jsx("div",{"data-controls":fe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P[K]),style:{position:"absolute",top:0,left:D.scalingValue(Le,i),width:D.scalingValue(Ze,i),height:"100%",pointerEvents:"auto"}},fe.marginLeftKey)});return le?[le,...Me]:Me},se=()=>g.map((G,le)=>{const Me=cn(le,P),K=te(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":G.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:D.scalingValue(K,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${G.widthKey}-junction`)}),we=()=>L.flatMap((G,le)=>{if(!G.marginLeftKey)return[];const Me=F[G.marginLeftKey]??0,fe=Ae(le),K=Math.max(Me,Un),{resolvedWidth:Xe}=z(G,"two-row-bottom");return a.jsx("div",{"data-controls":G.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:D.scalingValue(fe,i),width:D.scalingValue(K,i),height:"100%",pointerEvents:"auto"}},G.marginLeftKey)}),Ee=()=>L.map((G,le)=>{const{maxWidth:Me}=z(G,"two-row-bottom"),K=ve(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":G.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:D.scalingValue(K,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${G.widthKey}-junction`)}),Te=()=>!o||I?null:a.jsxs(a.Fragment,{children:[Q(),se()]}),Y=!!(t.title2||t.title3||(m??0)>0||o),de=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ae||ue?E():null,pe?M("single-row"):null,ue?me(j(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),oe(),Te()]}),ce=()=>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:J(t,!0)}),Te()]});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%",...I?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${I?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${I?` ${e}-text-bar-cell-stacked`:""}`,style:I?void 0:{flex:1,minWidth:0,width:"100%"},children:I?ce():de()})})})]})}function zf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function jf(e){return`
|
|
7190
7190
|
.${e}-wrapper {
|
|
7191
7191
|
display: grid;
|
|
7192
7192
|
align-items: start;
|
|
7193
7193
|
justify-content: center;
|
|
7194
|
-
min-height: ${
|
|
7194
|
+
min-height: ${zf(48)};
|
|
7195
7195
|
}
|
|
7196
7196
|
.${e}-item {
|
|
7197
7197
|
display: flex;
|
|
@@ -7506,7 +7506,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7506
7506
|
pointer-events: auto;
|
|
7507
7507
|
flex-shrink: 0;
|
|
7508
7508
|
}
|
|
7509
|
-
`}const Nl={url:"",name:"",objectFit:"cover"},Tn=500,fo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",jf=72,Vf=50,Gf=1e4,Xf=650,Yf=500;function qf(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 Nd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Or(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 Uf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Nd(i,n):null}function Kf(e){return e.reduce((t,n,i)=>{const o=qs(n.gallery),l=Us(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 $o(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 Wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return $o(e,i,n)}const Zf=.03;function Wd(e){return e.width*Zf}const La={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function pr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Jf(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ss(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 Qf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ss(e,t.width,t.height)}function ey(e,t){if(mo(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 ty(e){const t=new Set,n=[];for(const i of e){const o=qs(i.gallery),r=Us(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 ny({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=>mo(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 eo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Wd(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 Br(e,t,n){const i=eo(e,t,n);return{...i,left:2*i.left-e.left}}function iy(e,t,n){const{left:i,width:o}=n,r=Wd(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 Hd(e,t,n,i){const o=eo(e,"left",i),r=eo(e,"right",i),l=Br(e,"left",i),d=Br(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 oy(e,t,n,i){const{start:o,end:r}=Hd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function ry(e,t,n){const i=eo(e,t,n),o=Br(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Dd(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 qs(e){if(!e)return;if(Dd(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??Nl,i??o??Nl]}]}function ay(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function sy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Us(e){if(!Array.isArray(e)||e.length===0)return[];if(Dd(e)){const t=[];for(const n of e){const i=ay(n);if(!i)continue;const o=sy(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 mo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function ly({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return mo(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 cy({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 mr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return mo(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 dy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[W,U]=s.useState(0),H=s.useRef(null),I=s.useRef(0),z=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),_=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),P=s.useRef(null),q=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),B=s.useRef(null),K=s.useRef(!1),[ue,le]=s.useState(null),[F,pe]=s.useState(La),[j,se]=s.useState(0),[ne,ve]=s.useState("opening"),[ke,xe]=s.useState(0),[b,M]=s.useState(0),[E,V]=s.useState(!1),[Ce,te]=s.useState(null),[$e,ae]=s.useState(null),[ge,ye]=s.useState(null),[Z,J]=s.useState(!1),[de,be]=s.useState(null),[Pe,Se]=s.useState(!1),X=s.useRef(!1),[me,re]=s.useState(!1),[Y,ce]=s.useState(!1),Ee=s.useRef(n),he=s.useRef(void 0),Q=t[n],Ne=Q?mo(Q):!1,Fe=b!==0||E,et=!l&&(!r||!!d),Je=c&&!l,dt=u.length>1,tt=s.useCallback((N,Re)=>t.length<=1?null:t[(N+Re+t.length)%t.length]??null,[t]),De=dt?$o(u,p,-1):tt(n,-1),Ie=dt?$o(u,p,1):tt(n,1),We=Ce===-1&&Fe?dt&&$e!==null?$o(u,$e,-1):ge!==null?tt(ge,-1):null:null,je=Ce===1&&Fe?dt&&$e!==null?$o(u,$e,1):ge!==null?tt(ge,1):null:null,Ue=We&&We.url!==(De==null?void 0:De.url)?We:null,A=je&&je.url!==(Ie==null?void 0:Ie.url)?je:null,ee=De&&Je?(()=>{const N=dt?Wl(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return N&&N.url!==De.url?N:null})():null,Te=Ie&&Je?(()=>{const N=dt?Wl(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return N&&N.url!==Ie.url?N:null})():null,He=Ue??ee,Be=A??Te,Ve=s.useCallback((N,Re,Ae)=>{if(!N||!Re||!Ae)return;const ze=G.current,ct=ze.get(N);(ct==null?void 0:ct.width)===Re&&(ct==null?void 0:ct.height)===Ae||(ze.set(N,{width:Re,height:Ae}),U(Et=>Et+1))},[]),rt=s.useCallback(N=>{if(!(N!=null&&N.url))return null;const Re=G.current.get(N.url);return Qf(y.current,Re)},[W,j]),Ze=s.useCallback(()=>{if(!Q)return;const N=rt(Q);if(N){le(N);return}const Re=y.current;Re&&le(Hl(Re))},[Q,rt]),_e=s.useCallback(N=>{if(dt){const Re=u.length;ae((p+N+Re)%Re),ye(null);return}t.length>1&&(ye((n+N+t.length)%t.length),ae(null))},[dt,u.length,p,t.length,n]),qe=s.useCallback(N=>{_.current=N,V(N)},[]),Oe=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{Oe(),qe(!1)},fo+32)},[Oe,qe]),at=s.useCallback(()=>{const N=C.current;if(!N){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:La.width,height:typeof window<"u"?window.innerHeight:La.height});return}const Re=N.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),st=s.useCallback((N,Re)=>{if(Fe){if(me&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Ae=rt(N);if(!Ae)return;const{x:ze,y:ct}=oy(Ae,Re,Ce,F);return`translate(${ze}px, ${ct}px)`}if(E)return"translate(0px, 0px)"}},[Fe,me,E,b,Ce,F,rt]),St=s.useCallback(()=>{const N=D.current;D.current=null,Oe(),qe(!1),te(null),ae(null),ye(null),M(0),re(!1),T.current=!1,z.current=0,$.current="none",N===-1?f():N===1&&v()},[Oe,qe,f,v]),Yt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{D.current!==null&&St()},fo+32)},[Oe,St]),Zt=s.useCallback(()=>{Oe(),D.current=null,qe(!1),te(null),ae(null),ye(null),M(0),re(!1),T.current=!1,z.current=0,$.current="none"},[Oe,qe]),vt=s.useCallback(N=>{if(!(!Je||!ue)){if(_.current){if(D.current===N){P.current=N,St();return}Zt()}Oe(),_e(N),D.current=N,te(N),qe(!0),Yt()}},[Je,ue,St,Zt,Oe,_e,qe,Yt]);q.current=vt;const wt=s.useCallback(()=>{ie.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),Bt=s.useCallback(N=>{L.current!==null&&window.clearInterval(L.current);const Re=K.current?Yf:Xf;L.current=window.setInterval(()=>{q.current(N)},Re)},[]),At=s.useCallback(N=>{ie.current!==N&&(wt(),ie.current=N,K.current=!1,q.current(N),Bt(N),B.current=window.setTimeout(()=>{B.current=null,ie.current===N&&(K.current=!0,Bt(N))},Gf))},[wt,Bt]),xt=s.useCallback(()=>{const N=y.current;if(!N)return;const Re=Q==null?void 0:Q.url,Ae=Re?G.current.get(Re):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){le(ss(N,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Re&&(ze.src===Re||ze.currentSrc===Re)){const{width:Et,height:it}=Jf(ze);if(Et&&it){Ve(Re,Et,it),le(ss(N,Et,it));return}}const ct=Hl(N);!ct.width||!ct.height||le(ct)},[Q==null?void 0:Q.url,Ve]),Ft=s.useCallback(N=>{if(S.current=N,!!N){if(N instanceof HTMLVideoElement){N.readyState>=1&&N.videoWidth>0&&xt();return}N.complete&&N.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{at(),xt(),se(N=>N+1)},[at,xt]);s.useEffect(()=>{Nt();const N=y.current,Re=C.current,Ae=new ResizeObserver(()=>Nt());return N&&Ae.observe(N),Re&&Ae.observe(Re),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!Q)return;const N=S.current;if(N){if(N instanceof HTMLImageElement&&N.complete&&N.naturalWidth>0){xt();return}N instanceof HTMLVideoElement&&N.readyState>=1&&N.videoWidth>0&&xt()}},[Q==null?void 0:Q.url,n,xt]),s.useEffect(()=>{Ze()},[Ze,W]),s.useEffect(()=>{const N=new Set,Re=[],Ae=ze=>{!(ze!=null&&ze.url)||N.has(ze.url)||(N.add(ze.url),Re.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Re.forEach(ze=>{G.current.has(ze.url)||ey(ze,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(ne!=="opening"||!ue)return;if(!w){ve("open");return}J(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{J(!0),ve("open")})});return()=>cancelAnimationFrame(N)},[ne,ue,w]),s.useEffect(()=>{if(ne!=="closing")return;const N=setTimeout(()=>h(),Tn);return()=>clearTimeout(N)},[ne,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{Ee.current===n&&he.current===(Q==null?void 0:Q.url)||(Oe(),D.current=null,te(null),ae(null),ye(null),xe(0),M(0),qe(!1),ce(!1),re(!1),I.current=0,z.current=0,$.current="none",T.current=!1,H.current=null,k.current=!1,S.current=null,Ze(),Ee.current=n,he.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,qe,Oe,Ze]),s.useLayoutEffect(()=>{const N=P.current;N!==null&&(P.current=null,requestAnimationFrame(()=>{q.current(N)}))},[n,p,Q==null?void 0:Q.url]),s.useLayoutEffect(()=>{if(ne==="opening"){X.current=!1,Se(!1);return}if(ne!=="open"||X.current)return;if(!De&&!Ie){X.current=!0;return}Se(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Se(!0),X.current=!0})});return()=>cancelAnimationFrame(N)},[ne,De==null?void 0:De.url,Ie==null?void 0:Ie.url]),s.useEffect(()=>{if(ne!=="open")return;const N=()=>{const it=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Re=it=>{const yt=it<0?1:-1;Oe(),_e(yt),D.current=yt,te(yt),qe(!0),Yt()},Ae=it=>{if(Math.abs(it)>Vf&&Je){Re(it);return}D.current=null,te(null),ae(null),ye(null),qe(!0),M(0),nt()},ze=it=>{if(it.touches.length!==1||_.current)return;const yt=it.touches[0];k.current=!0,H.current={x:yt.clientX,y:yt.clientY},$.current="none",z.current=0,T.current=!1},ct=it=>{if(!H.current||it.touches.length!==1||_.current)return;const yt=it.touches[0],Ot=yt.clientX-H.current.x,It=yt.clientY-H.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Je)return;$.current="horizontal"}else if(It>0){if(!et)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,re(!0),z.current=Ot,M(Ot),it.preventDefault();return}$.current==="vertical"&&(T.current=!0,re(!0),I.current=It,xe(It),it.preventDefault())},Et=()=>{if(!H.current)return;const it=$.current,yt=T.current;if(yt&&it==="horizontal")Ae(z.current),N();else if(yt&&it==="vertical"){const Ot=I.current;if(et&&Ot>jf){const It=window.innerHeight;I.current=It,ce(!0),xe(It),ve("closing")}else I.current=0,xe(0);N()}else it==="horizontal"&&Math.abs(z.current)>0&&(Ae(z.current),N());H.current=null,$.current="none",z.current=0,T.current=!1,re(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Je,qe,nt,Oe,et,Yt,_e]);const Ut=s.useCallback(()=>{const N=(m==null?void 0:m())??w??null;N&&ue&&(be(N),J(!0)),ve("closing")},[m,w,ue]);s.useEffect(()=>{const N=ze=>{if(ze.key==="Escape"){if(r&&d||ne==="closing")return;wt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||ne!=="open"||!Je)return;ze.preventDefault();const ct=ze.key==="ArrowLeft"?-1:1;ze.repeat&&ie.current===ct||At(ct)},Re=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const ct=ze.key==="ArrowLeft"?-1:1;ie.current===ct&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",N),window.addEventListener("keyup",Re),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Ae),wt()}},[ne,r,d,Ut,Je,At,wt]),s.useEffect(()=>{ne!=="open"&&wt()},[ne,wt]);const Jt=()=>{ne==="closing"||l||Ut()},Tt=ne==="open",Wt=ne==="closing",rn=ke>0?Math.max(0,1-ke/500):1,gt=ke>0?Math.max(.35,1-ke/500):1,Me=s.useCallback(N=>{if(!(N.propertyName!=="transform"||!_.current)){if(D.current!==null){St();return}Oe(),qe(!1)}},[Oe,qe,St]),Xe=ne==="closing"?de??w:w,lt=Xe&&ue&&(ne==="opening"||Wt)?qf(Xe,ue):void 0,ht=Fe&&Q?st(Q,"center"):ke>0?`translateY(${ke}px)`:lt,ft=ue?pr(ue,F):null,Lt=!!(Xe&&ue),mt=Lt&&(ne==="closing"||ne==="open"&&Z),zt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:ke>0?gt:Lt?1:ne==="opening"||Wt?0:1,transition:me&&!E?"none":E?`transform ${fo}ms ${pn}`:Y?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:ne==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ne&&Tt&&!Fe?"auto":"none",touchAction:Ne&&Tt?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Fe?"auto":"none"},Mt=(N,Re,Ae="adjacent")=>{const ze=rt(N);if(!ze)return{display:"none"};const ct=Ae==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?Hd(ze,ct,Ce,F):{start:Ae==="far"?Br(ze,Re,F):eo(ze,Re,F)},it=pr(Et,F),yt=st(N,ct),Ot=!Fe&&Ae==="adjacent"&&Tt&&!Pe?ry(ze,Re,F):null,It=Ae==="far"&&Fe&&Ce===(Re==="left"?-1:1),nn=me&&!E?!1:E,un=Ae==="adjacent"&&Tt&&Pe&&!Fe;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:yt??(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 ${fo}ms ${pn}`:`transform ${fo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:ne==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(N,Re)=>{const Ae=rt(N);return Ae?iy(eo(Ae,Re,F),Re,F):null},Gt=N=>Re=>{if(!l){if(k.current){k.current=!1;return}Re.stopPropagation(),vt(N)}},Ht=De?Vt(De,"left"):null,Dt=Ie?Vt(Ie,"right"):null,_t=Ht?pr(Ht,F):null,Ct=Dt?pr(Dt,F):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:me?"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:me?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&He&&a.jsx(mr,{media:He,style:Mt(He,"left","far"),onMeasure:Ve,onTransitionEnd:Me},`far-prev-${He.url}`),Tt&&De&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:De,style:Mt(De,"left"),onMeasure:Ve,onTransitionEnd:Me},`prev-${De.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Tt&&Ie&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ie,style:Mt(Ie,"right"),onMeasure:Ve,onTransitionEnd:Me},`next-${Ie.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Tt&&Be&&a.jsx(mr,{media:Be,style:Mt(Be,"right","far"),onMeasure:Ve,onTransitionEnd:Me},`far-next-${Be.url}`),ue&&Q&&(Ne?a.jsx(cy,{src:Q.url,phase:ne,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Me},`${n}-${Q.url}`):a.jsx("img",{ref:Ft,src:Q.url,alt:Q.name,onLoad:xt,onTransitionEnd:Me,style:zt},`${n}-${Q.url}`))]})}function uy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=O.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,w=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",h=(x==null?void 0:x.reversed)??!1,[f,v]=m.split(":").map(Number),S=`${h?v:f} / ${h?f:v}`,G=c.entryWidth??.2,W=c.columnsCount,U=O.scalingValue(G,n),H=O.scalingValue(c.horizontalGap??0,n),I=U,z=U,$={width:I,...w?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},T=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[_,g]=s.useState(!1),[D,P]=s.useState([]),[q,ie]=s.useState(0),[L,B]=s.useState(0),[K,ue]=s.useState(null),[le,F]=s.useState({title1:"",title2:"",title3:""}),pe=(()=>{const ge={},ye=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return ye&&(ge["--cntrl-article-width"]=ye),ge})(),j=!n||i||o,se=s.useMemo(()=>zf(d),[d]),ne=t??[],ve=ne.length%W||W,ke=ve<W&&ne.length>0,xe=ne.length-ve,b=ke?Math.floor((W-ve)/2)+1:1,M=s.useMemo(()=>Kf(ne),[ne]),E=s.useMemo(()=>ty(ne),[ne]),V=(ge,ye,Z)=>{if(n&&!o&&!i)return;const J=M.findIndex(be=>be.gridIndex===ge);if(J<0)return;const de=M[J];B(J),P(de.items),ie(ye),F(de.entry),ue(Z??null),g(!0)},Ce=s.useCallback(()=>{g(!1),ue(null)},[]),te=s.useCallback(()=>{const ge=M[L];return!ge||!k.current?K:Uf(k.current,ge.gridIndex,w?"cover":"contain")??K},[M,L,K,w]),$e=s.useCallback(ge=>{if(M.length>1){const ye=M.length,Z=(L+ge+ye)%ye,J=M[Z],de=Math.min(q,J.items.length-1);B(Z),P(J.items),ie(de),F(J.entry);return}ie(ye=>(ye+ge+D.length)%D.length)},[M,L,q,D.length]),ae=M.length>1||D.length>1;return s.useEffect(()=>{if(!_||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[_]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:se}}),a.jsx(ny,{mediaList:E}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${W}, ${U})`,rowGap:0,columnGap:H,width:O.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:O.scalingValue(u??0,n)},children:ne.map((ge,ye)=>{const Z=qs(ge.gallery),J=Us(Z),de=J.filter(re=>re.lightboxMedia).map(re=>re.lightboxMedia),be=Math.floor(ye/W)===Math.ceil(ne.length/W)-1,Pe=ke&&ye>=xe?`${b+(ye-xe)}`:void 0,Se=J[0],X=Se!=null&&Se.lightboxMedia?de.findIndex(re=>re.url===Se.lightboxMedia.url):-1,me=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:J.length>0&&a.jsx(ly,{media:Se.displayMedia,gridIndex:ye,className:`${d}-item-${mo(Se.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:j&&X>=0?re=>V(ye,X,Nd(re.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`,be?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...Pe?{gridColumn:Pe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:z}})}),a.jsx("a",{className:`${d}-item-image-link`,children:me}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:z}})})]})},ye)})}),_&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:pe,"data-selection":"none",children:a.jsx(dy,{prefix:d,items:D,index:q,entry:le,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ae,lightboxEntries:M,entryIdx:L,layoutId:r,sourceRect:K,resolveCloseSourceRect:te,onClose:Ce,onPrev:()=>$e(-1),onNext:()=>$e(1)})}),ge)})()]})}const py=`import { CommonComponentProps } from '../props';
|
|
7509
|
+
`}const Nl={url:"",name:"",objectFit:"cover"},Tn=500,fo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Vf=72,Gf=50,Xf=1e4,Yf=650,qf=500;function Uf(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 Nd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Or(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 Kf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Nd(i,n):null}function Zf(e){return e.reduce((t,n,i)=>{const o=qs(n.gallery),l=Us(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 $o(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 Wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return $o(e,i,n)}const Jf=.03;function Wd(e){return e.width*Jf}const La={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function pr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Qf(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ss(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 ey(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ss(e,t.width,t.height)}function ty(e,t){if(mo(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 ny(e){const t=new Set,n=[];for(const i of e){const o=qs(i.gallery),r=Us(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 iy({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=>mo(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 eo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Wd(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 Br(e,t,n){const i=eo(e,t,n);return{...i,left:2*i.left-e.left}}function oy(e,t,n){const{left:i,width:o}=n,r=Wd(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 Hd(e,t,n,i){const o=eo(e,"left",i),r=eo(e,"right",i),l=Br(e,"left",i),d=Br(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 ry(e,t,n,i){const{start:o,end:r}=Hd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function ay(e,t,n){const i=eo(e,t,n),o=Br(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Dd(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 qs(e){if(!e)return;if(Dd(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??Nl,i??o??Nl]}]}function sy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ly(e){const[t]=e.media;return t!=null&&t.url?t:null}function Us(e){if(!Array.isArray(e)||e.length===0)return[];if(Dd(e)){const t=[];for(const n of e){const i=sy(n);if(!i)continue;const o=ly(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 mo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function cy({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return mo(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 dy({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 mr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return mo(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 uy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),X=s.useRef(new Map),[N,U]=s.useState(0),W=s.useRef(null),I=s.useRef(0),B=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),F=s.useRef(!1),g=s.useRef(null),H=s.useRef(null),P=s.useRef(null),q=s.useRef(()=>{}),ne=s.useRef(null),L=s.useRef(null),O=s.useRef(null),Z=s.useRef(!1),[ue,ae]=s.useState(null),[A,pe]=s.useState(La),[z,re]=s.useState(0),[te,be]=s.useState("opening"),[Ae,ve]=s.useState(0),[b,M]=s.useState(0),[E,j]=s.useState(!1),[Ce,ee]=s.useState(null),[Ie,oe]=s.useState(null),[me,xe]=s.useState(null),[J,Q]=s.useState(!1),[se,we]=s.useState(null),[Ee,Te]=s.useState(!1),Y=s.useRef(!1),[de,ce]=s.useState(!1),[G,le]=s.useState(!1),Me=s.useRef(n),fe=s.useRef(void 0),K=t[n],Xe=K?mo(K):!1,Le=b!==0||E,Ze=!l&&(!r||!!d),Qe=c&&!l,ct=u.length>1,nt=s.useCallback((_,Re)=>t.length<=1?null:t[(_+Re+t.length)%t.length]??null,[t]),Ve=ct?$o(u,p,-1):nt(n,-1),$e=ct?$o(u,p,1):nt(n,1),He=Ce===-1&&Le?ct&&Ie!==null?$o(u,Ie,-1):me!==null?nt(me,-1):null:null,Be=Ce===1&&Le?ct&&Ie!==null?$o(u,Ie,1):me!==null?nt(me,1):null:null,Ue=He&&He.url!==(Ve==null?void 0:Ve.url)?He:null,he=Be&&Be.url!==($e==null?void 0:$e.url)?Be:null,V=Ve&&Qe?(()=>{const _=ct?Wl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return _&&_.url!==Ve.url?_:null})():null,ye=$e&&Qe?(()=>{const _=ct?Wl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return _&&_.url!==$e.url?_:null})():null,Ne=Ue??V,ze=he??ye,We=s.useCallback((_,Re,Fe)=>{if(!_||!Re||!Fe)return;const Oe=X.current,lt=Oe.get(_);(lt==null?void 0:lt.width)===Re&&(lt==null?void 0:lt.height)===Fe||(Oe.set(_,{width:Re,height:Fe}),U(Et=>Et+1))},[]),et=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Re=X.current.get(_.url);return ey(y.current,Re)},[N,z]),Je=s.useCallback(()=>{if(!K)return;const _=et(K);if(_){ae(_);return}const Re=y.current;Re&&ae(Hl(Re))},[K,et]),_e=s.useCallback(_=>{if(ct){const Re=u.length;oe((p+_+Re)%Re),xe(null);return}t.length>1&&(xe((n+_+t.length)%t.length),oe(null))},[ct,u.length,p,t.length,n]),qe=s.useCallback(_=>{F.current=_,j(_)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),it=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),qe(!1)},fo+32)},[De,qe]),at=s.useCallback(()=>{const _=C.current;if(!_){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:La.width,height:typeof window<"u"?window.innerHeight:La.height});return}const Re=_.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),dt=s.useCallback((_,Re)=>{if(Le){if(de&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Fe=et(_);if(!Fe)return;const{x:Oe,y:lt}=ry(Fe,Re,Ce,A);return`translate(${Oe}px, ${lt}px)`}if(E)return"translate(0px, 0px)"}},[Le,de,E,b,Ce,A,et]),St=s.useCallback(()=>{const _=H.current;H.current=null,De(),qe(!1),ee(null),oe(null),xe(null),M(0),ce(!1),T.current=!1,B.current=0,$.current="none",_===-1?f():_===1&&v()},[De,qe,f,v]),At=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{H.current!==null&&St()},fo+32)},[De,St]),Zt=s.useCallback(()=>{De(),H.current=null,qe(!1),ee(null),oe(null),xe(null),M(0),ce(!1),T.current=!1,B.current=0,$.current="none"},[De,qe]),vt=s.useCallback(_=>{if(!(!Qe||!ue)){if(F.current){if(H.current===_){P.current=_,St();return}Zt()}De(),_e(_),H.current=_,ee(_),qe(!0),At()}},[Qe,ue,St,Zt,De,_e,qe,At]);q.current=vt;const wt=s.useCallback(()=>{ne.current=null,Z.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),zt=s.useCallback(_=>{L.current!==null&&window.clearInterval(L.current);const Re=Z.current?qf:Yf;L.current=window.setInterval(()=>{q.current(_)},Re)},[]),Ft=s.useCallback(_=>{ne.current!==_&&(wt(),ne.current=_,Z.current=!1,q.current(_),zt(_),O.current=window.setTimeout(()=>{O.current=null,ne.current===_&&(Z.current=!0,zt(_))},Xf))},[wt,zt]),xt=s.useCallback(()=>{const _=y.current;if(!_)return;const Re=K==null?void 0:K.url,Fe=Re?X.current.get(Re):void 0;if(Fe!=null&&Fe.width&&(Fe!=null&&Fe.height)){ae(ss(_,Fe.width,Fe.height));return}const Oe=S.current;if(Oe&&Re&&(Oe.src===Re||Oe.currentSrc===Re)){const{width:Et,height:ot}=Qf(Oe);if(Et&&ot){We(Re,Et,ot),ae(ss(_,Et,ot));return}}const lt=Hl(_);!lt.width||!lt.height||ae(lt)},[K==null?void 0:K.url,We]),_t=s.useCallback(_=>{if(S.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&xt();return}_.complete&&_.naturalWidth>0&&xt()}},[xt]),Wt=s.useCallback(()=>{at(),xt(),re(_=>_+1)},[at,xt]);s.useEffect(()=>{Wt();const _=y.current,Re=C.current,Fe=new ResizeObserver(()=>Wt());return _&&Fe.observe(_),Re&&Fe.observe(Re),window.addEventListener("resize",Wt),()=>{Fe.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,x]),s.useLayoutEffect(()=>{if(!K)return;const _=S.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){xt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&xt()}},[K==null?void 0:K.url,n,xt]),s.useEffect(()=>{Je()},[Je,N]),s.useEffect(()=>{const _=new Set,Re=[],Fe=Oe=>{!(Oe!=null&&Oe.url)||_.has(Oe.url)||(_.add(Oe.url),Re.push(Oe))};t.forEach(Fe),u.forEach(Oe=>Oe.items.forEach(Fe)),Re.forEach(Oe=>{X.current.has(Oe.url)||ty(Oe,We)})},[t,u,We]),s.useEffect(()=>{if(te!=="opening"||!ue)return;if(!w){be("open");return}Q(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(!0),be("open")})});return()=>cancelAnimationFrame(_)},[te,ue,w]),s.useEffect(()=>{if(te!=="closing")return;const _=setTimeout(()=>h(),Tn);return()=>clearTimeout(_)},[te,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Me.current===n&&fe.current===(K==null?void 0:K.url)||(De(),H.current=null,ee(null),oe(null),xe(null),ve(0),M(0),qe(!1),le(!1),ce(!1),I.current=0,B.current=0,$.current="none",T.current=!1,W.current=null,k.current=!1,S.current=null,Je(),Me.current=n,fe.current=K==null?void 0:K.url)},[n,K==null?void 0:K.url,qe,De,Je]),s.useLayoutEffect(()=>{const _=P.current;_!==null&&(P.current=null,requestAnimationFrame(()=>{q.current(_)}))},[n,p,K==null?void 0:K.url]),s.useLayoutEffect(()=>{if(te==="opening"){Y.current=!1,Te(!1);return}if(te!=="open"||Y.current)return;if(!Ve&&!$e){Y.current=!0;return}Te(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Te(!0),Y.current=!0})});return()=>cancelAnimationFrame(_)},[te,Ve==null?void 0:Ve.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(te!=="open")return;const _=()=>{const ot=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",ot,!0)};document.addEventListener("click",ot,!0)},Re=ot=>{const yt=ot<0?1:-1;De(),_e(yt),H.current=yt,ee(yt),qe(!0),At()},Fe=ot=>{if(Math.abs(ot)>Gf&&Qe){Re(ot);return}H.current=null,ee(null),oe(null),xe(null),qe(!0),M(0),it()},Oe=ot=>{if(ot.touches.length!==1||F.current)return;const yt=ot.touches[0];k.current=!0,W.current={x:yt.clientX,y:yt.clientY},$.current="none",B.current=0,T.current=!1},lt=ot=>{if(!W.current||ot.touches.length!==1||F.current)return;const yt=ot.touches[0],Bt=yt.clientX-W.current.x,It=yt.clientY-W.current.y;if($.current==="none"){if(Math.abs(Bt)<10&&Math.abs(It)<10)return;if(Math.abs(Bt)>Math.abs(It)){if(!Qe)return;$.current="horizontal"}else if(It>0){if(!Ze)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ce(!0),B.current=Bt,M(Bt),ot.preventDefault();return}$.current==="vertical"&&(T.current=!0,ce(!0),I.current=It,ve(It),ot.preventDefault())},Et=()=>{if(!W.current)return;const ot=$.current,yt=T.current;if(yt&&ot==="horizontal")Fe(B.current),_();else if(yt&&ot==="vertical"){const Bt=I.current;if(Ze&&Bt>Vf){const It=window.innerHeight;I.current=It,le(!0),ve(It),be("closing")}else I.current=0,ve(0);_()}else ot==="horizontal"&&Math.abs(B.current)>0&&(Fe(B.current),_());W.current=null,$.current="none",B.current=0,T.current=!1,ce(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",lt,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[te,Qe,qe,it,De,Ze,At,_e]);const Ut=s.useCallback(()=>{const _=(m==null?void 0:m())??w??null;_&&ue&&(we(_),Q(!0)),be("closing")},[m,w,ue]);s.useEffect(()=>{const _=Oe=>{if(Oe.key==="Escape"){if(r&&d||te==="closing")return;wt(),Ut();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||te!=="open"||!Qe)return;Oe.preventDefault();const lt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&ne.current===lt||Ft(lt)},Re=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const lt=Oe.key==="ArrowLeft"?-1:1;ne.current===lt&&wt()},Fe=()=>{wt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Re),window.addEventListener("blur",Fe),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Fe),wt()}},[te,r,d,Ut,Qe,Ft,wt]),s.useEffect(()=>{te!=="open"&&wt()},[te,wt]);const Jt=()=>{te==="closing"||l||Ut()},Tt=te==="open",Ht=te==="closing",rn=Ae>0?Math.max(0,1-Ae/500):1,gt=Ae>0?Math.max(.35,1-Ae/500):1,ke=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!F.current)){if(H.current!==null){St();return}De(),qe(!1)}},[De,qe,St]),Ge=te==="closing"?se??w:w,st=Ge&&ue&&(te==="opening"||Ht)?Uf(Ge,ue):void 0,ht=Le&&K?dt(K,"center"):Ae>0?`translateY(${Ae}px)`:st,ft=ue?pr(ue,A):null,Lt=!!(Ge&&ue),mt=Lt&&(te==="closing"||te==="open"&&J),jt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Ae>0?gt:Lt?1:te==="opening"||Ht?0:1,transition:de&&!E?"none":E?`transform ${fo}ms ${pn}`:G?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:te==="opening"||Ht?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Xe&&Tt&&!Le?"auto":"none",touchAction:Xe&&Tt?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Le?"auto":"none"},Mt=(_,Re,Fe="adjacent")=>{const Oe=et(_);if(!Oe)return{display:"none"};const lt=Fe==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?Hd(Oe,lt,Ce,A):{start:Fe==="far"?Br(Oe,Re,A):eo(Oe,Re,A)},ot=pr(Et,A),yt=dt(_,lt),Bt=!Le&&Fe==="adjacent"&&Tt&&!Ee?ay(Oe,Re,A):null,It=Fe==="far"&&Le&&Ce===(Re==="left"?-1:1),nn=de&&!E?!1:E,un=Fe==="adjacent"&&Tt&&Ee&&!Le;return{position:"absolute",top:ot.top,left:ot.left,width:ot.width,height:ot.height,objectFit:"contain",transform:yt??(Bt?`translate(${Bt.x}px, ${Bt.y}px)`:void 0),opacity:Fe==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Fe==="far"?`transform ${fo}ms ${pn}`:`transform ${fo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:te==="opening"||Ht?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(_,Re)=>{const Fe=et(_);return Fe?oy(eo(Fe,Re,A),Re,A):null},Xt=_=>Re=>{if(!l){if(k.current){k.current=!1;return}Re.stopPropagation(),vt(_)}},Dt=Ve?Gt(Ve,"left"):null,Ot=$e?Gt($e,"right"):null,Nt=Dt?pr(Dt,A):null,Ct=Ot?pr(Ot,A):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:de?"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:de?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Ne&&a.jsx(mr,{media:Ne,style:Mt(Ne,"left","far"),onMeasure:We,onTransitionEnd:ke},`far-prev-${Ne.url}`),Tt&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ve,style:Mt(Ve,"left"),onMeasure:We,onTransitionEnd:ke},`prev-${Ve.url}`),Nt&&a.jsx("div",{style:{position:"absolute",top:Nt.top,left:Nt.left,width:Nt.width,height:Nt.height,cursor:l||de?"default":"pointer",pointerEvents:l||de?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Tt&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:$e,style:Mt($e,"right"),onMeasure:We,onTransitionEnd:ke},`next-${$e.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||de?"default":"pointer",pointerEvents:l||de?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Tt&&ze&&a.jsx(mr,{media:ze,style:Mt(ze,"right","far"),onMeasure:We,onTransitionEnd:ke},`far-next-${ze.url}`),ue&&K&&(Xe?a.jsx(dy,{src:K.url,phase:te,onMediaElement:_t,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:ke},`${n}-${K.url}`):a.jsx("img",{ref:_t,src:K.url,alt:K.name,onLoad:xt,onTransitionEnd:ke,style:jt},`${n}-${K.url}`))]})}function py({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,w=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",h=(x==null?void 0:x.reversed)??!1,[f,v]=m.split(":").map(Number),S=`${h?v:f} / ${h?f:v}`,X=c.entryWidth??.2,N=c.columnsCount,U=D.scalingValue(X,n),W=D.scalingValue(c.horizontalGap??0,n),I=U,B=U,$={width:I,...w?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},T=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[F,g]=s.useState(!1),[H,P]=s.useState([]),[q,ne]=s.useState(0),[L,O]=s.useState(0),[Z,ue]=s.useState(null),[ae,A]=s.useState({title1:"",title2:"",title3:""}),pe=(()=>{const me={},xe=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return xe&&(me["--cntrl-article-width"]=xe),me})(),z=!n||i||o,re=s.useMemo(()=>jf(d),[d]),te=t??[],be=te.length%N||N,Ae=be<N&&te.length>0,ve=te.length-be,b=Ae?Math.floor((N-be)/2)+1:1,M=s.useMemo(()=>Zf(te),[te]),E=s.useMemo(()=>ny(te),[te]),j=(me,xe,J)=>{if(n&&!o&&!i)return;const Q=M.findIndex(we=>we.gridIndex===me);if(Q<0)return;const se=M[Q];O(Q),P(se.items),ne(xe),A(se.entry),ue(J??null),g(!0)},Ce=s.useCallback(()=>{g(!1),ue(null)},[]),ee=s.useCallback(()=>{const me=M[L];return!me||!k.current?Z:Kf(k.current,me.gridIndex,w?"cover":"contain")??Z},[M,L,Z,w]),Ie=s.useCallback(me=>{if(M.length>1){const xe=M.length,J=(L+me+xe)%xe,Q=M[J],se=Math.min(q,Q.items.length-1);O(J),P(Q.items),ne(se),A(Q.entry);return}ne(xe=>(xe+me+H.length)%H.length)},[M,L,q,H.length]),oe=M.length>1||H.length>1;return s.useEffect(()=>{if(!F||typeof document>"u")return;const me=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=me}},[F]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:re}}),a.jsx(iy,{mediaList:E}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${U})`,rowGap:0,columnGap:W,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:te.map((me,xe)=>{const J=qs(me.gallery),Q=Us(J),se=Q.filter(ce=>ce.lightboxMedia).map(ce=>ce.lightboxMedia),we=Math.floor(xe/N)===Math.ceil(te.length/N)-1,Ee=Ae&&xe>=ve?`${b+(xe-ve)}`:void 0,Te=Q[0],Y=Te!=null&&Te.lightboxMedia?se.findIndex(ce=>ce.url===Te.lightboxMedia.url):-1,de=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:Q.length>0&&a.jsx(cy,{media:Te.displayMedia,gridIndex:xe,className:`${d}-item-${mo(Te.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:z&&Y>=0?ce=>j(xe,Y,Nd(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`,we?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...Ee?{gridColumn:Ee}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:B}})}),a.jsx("a",{className:`${d}-item-image-link`,children:de}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:B}})})]})},xe)})}),F&&typeof document<"u"&&(()=>{const me=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:pe,"data-selection":"none",children:a.jsx(uy,{prefix:d,items:H,index:q,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:oe,lightboxEntries:M,entryIdx:L,layoutId:r,sourceRect:Z,resolveCloseSourceRect:ee,onClose:Ce,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),me)})()]})}const my=`import { CommonComponentProps } from '../props';
|
|
7510
7510
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7511
7511
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7512
7512
|
import { createPortal } from 'react-dom';
|
|
@@ -9849,7 +9849,7 @@ export function Hive({
|
|
|
9849
9849
|
</>
|
|
9850
9850
|
);
|
|
9851
9851
|
}
|
|
9852
|
-
`,my="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>'),mi={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 gy(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const to=oi.filter(e=>e!=="count"),hy=to.reduce((e,t)=>({...e,...gy(t)}),{}),fy=to.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Arial",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Pa(e){return to.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const yy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(to.map(e=>[Xs[e],Ys(e)]))},xy={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},vy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...xy,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),by={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{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"}},gallery:{type:"array",label:"Gallery",max:1,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"]}}}}}}}},required:["gallery"]},default:vy},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},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"]}},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"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...hy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:my,closeIconColor:"#000000",closeIconHoverColor:"#999999",...fy},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Pa({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Pa({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Pa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[yy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},wy={element:uy,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...to.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})},schema:by,sourceCode:py};function Sy(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)}function Cy({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Ea(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $y(e){return String(e??"").trim().length>0}function Dl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Ol(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Bl(e,t,n,i,o,r,l){const d=O.scalingValue(r,l),c=O.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Ty(e,t,n){const i=O.scalingValue(t,n),o=O.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const zl=10,jl=10,yo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Iy(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Ry(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+zl,y:n.clientY-d.top+zl}}switch(e){case"left":return{x:jl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-jl-i/2,y:l};default:return{x:o/2,y:l}}}function Ly(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,h=i.current;m&&(m.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Ma(m.x,m.targetX,yo.positionEase),m.y=Ma(m.y,m.targetY,yo.positionEase),m.rotation=Ma(m.rotation,m.targetRotation,yo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const h=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!h||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,h)=>{const f=i.current;f.targetX=m,f.targetY=h,f.targetRotation=0,f.x=m,f.y=h,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,h)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const v=m-f.lastX;f.targetRotation=Iy(v*yo.rotationFactor,-20,yo.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=h,t){c();return}f.x=m,f.y=h,f.rotation=f.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),w=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||w(),l),[e,w,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:w}}function Py(e){return`
|
|
9852
|
+
`,gy="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>'),mi={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 hy(e){const t={};return t[rt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[rt(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[rt(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[rt(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[rt(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[rt(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[rt(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[rt(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const to=oi.filter(e=>e!=="count"),fy=to.reduce((e,t)=>({...e,...hy(t)}),{}),yy=to.reduce((e,t)=>({...e,[rt(t,"fontFamily")]:"Arial",[rt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[rt(t,"letterSpacing")]:0,[rt(t,"wordSpacing")]:0,[rt(t,"textAlign")]:"left",[rt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Pa(e){return to.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[rt(n,"fontSize")]=i),o!==void 0&&(t[rt(n,"lineHeight")]=o),t},{})}const xy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(to.map(e=>[Xs[e],Ys(e)]))},vy={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},by=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...vy,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),wy={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{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"}},gallery:{type:"array",label:"Gallery",max:1,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"]}}}}}}}},required:["gallery"]},default:by},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},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"]}},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"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...fy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:gy,closeIconColor:"#000000",closeIconHoverColor:"#999999",...yy},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Pa({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Pa({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Pa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[xy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Sy={element:py,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...to.map(e=>({path:`${rt(e,"fontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${rt(t,"fontFamily")}`}),{})},schema:wy,sourceCode:my};function Cy(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)}function $y({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Ea(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ty(e){return String(e??"").trim().length>0}function Dl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Ol(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Bl(e,t,n,i,o,r,l){const d=D.scalingValue(r,l),c=D.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Iy(e,t,n){const i=D.scalingValue(t,n),o=D.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const zl=10,jl=10,yo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Ry(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Ly(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+zl,y:n.clientY-d.top+zl}}switch(e){case"left":return{x:jl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-jl-i/2,y:l};default:return{x:o/2,y:l}}}function Py(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,h=i.current;m&&(m.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Ma(m.x,m.targetX,yo.positionEase),m.y=Ma(m.y,m.targetY,yo.positionEase),m.rotation=Ma(m.rotation,m.targetRotation,yo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const h=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!h||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,h)=>{const f=i.current;f.targetX=m,f.targetY=h,f.targetRotation=0,f.x=m,f.y=h,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,h)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const v=m-f.lastX;f.targetRotation=Ry(v*yo.rotationFactor,-20,yo.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=h,t){c();return}f.x=m,f.y=h,f.rotation=f.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),w=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||w(),l),[e,w,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:w}}function Ey(e){return`
|
|
9853
9853
|
.${e}-wrapper {
|
|
9854
9854
|
display: grid;
|
|
9855
9855
|
align-items: start;
|
|
@@ -10225,7 +10225,7 @@ a.${e}-list-item {
|
|
|
10225
10225
|
overflow-wrap: anywhere;
|
|
10226
10226
|
word-break: break-word;
|
|
10227
10227
|
}
|
|
10228
|
-
`}const ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ks=["AColumn","BColumn","CColumn","DColumn","EColumn"],Hn="cutLabel",Do=[...Ks,Hn],ca=["A","B","C","D","E"];function Od(e){return`${e}ColumnVerticalAlign`}const ls=["Top","Center","Bottom"];function Zs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ca.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ey(e){const t=Zs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function My(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ca.includes(n)?n:null}function Bd(e,t,n){const i=My(e);return i?i===t?!1:Ey(n[Od(i)]):!0}function Oo(e){const t=Zs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ca.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ky(e,t,n){if(zd(e,t,n))return Oo(e);const i=Oo(e);return i.kind==="baseline"?{kind:"top"}:i}function Ay(e){const t=Oo(e);return t.kind==="baseline"?{kind:"top"}:t}function zd(e,t,n){return Bd(e,n,t)?Oo(e).kind==="baseline":!1}function Fy(e){const t={};let n=!1;for(const i of ca){const o=Od(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}Bd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function _y(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Ny(e){const t=Oo(e).kind;return t==="baseline"?"center":t}function Wy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Hy(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 ka(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Hy(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 Dy(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 Oy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const By={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const zy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function jy(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 Vy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[zy[e],jy(e)]))}}function zr(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 Gl(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(qt(n,t))}function Xl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Yl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:O.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],no=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],io=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],oo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Gy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Xy=["hover","focus","filled","success","error"],ql=.004,Di=.004,Aa=Di,Js=50,Bo=1440,zo=Js/Bo;function jd(e){const t=typeof e=="number"&&e>0?e:Bo;return Js/t}function Yy(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 Bo}const Vd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Po(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function qy(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function Uy(){return Object.fromEntries([...no.map(e=>[e,0]),...io.map(e=>[e,0])])}function Ky(){return Object.fromEntries(oo.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Gd(e,t,n){const i=e-zo,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 Mr(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 Zy(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=no[o],l=io[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Gd(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=xn.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)+zo;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]-zo;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function Jy(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=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Ul(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ri]}function Qy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function ex(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=no[c],x=io[c],w=oo[c],m=xn[l],h=no[l],f=io[l],v=oo[l],C=n[u],y=n[p],S=n[x],G=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof G=="number"&&(r[v]=G)}return r}function Xd(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 tx(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Po(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...qy(n,o),...Uy()};if(r)for(const d of oo)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Ky());return Xd(e,l)?l:e}function nx(e,t,n){const i=Fy(e);i&&(e={...e,...i});const o=jd(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Po(e),c=Po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ri.length,x=S=>{if(u)return S;const G=gr({...t,...S}),W=Po(S),U=Mr(p,W,G),H=Zy(p,U,{...t,...S});return Object.keys(H).length===0?S:{...S,...H}};if(typeof r=="number"&&r!==l)return e;const w=Ul(e),m=Ul(t);if(!Qy(w,m))return x({...e,...ex(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=gr({...t,...e});return x({...e,...Jy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,G=Math.max(0,(d-o)/2);return S>G?{...e,textPaddingLR:G}:e}const h=gr({...t,...e}),f=Mr(p,c,gr(t)),C=Mr(p,d,h).some((S,G)=>S<(f[G]??S)),y=xn.some(S=>{const G=e[S],W=t[S];return typeof G=="number"&&typeof W=="number"&&G!==W});return C||y?x(e):e}function ix(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(zo,i-o-r-zo)}function ox(e,t){return Math.random()*(t-e)+e}function rx(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function ax(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=no[d],u=io[d],p=oo[d];return{key:l,textPrefix:By[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function sx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=O.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:w,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:v,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:G,imageSize:W,imageOnHover:U,imagePosition:H="cursor",imageInterpolation:I="on",entryHoverEffect:z,entryHoverShowOption:$,rowPaddingTop:T,rowPaddingBottom:k,rowPaddingTopB:_,columnsOrder:g,textPaddingLR:D,textColor:P,backgroundColor:q,dividerColor:ie,textHoverColor:L,backgroundHoverColor:B,dividerHoverColor:K}=e,[ue,le]=s.useState(void 0),[F,pe]=s.useState(null),j=s.useRef(null),se=U==="on"&&(!n||i),ne=H==="cursor",ve=ne&&I==="on",{anchorRef:ke,onShow:xe,onCursorMove:b,exit:M}=Ly(!!(se&&F!==null),ve),E=(C??0)>0,V=x==="b",Ce=s.useRef(null),te=s.useRef(null),[$e,ae]=s.useState(null),[ge,ye]=s.useState(Bo),Z=jd(ge),J=Math.max(0,((w??0)-Z)/2),de=Math.min(D??0,J),be=Math.max(de,Di),Pe=((w??0)+Z)/2;s.useLayoutEffect(()=>{if(!n){ye(Bo);return}const Me=()=>{ye(Yy(Ce.current))};Me();const Xe=Ce.current;if(!Xe)return;const lt=new ResizeObserver(Me);lt.observe(Xe);let ht=Xe;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&<.observe(ht),()=>lt.disconnect()},[n,l]),s.useEffect(()=>{le(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&le(void 0)},[n,i]);const Se=O.buildColorVars(c,{textColor:P,backgroundColor:q,dividerColor:ie,textHoverColor:L,backgroundHoverColor:B,dividerHoverColor:K},Gy,Xy),X=r&&r!=="default"?`${c}-state-${r}`:"",re=`${!n||i?z==="default"?`${c}-entry-hover-default`:z==="blinds"?`${c}-entry-hover-blinds`:z==="reveal"?`${c}-entry-hover-reveal`:"":""} ${X}`.trim(),Y=z==="reveal"&&(!n||i),ce=(v==null?void 0:v[0])??!1,Ee=(v==null?void 0:v[1])??!1,he=s.useRef(e),Q=s.useRef(l);s.useEffect(()=>{if(!d||!n){he.current=e,Q.current=l;return}if(Q.current!==l){he.current=e,Q.current=l;return}const Me=he.current;if(!(Me!==e))return;if(typeof Me.columns=="number"&&typeof e.columns=="number"&&Me.columns!==e.columns){he.current=e;return}const lt=nx(e,Me,{designWidth:ge});he.current=e,Xd(e,lt)&&d(lt)},[e,d,n,l,ge]);const Ne=s.useMemo(()=>rx(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Fe=s.useMemo(()=>Fa(e,no),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),et=s.useMemo(()=>Fa(e,io),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Je=s.useMemo(()=>Fa(e,oo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),dt=s.useMemo(()=>Array.isArray(g)&&g.length>0?g:[...ri],[g]),tt=s.useMemo(()=>ax(dt,p,Ne,Fe,et,Je),[dt,p,Ne,Fe,et,Je]),De=Po(e),Ie=s.useMemo(()=>xn.slice(0,p).map(Me=>Ne[Me]),[p,Ne]),We=s.useMemo(()=>Qs(p,De,Ne),[p,De,Ne]),je=s.useMemo(()=>Mr(p,De,Ne),[p,De,Ne]),Ue=s.useMemo(()=>tt.map((Me,Xe)=>Gd(je[Xe]??0,Me.paddingLeft,Me.paddingRight)),[tt,je]),A=s.useMemo(()=>{const Me=m===0?1/0:m;return(t??[]).slice(0,Me).map((lt,ht)=>({id:ht,cells:Object.fromEntries(ri.map(ft=>[ft,lt[ft]??""])),image:lt.image,link:lt.link}))},[t,m]),ee=E?ue??C:A.length,Te=s.useMemo(()=>E?A.slice(0,ee):A,[A,E,ee]),He=E&&ee<A.length,Be=Te.length>1||He,Ve=[ce?`${c}-divider-top`:"",Ee||Be?`${c}-divider-bottom`:""].filter(Boolean).join(" "),rt=!n||i,Ze=()=>{if(!rt)return;const Me=ue??C;if(!y){le(A.length);return}le(Math.min(Me+y,A.length))},_e=Me=>O.scalingValue(Me,n??!1),qe=V?_??0:T??0,Oe=k??0,nt=h??0,at=Math.max(Oe,Aa),st=Bl(0,Te.length,ce,Ee,He,f??0,n??!1).borderTopWidth,St=V?"rowPaddingTopB":"rowPaddingTop",Yt=tt[0],Zt=tt[tt.length-1],vt=Ue[0],wt=Ue[Ue.length-1],Bt=Yt&&vt?Math.max(vt.paddingLeft,Di):0,At=Zt&&wt?Math.max(wt.paddingRight,Di):0,xt=De,Ft=(Me,Xe)=>Ry(H,Ce.current,ne?Me:null,Xe),Nt=(Me,Xe)=>{if(!se)return;const lt=Me.image;if(!(lt!=null&<.url)){M(()=>pe(null));return}const ht=(W==null?void 0:W.min)??80,ft=(W==null?void 0:W.max)??320,Lt=(F==null?void 0:F.rowId)===Me.id,mt=Lt?F.widthPx:ox(ht,ft),{x:zt,y:kt}=Ft(Xe,mt);if(Lt&&ne){b(zt,kt);return}pe({rowId:Me.id,url:lt.url,objectFit:"contain",isVideo:Sy(lt),widthPx:mt}),j.current={x:zt,y:kt}},Ut=Me=>{if(!se||!F||!ne)return;const{x:Xe,y:lt}=Ft(Me,F.widthPx);b(Xe,lt)},Jt=()=>{F&&M(()=>pe(null))},Tt=Me=>{Y&&Dl(Me,c),!(!se||!F)&&M(()=>pe(null))},Wt=Me=>{Y&&Ol(Me,c)};s.useLayoutEffect(()=>{if(!F||!j.current)return;const{x:Me,y:Xe}=j.current;j.current=null,xe(Me,Xe)},[F==null?void 0:F.rowId,F==null?void 0:F.url,xe]),s.useLayoutEffect(()=>{if(!u||V){ae(null);return}const Me=te.current,Xe=Me==null?void 0:Me.parentElement;if(!Me||!Xe){ae(null);return}const lt=()=>{const ft=Me.querySelector("[data-list-row]");if(!ft){ae(null);return}const Lt=Xe.getBoundingClientRect(),mt=ft.getBoundingClientRect();ae(mt.top-Lt.top+mt.height/2)};lt();const ht=new ResizeObserver(lt);return ht.observe(Me),ht.observe(Xe),()=>ht.disconnect()},[u,V,Te,qe,Oe,nt,t,e,tt,je,ge,f,ce,Ee,He]);const rn=s.useMemo(()=>!V&&Ks.some(Me=>{const Xe=Me.charAt(0),lt=e[`${Me}VerticalAlign`];return zd(lt,e,Xe)}),[V,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var zt;const Me=Ce.current;if(!Me)return;const Xe=()=>{Me.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Vt=kt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(V||!rn){Xe();return}const lt=()=>{const kt=Array.from(Me.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Vt=`${c}-baseline-probe`;kt.forEach(Gt=>{Gt.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(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]"));Dy(Gt,Ht,Mt)}),Me.offsetHeight,kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Dt=Gt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Ae=>{const ze=Ae.querySelector(`.${c}-list-col-title`),ct={el:Ae,titleEl:ze,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return _t.set(ct.letter,ct),ct}),N=new Map,Re=(Ae,ze)=>{const ct=N.get(Ae.letter);if(ct!==void 0)return ct;const Et=Ae.anchor?_t.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Et||ze.has(Ae.letter)){const nn=ka(Ae,Dt,Mt,Vt);return N.set(Ae.letter,nn),nn}ze.add(Ae.letter);const it=Re(Et,ze);ze.delete(Ae.letter);const yt=ka(Ae,Dt,Mt,Vt),Ot=it-yt;Oy(Ae.titleEl,Ot);const It=ka(Ae,Dt,Mt,Vt);return N.set(Ae.letter,It),It};Ct.forEach(Ae=>Re(Ae,new Set))})};let ht=null;const ft=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,lt()}))};lt();const Lt=new ResizeObserver(()=>ft());Lt.observe(Me);let mt=!1;return typeof document<"u"&&((zt=document.fonts)!=null&&zt.ready)&&document.fonts.ready.then(()=>{mt||ft()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Xe()}},[rn,V,e,t,ge,Te,je]);const gt=s.useMemo(()=>Py(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:Se,children:a.jsxs("div",{ref:Ce,className:`${c}-wrapper ${re}${Ve?` ${Ve}`:""}${V?` ${c}-type-b`:""}`.trim(),style:{width:O.scalingValue(w??0,n)},onMouseMove:se?Ut:void 0,onMouseLeave:se?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Te.map((Me,Xe)=>{var Lt;const lt=(((Lt=Me.link)==null?void 0:Lt.length)??0)>0,ht=lt&&(!n||i)?"a":"div",ft=Bl(Xe,Te.length,ce,Ee,He,f??0,n??!1);return a.jsxs(ht,{ref:Xe===0?mt=>{te.current=mt}:void 0,className:`${c}-list-item${lt||$==="always"?` ${c}-list-item-has-link`:""}${He&&Xe===Te.length-1?` ${c}-list-item-before-cut`:""}`,...lt?{href:Me.link,target:"_blank"}:{},style:ft,onMouseEnter:mt=>{Y&&(lt||$==="always")&&Dl(mt,c),se&&Nt(Me,mt)},onMouseLeave:mt=>{Y&&(lt||$==="always")&&Ol(mt,c)},children:[qe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(qe)}}),a.jsxs("div",{className:`${c}-list-cols-row${V?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&V?` ${c}-list-cols-row-controls`:""}`,...V?{}:{"data-list-row":""},style:V?void 0:{minHeight:_e(nt)},children:[tt.map((mt,zt)=>{const kt=zt===tt.length-1,Mt=Ue[zt],Vt=mt.paddingBottom,Gt=$y(Me.cells[mt.key]),Ht=V&&Gt&&Vt>0,Dt=V?{minHeight:_e(nt)}:{width:_e(je[zt])},_t=V?{paddingLeft:_e(de),paddingRight:_e(de)}:{paddingLeft:_e(Mt.paddingLeft),paddingRight:_e(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),N=V?Ay(e[`${mt.textPrefix}VerticalAlign`]):ky(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Re=V&&Gt&&u&&Xe===0;return V&&!Gt?null:a.jsxs("div",{className:V?`${c}-list-col-wrap`:void 0,...V?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":N.kind,...N.kind==="baseline"?{"data-valign-anchor":N.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...V?{justifyContent:Vl(N.kind)}:{}},"data-test":mt.width,children:a.jsx("span",{className:Xl(e,mt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Gl(zr(e,mt.textPrefix),n),...Yl(e,mt.textPrefix,c,n),...V?{}:_y(N.kind)},children:Me.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Vt)}}),Re&&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:_e(Math.max(Vt,Aa))}})]},mt.key)}),u&&Xe===0&&V&&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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(be),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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:_e(Math.max(be,De-be)),width:_e(be),height:"100%"}})]})]}),!V&&Oe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Oe)}}),u&&Xe===0&&!V&&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:_e(at)}})]},Me.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":V?"center":"left-y",className:`${c}-control-anchor`,style:{top:st,left:0,width:"100%",height:_e(Math.max(qe,Aa))}})},"row-padding-handles"),u&&!V&&Yt&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Yt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(Bt),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(je[tt.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(xt-At),width:_e(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!V&&tt.slice(0,-1).map((Me,Xe)=>{const lt=tt[Xe+1],ht=We.slice(0,Xe+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ue[Xe],Lt=Ue[Xe+1],mt=Math.max(ft.paddingRight,Di),zt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Me.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[Xe]-ft.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ht-mt),width:_e(mt),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[Xe+1]-Lt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ht),width:_e(zt),height:"100%"}})]},`${Me.paddingRightKey}-padding`)}),u&&!V&&tt.slice(0,-1).map((Me,Xe)=>{const lt=ix(Xe,We,Ie,De),ft=We.slice(0,Xe+1).reduce((Lt,mt)=>Lt+mt,0)-ql/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Me.widthKey,"data-controls-axis":"x","data-controls-min":String(Js),"data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(ft),width:_e(ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Me.widthKey}-junction`)})]}),He&&(()=>{const Me=zr(e,Hn),Xe=Ny(e.cutLabelVerticalAlign),lt=Me.textTextAlign==="justify"||V;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:_e(S??0),cursor:rt?"pointer":"default",...Ty(Ee,f??0,n??!1)},onClick:rt?Ze:void 0,onMouseEnter:Y||se?Tt:void 0,onMouseLeave:Y?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...V?{paddingLeft:_e(de),paddingRight:_e(de)}:{},justifyContent:Wy(Me.textTextAlign),alignItems:Vl(Xe)},children:a.jsx("span",{className:Xl(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gl(Me,n),...Yl(e,Hn,c,n),...lt?{width:"100%"}:{}},children:G})})})})(),se&&F&&(()=>{const Me=`${F.widthPx}px`,Xe={width:Me,height:"auto",maxHeight:Me,objectFit:"contain"};return a.jsx("div",{ref:ke,className:`${c}-hover-media-anchor`,children:a.jsx(Cy,{media:F,className:F.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${F.rowId}-${F.url}`)})})()]})})]})}const lx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10228
|
+
`}const ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ks=["AColumn","BColumn","CColumn","DColumn","EColumn"],Hn="cutLabel",Do=[...Ks,Hn],ca=["A","B","C","D","E"];function Od(e){return`${e}ColumnVerticalAlign`}const ls=["Top","Center","Bottom"];function Zs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ca.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function My(e){const t=Zs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function ky(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ca.includes(n)?n:null}function Bd(e,t,n){const i=ky(e);return i?i===t?!1:My(n[Od(i)]):!0}function Oo(e){const t=Zs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ca.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Ay(e,t,n){if(zd(e,t,n))return Oo(e);const i=Oo(e);return i.kind==="baseline"?{kind:"top"}:i}function Fy(e){const t=Oo(e);return t.kind==="baseline"?{kind:"top"}:t}function zd(e,t,n){return Bd(e,n,t)?Oo(e).kind==="baseline":!1}function _y(e){const t={};let n=!1;for(const i of ca){const o=Od(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}Bd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ny(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Wy(e){const t=Oo(e).kind;return t==="baseline"?"center":t}function Hy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Dy(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 ka(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Dy(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 Oy(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 By(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const zy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const jy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Vy(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 Gy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[jy[e],Vy(e)]))}}function zr(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 Gl(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(qt(n,t))}function Xl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Yl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],no=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],io=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],oo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Xy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Yy=["hover","focus","filled","success","error"],ql=.004,Di=.004,Aa=Di,Js=50,Bo=1440,zo=Js/Bo;function jd(e){const t=typeof e=="number"&&e>0?e:Bo;return Js/t}function qy(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 Bo}const Vd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Po(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Uy(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function Ky(){return Object.fromEntries([...no.map(e=>[e,0]),...io.map(e=>[e,0])])}function Zy(){return Object.fromEntries(oo.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Gd(e,t,n){const i=e-zo,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 Mr(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 Jy(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=no[o],l=io[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Gd(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=xn.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)+zo;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]-zo;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function Qy(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=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Ul(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ri]}function ex(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function tx(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=no[c],x=io[c],w=oo[c],m=xn[l],h=no[l],f=io[l],v=oo[l],C=n[u],y=n[p],S=n[x],X=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof X=="number"&&(r[v]=X)}return r}function Xd(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 nx(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Po(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Uy(n,o),...Ky()};if(r)for(const d of oo)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Zy());return Xd(e,l)?l:e}function ix(e,t,n){const i=_y(e);i&&(e={...e,...i});const o=jd(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Po(e),c=Po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ri.length,x=S=>{if(u)return S;const X=gr({...t,...S}),N=Po(S),U=Mr(p,N,X),W=Jy(p,U,{...t,...S});return Object.keys(W).length===0?S:{...S,...W}};if(typeof r=="number"&&r!==l)return e;const w=Ul(e),m=Ul(t);if(!ex(w,m))return x({...e,...tx(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=gr({...t,...e});return x({...e,...Qy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,X=Math.max(0,(d-o)/2);return S>X?{...e,textPaddingLR:X}:e}const h=gr({...t,...e}),f=Mr(p,c,gr(t)),C=Mr(p,d,h).some((S,X)=>S<(f[X]??S)),y=xn.some(S=>{const X=e[S],N=t[S];return typeof X=="number"&&typeof N=="number"&&X!==N});return C||y?x(e):e}function ox(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(zo,i-o-r-zo)}function rx(e,t){return Math.random()*(t-e)+e}function ax(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function sx(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=no[d],u=io[d],p=oo[d];return{key:l,textPrefix:zy[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function lx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=D.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:w,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:v,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:X,imageSize:N,imageOnHover:U,imagePosition:W="cursor",imageInterpolation:I="on",entryHoverEffect:B,entryHoverShowOption:$,rowPaddingTop:T,rowPaddingBottom:k,rowPaddingTopB:F,columnsOrder:g,textPaddingLR:H,textColor:P,backgroundColor:q,dividerColor:ne,textHoverColor:L,backgroundHoverColor:O,dividerHoverColor:Z}=e,[ue,ae]=s.useState(void 0),[A,pe]=s.useState(null),z=s.useRef(null),re=U==="on"&&(!n||i),te=W==="cursor",be=te&&I==="on",{anchorRef:Ae,onShow:ve,onCursorMove:b,exit:M}=Py(!!(re&&A!==null),be),E=(C??0)>0,j=x==="b",Ce=s.useRef(null),ee=s.useRef(null),[Ie,oe]=s.useState(null),[me,xe]=s.useState(Bo),J=jd(me),Q=Math.max(0,((w??0)-J)/2),se=Math.min(H??0,Q),we=Math.max(se,Di),Ee=((w??0)+J)/2;s.useLayoutEffect(()=>{if(!n){xe(Bo);return}const ke=()=>{xe(qy(Ce.current))};ke();const Ge=Ce.current;if(!Ge)return;const st=new ResizeObserver(ke);st.observe(Ge);let ht=Ge;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&st.observe(ht),()=>st.disconnect()},[n,l]),s.useEffect(()=>{ae(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&ae(void 0)},[n,i]);const Te=D.buildColorVars(c,{textColor:P,backgroundColor:q,dividerColor:ne,textHoverColor:L,backgroundHoverColor:O,dividerHoverColor:Z},Xy,Yy),Y=r&&r!=="default"?`${c}-state-${r}`:"",ce=`${!n||i?B==="default"?`${c}-entry-hover-default`:B==="blinds"?`${c}-entry-hover-blinds`:B==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Y}`.trim(),G=B==="reveal"&&(!n||i),le=(v==null?void 0:v[0])??!1,Me=(v==null?void 0:v[1])??!1,fe=s.useRef(e),K=s.useRef(l);s.useEffect(()=>{if(!d||!n){fe.current=e,K.current=l;return}if(K.current!==l){fe.current=e,K.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 st=ix(e,ke,{designWidth:me});fe.current=e,Xd(e,st)&&d(st)},[e,d,n,l,me]);const Xe=s.useMemo(()=>ax(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Le=s.useMemo(()=>Fa(e,no),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Ze=s.useMemo(()=>Fa(e,io),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Qe=s.useMemo(()=>Fa(e,oo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ct=s.useMemo(()=>Array.isArray(g)&&g.length>0?g:[...ri],[g]),nt=s.useMemo(()=>sx(ct,p,Xe,Le,Ze,Qe),[ct,p,Xe,Le,Ze,Qe]),Ve=Po(e),$e=s.useMemo(()=>xn.slice(0,p).map(ke=>Xe[ke]),[p,Xe]),He=s.useMemo(()=>Qs(p,Ve,Xe),[p,Ve,Xe]),Be=s.useMemo(()=>Mr(p,Ve,Xe),[p,Ve,Xe]),Ue=s.useMemo(()=>nt.map((ke,Ge)=>Gd(Be[Ge]??0,ke.paddingLeft,ke.paddingRight)),[nt,Be]),he=s.useMemo(()=>{const ke=m===0?1/0:m;return(t??[]).slice(0,ke).map((st,ht)=>({id:ht,cells:Object.fromEntries(ri.map(ft=>[ft,st[ft]??""])),image:st.image,link:st.link}))},[t,m]),V=E?ue??C:he.length,ye=s.useMemo(()=>E?he.slice(0,V):he,[he,E,V]),Ne=E&&V<he.length,ze=ye.length>1||Ne,We=[le?`${c}-divider-top`:"",Me||ze?`${c}-divider-bottom`:""].filter(Boolean).join(" "),et=!n||i,Je=()=>{if(!et)return;const ke=ue??C;if(!y){ae(he.length);return}ae(Math.min(ke+y,he.length))},_e=ke=>D.scalingValue(ke,n??!1),qe=j?F??0:T??0,De=k??0,it=h??0,at=Math.max(De,Aa),dt=Bl(0,ye.length,le,Me,Ne,f??0,n??!1).borderTopWidth,St=j?"rowPaddingTopB":"rowPaddingTop",At=nt[0],Zt=nt[nt.length-1],vt=Ue[0],wt=Ue[Ue.length-1],zt=At&&vt?Math.max(vt.paddingLeft,Di):0,Ft=Zt&&wt?Math.max(wt.paddingRight,Di):0,xt=Ve,_t=(ke,Ge)=>Ly(W,Ce.current,te?ke:null,Ge),Wt=(ke,Ge)=>{if(!re)return;const st=ke.image;if(!(st!=null&&st.url)){M(()=>pe(null));return}const ht=(N==null?void 0:N.min)??80,ft=(N==null?void 0:N.max)??320,Lt=(A==null?void 0:A.rowId)===ke.id,mt=Lt?A.widthPx:rx(ht,ft),{x:jt,y:kt}=_t(Ge,mt);if(Lt&&te){b(jt,kt);return}pe({rowId:ke.id,url:st.url,objectFit:"contain",isVideo:Cy(st),widthPx:mt}),z.current={x:jt,y:kt}},Ut=ke=>{if(!re||!A||!te)return;const{x:Ge,y:st}=_t(ke,A.widthPx);b(Ge,st)},Jt=()=>{A&&M(()=>pe(null))},Tt=ke=>{G&&Dl(ke,c),!(!re||!A)&&M(()=>pe(null))},Ht=ke=>{G&&Ol(ke,c)};s.useLayoutEffect(()=>{if(!A||!z.current)return;const{x:ke,y:Ge}=z.current;z.current=null,ve(ke,Ge)},[A==null?void 0:A.rowId,A==null?void 0:A.url,ve]),s.useLayoutEffect(()=>{if(!u||j){oe(null);return}const ke=ee.current,Ge=ke==null?void 0:ke.parentElement;if(!ke||!Ge){oe(null);return}const st=()=>{const ft=ke.querySelector("[data-list-row]");if(!ft){oe(null);return}const Lt=Ge.getBoundingClientRect(),mt=ft.getBoundingClientRect();oe(mt.top-Lt.top+mt.height/2)};st();const ht=new ResizeObserver(st);return ht.observe(ke),ht.observe(Ge),()=>ht.disconnect()},[u,j,ye,qe,De,it,t,e,nt,Be,me,f,le,Me,Ne]);const rn=s.useMemo(()=>!j&&Ks.some(ke=>{const Ge=ke.charAt(0),st=e[`${ke}VerticalAlign`];return zd(st,e,Ge)}),[j,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var jt;const ke=Ce.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 Gt=kt.querySelector(`.${c}-list-col-title`);Gt&&(Gt.style.transform="")})};if(j||!rn){Ge();return}const st=()=>{const kt=Array.from(ke.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Gt=`${c}-baseline-probe`;kt.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const Ot=Dt.querySelector(`.${Mt}`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const Nt=Dt.querySelector(`.${c}-list-col-title`);Nt&&(Nt.style.transform="")})}),kt.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));Oy(Xt,Dt,Mt)}),ke.offsetHeight,kt.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),Ot=Xt.getBoundingClientRect().top,Nt=new Map,Ct=Dt.map(Fe=>{const Oe=Fe.querySelector(`.${c}-list-col-title`),lt={el:Fe,titleEl:Oe,letter:Fe.getAttribute("data-col-letter")??"",kind:Fe.getAttribute("data-valign")??"top",anchor:Fe.getAttribute("data-valign-anchor")};return Nt.set(lt.letter,lt),lt}),_=new Map,Re=(Fe,Oe)=>{const lt=_.get(Fe.letter);if(lt!==void 0)return lt;const Et=Fe.anchor?Nt.get(Fe.anchor):void 0;if(Fe.kind!=="baseline"||!Et||Oe.has(Fe.letter)){const nn=ka(Fe,Ot,Mt,Gt);return _.set(Fe.letter,nn),nn}Oe.add(Fe.letter);const ot=Re(Et,Oe);Oe.delete(Fe.letter);const yt=ka(Fe,Ot,Mt,Gt),Bt=ot-yt;By(Fe.titleEl,Bt);const It=ka(Fe,Ot,Mt,Gt);return _.set(Fe.letter,It),It};Ct.forEach(Fe=>Re(Fe,new Set))})};let ht=null;const ft=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,st()}))};st();const Lt=new ResizeObserver(()=>ft());Lt.observe(ke);let mt=!1;return typeof document<"u"&&((jt=document.fonts)!=null&&jt.ready)&&document.fonts.ready.then(()=>{mt||ft()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Ge()}},[rn,j,e,t,me,ye,Be]);const gt=s.useMemo(()=>Ey(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:Te,children:a.jsxs("div",{ref:Ce,className:`${c}-wrapper ${ce}${We?` ${We}`:""}${j?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(w??0,n)},onMouseMove:re?Ut:void 0,onMouseLeave:re?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[ye.map((ke,Ge)=>{var Lt;const st=(((Lt=ke.link)==null?void 0:Lt.length)??0)>0,ht=st&&(!n||i)?"a":"div",ft=Bl(Ge,ye.length,le,Me,Ne,f??0,n??!1);return a.jsxs(ht,{ref:Ge===0?mt=>{ee.current=mt}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${Ne&&Ge===ye.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:ke.link,target:"_blank"}:{},style:ft,onMouseEnter:mt=>{G&&(st||$==="always")&&Dl(mt,c),re&&Wt(ke,mt)},onMouseLeave:mt=>{G&&(st||$==="always")&&Ol(mt,c)},children:[qe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(qe)}}),a.jsxs("div",{className:`${c}-list-cols-row${j?"":` ${c}-list-cols-row-h`}${u&&Ge===0&&j?` ${c}-list-cols-row-controls`:""}`,...j?{}:{"data-list-row":""},style:j?void 0:{minHeight:_e(it)},children:[nt.map((mt,jt)=>{const kt=jt===nt.length-1,Mt=Ue[jt],Gt=mt.paddingBottom,Xt=Ty(ke.cells[mt.key]),Dt=j&&Xt&&Gt>0,Ot=j?{minHeight:_e(it)}:{width:_e(Be[jt])},Nt=j?{paddingLeft:_e(se),paddingRight:_e(se)}:{paddingLeft:_e(Mt.paddingLeft),paddingRight:_e(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),_=j?Fy(e[`${mt.textPrefix}VerticalAlign`]):Ay(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Re=j&&Xt&&u&&Ge===0;return j&&!Xt?null:a.jsxs("div",{className:j?`${c}-list-col-wrap`:void 0,...j?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":_.kind,..._.kind==="baseline"?{"data-valign-anchor":_.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{...Nt,...Ot,...j?{justifyContent:Vl(_.kind)}:{}},"data-test":mt.width,children:a.jsx("span",{className:Xl(e,mt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Gl(zr(e,mt.textPrefix),n),...Yl(e,mt.textPrefix,c,n),...j?{}:Ny(_.kind)},children:ke.cells[mt.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Gt)}}),Re&&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:_e(Math.max(Gt,Aa))}})]},mt.key)}),u&&Ge===0&&j&&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(Ee),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(we),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(Ee),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:_e(Math.max(we,Ve-we)),width:_e(we),height:"100%"}})]})]}),!j&&De>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(De)}}),u&&Ge===0&&!j&&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:_e(at)}})]},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":j?"center":"left-y",className:`${c}-control-anchor`,style:{top:dt,left:0,width:"100%",height:_e(Math.max(qe,Aa))}})},"row-padding-handles"),u&&!j&&At&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":At.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((vt==null?void 0:vt.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:_e(zt),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[nt.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:_e(xt-Ft),width:_e(Ft),height:"100%"}})]},"column-edge-padding-handles"),u&&!j&&nt.slice(0,-1).map((ke,Ge)=>{const st=nt[Ge+1],ht=He.slice(0,Ge+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ue[Ge],Lt=Ue[Ge+1],mt=Math.max(ft.paddingRight,Di),jt=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]-ft.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:_e(ht-mt),width:_e(mt),height:"100%"}}),a.jsx("div",{"data-controls":st.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:_e(ht),width:_e(jt),height:"100%"}})]},`${ke.paddingRightKey}-padding`)}),u&&!j&&nt.slice(0,-1).map((ke,Ge)=>{const st=ox(Ge,He,$e,Ve),ft=He.slice(0,Ge+1).reduce((Lt,mt)=>Lt+mt,0)-ql/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(Js),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(ft),width:_e(ql),height:"calc(100%)",pointerEvents:"auto"}})},`${ke.widthKey}-junction`)})]}),Ne&&(()=>{const ke=zr(e,Hn),Ge=Wy(e.cutLabelVerticalAlign),st=ke.textTextAlign==="justify"||j;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:_e(S??0),cursor:et?"pointer":"default",...Iy(Me,f??0,n??!1)},onClick:et?Je:void 0,onMouseEnter:G||re?Tt:void 0,onMouseLeave:G?Ht:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...j?{paddingLeft:_e(se),paddingRight:_e(se)}:{},justifyContent:Hy(ke.textTextAlign),alignItems:Vl(Ge)},children:a.jsx("span",{className:Xl(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gl(ke,n),...Yl(e,Hn,c,n),...st?{width:"100%"}:{}},children:X})})})})(),re&&A&&(()=>{const ke=`${A.widthPx}px`,Ge={width:ke,height:"auto",maxHeight:ke,objectFit:"contain"};return a.jsx("div",{ref:Ae,className:`${c}-hover-media-anchor`,children:a.jsx($y,{media:A,className:A.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ge},`${A.rowId}-${A.url}`)})})()]})})]})}const cx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10229
10229
|
import { CommonComponentProps } from '../props';
|
|
10230
10230
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10231
10231
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13313,7 +13313,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13313
13313
|
</>
|
|
13314
13314
|
);
|
|
13315
13315
|
}
|
|
13316
|
-
`,go=["A","B","C","D","E"],Kl=[...ls,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],gi={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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function cx(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function hr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function dx(){return Object.fromEntries(go.map((e,t)=>{const n=ri[t],i=`${e} column`;return[n,cx(i)]}))}function ux(){const e={};for(const t of go)e[`${t}ColumnWidth`]=hr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=hr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=hr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=hr(`${t} column padding bottom`);return e}function Zl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ri]};for(const r of go)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function px(e){const t={};if(e===Hn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ls]},enum:[...ls]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Kl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Kl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const mx=Do.reduce((e,t)=>({...e,...px(t)}),{});function gx(e){return{verticalAlign:e===Hn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Hn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function hx(e,t={}){var n;return{...gx(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Jl=new Set(["textFontFamily","textFontSettings"]);function fx(e,t,n){const i=r=>n===void 0?!0:n==="common"?Jl.has(r):!Jl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function kr(e={},t){return Do.reduce((n,i)=>({...n,...fx(i,hx(i,e),t)}),{})}const yx=kr(),xx=Vy();function Yd(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function vx(){const e=[];return Ks.forEach((t,n)=>{const i=ri[n],o=Yd(t);for(let r=1;r<ri.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const bx=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Yd(Hn);const wx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],hi=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],Sx=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:hi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:hi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:hi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:hi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:hi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:hi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:hi[6],link:""}],Cx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],$x={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...dx(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Sx},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...ux(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...mx,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...yx,...kr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Zl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...kr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Zl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...kr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...vx(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...wx.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...go.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Cx]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",xx]}],paletteBookmark:{items:[...bx],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Tx={element:sx,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>tx(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Do.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...Do.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:$x,sourceCode:lx},Ql=300,Vn=.004,Ix={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Rx=["hover","focus","filled","success","error"];function Lx(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ec(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function tc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:O.scalingValue((o-t)/2,i)}}function Px(e){return`
|
|
13316
|
+
`,go=["A","B","C","D","E"],Kl=[...ls,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],gi={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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function dx(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function hr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function ux(){return Object.fromEntries(go.map((e,t)=>{const n=ri[t],i=`${e} column`;return[n,dx(i)]}))}function px(){const e={};for(const t of go)e[`${t}ColumnWidth`]=hr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=hr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=hr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=hr(`${t} column padding bottom`);return e}function Zl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ri]};for(const r of go)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function mx(e){const t={};if(e===Hn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ls]},enum:[...ls]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Kl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Kl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const gx=Do.reduce((e,t)=>({...e,...mx(t)}),{});function hx(e){return{verticalAlign:e===Hn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Hn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function fx(e,t={}){var n;return{...hx(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Jl=new Set(["textFontFamily","textFontSettings"]);function yx(e,t,n){const i=r=>n===void 0?!0:n==="common"?Jl.has(r):!Jl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function kr(e={},t){return Do.reduce((n,i)=>({...n,...yx(i,fx(i,e),t)}),{})}const xx=kr(),vx=Gy();function Yd(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function bx(){const e=[];return Ks.forEach((t,n)=>{const i=ri[n],o=Yd(t);for(let r=1;r<ri.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const wx=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Yd(Hn);const Sx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],hi=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],Cx=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:hi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:hi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:hi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:hi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:hi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:hi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:hi[6],link:""}],$x=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Tx={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...ux(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Cx},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...px(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...gx,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...xx,...kr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Zl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...kr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Zl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...kr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...bx(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Sx.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...go.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...$x]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",vx]}],paletteBookmark:{items:[...wx],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Ix={element:lx,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>nx(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Do.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...Do.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:Tx,sourceCode:cx},Ql=300,Vn=.004,Rx={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Lx=["hover","focus","filled","success","error"];function Px(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ec(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function tc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:D.scalingValue((o-t)/2,i)}}function Ex(e){return`
|
|
13317
13317
|
.${e}-wrapper {
|
|
13318
13318
|
box-sizing: border-box;
|
|
13319
13319
|
display: flex;
|
|
@@ -13375,7 +13375,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13375
13375
|
display: flex;
|
|
13376
13376
|
align-items: center;
|
|
13377
13377
|
justify-content: space-between;
|
|
13378
|
-
gap: ${
|
|
13378
|
+
gap: ${Px(20)};
|
|
13379
13379
|
width: 100%;
|
|
13380
13380
|
min-width: 0;
|
|
13381
13381
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -13478,7 +13478,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13478
13478
|
pointer-events: none;
|
|
13479
13479
|
z-index: 2;
|
|
13480
13480
|
}
|
|
13481
|
-
`}function nc(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
|
|
13481
|
+
`}function nc(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 Mx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=D.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:w="default",autoclose:m="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:v=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:S="#000000",dividerColor:X="#0000001F",iconColor:N="#000000",questionHoverColor:U="#666666",iconHoverColor:W="#666666",iconActiveColor:I="#000000",dividerHoverColor:B="#000000",questionFontFamily:$,questionFontSettings:T,questionFontSize:k,questionLineHeight:F,questionLetterSpacing:g,questionWordSpacing:H,questionTextAppearance:P,answerFontFamily:q,answerFontSettings:ne,answerFontSize:L,answerLineHeight:O,answerLetterSpacing:Z,answerWordSpacing:ue,answerTextAppearance:ae,questionPaddingLeft:A=0,questionPaddingTop:pe=0,questionPaddingBottom:z=0,answerPaddingLeft:re=0,answerPaddingRight:te=0,answerPaddingTop:be=0,answerPaddingBottom:Ae=0}=e,ve=t??[],[b,M]=s.useState(()=>new Set),E=!n||i;s.useEffect(()=>{M(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&M(new Set)},[n,o,i]);const j=Ue=>D.scalingValue(Ue,n??!1),Ce=Math.max(A,Vn),ee=Math.max(pe,Vn),Ie=Math.max(z,Vn),oe=Math.max(re,Vn),me=Math.max(te,Vn),xe=Math.max(be,Vn),J=Math.max(Ae,Vn),Q=Math.max(0,(c??1)-v-f),se=Math.max(0,(c??1)-te),we=Math.max(0,(c??1)-re),Ee=Math.max(v,Vn),Te=Math.max(0,(c??1)-A-f),Y=s.useMemo(()=>b.size===0?0:Math.min(...b),[b]),de=s.useCallback(Ue=>b.has(Ue),[b]),ce=E&&w==="default"?`${l}-entry-hover-default`:"",G=h??"",le=G!=="",Me=C.replace(/^rotate /,""),fe=`${l}-icon-anim-${Me}`,K=an(qt(nc($,T,k,F,g,H,P,y),n)),Xe=an(qt(nc(q,ne,L,O,Z,ue,ae,S),n)),Le=ec(k,F,`${l}-question`,`${l}-text-tight-leading`),Ze=ec(L,O,`${l}-answer-text`,`${l}-text-tight-leading`),Qe=tc(k,F,l,n),ct=tc(L,O,l,n),nt=D.buildColorVars(l,{questionColor:y,answerColor:S,dividerColor:X,iconColor:N,questionHoverColor:U,iconHoverColor:W,iconActiveColor:I,dividerHoverColor:B},Rx,Lx),Ve=r&&r!=="default"?`${l}-state-${r}`:"",$e=s.useCallback(Ue=>{E&&M(he=>{if(he.has(Ue)){const ye=new Set(he);return ye.delete(Ue),ye}if(m==="on")return new Set([Ue]);const V=new Set(he);return V.add(Ue),V})},[E,m]),He=s.useMemo(()=>Ex(l),[l]),Be={[`--${l}-divider-width`]:D.scalingValue(p,n??!1),[`--${l}-divider-style`]:x,[`--${l}-icon-max-width`]:D.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:D.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),a.jsx("div",{style:nt,children:a.jsx("div",{className:pt(`${l}-wrapper`,n&&!i&&`${l}-editor`,ce,Ve),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:ve.map((Ue,he)=>{var et;const V=de(he),ye=((et=Ue.question)==null?void 0:et.trim())??"",Ne=Ue.answer,ze=((Ne==null?void 0:Ne.length)??0)>0,We=d&&he===Y;return a.jsxs("div",{className:pt(`${l}-item`,V&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[We&&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:j(ee)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:j(Ce),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(Te),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:j(Ee),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":V,style:{...K,...Qe,paddingLeft:j(A),paddingRight:j(v)},onClick:()=>$e(he),children:[pe>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:j(pe)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Le,children:ye}),ze&&(le?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${fe}`,"aria-hidden":"true",children:a.jsx(sn,{url:G,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 ${fe}`,"aria-hidden":"true"}))]}),z>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:j(z)},"aria-hidden":"true"})]}),We&&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:j(Ie)}})]}),ze&&Ne&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!V,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[We&&V&&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:j(xe)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(se),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:j(oe),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(we),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:j(me),height:"100%"}})]}),be>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:j(be)}}),a.jsx("div",{className:`${l}-answer`,style:{...Xe,...ct,paddingLeft:j(re),paddingRight:j(te)},children:a.jsx("div",{className:Ze,children:a.jsx(Ri,{content:Ne})})}),Ae>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:j(Ae)}}),We&&V&&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:j(J)}})]})})})]},he)})})})]})}const kx=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13482
13482
|
import cn from 'classnames';
|
|
13483
13483
|
import { CommonComponentProps } from '../props';
|
|
13484
13484
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14226,7 +14226,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14226
14226
|
</>
|
|
14227
14227
|
);
|
|
14228
14228
|
}
|
|
14229
|
-
`;function Gn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ic={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},kx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Ax={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:{...ic.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:{...ic.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:[...kx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Fx={element:Ex,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:Ax,sourceCode:Mx},Dn=e=>e.display==="cover",da=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},oc=100,_x=.2,rc=8,qd=({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"?oc:Math.max(oc,window.innerHeight*_x),[]),x=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),w=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const T=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-$/T*.12);return`translateY(${$}px) scale(${k})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),v=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 T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const k=$.clientX-T.startX,_=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(k)<rc&&Math.abs(_)<rc)return;if(_>0&&_>Math.abs(k))T.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{T.isLocked=!1,h();return}}if(!T.isLocked)return;$.preventDefault();const g=Math.max(0,_);u.current=g,r(g)},[e,h]),S=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const k=T.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!k){h();return}$.clientY-T.startY>=p?v():f()},[p,v,e,h,f]),G=s.useCallback($=>{S($)},[S]),W=s.useCallback($=>{S($)},[S]),U=o>0,H=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",z=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:x(o),transition:I},mediaAreaStyle:{transform:m(o),transition:H,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:z?{opacity:w(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:G,onPointerCancel:W}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},Nx="[data-lightbox-scrollable]",Ud=()=>{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(Nx)||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"})}},[])},Wx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Hx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Dx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Ox=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Hx(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const w=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},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)`,x=window.setTimeout(()=>{p||(p=!0,w(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-Dx(t),!1))}},Eo=300,Bx=900,zx=1500,jx="cubic-bezier(0.16, 1, 0.3, 1)",Vx=3e3,Gx=2,Xx=16,Yx=.05,qx=1,fr=.3,Ux=50,Kx=20,Ai=.004,ro=["title1","title2","title3"],Zx={title1:"1",title2:"2",title3:"3"},Jx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Qx={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${Kx}px)`,ev=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]}},tv=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=ev(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,nv=e=>[jt(e,"fontFamily"),jt(e,"fontSettings"),{type:"row",items:[jt(e,"fontSize"),jt(e,"lineHeight"),jt(e,"letterSpacing"),jt(e,"wordSpacing")]},jt(e,"textAlign"),jt(e,"textAppearance")],iv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ro.map(e=>[Zx[e],nv(e)]))}),el=(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},Kd=(e,t)=>el(e,t),xr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ac=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:el(e.length,n),effective:Kd(e.length,n)}},ov=(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},_a=(e,t)=>{const n=i=>{const o=jt(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[Jx[t]]}},rv=(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),Na=(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??Qx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)},av=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:w,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:G,title1Width:W,title2Width:U,title3Width:H,title1MarginLeft:I=0,title2MarginLeft:z=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:k="desktop",contentMarginTop:_,iconMarginLeft:g}=n,D=R=>O.scalingValue(R,i??!1),P=c??n.thumnailSize??.03,q=D(P),ie=D(u),L=D(p??.02),B=D(x??0),K=D(_??0),ue=yr(K),le=D(g??0),[F,pe]=s.useState(0),j=s.useRef(F);j.current=F;const se=t[F],{title1:ne,title2:ve,title3:ke}=tv(se),xe=Na("title1",_a(n,"title1"),i),b=Na("title2",_a(n,"title2"),i),M=Na("title3",_a(n,"title3"),i),E=k==="mobile",V=!o&&(!i||r),Ce=V,te=V,$e=V,ae=Dn(y),ge=ae?{"--image-aspect-ratio":da(y)}:void 0,ye=!!(ne||ve||ke),Z=s.useMemo(()=>ov(e,ne,ve,ke,xe,b,M),[e,F,ne,ve,ke,xe,b,M]),J=s.useMemo(()=>({title1Width:W,title2Width:U,title3Width:H}),[W,U,H]),de=s.useMemo(()=>Z.map(R=>J[R.widthKey]),[Z,J]),be=s.useMemo(()=>el(Z.length,de),[Z.length,de]),Pe=s.useMemo(()=>Kd(Z.length,de),[Z.length,de]),Se=s.useMemo(()=>Z.filter(R=>R.prefix==="title1"),[Z]),X=s.useMemo(()=>Z.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[Z]),me=s.useMemo(()=>ac(Se,J),[Se,J]),re=s.useMemo(()=>ac(X,J),[X,J]),Y=s.useCallback((R,oe)=>{const fe=Z.indexOf(R);if(!E||oe==="single-row")return{effectiveWidth:Pe[fe]??0,resolvedWidth:be[fe]??0,maxWidth:xr(fe,be)};if(oe==="two-row-top"){const Ge=Se.indexOf(R);return{effectiveWidth:me.effective[Ge]??0,resolvedWidth:me.resolved[Ge]??0,maxWidth:xr(Ge,me.resolved)}}const Le=X.indexOf(R);return{effectiveWidth:re.effective[Le]??0,resolvedWidth:re.resolved[Le]??0,maxWidth:xr(Le,re.resolved)}},[X,re,Pe,be,Z,Se,me,E]),ce=s.useCallback(R=>O.scalingValue(R,i??!1),[i]),Ee=ce(T??0),he=s.useMemo(()=>({title1MarginLeft:I,title2MarginLeft:z,title3MarginLeft:$}),[I,z,$]),Q=s.useCallback(R=>Z.slice(0,R+1).reduce((oe,fe,Le)=>oe+(fe!=null&&fe.marginLeftKey?he[fe.marginLeftKey]??0:0)+(be[Le]??0),0)+(E?0:I??0),[Z,he,be,E,I]),Ne=s.useCallback(()=>E?0:I??0,[E,I]),Fe=s.useCallback(R=>X.slice(0,R).reduce((oe,fe,Le)=>oe+(fe.marginLeftKey?he[fe.marginLeftKey]??0:0)+(re.resolved[Le]??0),0),[X,re.resolved,he]),et=s.useCallback(R=>{const oe=X[R];return Fe(R)+(oe.marginLeftKey?he[oe.marginLeftKey]??0:0)+(re.resolved[R]??0)},[X,re.resolved,Fe,he]),Je=(R,oe)=>{const fe=R.marginLeftKey?he[R.marginLeftKey]??0:0,{effectiveWidth:Le,resolvedWidth:Ge,maxWidth:Qe}=Y(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:ce(Le),...fe>0?{marginLeft:ce(fe)}:{}},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(Ge),style:{position:"absolute",top:0,left:ce(-fe),width:`max(${ce(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:ce(-Ai/2),width:ce(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},dt=()=>{const R=E?-1:Z.findIndex(Le=>Le.prefix==="title1"),oe=!E&&(o||(I??0)>0)?(()=>{const Le=I??0,Ge=R>=0?be[R]:W??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:0,width:`max(${ce(Le)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,fe=Z.flatMap((Le,Ge)=>{if(!Le.marginLeftKey)return[];const Qe=he[Le.marginLeftKey]??0,bt=rv(Z,be,he,Ge)+Ne();return a.jsx("div",{"data-controls":Le.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(be[Ge]),style:{position:"absolute",top:0,left:ce(bt),width:`max(${ce(Qe)}, 10px)`,height:"100%",pointerEvents:"auto"}},Le.marginLeftKey)});return oe?[oe,...fe]:fe},tt=()=>Z.map((R,oe)=>{const fe=xr(oe,be),Ge=Q(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(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ce(Ge),width:ce(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),De=()=>X.flatMap((R,oe)=>{if(!R.marginLeftKey)return[];const fe=he[R.marginLeftKey]??0,Le=Fe(oe),{resolvedWidth:Ge}=Y(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(Ge),style:{position:"absolute",top:0,left:ce(Le),width:`max(${ce(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Ie=()=>X.map((R,oe)=>{const{maxWidth:fe}=Y(R,"two-row-bottom"),Ge=et(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(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ce(Ge),width:ce(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),We=s.useRef(null),je=s.useRef(null),Ue=s.useRef(null),A=s.useRef(null),ee=s.useRef([]),Te=s.useRef([]),He=s.useRef(0),Be=s.useRef(null),Ve=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),rt=s.useRef(null),Ze=s.useRef(null),_e=s.useRef(0),qe=s.useRef("forward"),Oe=s.useRef(0),nt=s.useRef(null),at=s.useRef(!1),st=t.length>1&&(!o||!!r),St=st?3:1,Yt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[Zt,vt]=s.useState(!1),[wt,Bt]=s.useState(!1),[At,xt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Ut=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Ce&&!At,gt=s.useCallback(()=>{Ce&&(xt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Ve.current.isActive||xt(!1)},Vx))},[Ce]),Me=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,Bt(!1),Tt.current=setTimeout(()=>{l()},Eo))},[o,l]),Xe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:O.scalingValue(m??0,i),height:O.scalingValue(m??0,i),marginRight:le,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Me,"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:le,height:"100%",pointerEvents:"auto"}})]}),lt=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ce(I??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=Z.find(Le=>Le.prefix==="title1"),oe=Z.filter(Le=>Le.prefix==="title2"||Le.prefix==="title3"),fe=oe.length>0||o||(T??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(I??0)>0||o?lt():null,R&&Je(R,"two-row-top"),w&&Xe()]}),fe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[oe.map(Le=>Je(Le,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[De(),Ie()]})]}):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:Ee,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(I??0)>0||o?lt("single-row"):null,Z.map(R=>Je(R,"single-row")),o?a.jsxs(a.Fragment,{children:[dt(),tt()]}):null,w?Xe():null]}),Lt=s.useCallback(R=>!!(R.closest("[data-controls]")||R.closest(`.${e}-thumbnails`)||R.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:zt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Vt,dismissAreaStyle:Gt}=qd({enabled:V??!1,onClose:Me,animMs:Eo,isBlockedTarget:Lt}),Ht=()=>{if(!st||t.length===0)return He.current=0,0;const R=Te.current[0],oe=Te.current[t.length];if(!R||!oe)return He.current;const fe=oe.offsetLeft-R.offsetLeft;return fe>0&&(He.current=fe),He.current},Dt=(R=!1)=>{if(!st)return;const oe=je.current,fe=Ht();!oe||fe<=0||fe<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=fe,R&&(Ve.current.scrollLeft+=fe),at.current&&(Oe.current+=fe)):oe.scrollLeft>=fe*2&&(oe.scrollLeft-=fe,R&&(Ve.current.scrollLeft-=fe),at.current&&(Oe.current-=fe)))},_t=(R,oe=(fe=>(fe=je.current)==null?void 0:fe.scrollLeft)()??0)=>{if(!st)return R;let Le=t.length+R,Ge=1/0;for(let Qe=0;Qe<St;Qe++){const bt=Qe*t.length+R,Rt=Te.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-oe);tn<Ge&&(Ge=tn,Le=bt)}return Le},Ct=R=>{const oe=je.current;return!R||!oe?!1:R.offsetWidth>oe.clientWidth+1},N=R=>{const oe=je.current;if(!R||!oe||!Ct(R))return!1;const fe=R.offsetLeft,Le=fe+R.offsetWidth;return oe.scrollLeft>=fe-1&&oe.scrollLeft+oe.clientWidth<=Le+1},Re=(R=(oe=>(oe=je.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Le=0;Le<Te.current.length;Le+=1){const Ge=Te.current[Le];if(Ge&&N(Ge))return Le}let fe={flatIndex:0,distance:1/0};return Te.current.forEach((Le,Ge)=>{if(!Le)return;const Qe=Math.abs(Le.offsetLeft-R);Qe<fe.distance&&(fe={flatIndex:Ge,distance:Qe})}),fe.flatIndex},Ae=R=>{je.current&&Te.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=Ct(oe)&&R==="backward"?"end":"start")})},ze=(R,oe,fe)=>{const Le=R-oe,Ge=Re(oe),Qe=Te.current[Ge];if(N(Qe))return Re(R)%t.length;const bt=Te.current[Ge+1],Rt=Qe?bt?bt.offsetLeft-Qe.offsetLeft:Qe.offsetWidth:0,tn=Rt>0?Le>Rt*fr?1:Le<-Rt*fr?-1:0:0;return tn===0?fe:st?(fe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,fe+tn))},ct=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const oe=A.current,fe=j.current,Le=ee.current[fe];if(!oe||!Le||oe.scrollWidth<=oe.clientWidth)return;const Ge=oe.scrollLeft,Qe=Ge+oe.clientWidth,bt=Le.offsetLeft,Rt=bt+Le.offsetWidth;if(bt>=Ge&&Rt<=Qe)return;const tn=oe.scrollWidth-oe.clientWidth;let Qt=Ge;if(!R&&Ft.current===null){const Ei=ee.current[fe-1],ho=ee.current[fe+1],ar=Ei?Le.offsetLeft-Ei.offsetLeft:ho?ho.offsetLeft-Le.offsetLeft:Le.offsetWidth;Rt>Qe?Qt+=ar:bt<Ge&&(Qt-=ar)}else Rt>Qe?Qt=Rt-oe.clientWidth:Qt=bt;oe.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Ut.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const oe=Ut.current;Ut.current=!1,ct(oe)}))},[ct]),it=s.useCallback(R=>{if(R===j.current)return;const oe=j.current;j.current=R;const fe=Math.abs(R-oe)>1,Le=st&&t.length>1&&(oe===t.length-1&&R===0||oe===0&&R===t.length-1);pe(R),Et(fe||Le)},[t.length,st,Et]),yt=()=>{if(!je.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const R=je.current.scrollLeft,oe=Re(R)%t.length;oe!==j.current&&it(oe)},Ot=()=>{Ft.current=null},It=R=>{const oe=je.current;oe&&(oe.style.scrollSnapType=R?"":"none")},nn=()=>{var R;(R=Ze.current)==null||R.call(Ze),Ze.current=null},un=()=>{nt.current!==null&&(cancelAnimationFrame(nt.current),nt.current=null),at.current=!1},ci=()=>{const R=je.current;if(!R){nt.current=null,at.current=!1;return}const oe=Oe.current-R.scrollLeft;if(Math.abs(oe)<.5){R.scrollLeft=Oe.current,Dt(),yt(),nt.current=null,at.current=!1;return}R.scrollLeft+=oe*Yx,Dt(),yt(),gt(),nt.current=requestAnimationFrame(ci)},di=()=>{const R=Ue.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},nr=(R,oe,fe,Le)=>{di(),R.scrollLeft=oe,_e.current=R.scrollLeft,Dt(),fe!==void 0?(j.current=fe,pe(fe)):yt(),It(!0),Le==null||Le()},ir=(R,{behavior:oe="smooth",activeIndex:fe,onComplete:Le}={})=>{const Ge=je.current,Qe=Ue.current;if(!Ge||!Qe)return;if(un(),nn(),It(!1),oe==="auto"){nr(Ge,R,fe,Le);return}const bt=Math.abs(R-Ge.scrollLeft),Rt=Wx(bt,Bx,zx,Ge.clientWidth*.55);Ze.current=Ox(Ge,Qe,R,{duration:Rt,easing:jx,onComplete:()=>{Ze.current=null,nr(Ge,R,fe,Le)}})},pa=(R="smooth")=>{const oe=je.current;if(!oe||t.length===0)return;const fe=Re()%t.length,Le=_t(fe,oe.scrollLeft),Ge=Te.current[Le];Ge&&ir(Ge.offsetLeft,{behavior:R,activeIndex:fe})},ma=(R,oe="smooth",fe,Le)=>{const Ge=je.current;if(!Ge||t.length===0)return;const Qe=(Le??Ge.scrollLeft)-R,bt=Re(R),Rt=Te.current[bt];if(N(Rt)){It(!0),yt();return}const tn=Te.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Qe>Qt*fr?1:Qe<-Qt*fr?-1:0:0)!==0){const Cu=fe??bt%t.length,$u=ze(Le??Ge.scrollLeft,R,Cu);$n($u,oe);return}const ho=Le??Ge.scrollLeft,ar=Re(ho),il=Te.current[ar];if(il&&Math.abs(il.offsetLeft-ho)<1){It(!0),yt();return}pa("auto")},$n=(R,oe="smooth")=>{const fe=je.current;if(!fe||t.length===0)return;const Le=_t(R,fe.scrollLeft),Ge=Te.current[Le];Ge&&(oe==="smooth"?Ft.current=R:Ft.current=null,j.current=R,pe(R),Et(!0),ir(Ge.offsetLeft,{behavior:oe,activeIndex:R,onComplete:oe==="smooth"?Ot:void 0}))},Pi=()=>{rt.current&&(window.removeEventListener("pointerup",rt.current),window.removeEventListener("pointercancel",rt.current),rt.current=null)},or=(R,oe,fe,Le,Ge)=>{const Qe=fe-R,bt=Le-oe,Rt=Math.abs(Qe),tn=Math.abs(bt);if(Rt<Ux||Rt<=tn)return!1;const Qt=Qe<0?1:-1,Ei=st?(Ge+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ge+Qt));return Ei===Ge?!1:($n(Ei),!0)},ui=R=>{if(!Ve.current.isActive)return;Pi();const oe=je.current;if(!oe)return;const{scrollLeft:fe,startActiveIndex:Le,hasMoved:Ge}=Ve.current,Qe=oe.scrollLeft;Dt(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),R!==void 0&&oe.hasPointerCapture(R)&&oe.releasePointerCapture(R),Ge?ma(fe,"smooth",Le,Qe):(It(!0),yt()),gt()},rr=(R,oe)=>{const fe=Be.current;Be.current=null,fe&&(or(fe.startX,fe.startY,R,oe,fe.startActiveIndex),gt())},ga=R=>{if(!te)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;Be.current={startX:R.clientX,startY:R.clientY,startActiveIndex:j.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const oe=je.current;if(!oe)return;un(),nn(),di(),Ft.current=null,Ve.current={isActive:!0,startX:R.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:j.current,hasMoved:!1},It(!1),gt(),oe.setPointerCapture(R.pointerId),Pi();const fe=Le=>{Le.pointerType==="mouse"&&ui(Le.pointerId)};rt.current=fe,window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},ha=R=>{if(!te||R.pointerType!=="mouse")return;const oe=je.current;if(!oe||!Ve.current.isActive)return;if(R.buttons===0){ui(R.pointerId);return}const fe=R.clientX-Ve.current.startX;Math.abs(fe)>qx&&(Ve.current.hasMoved=!0,vt(!0)),Ve.current.hasMoved&&(R.preventDefault(),oe.scrollLeft=Ve.current.scrollLeft-fe,Dt(!0),yt(),gt())},we=R=>{if(te){if(R.pointerType==="touch"){R.type==="pointerup"?rr(R.clientX,R.clientY):Be.current=null;return}R.pointerType==="mouse"&&ui(R.pointerId)}},Ye=R=>{!te||R.pointerType!=="mouse"||ui(R.pointerId)};return Ud(),s.useEffect(()=>{const R=requestAnimationFrame(()=>Bt(!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(!Ce){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)}},[Ce,gt]),s.useEffect(()=>{const R=oe=>{oe.key==="Escape"&&Me()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Me]),s.useLayoutEffect(()=>{Ht()},[B,t.length,st]),s.useLayoutEffect(()=>{o||$n(j.current,"auto")},[B,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,st]),s.useEffect(()=>{const R=je.current;if(!R||o||!V)return;const oe=fe=>{if(fe.preventDefault(),Math.abs(fe.deltaY)<=Math.abs(fe.deltaX))return;const Le=fe.deltaMode===1?Xx:fe.deltaMode===2?R.clientHeight:1,Ge=fe.deltaY*Le*Gx;if(Ge!==0){if(nn(),at.current||(at.current=!0,Oe.current=R.scrollLeft,Ft.current=null,It(!1)),Oe.current+=Ge,!st){const Qe=R.scrollWidth-R.clientWidth;Oe.current=Math.max(0,Math.min(Qe,Oe.current))}gt(),nt.current===null&&(nt.current=requestAnimationFrame(ci))}};return R.addEventListener("wheel",oe,{passive:!1}),()=>{R.removeEventListener("wheel",oe),un()}},[o,V,st]),s.useEffect(()=>{const R=je.current;if(!R)return;const oe=()=>{Dt(Ve.current.isActive);const Le=R.scrollLeft,Ge=Le-_e.current;_e.current=Le;const Qe=He.current>0?He.current*.5:1/0;if(Ge!==0&&Math.abs(Ge)<Qe){const bt=Ge>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Ae(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};R.addEventListener("scroll",oe,{passive:!0});const fe=new ResizeObserver(()=>{Ht(),Dt(Ve.current.isActive),Ae(qe.current),yt()});return fe.observe(R),()=>{nn(),R.removeEventListener("scroll",oe),fe.disconnect()}},[t.length,st]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Me()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${Eo}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...zt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:je,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":te&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:B},children:Yt.map((R,oe)=>{const fe=R.image.objectFit??"contain",Le=oe%t.length,Ge=Math.floor(oe/t.length),Qe=yr(B),bt=`calc(-0.5 * (${Qe} + ${B}))`;return a.jsxs("div",{ref:Rt=>Te.current[oe]=Rt,className:`${e}-strip-item`,style:{height:k==="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:fe}}),o&&Le<t.length-1&&Ge===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Qe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ge}-${R.image.url}-${Le}`)})})})}),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:K,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:ue,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${E?` ${e}-lightbox-content-area-stacked`:""}`,children:(ye||w)&&a.jsx("div",{className:`${e}-header ${E?`${e}-header-two-row`:`${e}-header-single-row`}`,children:E?ht():ye||w?ft():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=yr(L),oe=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:A,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:fe=>fe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ie,"--thumbnail-active-color":G},children:[t.map((fe,Le)=>{const Ge=yr(ie),Qe=`calc(-0.5 * (${Ge} + ${ie}))`;return a.jsxs("div",{ref:bt=>{ee.current[Le]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":F===Le?"true":"false",onClick:()=>V&&v==="click"&&$n(Le),onMouseEnter:()=>$e&&v==="hover"&&$n(Le),"aria-label":fe.image.name?`View ${fe.image.name}`:`View image ${Le+1}`,"aria-current":F===Le?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ae?` ${e}-thumb-image-cover`:""}`,src:fe.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:q,maxHeight:q,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Le<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Qe,width:Ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${fe.image.url}-${Le}`)}),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 sv(e){return`
|
|
14229
|
+
`;function Gn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ic={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ax=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Fx={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:{...ic.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:{...ic.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:[...Ax],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},_x={element:Mx,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:Fx,sourceCode:kx},Dn=e=>e.display==="cover",da=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},oc=100,Nx=.2,rc=8,qd=({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"?oc:Math.max(oc,window.innerHeight*Nx),[]),x=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),w=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const T=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-$/T*.12);return`translateY(${$}px) scale(${k})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),v=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 T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const k=$.clientX-T.startX,F=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(k)<rc&&Math.abs(F)<rc)return;if(F>0&&F>Math.abs(k))T.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{T.isLocked=!1,h();return}}if(!T.isLocked)return;$.preventDefault();const g=Math.max(0,F);u.current=g,r(g)},[e,h]),S=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const k=T.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!k){h();return}$.clientY-T.startY>=p?v():f()},[p,v,e,h,f]),X=s.useCallback($=>{S($)},[S]),N=s.useCallback($=>{S($)},[S]),U=o>0,W=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",B=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:x(o),transition:I},mediaAreaStyle:{transform:m(o),transition:W,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:B?{opacity:w(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:X,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},Wx="[data-lightbox-scrollable]",Ud=()=>{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(Wx)||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"})}},[])},Hx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Dx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Ox=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Bx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Dx(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const w=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},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)`,x=window.setTimeout(()=>{p||(p=!0,w(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-Ox(t),!1))}},Eo=300,zx=900,jx=1500,Vx="cubic-bezier(0.16, 1, 0.3, 1)",Gx=3e3,Xx=2,Yx=16,qx=.05,Ux=1,fr=.3,Kx=50,Zx=20,Ai=.004,ro=["title1","title2","title3"],Jx={title1:"1",title2:"2",title3:"3"},Qx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},ev={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${Zx}px)`,tv=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]}},nv=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=tv(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Vt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,iv=e=>[Vt(e,"fontFamily"),Vt(e,"fontSettings"),{type:"row",items:[Vt(e,"fontSize"),Vt(e,"lineHeight"),Vt(e,"letterSpacing"),Vt(e,"wordSpacing")]},Vt(e,"textAlign"),Vt(e,"textAppearance")],ov=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ro.map(e=>[Jx[e],iv(e)]))}),el=(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},Kd=(e,t)=>el(e,t),xr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ac=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:el(e.length,n),effective:Kd(e.length,n)}},rv=(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},_a=(e,t)=>{const n=i=>{const o=Vt(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[Qx[t]]}},av=(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),Na=(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??ev[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)},sv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:w,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:X,title1Width:N,title2Width:U,title3Width:W,title1MarginLeft:I=0,title2MarginLeft:B=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:k="desktop",contentMarginTop:F,iconMarginLeft:g}=n,H=R=>D.scalingValue(R,i??!1),P=c??n.thumnailSize??.03,q=H(P),ne=H(u),L=H(p??.02),O=H(x??0),Z=H(F??0),ue=yr(Z),ae=H(g??0),[A,pe]=s.useState(0),z=s.useRef(A);z.current=A;const re=t[A],{title1:te,title2:be,title3:Ae}=nv(re),ve=Na("title1",_a(n,"title1"),i),b=Na("title2",_a(n,"title2"),i),M=Na("title3",_a(n,"title3"),i),E=k==="mobile",j=!o&&(!i||r),Ce=j,ee=j,Ie=j,oe=Dn(y),me=oe?{"--image-aspect-ratio":da(y)}:void 0,xe=!!(te||be||Ae),J=s.useMemo(()=>rv(e,te,be,Ae,ve,b,M),[e,A,te,be,Ae,ve,b,M]),Q=s.useMemo(()=>({title1Width:N,title2Width:U,title3Width:W}),[N,U,W]),se=s.useMemo(()=>J.map(R=>Q[R.widthKey]),[J,Q]),we=s.useMemo(()=>el(J.length,se),[J.length,se]),Ee=s.useMemo(()=>Kd(J.length,se),[J.length,se]),Te=s.useMemo(()=>J.filter(R=>R.prefix==="title1"),[J]),Y=s.useMemo(()=>J.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[J]),de=s.useMemo(()=>ac(Te,Q),[Te,Q]),ce=s.useMemo(()=>ac(Y,Q),[Y,Q]),G=s.useCallback((R,ie)=>{const ge=J.indexOf(R);if(!E||ie==="single-row")return{effectiveWidth:Ee[ge]??0,resolvedWidth:we[ge]??0,maxWidth:xr(ge,we)};if(ie==="two-row-top"){const je=Te.indexOf(R);return{effectiveWidth:de.effective[je]??0,resolvedWidth:de.resolved[je]??0,maxWidth:xr(je,de.resolved)}}const Pe=Y.indexOf(R);return{effectiveWidth:ce.effective[Pe]??0,resolvedWidth:ce.resolved[Pe]??0,maxWidth:xr(Pe,ce.resolved)}},[Y,ce,Ee,we,J,Te,de,E]),le=s.useCallback(R=>D.scalingValue(R,i??!1),[i]),Me=le(T??0),fe=s.useMemo(()=>({title1MarginLeft:I,title2MarginLeft:B,title3MarginLeft:$}),[I,B,$]),K=s.useCallback(R=>J.slice(0,R+1).reduce((ie,ge,Pe)=>ie+(ge!=null&&ge.marginLeftKey?fe[ge.marginLeftKey]??0:0)+(we[Pe]??0),0)+(E?0:I??0),[J,fe,we,E,I]),Xe=s.useCallback(()=>E?0:I??0,[E,I]),Le=s.useCallback(R=>Y.slice(0,R).reduce((ie,ge,Pe)=>ie+(ge.marginLeftKey?fe[ge.marginLeftKey]??0:0)+(ce.resolved[Pe]??0),0),[Y,ce.resolved,fe]),Ze=s.useCallback(R=>{const ie=Y[R];return Le(R)+(ie.marginLeftKey?fe[ie.marginLeftKey]??0:0)+(ce.resolved[R]??0)},[Y,ce.resolved,Le,fe]),Qe=(R,ie)=>{const ge=R.marginLeftKey?fe[R.marginLeftKey]??0:0,{effectiveWidth:Pe,resolvedWidth:je,maxWidth:tt}=G(R,ie),bt=o&&ie==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...ie==="single-row"?{gridArea:R.prefix}:{},width:le(Pe),...ge>0?{marginLeft:le(ge)}:{}},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:le(-ge),width:`max(${le(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(tt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-Ai/2),width:le(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},ct=()=>{const R=E?-1:J.findIndex(Pe=>Pe.prefix==="title1"),ie=!E&&(o||(I??0)>0)?(()=>{const Pe=I??0,je=R>=0?we[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(${le(Pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ge=J.flatMap((Pe,je)=>{if(!Pe.marginLeftKey)return[];const tt=fe[Pe.marginLeftKey]??0,bt=av(J,we,fe,je)+Xe();return a.jsx("div",{"data-controls":Pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[je]),style:{position:"absolute",top:0,left:le(bt),width:`max(${le(tt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Pe.marginLeftKey)});return ie?[ie,...ge]:ge},nt=()=>J.map((R,ie)=>{const ge=xr(ie,we),je=K(ie)-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(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(je),width:le(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),Ve=()=>Y.flatMap((R,ie)=>{if(!R.marginLeftKey)return[];const ge=fe[R.marginLeftKey]??0,Pe=Le(ie),{resolvedWidth:je}=G(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:le(Pe),width:`max(${le(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),$e=()=>Y.map((R,ie)=>{const{maxWidth:ge}=G(R,"two-row-bottom"),je=Ze(ie)-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(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(je),width:le(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),He=s.useRef(null),Be=s.useRef(null),Ue=s.useRef(null),he=s.useRef(null),V=s.useRef([]),ye=s.useRef([]),Ne=s.useRef(0),ze=s.useRef(null),We=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),et=s.useRef(null),Je=s.useRef(null),_e=s.useRef(0),qe=s.useRef("forward"),De=s.useRef(0),it=s.useRef(null),at=s.useRef(!1),dt=t.length>1&&(!o||!!r),St=dt?3:1,At=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[Zt,vt]=s.useState(!1),[wt,zt]=s.useState(!1),[Ft,xt]=s.useState(!0),_t=s.useRef(null),Wt=s.useRef(null),Ut=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Ht=s.useRef(null),rn=Ce&&!Ft,gt=s.useCallback(()=>{Ce&&(xt(!0),Ht.current&&clearTimeout(Ht.current),Ht.current=setTimeout(()=>{We.current.isActive||xt(!1)},Gx))},[Ce]),ke=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,zt(!1),Tt.current=setTimeout(()=>{l()},Eo))},[o,l]),Ge=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:D.scalingValue(m??0,i),height:D.scalingValue(m??0,i),marginRight:ae,"--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:ae,height:"100%",pointerEvents:"auto"}})]}),st=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(I??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=J.find(Pe=>Pe.prefix==="title1"),ie=J.filter(Pe=>Pe.prefix==="title2"||Pe.prefix==="title3"),ge=ie.length>0||o||(T??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(I??0)>0||o?st():null,R&&Qe(R,"two-row-top"),w&&Ge()]}),ge?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ie.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ie.map(Pe=>Qe(Pe,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ve(),$e()]})]}):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:Me,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(I??0)>0||o?st("single-row"):null,J.map(R=>Qe(R,"single-row")),o?a.jsxs(a.Fragment,{children:[ct(),nt()]}):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:jt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Gt,dismissAreaStyle:Xt}=qd({enabled:j??!1,onClose:ke,animMs:Eo,isBlockedTarget:Lt}),Dt=()=>{if(!dt||t.length===0)return Ne.current=0,0;const R=ye.current[0],ie=ye.current[t.length];if(!R||!ie)return Ne.current;const ge=ie.offsetLeft-R.offsetLeft;return ge>0&&(Ne.current=ge),Ne.current},Ot=(R=!1)=>{if(!dt)return;const ie=Be.current,ge=Dt();!ie||ge<=0||ge<ie.clientWidth*.25||(ie.scrollLeft<=0?(ie.scrollLeft+=ge,R&&(We.current.scrollLeft+=ge),at.current&&(De.current+=ge)):ie.scrollLeft>=ge*2&&(ie.scrollLeft-=ge,R&&(We.current.scrollLeft-=ge),at.current&&(De.current-=ge)))},Nt=(R,ie=(ge=>(ge=Be.current)==null?void 0:ge.scrollLeft)()??0)=>{if(!dt)return R;let Pe=t.length+R,je=1/0;for(let tt=0;tt<St;tt++){const bt=tt*t.length+R,Rt=ye.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-ie);tn<je&&(je=tn,Pe=bt)}return Pe},Ct=R=>{const ie=Be.current;return!R||!ie?!1:R.offsetWidth>ie.clientWidth+1},_=R=>{const ie=Be.current;if(!R||!ie||!Ct(R))return!1;const ge=R.offsetLeft,Pe=ge+R.offsetWidth;return ie.scrollLeft>=ge-1&&ie.scrollLeft+ie.clientWidth<=Pe+1},Re=(R=(ie=>(ie=Be.current)==null?void 0:ie.scrollLeft)()??0)=>{for(let Pe=0;Pe<ye.current.length;Pe+=1){const je=ye.current[Pe];if(je&&_(je))return Pe}let ge={flatIndex:0,distance:1/0};return ye.current.forEach((Pe,je)=>{if(!Pe)return;const tt=Math.abs(Pe.offsetLeft-R);tt<ge.distance&&(ge={flatIndex:je,distance:tt})}),ge.flatIndex},Fe=R=>{Be.current&&ye.current.forEach(ie=>{ie&&(ie.style.scrollSnapAlign=Ct(ie)&&R==="backward"?"end":"start")})},Oe=(R,ie,ge)=>{const Pe=R-ie,je=Re(ie),tt=ye.current[je];if(_(tt))return Re(R)%t.length;const bt=ye.current[je+1],Rt=tt?bt?bt.offsetLeft-tt.offsetLeft:tt.offsetWidth:0,tn=Rt>0?Pe>Rt*fr?1:Pe<-Rt*fr?-1:0:0;return tn===0?ge:dt?(ge+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ge+tn))},lt=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const ie=he.current,ge=z.current,Pe=V.current[ge];if(!ie||!Pe||ie.scrollWidth<=ie.clientWidth)return;const je=ie.scrollLeft,tt=je+ie.clientWidth,bt=Pe.offsetLeft,Rt=bt+Pe.offsetWidth;if(bt>=je&&Rt<=tt)return;const tn=ie.scrollWidth-ie.clientWidth;let Qt=je;if(!R&&_t.current===null){const Ei=V.current[ge-1],ho=V.current[ge+1],ar=Ei?Pe.offsetLeft-Ei.offsetLeft:ho?ho.offsetLeft-Pe.offsetLeft:Pe.offsetWidth;Rt>tt?Qt+=ar:bt<je&&(Qt-=ar)}else Rt>tt?Qt=Rt-ie.clientWidth:Qt=bt;ie.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Ut.current=!0),Wt.current===null&&(Wt.current=requestAnimationFrame(()=>{Wt.current=null;const ie=Ut.current;Ut.current=!1,lt(ie)}))},[lt]),ot=s.useCallback(R=>{if(R===z.current)return;const ie=z.current;z.current=R;const ge=Math.abs(R-ie)>1,Pe=dt&&t.length>1&&(ie===t.length-1&&R===0||ie===0&&R===t.length-1);pe(R),Et(ge||Pe)},[t.length,dt,Et]),yt=()=>{if(!Be.current||t.length===0||_t.current!==null||We.current.isActive&&We.current.hasMoved)return;const R=Be.current.scrollLeft,ie=Re(R)%t.length;ie!==z.current&&ot(ie)},Bt=()=>{_t.current=null},It=R=>{const ie=Be.current;ie&&(ie.style.scrollSnapType=R?"":"none")},nn=()=>{var R;(R=Je.current)==null||R.call(Je),Je.current=null},un=()=>{it.current!==null&&(cancelAnimationFrame(it.current),it.current=null),at.current=!1},ci=()=>{const R=Be.current;if(!R){it.current=null,at.current=!1;return}const ie=De.current-R.scrollLeft;if(Math.abs(ie)<.5){R.scrollLeft=De.current,Ot(),yt(),it.current=null,at.current=!1;return}R.scrollLeft+=ie*qx,Ot(),yt(),gt(),it.current=requestAnimationFrame(ci)},di=()=>{const R=Ue.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},nr=(R,ie,ge,Pe)=>{di(),R.scrollLeft=ie,_e.current=R.scrollLeft,Ot(),ge!==void 0?(z.current=ge,pe(ge)):yt(),It(!0),Pe==null||Pe()},ir=(R,{behavior:ie="smooth",activeIndex:ge,onComplete:Pe}={})=>{const je=Be.current,tt=Ue.current;if(!je||!tt)return;if(un(),nn(),It(!1),ie==="auto"){nr(je,R,ge,Pe);return}const bt=Math.abs(R-je.scrollLeft),Rt=Hx(bt,zx,jx,je.clientWidth*.55);Je.current=Bx(je,tt,R,{duration:Rt,easing:Vx,onComplete:()=>{Je.current=null,nr(je,R,ge,Pe)}})},pa=(R="smooth")=>{const ie=Be.current;if(!ie||t.length===0)return;const ge=Re()%t.length,Pe=Nt(ge,ie.scrollLeft),je=ye.current[Pe];je&&ir(je.offsetLeft,{behavior:R,activeIndex:ge})},ma=(R,ie="smooth",ge,Pe)=>{const je=Be.current;if(!je||t.length===0)return;const tt=(Pe??je.scrollLeft)-R,bt=Re(R),Rt=ye.current[bt];if(_(Rt)){It(!0),yt();return}const tn=ye.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?tt>Qt*fr?1:tt<-Qt*fr?-1:0:0)!==0){const $u=ge??bt%t.length,Tu=Oe(Pe??je.scrollLeft,R,$u);$n(Tu,ie);return}const ho=Pe??je.scrollLeft,ar=Re(ho),il=ye.current[ar];if(il&&Math.abs(il.offsetLeft-ho)<1){It(!0),yt();return}pa("auto")},$n=(R,ie="smooth")=>{const ge=Be.current;if(!ge||t.length===0)return;const Pe=Nt(R,ge.scrollLeft),je=ye.current[Pe];je&&(ie==="smooth"?_t.current=R:_t.current=null,z.current=R,pe(R),Et(!0),ir(je.offsetLeft,{behavior:ie,activeIndex:R,onComplete:ie==="smooth"?Bt:void 0}))},Pi=()=>{et.current&&(window.removeEventListener("pointerup",et.current),window.removeEventListener("pointercancel",et.current),et.current=null)},or=(R,ie,ge,Pe,je)=>{const tt=ge-R,bt=Pe-ie,Rt=Math.abs(tt),tn=Math.abs(bt);if(Rt<Kx||Rt<=tn)return!1;const Qt=tt<0?1:-1,Ei=dt?(je+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+Qt));return Ei===je?!1:($n(Ei),!0)},ui=R=>{if(!We.current.isActive)return;Pi();const ie=Be.current;if(!ie)return;const{scrollLeft:ge,startActiveIndex:Pe,hasMoved:je}=We.current,tt=ie.scrollLeft;Ot(!0),We.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),R!==void 0&&ie.hasPointerCapture(R)&&ie.releasePointerCapture(R),je?ma(ge,"smooth",Pe,tt):(It(!0),yt()),gt()},rr=(R,ie)=>{const ge=ze.current;ze.current=null,ge&&(or(ge.startX,ge.startY,R,ie,ge.startActiveIndex),gt())},ga=R=>{if(!ee)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;ze.current={startX:R.clientX,startY:R.clientY,startActiveIndex:z.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const ie=Be.current;if(!ie)return;un(),nn(),di(),_t.current=null,We.current={isActive:!0,startX:R.clientX,scrollLeft:ie.scrollLeft,startActiveIndex:z.current,hasMoved:!1},It(!1),gt(),ie.setPointerCapture(R.pointerId),Pi();const ge=Pe=>{Pe.pointerType==="mouse"&&ui(Pe.pointerId)};et.current=ge,window.addEventListener("pointerup",ge),window.addEventListener("pointercancel",ge)},ha=R=>{if(!ee||R.pointerType!=="mouse")return;const ie=Be.current;if(!ie||!We.current.isActive)return;if(R.buttons===0){ui(R.pointerId);return}const ge=R.clientX-We.current.startX;Math.abs(ge)>Ux&&(We.current.hasMoved=!0,vt(!0)),We.current.hasMoved&&(R.preventDefault(),ie.scrollLeft=We.current.scrollLeft-ge,Ot(!0),yt(),gt())},Se=R=>{if(ee){if(R.pointerType==="touch"){R.type==="pointerup"?rr(R.clientX,R.clientY):ze.current=null;return}R.pointerType==="mouse"&&ui(R.pointerId)}},Ye=R=>{!ee||R.pointerType!=="mouse"||ui(R.pointerId)};return Ud(),s.useEffect(()=>{const R=requestAnimationFrame(()=>zt(!0));return()=>{cancelAnimationFrame(R),nn(),Pi(),Wt.current!==null&&(cancelAnimationFrame(Wt.current),Wt.current=null),Tt.current&&clearTimeout(Tt.current),Ht.current&&clearTimeout(Ht.current)}},[]),s.useEffect(()=>{if(!Ce){xt(!0);return}gt();const R=He.current;if(!R)return;const ie=()=>gt();return R.addEventListener("pointermove",ie),R.addEventListener("pointerdown",ie),()=>{R.removeEventListener("pointermove",ie),R.removeEventListener("pointerdown",ie),Ht.current&&clearTimeout(Ht.current)}},[Ce,gt]),s.useEffect(()=>{const R=ie=>{ie.key==="Escape"&&ke()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[ke]),s.useLayoutEffect(()=>{Dt()},[O,t.length,dt]),s.useLayoutEffect(()=>{o||$n(z.current,"auto")},[O,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,dt]),s.useEffect(()=>{const R=Be.current;if(!R||o||!j)return;const ie=ge=>{if(ge.preventDefault(),Math.abs(ge.deltaY)<=Math.abs(ge.deltaX))return;const Pe=ge.deltaMode===1?Yx:ge.deltaMode===2?R.clientHeight:1,je=ge.deltaY*Pe*Xx;if(je!==0){if(nn(),at.current||(at.current=!0,De.current=R.scrollLeft,_t.current=null,It(!1)),De.current+=je,!dt){const tt=R.scrollWidth-R.clientWidth;De.current=Math.max(0,Math.min(tt,De.current))}gt(),it.current===null&&(it.current=requestAnimationFrame(ci))}};return R.addEventListener("wheel",ie,{passive:!1}),()=>{R.removeEventListener("wheel",ie),un()}},[o,j,dt]),s.useEffect(()=>{const R=Be.current;if(!R)return;const ie=()=>{Ot(We.current.isActive);const Pe=R.scrollLeft,je=Pe-_e.current;_e.current=Pe;const tt=Ne.current>0?Ne.current*.5:1/0;if(je!==0&&Math.abs(je)<tt){const bt=je>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Fe(bt))}We.current.isActive&&We.current.hasMoved||yt()};R.addEventListener("scroll",ie,{passive:!0});const ge=new ResizeObserver(()=>{Dt(),Ot(We.current.isActive),Fe(qe.current),yt()});return ge.observe(R),()=>{nn(),R.removeEventListener("scroll",ie),ge.disconnect()}},[t.length,dt]),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 ${Eo}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...jt}}),a.jsxs("div",{ref:He,className:`${e}-lightbox-dismiss-area`,style:Xt,...Gt,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":ee&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:Se,onPointerCancel:Se,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:O},children:At.map((R,ie)=>{const ge=R.image.objectFit??"contain",Pe=ie%t.length,je=Math.floor(ie/t.length),tt=yr(O),bt=`calc(-0.5 * (${tt} + ${O}))`;return a.jsxs("div",{ref:Rt=>ye.current[ie]=Rt,className:`${e}-strip-item`,style:{height:k==="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:ge}}),o&&Pe<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:tt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${R.image.url}-${Pe}`)})})})}),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:Z,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:ue,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${E?` ${e}-lightbox-content-area-stacked`:""}`,children:(xe||w)&&a.jsx("div",{className:`${e}-header ${E?`${e}-header-two-row`:`${e}-header-single-row`}`,children:E?ht():xe||w?ft():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=yr(L),ie=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:he,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ge=>ge.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ne,"--thumbnail-active-color":X},children:[t.map((ge,Pe)=>{const je=yr(ne),tt=`calc(-0.5 * (${je} + ${ne}))`;return a.jsxs("div",{ref:bt=>{V.current[Pe]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===Pe?"true":"false",onClick:()=>j&&v==="click"&&$n(Pe),onMouseEnter:()=>Ie&&v==="hover"&&$n(Pe),"aria-label":ge.image.name?`View ${ge.image.name}`:`View image ${Pe+1}`,"aria-current":A===Pe?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${oe?` ${e}-thumb-image-cover`:""}`,src:ge.image.url,alt:"",draggable:!1,style:{...me,maxWidth:q,maxHeight:q,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Pe<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:tt,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ge.image.url}-${Pe}`)}),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:ie,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function lv(e){return`
|
|
14230
14230
|
.${e}-wrapper {
|
|
14231
14231
|
position: relative;
|
|
14232
14232
|
width: 100%;
|
|
@@ -14611,7 +14611,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14611
14611
|
pointer-events: auto;
|
|
14612
14612
|
z-index: 10;
|
|
14613
14613
|
}
|
|
14614
|
-
`}const
|
|
14614
|
+
`}const cv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=D.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,x]=s.useState(!1),w=t??[],m=p&&w.length>0,h=()=>{w.length!==0&&x(!0)};return s.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:lv(l)}}),d&&a.jsx("div",{className:`${l}-cover ${Dn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Dn(c)?{"--image-aspect-ratio":da(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${Dn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(sv,{prefix:l,images:w,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),f)})()]})},dv=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14615
14615
|
import { createPortal } from 'react-dom';
|
|
14616
14616
|
import { CommonComponentProps } from '../props';
|
|
14617
14617
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15157,7 +15157,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15157
15157
|
</>
|
|
15158
15158
|
);
|
|
15159
15159
|
};
|
|
15160
|
-
`,dv="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>'),fi={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 uv(e){const t={};return t[jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[jt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[jt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[jt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[jt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[jt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const pv=ro.reduce((e,t)=>({...e,...uv(t)}),{}),mv=ro.reduce((e,t)=>({...e,[jt(t,"fontFamily")]:"Goudy Bookletter 1911",[jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[jt(t,"letterSpacing")]:0,[jt(t,"wordSpacing")]:0,[jt(t,"textAlign")]:"left",[jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[jt(n,"fontSize")]=i),o!==void 0&&(t[jt(n,"lineHeight")]=o),t},{})}const gv=iv(),hv={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"}},...pv,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:dv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...mv},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,...Wa({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,...Wa({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,...Wa({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:[gv]}],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"}]}},fv={element:lv,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:hv,sourceCode:cv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ro.map(e=>({path:`${jt(e,"fontFamily")}`}))]},fontRelations:{...ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${jt(t,"fontFamily")}`}),{})}},yv=({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:x,coverFit:w,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:v,textTransition:C,title1Width:y,title2Width:S,title3Width:G,title1MarginLeft:W=0,title2MarginLeft:U=0,title3MarginLeft:H=0,titleRowMarginBottom:I=0,titleHeaderLayout:z="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:k,closeIconColor:_,closeIconHoverColor:g,contentMarginTop:D=0,iconMarginRight:P=0}=n,q=s.useCallback(we=>O.scalingValue(we,i??!1),[i]),ie=q(h??0),L=`${f}%`,B=`${v}%`,K=q($),ue=q(D),le=q(P),F=wi("title1",bi(n,"title1"),i),pe=wi("title2",bi(n,"title2"),i),j=wi("title3",bi(n,"title3"),i),se=wi("count",bi(n,"count"),i),ne=z==="mobile",ve=!i||!!r,ke=!o&&(!i||!!r),xe=s.useMemo(()=>Er(t,x),[t,x]),[b,M]=s.useState(l),E=xe[b],V=E==null?void 0:E.entry,[Ce,te]=s.useState(!1),[$e,ae]=s.useState(null),[ge,ye]=s.useState(!1),[Z,J]=s.useState(null),[de,be]=s.useState(!1),[Pe,Se]=s.useState(0),[X,me]=s.useState(),[re,Y]=s.useState(),[ce,Ee]=s.useState(null),he=s.useRef(null),Q=s.useRef(0),Ne=s.useRef(0),Fe=s.useRef(0),et=s.useRef(!1),Je=s.useRef(null),dt=s.useRef(null),tt=s.useRef(null),De=s.useRef(null),Ie=s.useRef(null),We=s.useRef(null),je=s.useRef(null),Ue=s.useCallback(()=>{const we=dt.current;if(!we)return;const Ye=we.closest(`.${e}-lightbox-content-area`);if(!Ye)return we.getBoundingClientRect().width;const R=Array.from(Ye.children).reduce((oe,fe)=>!(fe instanceof HTMLElement)||fe.contains(we)?oe:oe+fe.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-R},[e]),A=s.useCallback(()=>{he.current&&(clearTimeout(he.current),he.current=null)},[]),ee=s.useCallback(we=>{we===Q.current&&(J(null),be(!1))},[]),Te=s.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),te(!1),Je.current=setTimeout(()=>{p()},300))},[o,u,p]),He=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Be,backdropStyle:Ve,mediaAreaStyle:rt,overlayContentStyle:Ze,swipeHandlers:_e,dismissAreaStyle:qe}=qd({enabled:ke,onClose:Te,animMs:300,isBlockedTarget:He}),Oe=s.useCallback(we=>{d&&Ed(we+1,c,!0)},[d,c]),nt=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),at=s.useCallback(we=>{if(xe.length===0)return;const Ye=(we%xe.length+xe.length)%xe.length;if(Ye===b)return;const R=xe[b],oe=xe[Ye];Q.current+=1;const fe=Q.current,Le=C==="fade"&&_l(R==null?void 0:R.entry)!==_l(oe==null?void 0:oe.entry),Ge=nt(tt.current),Qe=Le?(()=>{const Rt=Ue();zn.flushSync(()=>{Ee(oe.entry)}),tt.current&&Rt&&(tt.current.style.width=`${Rt}px`);const tn=nt(tt.current);return tt.current&&(tt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(Ge??0,(Qe==null?void 0:Qe.measuredIncomingTitlesHeight)??0)||void 0;Se(fe),J(b),be(!0),M(Ye),Oe(Ye),Fe.current=Ye,Le?(A(),bt&&me(bt),Qe!=null&&Qe.incomingTitlesMeasureWidth&&Y(Qe.incomingTitlesMeasureWidth),ae((R==null?void 0:R.entryIndex)??null),ye(!0),Ne.current=oe.entryIndex,he.current=setTimeout(()=>{ae(null),ye(!1),me(void 0),Y(void 0),Ee(null),he.current=null},400)):(A(),ae(null),ye(!1),me(void 0),Y(void 0),Ee(null),Ne.current=oe.entryIndex)},[b,A,Ue,nt,xe,Oe,C]),st=s.useCallback(()=>{je.current=null},[]),St=s.useCallback(we=>{!ve||xe.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(je.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[ve,xe.length]),Yt=s.useCallback(we=>{var Rt;if(!ve||xe.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(Be){st();return}const Ye=je.current;if(!Ye||Ye.pointerId!==we.pointerId||(st(),we.target.closest("[data-controls]")))return;const oe=we.clientX-Ye.startX,fe=we.clientY-Ye.startY,Le=Math.abs(oe),Ge=Math.abs(fe);if(Le>=Pf&&Le>Ge){at(oe>0?b-1:b+1);return}if(Le>Ml||Ge>Ml)return;const Qe=(Rt=De.current)==null?void 0:Rt.getBoundingClientRect(),bt=Qe?Qe.left+Qe.width/2:window.innerWidth/2;at(we.clientX<bt?b-1:b+1)},[b,ve,at,Be,st,xe.length]),Zt=s.useCallback(we=>{const Ye=je.current;(Ye==null?void 0:Ye.pointerId)===we.pointerId&&st()},[st]);Ud(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{te(!0),requestAnimationFrame(()=>{Ie.current?Ie.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(we),Je.current&&clearTimeout(Je.current),he.current&&clearTimeout(he.current);const Ye=We.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;C!=="fade"&&(Ne.current=((we=xe[b])==null?void 0:we.entryIndex)??0,A(),ae(null),ye(!1),me(void 0),Y(void 0))},[b,A,xe,C]),s.useEffect(()=>{const we=Ye=>{if(Ye.key==="Escape"){Te();return}if(Ye.key==="ArrowLeft"&&xe.length>1){at(b-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){at(b+1);return}if(Ye.key==="Tab"&&De.current){const R=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(R).filter(Qe=>!Qe.closest('[aria-hidden="true"]'));if(oe.length===0)return;const fe=oe[0],Le=oe[oe.length-1],Ge=document.activeElement;Ye.shiftKey?(Ge===fe||!De.current.contains(Ge))&&(Ye.preventDefault(),Le.focus()):(Ge===Le||!De.current.contains(Ge))&&(Ye.preventDefault(),fe.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[at,Te,b,xe.length]),s.useLayoutEffect(()=>{A(),Q.current=0,Se(0),J(null),be(!1),ae(null),ye(!1),me(void 0),Y(void 0),Ee(null),M(we=>{const Ye=Math.max(0,xe.length-1);return Math.min(we,Ye)})},[A,t.length,x,xe.length]),s.useLayoutEffect(()=>{var R;const we=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),we);Fe.current=Ye,Ne.current=((R=xe[Ye])==null?void 0:R.entryIndex)??0,M(Ye)},[l]);const vt=$e!==null?t[$e]:null,wt=Z!==null?xe[Z]:null,Bt=(V==null?void 0:V.title1)||(V==null?void 0:V.title2)||(V==null?void 0:V.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),At=Wf(x,xe,t),xt=T!==null,Ft=Bt||At||xt,Nt=At&&xt?{gap:K}:void 0,Ut=`${e}-titles-stack${ne?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${ne?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(W??0)>0||o,rn=q(I),gt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:S??Yi.title2Width,title3Width:G??Yi.title3Width}),[y,S,G]),Me=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:H}),[U,H]),Xe=s.useMemo(()=>V?Kn(e,V,F,pe,j):[],[e,V,F,pe,j]),lt=s.useMemo(()=>Xe.map(we=>gt[we.widthKey]),[Xe,gt]),ht=s.useMemo(()=>Qi(Xe.length,lt),[Xe.length,lt]),ft=s.useMemo(()=>Ho(Xe.length,lt),[Xe.length,lt]),Lt=s.useMemo(()=>Xe.filter(we=>we.prefix==="title1"),[Xe]),mt=s.useMemo(()=>Xe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[Xe]),zt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((we,Ye)=>{const R=Xe.findIndex(fe=>fe.prefix===we.prefix);if(!ne||Ye==="single-row")return{effectiveWidth:ft[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(Ye==="two-row-top"){const fe=Lt.findIndex(Le=>Le.prefix===we.prefix);return{effectiveWidth:zt.effective[fe]??0,resolvedWidth:zt.resolved[fe]??0,maxWidth:cn(fe,zt.resolved)}}const oe=mt.findIndex(fe=>fe.prefix===we.prefix);return{effectiveWidth:kt.effective[oe]??0,resolvedWidth:kt.resolved[oe]??0,maxWidth:cn(oe,kt.resolved)}},[Xe,mt,kt,ft,ht,Lt,zt,ne]),Vt=s.useCallback(we=>Fd(Xe,ht,Me,we)+(ne?0:W??0),[Xe,ht,Me,ne,W]),Gt=s.useCallback(()=>ne?0:W??0,[ne,W]),Ht=s.useCallback(we=>mt.slice(0,we).reduce((Ye,R,oe)=>Ye+(R.marginLeftKey?Me[R.marginLeftKey]??0:0)+(kt.resolved[oe]??0),0),[mt,kt.resolved,Me]),Dt=s.useCallback(we=>{const Ye=mt[we];return Ht(we)+(Ye.marginLeftKey?Me[Ye.marginLeftKey]??0:0)+(kt.resolved[we]??0)},[mt,kt.resolved,Ht,Me]),_t=s.useCallback((we,Ye,R)=>{if(!ne||R==="single-row"){const Qe=we.findIndex(Qt=>Qt.prefix===Ye.prefix),bt=we.map(Qt=>gt[Qt.widthKey]),Rt=Qi(we.length,bt);return{effectiveWidth:Ho(we.length,bt)[Qe]??0,resolvedWidth:Rt[Qe]??0,maxWidth:cn(Qe,Rt)}}if(R==="two-row-top"){const Qe=we.filter(Qt=>Qt.prefix==="title1"),bt=Qe.findIndex(Qt=>Qt.prefix===Ye.prefix),{resolved:Rt,effective:tn}=Zn(Qe,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const oe=we.filter(Qe=>Qe.prefix==="title2"||Qe.prefix==="title3"),fe=oe.findIndex(Qe=>Qe.prefix===Ye.prefix),{resolved:Le,effective:Ge}=Zn(oe,gt);return{effectiveWidth:Ge[fe]??0,resolvedWidth:Le[fe]??0,maxWidth:cn(fe,Le)}},[gt,ne]),Ct=(we,Ye,R)=>{const oe=we.marginLeftKey?Me[we.marginLeftKey]??0:0,{effectiveWidth:fe,resolvedWidth:Le,maxWidth:Ge}=R??Mt(we,Ye),Qe=Math.max(oe,Un),bt=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:q(fe),...oe>0?{marginLeft:q(oe)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),bt&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:q(-oe),width:q(Qe),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:q(-fn/2),width:q(fn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},N=(we="two-row")=>{const Ye=Xe.findIndex(fe=>fe.prefix==="title1"),R=Ye>=0?ht[Ye]:gt.title1Width,oe=we==="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:q(W??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Re=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:F,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:se,"aria-live":"polite","aria-atomic":"true",children:Nf(xe,b,x,t)}),ze=()=>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 * (${Ra(K)} + ${K}))`,width:Ra(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,ct=()=>!At&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[ze(),xt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?Re():null,Wt?N("single-row"):null,It(V),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ct(),$n()]}),it=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?Re():null,Wt?N("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&X?{minHeight:X}:void 0,children:[a.jsx("div",{ref:tt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(ce||V)}),a.jsxs("div",{ref:dt,className:Ut,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&re?{width:re,maxWidth:"100%"}:void 0},children:[vt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:di(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(V)})]})]}),ct(),$n()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:O.scalingValue(k??0,i),height:O.scalingValue(k??0,i),marginRight:le,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Ie,type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:_,hoverFill:i&&!r?_: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:le,height:"100%",pointerEvents:"auto"}})]}),Ot=(we,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Bt?Re():null,Wt?N("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ct()]}),It=we=>{if(!we)return null;const Ye=Kn(e,we,F,pe,j);return a.jsx(a.Fragment,{children:Ye.map(R=>Ct(R,"single-row",_t(Ye,R,"single-row")))})},nn=we=>{if(!we)return null;const Ye=Kn(e,we,F,pe,j),R=Ye.find(oe=>oe.prefix==="title1");return R?Ct(R,"two-row-top",_t(Ye,R,"two-row-top")):null},un=(we,Ye=!1)=>{const R=we?Kn(e,we,F,pe,j):[],oe=R.filter(Ge=>Ge.prefix==="title2"||Ge.prefix==="title3"),fe=o&&Ye;return oe.length>0||fe||(I??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(Ge=>Ct(Ge,"two-row-bottom",_t(R,Ge,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(I??0)>0||fe?a.jsx("div",{"data-controls":fe?"titleRowMarginBottom":void 0,"data-controls-axis":fe?"y":void 0,"data-controls-reverse":fe?"":void 0,className:fe?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:fe?"auto":"none"}}):null]}):null},ci=(we,Ye=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(we)),un(we,Ye)]}),di=we=>ne?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(we)}):null,nr=()=>{const we=ne?-1:Xe.findIndex(oe=>oe.prefix==="title1"),Ye=!ne&&(o||(W??0)>0)?(()=>{const oe=W??0,fe=we>=0?ht[we]:gt.title1Width,Le=Math.max(oe,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(fe),style:{position:"absolute",top:0,left:0,width:q(Le),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Xe.flatMap((oe,fe)=>{if(!oe.marginLeftKey)return[];const Le=Me[oe.marginLeftKey]??0,Ge=Ad(Xe,ht,Me,fe)+Gt(),Qe=Math.max(Le,Un);return a.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[fe]),style:{position:"absolute",top:0,left:q(Ge),width:q(Qe),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return Ye?[Ye,...R]:R},ir=()=>Xe.map((we,Ye)=>{const R=cn(Ye,ht),fe=Vt(Ye)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.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:q(fe),width:q(fn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),pa=()=>mt.flatMap((we,Ye)=>{if(!we.marginLeftKey)return[];const R=Me[we.marginLeftKey]??0,oe=Ht(Ye),fe=Math.max(R,Un),{resolvedWidth:Le}=Mt(we,"two-row-bottom");return a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:q(oe),width:q(fe),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),ma=()=>mt.map((we,Ye)=>{const{maxWidth:R}=Mt(we,"two-row-bottom"),fe=Dt(Ye)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.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:q(fe),width:q(fn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),$n=()=>!o||ne?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Pi=we=>{const Ye=!we.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:B,...Ye?{"--image-aspect-ratio":da(w)}:{}}}},or=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:Dn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=we=>{if(we.length===0)return null;const Ye=we.length>1,R=Ra(ie),oe=`calc(-0.5 * (${R} + ${ie}))`;if(we.length===1){const fe=we[0];return a.jsx("div",{...Pi(fe),children:a.jsx("img",{...or(fe),src:fe.url,alt:fe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ie}:void 0,children:we.map((fe,Le)=>a.jsxs("div",{...Pi(fe),children:[a.jsx("img",{...or(fe),src:fe.url,alt:fe.name??"",draggable:!1}),o&&Ye&&Le<we.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}})]},`${fe.url}-${Le}`))})},rr=!!(V!=null&&V.title2||V!=null&&V.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(I??0)>0||o),ga=()=>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:tt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(ce||V)}),a.jsxs("div",{ref:dt,className:`${e}-titles-row-two-row`,style:{...ge&&X?{minHeight:X}:void 0,...ge&&re?{width:re,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Ut,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(V)})]}),ge&&X?X:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ne?` ${e}-titles-layer-in-stacked`:""}`,children:un(V,!0)})]}):null]})]}),ha=()=>{const we=rr;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...we?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:we?void 0:{flex:"0 0 auto",height:"auto"},children:ci(V,!0)}),$n()]})};return a.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Be||Te()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Ce?1:0,transition:"opacity 300ms ease",pointerEvents:Ce?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...Ve}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,..._e,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:rt,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&xe.length>1?"true":"false",onPointerDown:ve?St:void 0,onPointerUp:ve?Yt:void 0,onPointerCancel:ve?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&de?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&ee(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(wt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${de?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:E?ui(E.images):null})},`slide-in-${Pe}-${b}`)]})})}),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:ue,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ne?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ne?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${ne?` ${e}-text-bar-cell-stacked`:""}`,style:ne?void 0:{flex:1,minWidth:0,width:"100%"},children:ne?C==="fade"?ga():ha():C==="fade"?it():Et()})})})]})]})]})};function xv(e){return`
|
|
15160
|
+
`,uv="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>'),fi={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 pv(e){const t={};return t[Vt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Vt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Vt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Vt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Vt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Vt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Vt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Vt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const mv=ro.reduce((e,t)=>({...e,...pv(t)}),{}),gv=ro.reduce((e,t)=>({...e,[Vt(t,"fontFamily")]:"Goudy Bookletter 1911",[Vt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Vt(t,"letterSpacing")]:0,[Vt(t,"wordSpacing")]:0,[Vt(t,"textAlign")]:"left",[Vt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Vt(n,"fontSize")]=i),o!==void 0&&(t[Vt(n,"lineHeight")]=o),t},{})}const hv=ov(),fv={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"}},...mv,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:uv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...gv},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,...Wa({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,...Wa({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,...Wa({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:[hv]}],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"}]}},yv={element:cv,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:fv,sourceCode:dv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ro.map(e=>({path:`${Vt(e,"fontFamily")}`}))]},fontRelations:{...ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Vt(t,"fontFamily")}`}),{})}},xv=({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:x,coverFit:w,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:v,textTransition:C,title1Width:y,title2Width:S,title3Width:X,title1MarginLeft:N=0,title2MarginLeft:U=0,title3MarginLeft:W=0,titleRowMarginBottom:I=0,titleHeaderLayout:B="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:k,closeIconColor:F,closeIconHoverColor:g,contentMarginTop:H=0,iconMarginRight:P=0}=n,q=s.useCallback(Se=>D.scalingValue(Se,i??!1),[i]),ne=q(h??0),L=`${f}%`,O=`${v}%`,Z=q($),ue=q(H),ae=q(P),A=wi("title1",bi(n,"title1"),i),pe=wi("title2",bi(n,"title2"),i),z=wi("title3",bi(n,"title3"),i),re=wi("count",bi(n,"count"),i),te=B==="mobile",be=!i||!!r,Ae=!o&&(!i||!!r),ve=s.useMemo(()=>Er(t,x),[t,x]),[b,M]=s.useState(l),E=ve[b],j=E==null?void 0:E.entry,[Ce,ee]=s.useState(!1),[Ie,oe]=s.useState(null),[me,xe]=s.useState(!1),[J,Q]=s.useState(null),[se,we]=s.useState(!1),[Ee,Te]=s.useState(0),[Y,de]=s.useState(),[ce,G]=s.useState(),[le,Me]=s.useState(null),fe=s.useRef(null),K=s.useRef(0),Xe=s.useRef(0),Le=s.useRef(0),Ze=s.useRef(!1),Qe=s.useRef(null),ct=s.useRef(null),nt=s.useRef(null),Ve=s.useRef(null),$e=s.useRef(null),He=s.useRef(null),Be=s.useRef(null),Ue=s.useCallback(()=>{const Se=ct.current;if(!Se)return;const Ye=Se.closest(`.${e}-lightbox-content-area`);if(!Ye)return Se.getBoundingClientRect().width;const R=Array.from(Ye.children).reduce((ie,ge)=>!(ge instanceof HTMLElement)||ge.contains(Se)?ie:ie+ge.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-R},[e]),he=s.useCallback(()=>{fe.current&&(clearTimeout(fe.current),fe.current=null)},[]),V=s.useCallback(Se=>{Se===K.current&&(Q(null),we(!1))},[]),ye=s.useCallback(()=>{o||Ze.current||(Ze.current=!0,u==null||u(),ee(!1),Qe.current=setTimeout(()=>{p()},300))},[o,u,p]),Ne=s.useCallback(Se=>!!(Se.closest("[data-controls]")||Se.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ze,backdropStyle:We,mediaAreaStyle:et,overlayContentStyle:Je,swipeHandlers:_e,dismissAreaStyle:qe}=qd({enabled:Ae,onClose:ye,animMs:300,isBlockedTarget:Ne}),De=s.useCallback(Se=>{d&&Ed(Se+1,c,!0)},[d,c]),it=s.useCallback(Se=>{if(Se)return Se.getBoundingClientRect().height},[]),at=s.useCallback(Se=>{if(ve.length===0)return;const Ye=(Se%ve.length+ve.length)%ve.length;if(Ye===b)return;const R=ve[b],ie=ve[Ye];K.current+=1;const ge=K.current,Pe=C==="fade"&&_l(R==null?void 0:R.entry)!==_l(ie==null?void 0:ie.entry),je=it(nt.current),tt=Pe?(()=>{const Rt=Ue();zn.flushSync(()=>{Me(ie.entry)}),nt.current&&Rt&&(nt.current.style.width=`${Rt}px`);const tn=it(nt.current);return nt.current&&(nt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(je??0,(tt==null?void 0:tt.measuredIncomingTitlesHeight)??0)||void 0;Te(ge),Q(b),we(!0),M(Ye),De(Ye),Le.current=Ye,Pe?(he(),bt&&de(bt),tt!=null&&tt.incomingTitlesMeasureWidth&&G(tt.incomingTitlesMeasureWidth),oe((R==null?void 0:R.entryIndex)??null),xe(!0),Xe.current=ie.entryIndex,fe.current=setTimeout(()=>{oe(null),xe(!1),de(void 0),G(void 0),Me(null),fe.current=null},400)):(he(),oe(null),xe(!1),de(void 0),G(void 0),Me(null),Xe.current=ie.entryIndex)},[b,he,Ue,it,ve,De,C]),dt=s.useCallback(()=>{Be.current=null},[]),St=s.useCallback(Se=>{!be||ve.length<=1||Se.pointerType==="mouse"&&Se.button!==0||Se.target.closest("[data-controls]")||(Be.current={startX:Se.clientX,startY:Se.clientY,pointerId:Se.pointerId})},[be,ve.length]),At=s.useCallback(Se=>{var Rt;if(!be||ve.length<=1||Se.pointerType==="mouse"&&Se.button!==0)return;if(ze){dt();return}const Ye=Be.current;if(!Ye||Ye.pointerId!==Se.pointerId||(dt(),Se.target.closest("[data-controls]")))return;const ie=Se.clientX-Ye.startX,ge=Se.clientY-Ye.startY,Pe=Math.abs(ie),je=Math.abs(ge);if(Pe>=Ef&&Pe>je){at(ie>0?b-1:b+1);return}if(Pe>Ml||je>Ml)return;const tt=(Rt=Ve.current)==null?void 0:Rt.getBoundingClientRect(),bt=tt?tt.left+tt.width/2:window.innerWidth/2;at(Se.clientX<bt?b-1:b+1)},[b,be,at,ze,dt,ve.length]),Zt=s.useCallback(Se=>{const Ye=Be.current;(Ye==null?void 0:Ye.pointerId)===Se.pointerId&&dt()},[dt]);Ud(),s.useEffect(()=>{He.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Se=requestAnimationFrame(()=>{ee(!0),requestAnimationFrame(()=>{$e.current?$e.current.focus():Ve.current&&Ve.current.focus()})});return()=>{cancelAnimationFrame(Se),Qe.current&&clearTimeout(Qe.current),fe.current&&clearTimeout(fe.current);const Ye=He.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Se;C!=="fade"&&(Xe.current=((Se=ve[b])==null?void 0:Se.entryIndex)??0,he(),oe(null),xe(!1),de(void 0),G(void 0))},[b,he,ve,C]),s.useEffect(()=>{const Se=Ye=>{if(Ye.key==="Escape"){ye();return}if(Ye.key==="ArrowLeft"&&ve.length>1){at(b-1);return}if(Ye.key==="ArrowRight"&&ve.length>1){at(b+1);return}if(Ye.key==="Tab"&&Ve.current){const R=Ve.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ie=Array.from(R).filter(tt=>!tt.closest('[aria-hidden="true"]'));if(ie.length===0)return;const ge=ie[0],Pe=ie[ie.length-1],je=document.activeElement;Ye.shiftKey?(je===ge||!Ve.current.contains(je))&&(Ye.preventDefault(),Pe.focus()):(je===Pe||!Ve.current.contains(je))&&(Ye.preventDefault(),ge.focus())}};return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[at,ye,b,ve.length]),s.useLayoutEffect(()=>{he(),K.current=0,Te(0),Q(null),we(!1),oe(null),xe(!1),de(void 0),G(void 0),Me(null),M(Se=>{const Ye=Math.max(0,ve.length-1);return Math.min(Se,Ye)})},[he,t.length,x,ve.length]),s.useLayoutEffect(()=>{var R;const Se=Math.max(0,ve.length-1),Ye=Math.min(Math.max(0,l),Se);Le.current=Ye,Xe.current=((R=ve[Ye])==null?void 0:R.entryIndex)??0,M(Ye)},[l]);const vt=Ie!==null?t[Ie]:null,wt=J!==null?ve[J]:null,zt=(j==null?void 0:j.title1)||(j==null?void 0:j.title2)||(j==null?void 0:j.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Ft=Hf(x,ve,t),xt=T!==null,_t=zt||Ft||xt,Wt=Ft&&xt?{gap:Z}:void 0,Ut=`${e}-titles-stack${te?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${te?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Ht=(N??0)>0||o,rn=q(I),gt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:S??Yi.title2Width,title3Width:X??Yi.title3Width}),[y,S,X]),ke=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:W}),[U,W]),Ge=s.useMemo(()=>j?Kn(e,j,A,pe,z):[],[e,j,A,pe,z]),st=s.useMemo(()=>Ge.map(Se=>gt[Se.widthKey]),[Ge,gt]),ht=s.useMemo(()=>Qi(Ge.length,st),[Ge.length,st]),ft=s.useMemo(()=>Ho(Ge.length,st),[Ge.length,st]),Lt=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title1"),[Ge]),mt=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),[Ge]),jt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((Se,Ye)=>{const R=Ge.findIndex(ge=>ge.prefix===Se.prefix);if(!te||Ye==="single-row")return{effectiveWidth:ft[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(Ye==="two-row-top"){const ge=Lt.findIndex(Pe=>Pe.prefix===Se.prefix);return{effectiveWidth:jt.effective[ge]??0,resolvedWidth:jt.resolved[ge]??0,maxWidth:cn(ge,jt.resolved)}}const ie=mt.findIndex(ge=>ge.prefix===Se.prefix);return{effectiveWidth:kt.effective[ie]??0,resolvedWidth:kt.resolved[ie]??0,maxWidth:cn(ie,kt.resolved)}},[Ge,mt,kt,ft,ht,Lt,jt,te]),Gt=s.useCallback(Se=>Fd(Ge,ht,ke,Se)+(te?0:N??0),[Ge,ht,ke,te,N]),Xt=s.useCallback(()=>te?0:N??0,[te,N]),Dt=s.useCallback(Se=>mt.slice(0,Se).reduce((Ye,R,ie)=>Ye+(R.marginLeftKey?ke[R.marginLeftKey]??0:0)+(kt.resolved[ie]??0),0),[mt,kt.resolved,ke]),Ot=s.useCallback(Se=>{const Ye=mt[Se];return Dt(Se)+(Ye.marginLeftKey?ke[Ye.marginLeftKey]??0:0)+(kt.resolved[Se]??0)},[mt,kt.resolved,Dt,ke]),Nt=s.useCallback((Se,Ye,R)=>{if(!te||R==="single-row"){const tt=Se.findIndex(Qt=>Qt.prefix===Ye.prefix),bt=Se.map(Qt=>gt[Qt.widthKey]),Rt=Qi(Se.length,bt);return{effectiveWidth:Ho(Se.length,bt)[tt]??0,resolvedWidth:Rt[tt]??0,maxWidth:cn(tt,Rt)}}if(R==="two-row-top"){const tt=Se.filter(Qt=>Qt.prefix==="title1"),bt=tt.findIndex(Qt=>Qt.prefix===Ye.prefix),{resolved:Rt,effective:tn}=Zn(tt,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const ie=Se.filter(tt=>tt.prefix==="title2"||tt.prefix==="title3"),ge=ie.findIndex(tt=>tt.prefix===Ye.prefix),{resolved:Pe,effective:je}=Zn(ie,gt);return{effectiveWidth:je[ge]??0,resolvedWidth:Pe[ge]??0,maxWidth:cn(ge,Pe)}},[gt,te]),Ct=(Se,Ye,R)=>{const ie=Se.marginLeftKey?ke[Se.marginLeftKey]??0:0,{effectiveWidth:ge,resolvedWidth:Pe,maxWidth:je}=R??Mt(Se,Ye),tt=Math.max(ie,Un),bt=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Se.prefix,style:{width:q(ge),...ie>0?{marginLeft:q(ie)}:{}},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(Pe),style:{position:"absolute",top:0,left:q(-ie),width:q(tt),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:q(-fn/2),width:q(fn),height:"100%",pointerEvents:"auto"}}):null]},Se.className)},_=(Se="two-row")=>{const Ye=Ge.findIndex(ge=>ge.prefix==="title1"),R=Ye>=0?ht[Ye]:gt.title1Width,ie=Se==="two-row"&&o;return a.jsx("div",{...ie?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:q(N??0),flexShrink:0,alignSelf:"stretch",...ie?{pointerEvents:"auto"}:{}}})},Re=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Fe=()=>a.jsx("span",{className:`${e}-entry-counter`,style:re,"aria-live":"polite","aria-atomic":"true",children:Wf(ve,b,x,t)}),Oe=()=>Ft?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 * (${Ra(Z)} + ${Z}))`,width:Ra(Z),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Fe():null,lt=()=>!Ft&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Wt,children:[Oe(),xt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||zt?Re():null,Ht?_("single-row"):null,It(j),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),lt(),$n()]}),ot=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||zt?Re():null,Ht?_("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:me&&Y?{minHeight:Y}:void 0,children:[a.jsx("div",{ref:nt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(le||j)}),a.jsxs("div",{ref:ct,className:Ut,style:{position:me?"absolute":"relative",inset:me?0:void 0,width:"100%",...me&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[vt&&me?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:di(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(j)})]})]}),lt(),$n()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(k??0,i),height:D.scalingValue(k??0,i),marginRight:ae,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:$e,type:"button",className:`${e}-close-icon-inner`,onClick:ye,"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:F,hoverFill:i&&!r?F: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:ae,height:"100%",pointerEvents:"auto"}})]}),Bt=(Se,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||zt?Re():null,Ht?_("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:Se}):a.jsxs(a.Fragment,{children:[Se,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),lt()]}),It=Se=>{if(!Se)return null;const Ye=Kn(e,Se,A,pe,z);return a.jsx(a.Fragment,{children:Ye.map(R=>Ct(R,"single-row",Nt(Ye,R,"single-row")))})},nn=Se=>{if(!Se)return null;const Ye=Kn(e,Se,A,pe,z),R=Ye.find(ie=>ie.prefix==="title1");return R?Ct(R,"two-row-top",Nt(Ye,R,"two-row-top")):null},un=(Se,Ye=!1)=>{const R=Se?Kn(e,Se,A,pe,z):[],ie=R.filter(je=>je.prefix==="title2"||je.prefix==="title3"),ge=o&&Ye;return ie.length>0||ge||(I??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ie.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ie.map(je=>Ct(je,"two-row-bottom",Nt(R,je,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(I??0)>0||ge?a.jsx("div",{"data-controls":ge?"titleRowMarginBottom":void 0,"data-controls-axis":ge?"y":void 0,"data-controls-reverse":ge?"":void 0,className:ge?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ge?"auto":"none"}}):null]}):null},ci=(Se,Ye=!1)=>a.jsxs(a.Fragment,{children:[Bt(nn(Se)),un(Se,Ye)]}),di=Se=>te?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(Se)}):Se?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(Se)}):null,nr=()=>{const Se=te?-1:Ge.findIndex(ie=>ie.prefix==="title1"),Ye=!te&&(o||(N??0)>0)?(()=>{const ie=N??0,ge=Se>=0?ht[Se]:gt.title1Width,Pe=Math.max(ie,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ge),style:{position:"absolute",top:0,left:0,width:q(Pe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Ge.flatMap((ie,ge)=>{if(!ie.marginLeftKey)return[];const Pe=ke[ie.marginLeftKey]??0,je=Ad(Ge,ht,ke,ge)+Xt(),tt=Math.max(Pe,Un);return a.jsx("div",{"data-controls":ie.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[ge]),style:{position:"absolute",top:0,left:q(je),width:q(tt),height:"100%",pointerEvents:"auto"}},ie.marginLeftKey)});return Ye?[Ye,...R]:R},ir=()=>Ge.map((Se,Ye)=>{const R=cn(Ye,ht),ge=Gt(Ye)-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:q(ge),width:q(fn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),pa=()=>mt.flatMap((Se,Ye)=>{if(!Se.marginLeftKey)return[];const R=ke[Se.marginLeftKey]??0,ie=Dt(Ye),ge=Math.max(R,Un),{resolvedWidth:Pe}=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(Pe),style:{position:"absolute",top:0,left:q(ie),width:q(ge),height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)}),ma=()=>mt.map((Se,Ye)=>{const{maxWidth:R}=Mt(Se,"two-row-bottom"),ge=Ot(Ye)-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:q(ge),width:q(fn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),$n=()=>!o||te?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Pi=Se=>{const Ye=!Se.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:O,...Ye?{"--image-aspect-ratio":da(w)}:{}}}},or=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`},ui=Se=>{if(Se.length===0)return null;const Ye=Se.length>1,R=Ra(ne),ie=`calc(-0.5 * (${R} + ${ne}))`;if(Se.length===1){const ge=Se[0];return a.jsx("div",{...Pi(ge),children:a.jsx("img",{...or(ge),src:ge.url,alt:ge.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ne}:void 0,children:Se.map((ge,Pe)=>a.jsxs("div",{...Pi(ge),children:[a.jsx("img",{...or(ge),src:ge.url,alt:ge.name??"",draggable:!1}),o&&Ye&&Pe<Se.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ie,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ge.url}-${Pe}`))})},rr=!!(j!=null&&j.title2||j!=null&&j.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(I??0)>0||o),ga=()=>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:nt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(le||j)}),a.jsxs("div",{ref:ct,className:`${e}-titles-row-two-row`,style:{...me&&Y?{minHeight:Y}:void 0,...me&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[Bt(a.jsxs("div",{className:Ut,style:{position:me?"absolute":"relative",inset:me?0:void 0,width:"100%"},children:[vt&&me?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(j)})]}),me&&Y?Y:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&me?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${te?` ${e}-titles-layer-in-stacked`:""}`,children:un(j,!0)})]}):null]})]}),ha=()=>{const Se=rr;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:ci(j,!0)}),$n()]})};return a.jsxs("div",{ref:Ve,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ze||ye()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Ce?1:0,transition:"opacity 300ms ease",pointerEvents:Ce?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...We}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,..._e,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:et,onClick:Se=>Se.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":be&&ve.length>1?"true":"false",onPointerDown:be?St:void 0,onPointerUp:be?At:void 0,onPointerCancel:be?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&se?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Se=>{Se.target===Se.currentTarget&&V(Ee)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(wt.images)})},`slide-out-${Ee}`):null,a.jsx("div",{className:`${e}-slide-layer-in${se?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:E?ui(E.images):null})},`slide-in-${Ee}-${b}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Je,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ue,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...te?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${te?` ${e}-lightbox-content-area-stacked`:""}`,children:_t&&a.jsx("div",{className:`${e}-text-bar-cell${te?` ${e}-text-bar-cell-stacked`:""}`,style:te?void 0:{flex:1,minWidth:0,width:"100%"},children:te?C==="fade"?ga():ha():C==="fade"?ot():Et()})})})]})]})]})};function vv(e){return`
|
|
15161
15161
|
.${e}-wrapper {
|
|
15162
15162
|
position: relative;
|
|
15163
15163
|
width: 100%;
|
|
@@ -15679,7 +15679,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15679
15679
|
pointer-events: auto;
|
|
15680
15680
|
z-index: 10;
|
|
15681
15681
|
}
|
|
15682
|
-
`}const
|
|
15682
|
+
`}const bv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=D.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,w=s.useRef(null),[m,h]=s.useState(!1),[f,v]=s.useState(0),C=s.useRef(!1),y=s.useRef(!1),S=s.useRef(!1),X=s.useMemo(()=>(t??[]).filter($=>Ji($).length>0),[t]),N=m&&X.length>0,U=!n,W=s.useCallback(()=>{U&&(S.current=!0,kf(y.current,c),y.current=!1)},[U,c]),I=($=0)=>{if(X.length===0||n&&!i&&!o)return;const T=Er(X,x),k=Math.max(0,Math.min($,T.length-1));if(v(k),U){const F=Md();Ed(k+1,c,F),y.current=!F}h(!0)},B=s.useCallback(()=>{h(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!U||C.current)return;C.current=!0;const $=Al(c);if(!$)return;const T=Fl($,Er(X,x).length);T<0||(v(T),h(!0))},[X,c,U,x]),s.useEffect(()=>{if(!U)return;const $=()=>{if(S.current){S.current=!1,h(!1);return}const T=Al(c);if(!T){h(!1);return}const k=Fl(T,Er(X,x).length);if(k<0){h(!1);return}y.current=!1,v(k),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[X,c,U,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vv(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Dn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>I(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Dn(p)?{"--image-aspect-ratio":da(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(xv,{prefix:d,entries:X,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:U,journalItemId:c,onBeforeClose:W,onClose:B}),$)})()]})},wv=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15683
15683
|
import { createPortal } from 'react-dom';
|
|
15684
15684
|
import { CommonComponentProps } from '../props';
|
|
15685
15685
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16435,7 +16435,7 @@ export type LightboxJournalSettings = {
|
|
|
16435
16435
|
closeIconColor: string;
|
|
16436
16436
|
closeIconHoverColor: string;
|
|
16437
16437
|
};
|
|
16438
|
-
`,wv="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>'),yi={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 Sv(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Cv=oi.reduce((e,t)=>({...e,...Sv(t)}),{}),$v=oi.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Goudy Bookletter 1911",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ha(e){return oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const Tv=Hf(),Iv={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"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},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"]}},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"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...Cv,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",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:wv,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...$v,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...Ha({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...Ha({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Ha({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Tv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{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"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{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"},{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"}]}]}},Rv={element:vv,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Iv,sourceCode:bv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...oi.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{...oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})}},Lv={sizeType:"custom",value:700,min:400,max:700};function jr(e,t){return{widthPx:e,heightPx:e*t}}function cs(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function sc(e,t,n,i){const{heightPx:o}=jr(n,i);return cs(e/2,t/2,e,t,n,o)}function Zd(e,t,n){for(const i of n){const{heightPx:o}=jr(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Pv(e,t,n,i,o,r,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Zd(e,t,n)||r==="area"?l??"none":d??"none"}function lc(e,t,n){var d;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function Ev(e){return`
|
|
16438
|
+
`,Sv="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>'),yi={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 Cv(e){const t={};return t[rt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[rt(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[rt(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[rt(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[rt(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[rt(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[rt(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[rt(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const $v=oi.reduce((e,t)=>({...e,...Cv(t)}),{}),Tv=oi.reduce((e,t)=>({...e,[rt(t,"fontFamily")]:"Goudy Bookletter 1911",[rt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[rt(t,"letterSpacing")]:0,[rt(t,"wordSpacing")]:0,[rt(t,"textAlign")]:"left",[rt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ha(e){return oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[rt(n,"fontSize")]=i),o!==void 0&&(t[rt(n,"lineHeight")]=o),t},{})}const Iv=Df(),Rv={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"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},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"]}},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"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...$v,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",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:Sv,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Tv,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...Ha({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...Ha({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Ha({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Iv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{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"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{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"},{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"}]}]}},Lv={element:bv,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Rv,sourceCode:wv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...oi.map(e=>({path:`${rt(e,"fontFamily")}`}))]},fontRelations:{...oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${rt(t,"fontFamily")}`}),{})}},Pv={sizeType:"custom",value:700,min:400,max:700};function jr(e,t){return{widthPx:e,heightPx:e*t}}function cs(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function sc(e,t,n,i){const{heightPx:o}=jr(n,i);return cs(e/2,t/2,e,t,n,o)}function Zd(e,t,n){for(const i of n){const{heightPx:o}=jr(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Ev(e,t,n,i,o,r,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Zd(e,t,n)||r==="area"?l??"none":d??"none"}function lc(e,t,n){var d;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function Mv(e){return`
|
|
16439
16439
|
.${e}-root {
|
|
16440
16440
|
position: absolute;
|
|
16441
16441
|
top: 0;
|
|
@@ -16470,7 +16470,7 @@ export type LightboxJournalSettings = {
|
|
|
16470
16470
|
width: 32px;
|
|
16471
16471
|
height: 32px;
|
|
16472
16472
|
}
|
|
16473
|
-
`}function
|
|
16473
|
+
`}function kv(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 Av(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await kv(i)]));return new Map(n)}function Fv({settings:e,content:t=[],isEditor:n}){const{prefix:i}=D.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[x,w]=s.useState({x:0,y:0}),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[v,C]=s.useState(!1),[y,S]=s.useState(!1),X=s.useRef(new Map),{imageSize:N=Pv,cursor:U="system",target:W="area",position:I="random",visible:B="all",defaultCursor:$=null,hoverCursor:T=null}=e,k=t.filter(L=>{var O;return!!((O=L==null?void 0:L.image)!=null&&O.url)}),F=s.useMemo(()=>Mv(i),[i]),g=s.useCallback((L,O,Z=l)=>{if(!o)return;const ue=o.getBoundingClientRect(),ae=L-ue.left,A=O-ue.top;w({x:ae,y:A}),h(Ev(ae,A,Z,o,U,W,T,$))},[o,l,U,W,T,$]);s.useEffect(()=>{const L=[...k.map(Z=>Z.image.url),$,T].filter(Z=>!!Z);if(L.length===0){X.current=new Map,S(!0);return}let O=!1;return S(!1),Av(L).then(Z=>{O||(X.current=Z,S(!0))}),()=>{O=!0}},[t,$,T]),s.useEffect(()=>{if(!o)return;const L=Z=>{Z.stopPropagation(),f.current={x:Z.clientX,y:Z.clientY},g(Z.clientX,Z.clientY)},O=()=>{v&&g(f.current.x,f.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",O,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",O,!0)}},[o,v,g]),s.useEffect(()=>{!o||!v||g(f.current.x,f.current.y)},[l,o,v,g]),s.useEffect(()=>{v||h("none")},[v]);const H=(L,O,Z,ue={})=>{var te,be;if(!((te=L==null?void 0:L.image)!=null&&te.url))return null;const ae=((be=X.current.get(L.image.url))==null?void 0:be.aspectRatio)??1,A=lc(L.image.url,N,X.current),{heightPx:pe}=jr(A,ae);let z=0,re=0;return I==="same"?{x:z,y:re}=sc(O,Z,A,ae):(z=ue.x??Math.random()*O,re=ue.y??Math.random()*Z,{x:z,y:re}=cs(z,re,O,Z,A,pe)),{id:p.current++,url:L.image.url,link:L.link,name:L.image.name,x:z,y:re,xRatio:z/O,yRatio:re/Z,aspectRatio:ae,widthPx:A}},P=()=>{if(!o)return;const L=o.getBoundingClientRect(),O=L.width,Z=L.height;O===0||Z===0||d(ue=>ue.length===0?ue:ue.map(ae=>{const A=N.sizeType==="random"?ae.widthPx:lc(ae.url,N,X.current),{heightPx:pe}=jr(A,ae.aspectRatio);if(I==="same"){const{x:te,y:be}=sc(O,Z,A,ae.aspectRatio);return{...ae,x:te,y:be,widthPx:A}}const{x:z,y:re}=cs(ae.xRatio*O,ae.yRatio*Z,O,Z,A,pe);return{...ae,x:z,y:re,widthPx:A}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const L=o.getBoundingClientRect(),O=L.width,Z=L.height,ue=H(k[0],O,Z);ue&&(d([ue]),u(k.length>1?1:0))},[N,I,o,t,y]),s.useEffect(()=>{if(!o)return;P();const L=new ResizeObserver(P);return L.observe(o),window.addEventListener("resize",P),()=>{L.disconnect(),window.removeEventListener("resize",P)}},[o,I,N,l.length]),s.useEffect(()=>{B==="last One"&&d(L=>L.length>0?[L[L.length-1]]:[])},[B]);const q=L=>{if(!o||k.length===0||!y)return;const O=o.getBoundingClientRect(),Z=L.clientX-O.left,ue=L.clientY-O.top;if(W==="image"&&!Zd(Z,ue,l))return;let ae=0,A=0;I==="on Click"?(ae=Z,A=ue):I==="same"?(ae=O.width/2,A=O.height/2):(ae=Math.random()*O.width,A=Math.random()*O.height);const pe=k[c%k.length],z=H(pe,O.width,O.height,{x:ae,y:A});if(!z)return;const re=B==="all"?[...l,z]:[z];d(re),u(te=>(te+1)%k.length),g(L.clientX,L.clientY,re)},ne=U==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),a.jsxs("div",{ref:r,onClick:q,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:ne?"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:ne?"none":"default"},children:W==="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)),v&&ne&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const _v=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16474
16474
|
import { CommonComponentProps } from '../props';
|
|
16475
16475
|
import { useScopedStyles } from '../utils/index';
|
|
16476
16476
|
|
|
@@ -17000,7 +17000,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17000
17000
|
</>
|
|
17001
17001
|
);
|
|
17002
17002
|
}
|
|
17003
|
-
`,
|
|
17003
|
+
`,Nv={type:"object",version:1,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"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},Wv={element:Fv,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:Nv,sourceCode:_v,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},Hv=100,Dv=70,Xn="cubic-bezier(0.86, 0, 0.07, 1)";function Ov(e){return`
|
|
17004
17004
|
.${e}-wrapper {
|
|
17005
17005
|
position: relative;
|
|
17006
17006
|
width: 100%;
|
|
@@ -17110,7 +17110,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17110
17110
|
display: block;
|
|
17111
17111
|
pointer-events: none;
|
|
17112
17112
|
}
|
|
17113
|
-
`}function
|
|
17113
|
+
`}function Bv(e){return e==="blur"?Dv:e==="greyscale"?Hv:0}function xo(e,t=1,n=1){const i=Bv(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 cc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function zv(e,t){return t<=1?0:(e-1+t)%t}function jv(e,t=1){return!e||e.height===0?t:e.width/e.height}function Vv(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 dc(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 Jd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function uc(e,t,n){return{...Jd(e),[`--${n}-stage-scale`]:t}}function Gv(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 Xv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var xe,J,Q,se,we,Ee,Te;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>Ov(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],w=cc(x.length),[m,h]=s.useState(w.activeIndex),[f,v]=s.useState(w.backgroundIndex),[C,y]=s.useState(!1),[S,X]=s.useState(!1),[N,U]=s.useState(null),[W,I]=s.useState(null),[B,$]=s.useState(0),[T,k]=s.useState(1),[F,g]=s.useState("none"),[H,P]=s.useState("next"),[q,ne]=s.useState({}),[L,O]=s.useState({width:0,height:0}),Z=s.useRef(null),ue=s.useRef(null),ae=!n||!!i,A=l??60,pe=Math.max(10,Math.min(100,d??A)),z=Math.max(10,Math.min(100,c??A)),re=Math.max(100,u),te=xo(p),be=s.useCallback(Y=>{const de=jv(Y?q[Y]:void 0);return Vv(L.width,L.height,de,pe,z)},[L.height,L.width,q,z,pe]);s.useEffect(()=>{const Y=ue.current;if(!Y)return;const de=new ResizeObserver(([ce])=>{const{width:G,height:le}=ce.contentRect;O({width:G,height:le})});return de.observe(Y),()=>de.disconnect()},[]),s.useEffect(()=>{const Y=(t??[]).map(de=>{var ce;return(ce=de.image)==null?void 0:ce.url}).filter(de=>!!de);Gv(Y,(de,ce)=>{ne(G=>{var le,Me;return((le=G[de])==null?void 0:le.width)===ce.width&&((Me=G[de])==null?void 0:Me.height)===ce.height?G:{...G,[de]:ce}})})},[t]),s.useEffect(()=>{const{backgroundIndex:Y,activeIndex:de}=cc(x.length);h(de),v(Y),y(!1),X(!1),U(null),I(null),$(0),k(1),g("none"),P("next")},[x.length,t]),s.useEffect(()=>()=>{Z.current&&clearTimeout(Z.current)},[]);const Ae=s.useCallback(Y=>{var fe,K,Xe,Le;if(!ae||C||x.length<=1)return;const de=Y==="next"?(m+1)%x.length:(m-1+x.length)%x.length,ce=be((K=(fe=x[m])==null?void 0:fe.image)==null?void 0:K.url),G=be((Le=(Xe=x[de])==null?void 0:Xe.image)==null?void 0:Le.url),le=dc(L.width,L.height,ce),Me=dc(L.width,L.height,G);Z.current&&clearTimeout(Z.current),P(Y),X(!0),y(!0),Y==="next"?(U(m),I(de),$(0),k(1),g(xo(p,0,1))):(v(zv(de,x.length)),U(de),I(m),$(1),k(Me),g(xo(p,1,Me))),requestAnimationFrame(()=>{X(!1),requestAnimationFrame(()=>{Y==="next"?($(1),k(le),g(xo(p,1,le))):($(0),k(1),g(xo(p,0,1)))})}),Z.current=setTimeout(()=>{Y==="next"&&v(m),h(de),U(null),I(null),y(!1)},re)},[m,p,L.height,L.width,be,C,ae,x,re]),ve=x[m],b=f!==null?x[f]:null,M=N!==null?x[N]:null,E=W!==null?x[W]:null,j=x.length<=1?0:(m-1+x.length)%x.length,Ce=x.length<=1?0:(m+1)%x.length,ee=be((xe=ve==null?void 0:ve.image)==null?void 0:xe.url),Ie=be((J=M==null?void 0:M.image)==null?void 0:J.url),oe=be((Q=E==null?void 0:E.image)==null?void 0:Q.url),me={[`--${o}-transition-ms`]:`${re}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ue,className:pt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:me,"aria-label":"Zoom gallery",children:[((se=b==null?void 0:b.image)==null?void 0:se.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:b.image.url,alt:"",style:{filter:te}})}),C&&((we=M==null?void 0:M.image)==null?void 0:we.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${H}`),style:uc(Ie,T,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:M.image.url,alt:"",style:{filter:F}})}),C&&((Ee=E==null?void 0:E.image)==null?void 0:Ee.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${H}`),style:uc(oe,B,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:E.image.url,alt:""})}),!C&&((Te=ve==null?void 0:ve.image)==null?void 0:Te.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:Jd(ee),children:a.jsx("img",{className:`${o}-image`,src:ve.image.url,alt:ve.image.name??""})}),ae&&x.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ae("prev"),"aria-label":`Show previous image (${j+1} of ${x.length})`}),a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ae("next"),"aria-label":`Show next image (${Ce+1} of ${x.length})`})]})]})]})}const Yv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17114
17114
|
import cn from 'classnames';
|
|
17115
17115
|
import { CommonComponentProps } from '../props';
|
|
17116
17116
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17629,7 +17629,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17629
17629
|
</>
|
|
17630
17630
|
);
|
|
17631
17631
|
}
|
|
17632
|
-
`,
|
|
17632
|
+
`,qv={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Uv={element:Xv,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:qv,sourceCode:Yv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Kv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},Zv=["hover","active"],Da={left:"flex-start",center:"center",right:"flex-end"};function Jv(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Qv(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function e0(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,r=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${r}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,x=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,w=`.${e}-button:hover, ${x}`,m=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
|
|
17633
17633
|
.${e}-root {
|
|
17634
17634
|
line-height: 0;
|
|
17635
17635
|
}
|
|
@@ -17869,7 +17869,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17869
17869
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17870
17870
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17871
17871
|
}
|
|
17872
|
-
`}function Oa(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 pc(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=
|
|
17872
|
+
`}function Oa(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 pc(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=D.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 t0({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>e0(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:w="text-icon",gap:m=0,iconSize:h=0,iconWidthC:f=0,dimensions:v=!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:X="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:W=0,backgroundColor:I="#000000",textColor:B="#ffffff",borderColor:$="#ffffff",iconColor:T="#ffffff",hoverEffect:k="none",fontFamily:F,fontSettings:g,fontSize:H,lineHeight:P,letterSpacing:q=0,wordSpacing:ne=0,textAppearance:L,stateOverrides:O,minWidth:Z=0,minHeight:ue=0,width:ae=0,height:A=0}=e,pe=D.buildColorVars(r,{backgroundColor:I,textColor:B,borderColor:$,iconColor:T,boxShadowColor:X,innerBoxShadowColor:U},Kv,Zv,O),z=i&&i!=="default"?`${r}-state-${i}`:"",re=t&&!n?`${r}-editing`:"",te=k!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${k}`:"",be=k==="reveal"||k==="swipe",Ae=k==="content-roll",ve=k==="reveal"&&(!t||n),b=v===!0,E=d==="a"?x??p:p,j=d==="c",Ce=d!=="b",ee={fontSettings:{fontFamily:F,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:H??.01,lineHeight:P,letterSpacing:q,wordSpacing:ne,textAppearance:L,color:B},oe={...Ce?an(qt(ee,t)):{},[`--${r}-box-shadow-x`]:D.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:D.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:D.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:D.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:D.scalingValue(N.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(N.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(N.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(N.bottom,t),paddingTop:D.scalingValue(C.top,t),paddingRight:D.scalingValue(C.right,t),paddingBottom:D.scalingValue(C.bottom,t),paddingLeft:D.scalingValue(C.left,t),borderRadius:D.scalingValue(y,t),borderWidth:D.scalingValue(W,t),...j?{}:{justifyContent:Da[E],textAlign:E},...j&&!Ae?{gap:D.scalingValue(m,t)}:{},...b?{width:D.scalingValue(ae,t),height:D.scalingValue(A,t)}:{minWidth:D.scalingValue(Z,t),minHeight:D.scalingValue(ue,t),...j?{width:"100%"}:{}}};let me;const xe={display:"inline-flex",alignItems:"center",justifyContent:j?Da[E]:Da[d==="a"?E:"center"],gap:j?D.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:E}:{}};if(d==="b"){const se=()=>pc(r,u,h>0?"fixed":"fill",100,h,t);me=Ae?Oa(r,se,`${r}-icon-roll`,void 0,xe):se()}else if(d==="c"){const se=()=>{const we=a.jsx("span",{className:`${r}-text`,style:{textAlign:E},children:c}),Ee=pc(r,u,f>0?"fixed":"fill",100,f,t);return w==="icon-text"?a.jsxs(a.Fragment,{children:[Ee,we]}):a.jsxs(a.Fragment,{children:[we,Ee]})};me=Ae?Oa(r,se,`${r}-icon-text-roll`,void 0,xe):se()}else me=Ae?Oa(r,()=>c,`${r}-label-roll`,void 0,xe):be?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const J=ve?se=>Jv(se,r):void 0,Q=ve?se=>Qv(se,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:pe,children:a.jsx("div",{className:`${r}-wrapper ${z} ${re}`.trim(),children:a.jsx("div",{className:`${r}-button ${te}`.trim(),style:oe,onMouseEnter:J,onMouseLeave:Q,role:"button",tabIndex:o||t&&!n?void 0:0,children:me})})})]})}const n0=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17873
17873
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17874
17874
|
import { CommonComponentProps } from '../props';
|
|
17875
17875
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18496,7 +18496,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18496
18496
|
</>
|
|
18497
18497
|
);
|
|
18498
18498
|
}
|
|
18499
|
-
`,n0={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},i0=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],o0={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...n0.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...i0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},r0={element:e0,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:o0,sourceCode:t0,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function a0(e){return`
|
|
18499
|
+
`,i0={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},o0=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],r0={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...i0.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...o0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},a0={element:t0,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:r0,sourceCode:n0,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function s0(e){return`
|
|
18500
18500
|
.${e}-titles-row {
|
|
18501
18501
|
position: relative;
|
|
18502
18502
|
flex: 0 1 auto;
|
|
@@ -18694,7 +18694,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18694
18694
|
pointer-events: auto;
|
|
18695
18695
|
flex-shrink: 0;
|
|
18696
18696
|
}
|
|
18697
|
-
`}const In=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",s0=72,l0=50,c0=1e4,d0=650,u0=500;function p0(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 Qd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Or(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 m0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Qd(i,n):null}function g0(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 To(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 mc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const h0=.03;function eu(e){return e.width*h0}const Ba={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function f0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ds(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 y0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function x0(e,t){if(ua(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 v0(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 b0({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=>ua(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 ao(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=eu(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 Vr(e,t,n){const i=ao(e,t,n);return{...i,left:2*i.left-e.left}}function w0(e,t,n){const{left:i,width:o}=n,r=eu(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 tu(e,t,n,i){const o=ao(e,"left",i),r=ao(e,"right",i),l=Vr(e,"left",i),d=Vr(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 S0(e,t,n,i){const{start:o,end:r}=tu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function C0(e,t,n){const i=ao(e,t,n),o=Vr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ua(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function $0({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 br({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ua(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 T0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[W,U]=s.useState(0),H=s.useRef(null),I=s.useRef(0),z=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),_=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),P=s.useRef(null),q=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),B=s.useRef(null),K=s.useRef(!1),[ue,le]=s.useState(null),[F,pe]=s.useState(Ba),[j,se]=s.useState(0),[ne,ve]=s.useState("opening"),[ke,xe]=s.useState(0),[b,M]=s.useState(0),[E,V]=s.useState(!1),[Ce,te]=s.useState(null),[$e,ae]=s.useState(null),[ge,ye]=s.useState(null),[Z,J]=s.useState(!1),[de,be]=s.useState(null),[Pe,Se]=s.useState(!1),X=s.useRef(!1),[me,re]=s.useState(!1),[Y,ce]=s.useState(!1),Ee=s.useRef(n),he=s.useRef(void 0),Q=t[n],Ne=Q?ua(Q):!1,Fe=b!==0||E,et=!l&&(!r||!!d),Je=c&&!l,dt=u.length>1,tt=s.useCallback((N,Re)=>t.length<=1?null:t[(N+Re+t.length)%t.length]??null,[t]),De=dt?To(u,p,-1):tt(n,-1),Ie=dt?To(u,p,1):tt(n,1),We=Ce===-1&&Fe?dt&&$e!==null?To(u,$e,-1):ge!==null?tt(ge,-1):null:null,je=Ce===1&&Fe?dt&&$e!==null?To(u,$e,1):ge!==null?tt(ge,1):null:null,Ue=We&&We.url!==(De==null?void 0:De.url)?We:null,A=je&&je.url!==(Ie==null?void 0:Ie.url)?je:null,ee=De&&Je?(()=>{const N=dt?mc(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return N&&N.url!==De.url?N:null})():null,Te=Ie&&Je?(()=>{const N=dt?mc(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return N&&N.url!==Ie.url?N:null})():null,He=Ue??ee,Be=A??Te,Ve=s.useCallback((N,Re,Ae)=>{if(!N||!Re||!Ae)return;const ze=G.current,ct=ze.get(N);(ct==null?void 0:ct.width)===Re&&(ct==null?void 0:ct.height)===Ae||(ze.set(N,{width:Re,height:Ae}),U(Et=>Et+1))},[]),rt=s.useCallback(N=>{if(!(N!=null&&N.url))return null;const Re=G.current.get(N.url);return y0(y.current,Re)},[W,j]),Ze=s.useCallback(()=>{if(!Q)return;const N=rt(Q);if(N){le(N);return}const Re=y.current;Re&&le(gc(Re))},[Q,rt]),_e=s.useCallback(N=>{if(dt){const Re=u.length;ae((p+N+Re)%Re),ye(null);return}t.length>1&&(ye((n+N+t.length)%t.length),ae(null))},[dt,u.length,p,t.length,n]),qe=s.useCallback(N=>{_.current=N,V(N)},[]),Oe=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{Oe(),qe(!1)},vo+32)},[Oe,qe]),at=s.useCallback(()=>{const N=C.current;if(!N){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ba.width,height:typeof window<"u"?window.innerHeight:Ba.height});return}const Re=N.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),st=s.useCallback((N,Re)=>{if(Fe){if(me&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Ae=rt(N);if(!Ae)return;const{x:ze,y:ct}=S0(Ae,Re,Ce,F);return`translate(${ze}px, ${ct}px)`}if(E)return"translate(0px, 0px)"}},[Fe,me,E,b,Ce,F,rt]),St=s.useCallback(()=>{const N=D.current;D.current=null,Oe(),qe(!1),te(null),ae(null),ye(null),M(0),re(!1),T.current=!1,z.current=0,$.current="none",N===-1?f():N===1&&v()},[Oe,qe,f,v]),Yt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{D.current!==null&&St()},vo+32)},[Oe,St]),Zt=s.useCallback(()=>{Oe(),D.current=null,qe(!1),te(null),ae(null),ye(null),M(0),re(!1),T.current=!1,z.current=0,$.current="none"},[Oe,qe]),vt=s.useCallback(N=>{if(!(!Je||!ue)){if(_.current){if(D.current===N){P.current=N,St();return}Zt()}Oe(),_e(N),D.current=N,te(N),qe(!0),Yt()}},[Je,ue,St,Zt,Oe,_e,qe,Yt]);q.current=vt;const wt=s.useCallback(()=>{ie.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),Bt=s.useCallback(N=>{L.current!==null&&window.clearInterval(L.current);const Re=K.current?u0:d0;L.current=window.setInterval(()=>{q.current(N)},Re)},[]),At=s.useCallback(N=>{ie.current!==N&&(wt(),ie.current=N,K.current=!1,q.current(N),Bt(N),B.current=window.setTimeout(()=>{B.current=null,ie.current===N&&(K.current=!0,Bt(N))},c0))},[wt,Bt]),xt=s.useCallback(()=>{const N=y.current;if(!N)return;const Re=Q==null?void 0:Q.url,Ae=Re?G.current.get(Re):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){le(ds(N,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Re&&(ze.src===Re||ze.currentSrc===Re)){const{width:Et,height:it}=f0(ze);if(Et&&it){Ve(Re,Et,it),le(ds(N,Et,it));return}}const ct=gc(N);!ct.width||!ct.height||le(ct)},[Q==null?void 0:Q.url,Ve]),Ft=s.useCallback(N=>{if(S.current=N,!!N){if(N instanceof HTMLVideoElement){N.readyState>=1&&N.videoWidth>0&&xt();return}N.complete&&N.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{at(),xt(),se(N=>N+1)},[at,xt]);s.useEffect(()=>{Nt();const N=y.current,Re=C.current,Ae=new ResizeObserver(()=>Nt());return N&&Ae.observe(N),Re&&Ae.observe(Re),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!Q)return;const N=S.current;if(N){if(N instanceof HTMLImageElement&&N.complete&&N.naturalWidth>0){xt();return}N instanceof HTMLVideoElement&&N.readyState>=1&&N.videoWidth>0&&xt()}},[Q==null?void 0:Q.url,n,xt]),s.useEffect(()=>{Ze()},[Ze,W]),s.useEffect(()=>{const N=new Set,Re=[],Ae=ze=>{!(ze!=null&&ze.url)||N.has(ze.url)||(N.add(ze.url),Re.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Re.forEach(ze=>{G.current.has(ze.url)||x0(ze,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(ne!=="opening"||!ue)return;if(!w){ve("open");return}J(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{J(!0),ve("open")})});return()=>cancelAnimationFrame(N)},[ne,ue,w]),s.useEffect(()=>{if(ne!=="closing")return;const N=setTimeout(()=>h(),In);return()=>clearTimeout(N)},[ne,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{Ee.current===n&&he.current===(Q==null?void 0:Q.url)||(Oe(),D.current=null,te(null),ae(null),ye(null),xe(0),M(0),qe(!1),ce(!1),re(!1),I.current=0,z.current=0,$.current="none",T.current=!1,H.current=null,k.current=!1,S.current=null,Ze(),Ee.current=n,he.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,qe,Oe,Ze]),s.useLayoutEffect(()=>{const N=P.current;N!==null&&(P.current=null,requestAnimationFrame(()=>{q.current(N)}))},[n,p,Q==null?void 0:Q.url]),s.useLayoutEffect(()=>{if(ne==="opening"){X.current=!1,Se(!1);return}if(ne!=="open"||X.current)return;if(!De&&!Ie){X.current=!0;return}Se(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Se(!0),X.current=!0})});return()=>cancelAnimationFrame(N)},[ne,De==null?void 0:De.url,Ie==null?void 0:Ie.url]),s.useEffect(()=>{if(ne!=="open")return;const N=()=>{const it=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Re=it=>{const yt=it<0?1:-1;Oe(),_e(yt),D.current=yt,te(yt),qe(!0),Yt()},Ae=it=>{if(Math.abs(it)>l0&&Je){Re(it);return}D.current=null,te(null),ae(null),ye(null),qe(!0),M(0),nt()},ze=it=>{if(it.touches.length!==1||_.current)return;const yt=it.touches[0];k.current=!0,H.current={x:yt.clientX,y:yt.clientY},$.current="none",z.current=0,T.current=!1},ct=it=>{if(!H.current||it.touches.length!==1||_.current)return;const yt=it.touches[0],Ot=yt.clientX-H.current.x,It=yt.clientY-H.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Je)return;$.current="horizontal"}else if(It>0){if(!et)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,re(!0),z.current=Ot,M(Ot),it.preventDefault();return}$.current==="vertical"&&(T.current=!0,re(!0),I.current=It,xe(It),it.preventDefault())},Et=()=>{if(!H.current)return;const it=$.current,yt=T.current;if(yt&&it==="horizontal")Ae(z.current),N();else if(yt&&it==="vertical"){const Ot=I.current;if(et&&Ot>s0){const It=window.innerHeight;I.current=It,ce(!0),xe(It),ve("closing")}else I.current=0,xe(0);N()}else it==="horizontal"&&Math.abs(z.current)>0&&(Ae(z.current),N());H.current=null,$.current="none",z.current=0,T.current=!1,re(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Je,qe,nt,Oe,et,Yt,_e]);const Ut=s.useCallback(()=>{const N=(m==null?void 0:m())??w??null;N&&ue&&(be(N),J(!0)),ve("closing")},[m,w,ue]);s.useEffect(()=>{const N=ze=>{if(ze.key==="Escape"){if(r&&d||ne==="closing")return;wt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||ne!=="open"||!Je)return;ze.preventDefault();const ct=ze.key==="ArrowLeft"?-1:1;ze.repeat&&ie.current===ct||At(ct)},Re=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const ct=ze.key==="ArrowLeft"?-1:1;ie.current===ct&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",N),window.addEventListener("keyup",Re),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Ae),wt()}},[ne,r,d,Ut,Je,At,wt]),s.useEffect(()=>{ne!=="open"&&wt()},[ne,wt]);const Jt=()=>{ne==="closing"||l||Ut()},Tt=ne==="open",Wt=ne==="closing",rn=ke>0?Math.max(0,1-ke/500):1,gt=ke>0?Math.max(.35,1-ke/500):1,Me=s.useCallback(N=>{if(!(N.propertyName!=="transform"||!_.current)){if(D.current!==null){St();return}Oe(),qe(!1)}},[Oe,qe,St]),Xe=ne==="closing"?de??w:w,lt=Xe&&ue&&(ne==="opening"||Wt)?p0(Xe,ue):void 0,ht=Fe&&Q?st(Q,"center"):ke>0?`translateY(${ke}px)`:lt,ft=ue?vr(ue,F):null,Lt=!!(Xe&&ue),mt=Lt&&(ne==="closing"||ne==="open"&&Z),zt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:ke>0?gt:Lt?1:ne==="opening"||Wt?0:1,transition:me&&!E?"none":E?`transform ${vo}ms ${mn}`:Y?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:ne==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Ne&&Tt&&!Fe?"auto":"none",touchAction:Ne&&Tt?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Fe?"auto":"none"},Mt=(N,Re,Ae="adjacent")=>{const ze=rt(N);if(!ze)return{display:"none"};const ct=Ae==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?tu(ze,ct,Ce,F):{start:Ae==="far"?Vr(ze,Re,F):ao(ze,Re,F)},it=vr(Et,F),yt=st(N,ct),Ot=!Fe&&Ae==="adjacent"&&Tt&&!Pe?C0(ze,Re,F):null,It=Ae==="far"&&Fe&&Ce===(Re==="left"?-1:1),nn=me&&!E?!1:E,un=Ae==="adjacent"&&Tt&&Pe&&!Fe;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:yt??(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 ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:ne==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(N,Re)=>{const Ae=rt(N);return Ae?w0(ao(Ae,Re,F),Re,F):null},Gt=N=>Re=>{if(!l){if(k.current){k.current=!1;return}Re.stopPropagation(),vt(N)}},Ht=De?Vt(De,"left"):null,Dt=Ie?Vt(Ie,"right"):null,_t=Ht?vr(Ht,F):null,Ct=Dt?vr(Dt,F):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:me?"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:me?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&He&&a.jsx(br,{media:He,style:Mt(He,"left","far"),onMeasure:Ve,onTransitionEnd:Me},`far-prev-${He.url}`),Tt&&De&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:De,style:Mt(De,"left"),onMeasure:Ve,onTransitionEnd:Me},`prev-${De.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Tt&&Ie&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ie,style:Mt(Ie,"right"),onMeasure:Ve,onTransitionEnd:Me},`next-${Ie.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Tt&&Be&&a.jsx(br,{media:Be,style:Mt(Be,"right","far"),onMeasure:Ve,onTransitionEnd:Me},`far-next-${Be.url}`),ue&&Q&&(Ne?a.jsx($0,{src:Q.url,phase:ne,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Me},`${n}-${Q.url}`):a.jsx("img",{ref:Ft,src:Q.url,alt:Q.name,onLoad:xt,onTransitionEnd:Me,style:zt},`${n}-${Q.url}`))]})}const I0=20,R0=.18;function L0(e){return`
|
|
18697
|
+
`}const In=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",l0=72,c0=50,d0=1e4,u0=650,p0=500;function m0(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 Qd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Or(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 g0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Qd(i,n):null}function h0(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 To(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 mc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const f0=.03;function eu(e){return e.width*f0}const Ba={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function y0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ds(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 x0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function v0(e,t){if(ua(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 b0(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 w0({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=>ua(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 ao(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=eu(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 Vr(e,t,n){const i=ao(e,t,n);return{...i,left:2*i.left-e.left}}function S0(e,t,n){const{left:i,width:o}=n,r=eu(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 tu(e,t,n,i){const o=ao(e,"left",i),r=ao(e,"right",i),l=Vr(e,"left",i),d=Vr(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 C0(e,t,n,i){const{start:o,end:r}=tu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function $0(e,t,n){const i=ao(e,t,n),o=Vr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ua(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function T0({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 br({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ua(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 I0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),X=s.useRef(new Map),[N,U]=s.useState(0),W=s.useRef(null),I=s.useRef(0),B=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),F=s.useRef(!1),g=s.useRef(null),H=s.useRef(null),P=s.useRef(null),q=s.useRef(()=>{}),ne=s.useRef(null),L=s.useRef(null),O=s.useRef(null),Z=s.useRef(!1),[ue,ae]=s.useState(null),[A,pe]=s.useState(Ba),[z,re]=s.useState(0),[te,be]=s.useState("opening"),[Ae,ve]=s.useState(0),[b,M]=s.useState(0),[E,j]=s.useState(!1),[Ce,ee]=s.useState(null),[Ie,oe]=s.useState(null),[me,xe]=s.useState(null),[J,Q]=s.useState(!1),[se,we]=s.useState(null),[Ee,Te]=s.useState(!1),Y=s.useRef(!1),[de,ce]=s.useState(!1),[G,le]=s.useState(!1),Me=s.useRef(n),fe=s.useRef(void 0),K=t[n],Xe=K?ua(K):!1,Le=b!==0||E,Ze=!l&&(!r||!!d),Qe=c&&!l,ct=u.length>1,nt=s.useCallback((_,Re)=>t.length<=1?null:t[(_+Re+t.length)%t.length]??null,[t]),Ve=ct?To(u,p,-1):nt(n,-1),$e=ct?To(u,p,1):nt(n,1),He=Ce===-1&&Le?ct&&Ie!==null?To(u,Ie,-1):me!==null?nt(me,-1):null:null,Be=Ce===1&&Le?ct&&Ie!==null?To(u,Ie,1):me!==null?nt(me,1):null:null,Ue=He&&He.url!==(Ve==null?void 0:Ve.url)?He:null,he=Be&&Be.url!==($e==null?void 0:$e.url)?Be:null,V=Ve&&Qe?(()=>{const _=ct?mc(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return _&&_.url!==Ve.url?_:null})():null,ye=$e&&Qe?(()=>{const _=ct?mc(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return _&&_.url!==$e.url?_:null})():null,Ne=Ue??V,ze=he??ye,We=s.useCallback((_,Re,Fe)=>{if(!_||!Re||!Fe)return;const Oe=X.current,lt=Oe.get(_);(lt==null?void 0:lt.width)===Re&&(lt==null?void 0:lt.height)===Fe||(Oe.set(_,{width:Re,height:Fe}),U(Et=>Et+1))},[]),et=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Re=X.current.get(_.url);return x0(y.current,Re)},[N,z]),Je=s.useCallback(()=>{if(!K)return;const _=et(K);if(_){ae(_);return}const Re=y.current;Re&&ae(gc(Re))},[K,et]),_e=s.useCallback(_=>{if(ct){const Re=u.length;oe((p+_+Re)%Re),xe(null);return}t.length>1&&(xe((n+_+t.length)%t.length),oe(null))},[ct,u.length,p,t.length,n]),qe=s.useCallback(_=>{F.current=_,j(_)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),it=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),qe(!1)},vo+32)},[De,qe]),at=s.useCallback(()=>{const _=C.current;if(!_){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ba.width,height:typeof window<"u"?window.innerHeight:Ba.height});return}const Re=_.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),dt=s.useCallback((_,Re)=>{if(Le){if(de&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Fe=et(_);if(!Fe)return;const{x:Oe,y:lt}=C0(Fe,Re,Ce,A);return`translate(${Oe}px, ${lt}px)`}if(E)return"translate(0px, 0px)"}},[Le,de,E,b,Ce,A,et]),St=s.useCallback(()=>{const _=H.current;H.current=null,De(),qe(!1),ee(null),oe(null),xe(null),M(0),ce(!1),T.current=!1,B.current=0,$.current="none",_===-1?f():_===1&&v()},[De,qe,f,v]),At=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{H.current!==null&&St()},vo+32)},[De,St]),Zt=s.useCallback(()=>{De(),H.current=null,qe(!1),ee(null),oe(null),xe(null),M(0),ce(!1),T.current=!1,B.current=0,$.current="none"},[De,qe]),vt=s.useCallback(_=>{if(!(!Qe||!ue)){if(F.current){if(H.current===_){P.current=_,St();return}Zt()}De(),_e(_),H.current=_,ee(_),qe(!0),At()}},[Qe,ue,St,Zt,De,_e,qe,At]);q.current=vt;const wt=s.useCallback(()=>{ne.current=null,Z.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),zt=s.useCallback(_=>{L.current!==null&&window.clearInterval(L.current);const Re=Z.current?p0:u0;L.current=window.setInterval(()=>{q.current(_)},Re)},[]),Ft=s.useCallback(_=>{ne.current!==_&&(wt(),ne.current=_,Z.current=!1,q.current(_),zt(_),O.current=window.setTimeout(()=>{O.current=null,ne.current===_&&(Z.current=!0,zt(_))},d0))},[wt,zt]),xt=s.useCallback(()=>{const _=y.current;if(!_)return;const Re=K==null?void 0:K.url,Fe=Re?X.current.get(Re):void 0;if(Fe!=null&&Fe.width&&(Fe!=null&&Fe.height)){ae(ds(_,Fe.width,Fe.height));return}const Oe=S.current;if(Oe&&Re&&(Oe.src===Re||Oe.currentSrc===Re)){const{width:Et,height:ot}=y0(Oe);if(Et&&ot){We(Re,Et,ot),ae(ds(_,Et,ot));return}}const lt=gc(_);!lt.width||!lt.height||ae(lt)},[K==null?void 0:K.url,We]),_t=s.useCallback(_=>{if(S.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&xt();return}_.complete&&_.naturalWidth>0&&xt()}},[xt]),Wt=s.useCallback(()=>{at(),xt(),re(_=>_+1)},[at,xt]);s.useEffect(()=>{Wt();const _=y.current,Re=C.current,Fe=new ResizeObserver(()=>Wt());return _&&Fe.observe(_),Re&&Fe.observe(Re),window.addEventListener("resize",Wt),()=>{Fe.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,x]),s.useLayoutEffect(()=>{if(!K)return;const _=S.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){xt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&xt()}},[K==null?void 0:K.url,n,xt]),s.useEffect(()=>{Je()},[Je,N]),s.useEffect(()=>{const _=new Set,Re=[],Fe=Oe=>{!(Oe!=null&&Oe.url)||_.has(Oe.url)||(_.add(Oe.url),Re.push(Oe))};t.forEach(Fe),u.forEach(Oe=>Oe.items.forEach(Fe)),Re.forEach(Oe=>{X.current.has(Oe.url)||v0(Oe,We)})},[t,u,We]),s.useEffect(()=>{if(te!=="opening"||!ue)return;if(!w){be("open");return}Q(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(!0),be("open")})});return()=>cancelAnimationFrame(_)},[te,ue,w]),s.useEffect(()=>{if(te!=="closing")return;const _=setTimeout(()=>h(),In);return()=>clearTimeout(_)},[te,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Me.current===n&&fe.current===(K==null?void 0:K.url)||(De(),H.current=null,ee(null),oe(null),xe(null),ve(0),M(0),qe(!1),le(!1),ce(!1),I.current=0,B.current=0,$.current="none",T.current=!1,W.current=null,k.current=!1,S.current=null,Je(),Me.current=n,fe.current=K==null?void 0:K.url)},[n,K==null?void 0:K.url,qe,De,Je]),s.useLayoutEffect(()=>{const _=P.current;_!==null&&(P.current=null,requestAnimationFrame(()=>{q.current(_)}))},[n,p,K==null?void 0:K.url]),s.useLayoutEffect(()=>{if(te==="opening"){Y.current=!1,Te(!1);return}if(te!=="open"||Y.current)return;if(!Ve&&!$e){Y.current=!0;return}Te(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Te(!0),Y.current=!0})});return()=>cancelAnimationFrame(_)},[te,Ve==null?void 0:Ve.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(te!=="open")return;const _=()=>{const ot=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",ot,!0)};document.addEventListener("click",ot,!0)},Re=ot=>{const yt=ot<0?1:-1;De(),_e(yt),H.current=yt,ee(yt),qe(!0),At()},Fe=ot=>{if(Math.abs(ot)>c0&&Qe){Re(ot);return}H.current=null,ee(null),oe(null),xe(null),qe(!0),M(0),it()},Oe=ot=>{if(ot.touches.length!==1||F.current)return;const yt=ot.touches[0];k.current=!0,W.current={x:yt.clientX,y:yt.clientY},$.current="none",B.current=0,T.current=!1},lt=ot=>{if(!W.current||ot.touches.length!==1||F.current)return;const yt=ot.touches[0],Bt=yt.clientX-W.current.x,It=yt.clientY-W.current.y;if($.current==="none"){if(Math.abs(Bt)<10&&Math.abs(It)<10)return;if(Math.abs(Bt)>Math.abs(It)){if(!Qe)return;$.current="horizontal"}else if(It>0){if(!Ze)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ce(!0),B.current=Bt,M(Bt),ot.preventDefault();return}$.current==="vertical"&&(T.current=!0,ce(!0),I.current=It,ve(It),ot.preventDefault())},Et=()=>{if(!W.current)return;const ot=$.current,yt=T.current;if(yt&&ot==="horizontal")Fe(B.current),_();else if(yt&&ot==="vertical"){const Bt=I.current;if(Ze&&Bt>l0){const It=window.innerHeight;I.current=It,le(!0),ve(It),be("closing")}else I.current=0,ve(0);_()}else ot==="horizontal"&&Math.abs(B.current)>0&&(Fe(B.current),_());W.current=null,$.current="none",B.current=0,T.current=!1,ce(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",lt,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[te,Qe,qe,it,De,Ze,At,_e]);const Ut=s.useCallback(()=>{const _=(m==null?void 0:m())??w??null;_&&ue&&(we(_),Q(!0)),be("closing")},[m,w,ue]);s.useEffect(()=>{const _=Oe=>{if(Oe.key==="Escape"){if(r&&d||te==="closing")return;wt(),Ut();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||te!=="open"||!Qe)return;Oe.preventDefault();const lt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&ne.current===lt||Ft(lt)},Re=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const lt=Oe.key==="ArrowLeft"?-1:1;ne.current===lt&&wt()},Fe=()=>{wt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Re),window.addEventListener("blur",Fe),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Fe),wt()}},[te,r,d,Ut,Qe,Ft,wt]),s.useEffect(()=>{te!=="open"&&wt()},[te,wt]);const Jt=()=>{te==="closing"||l||Ut()},Tt=te==="open",Ht=te==="closing",rn=Ae>0?Math.max(0,1-Ae/500):1,gt=Ae>0?Math.max(.35,1-Ae/500):1,ke=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!F.current)){if(H.current!==null){St();return}De(),qe(!1)}},[De,qe,St]),Ge=te==="closing"?se??w:w,st=Ge&&ue&&(te==="opening"||Ht)?m0(Ge,ue):void 0,ht=Le&&K?dt(K,"center"):Ae>0?`translateY(${Ae}px)`:st,ft=ue?vr(ue,A):null,Lt=!!(Ge&&ue),mt=Lt&&(te==="closing"||te==="open"&&J),jt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Ae>0?gt:Lt?1:te==="opening"||Ht?0:1,transition:de&&!E?"none":E?`transform ${vo}ms ${mn}`:G?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:te==="opening"||Ht?`opacity ${In}ms ${mn}`:"none",pointerEvents:Xe&&Tt&&!Le?"auto":"none",touchAction:Xe&&Tt?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Le?"auto":"none"},Mt=(_,Re,Fe="adjacent")=>{const Oe=et(_);if(!Oe)return{display:"none"};const lt=Fe==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?tu(Oe,lt,Ce,A):{start:Fe==="far"?Vr(Oe,Re,A):ao(Oe,Re,A)},ot=vr(Et,A),yt=dt(_,lt),Bt=!Le&&Fe==="adjacent"&&Tt&&!Ee?$0(Oe,Re,A):null,It=Fe==="far"&&Le&&Ce===(Re==="left"?-1:1),nn=de&&!E?!1:E,un=Fe==="adjacent"&&Tt&&Ee&&!Le;return{position:"absolute",top:ot.top,left:ot.left,width:ot.width,height:ot.height,objectFit:"contain",transform:yt??(Bt?`translate(${Bt.x}px, ${Bt.y}px)`:void 0),opacity:Fe==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Fe==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:te==="opening"||Ht?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(_,Re)=>{const Fe=et(_);return Fe?S0(ao(Fe,Re,A),Re,A):null},Xt=_=>Re=>{if(!l){if(k.current){k.current=!1;return}Re.stopPropagation(),vt(_)}},Dt=Ve?Gt(Ve,"left"):null,Ot=$e?Gt($e,"right"):null,Nt=Dt?vr(Dt,A):null,Ct=Ot?vr(Ot,A):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:de?"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:de?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Ne&&a.jsx(br,{media:Ne,style:Mt(Ne,"left","far"),onMeasure:We,onTransitionEnd:ke},`far-prev-${Ne.url}`),Tt&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ve,style:Mt(Ve,"left"),onMeasure:We,onTransitionEnd:ke},`prev-${Ve.url}`),Nt&&a.jsx("div",{style:{position:"absolute",top:Nt.top,left:Nt.left,width:Nt.width,height:Nt.height,cursor:l||de?"default":"pointer",pointerEvents:l||de?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Tt&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:$e,style:Mt($e,"right"),onMeasure:We,onTransitionEnd:ke},`next-${$e.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||de?"default":"pointer",pointerEvents:l||de?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Tt&&ze&&a.jsx(br,{media:ze,style:Mt(ze,"right","far"),onMeasure:We,onTransitionEnd:ke},`far-next-${ze.url}`),ue&&K&&(Xe?a.jsx(T0,{src:K.url,phase:te,onMediaElement:_t,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:ke},`${n}-${K.url}`):a.jsx("img",{ref:_t,src:K.url,alt:K.name,onLoad:xt,onTransitionEnd:ke,style:jt},`${n}-${K.url}`))]})}const R0=20,L0=.18;function P0(e){return`
|
|
18698
18698
|
.${e}-wrapper {
|
|
18699
18699
|
box-sizing: border-box;
|
|
18700
18700
|
max-width: 100%;
|
|
@@ -18781,8 +18781,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18781
18781
|
z-index: 2;
|
|
18782
18782
|
pointer-events: auto;
|
|
18783
18783
|
}
|
|
18784
|
-
${
|
|
18785
|
-
`}function
|
|
18784
|
+
${s0(e)}
|
|
18785
|
+
`}function E0(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 M0(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 k0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:D.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:D.scalingValue(i*L0,n??!1),[`--${t}-image-aspect`]:E0(e)}}function A0(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 qt(n,t)}function F0(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 _0(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?Qd(d,o):void 0)}}function N0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>P0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=D.scalingValue(w,n??!1),h=`max(${m}, ${R0}px)`,{objectFitMode:f,imageStyle:v}=F0(e),C=A0(e,n),y=s.useRef(null),[S,X]=s.useState(!1),[N,U]=s.useState([]),[W,I]=s.useState(0),[B,$]=s.useState(0),[T,k]=s.useState(null),[F,g]=s.useState({title1:"",title2:"",title3:""}),H=(!n||i)&&!S,P=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},q=P.sizeType??"none",ne=H&&q!=="none"?`${d}-item-image-hover-${q}`:void 0,L=(P.value??120)/100,O=s.useCallback(b=>{!b||q!=="scale"||(b.style.transformOrigin=Eg(b))},[q]),Z=s.useCallback(b=>{if(b){if(f==="contain"){const M=M0(b);if(M){const E=b.closest(`.${d}-item-image`);E instanceof HTMLElement&&E.style.setProperty(`--${d}-item-media-aspect`,String(M))}}O(b)}},[d,O,f]),ue={width:D.scalingValue(x,n??!1),...C,...k0(e,d,n),[`--${d}-image-hover-scale`]:String(L)},ae=(()=>{const b={},M=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return M&&(b["--cntrl-article-width"]=M),b})(),A=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),pe=s.useMemo(()=>h0(u),[u]),z=s.useMemo(()=>b0(u),[u]),re=(b,M)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const E=pe.findIndex(Ce=>Ce.gridIndex===b);if(E<0)return;const j=pe[E];$(E),U(j.items),I(0),g(j.entry),k(M??null),X(!0)},te=s.useCallback(()=>{X(!1),k(null)},[]),be=s.useCallback(()=>{const b=pe[B];return!b||!y.current?T:g0(y.current,b.gridIndex,f)??T},[pe,B,T,f]),Ae=s.useCallback(b=>{if(pe.length>1){const M=pe.length,E=(B+b+M)%M,j=pe[E];$(E),U(j.items),I(0),g(j.entry);return}I(M=>(M+b+N.length)%N.length)},[pe,B,N.length]),ve=pe.length>1||N.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b}},[S]),s.useEffect(()=>{!n||o||i||X(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&X(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(w0,{mediaList:z}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:ue,children:u.map((b,M)=>{var Ce,ee;const E=!!((Ce=b.image)!=null&&Ce.url),j=_0(!!A,E,M,d,f,re);return a.jsxs("div",{className:`${d}-item`,children:[b.title?a.jsx("span",{className:`${d}-item-title`,onClick:j,style:j?{cursor:"pointer"}:void 0,children:b.title}):null,(ee=b.image)!=null&&ee.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ne].filter(Boolean).join(" "),children:b.image.type==="video"?a.jsx("video",{ref:Z,src:b.image.url,"data-waterfall-index":M,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:j,onLoadedData:Ie=>Z(Ie.currentTarget)}):a.jsx("img",{ref:Z,src:b.image.url,alt:b.image.name??"","data-waterfall-index":M,style:v,onClick:j,onLoad:Ie=>Z(Ie.currentTarget)})}):null,M<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%"}})})]},M)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const b=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:ae,"data-selection":"none",children:a.jsx(I0,{prefix:d,items:N,index:W,entry:F,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ve,lightboxEntries:pe,entryIdx:B,layoutId:r,sourceRect:T,resolveCloseSourceRect:be,onClose:te,onPrev:()=>Ae(-1),onNext:()=>Ae(1)})}),b)})()]})}const W0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18786
18786
|
import type React from 'react';
|
|
18787
18787
|
import { createPortal } from 'react-dom';
|
|
18788
18788
|
import { CommonComponentProps } from '../props';
|
|
@@ -19296,7 +19296,7 @@ export function Waterfall({
|
|
|
19296
19296
|
</>
|
|
19297
19297
|
);
|
|
19298
19298
|
}
|
|
19299
|
-
`,W0="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>'),Yn={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 H0(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const so=oi.filter(e=>e!=="count"),D0=so.reduce((e,t)=>({...e,...H0(t)}),{}),O0=so.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Arial",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function za(e){return so.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const B0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(so.map(e=>[Xs[e],Ys(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},z0=[{title:"Salton Sea from Above",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],j0={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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:z0},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},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"]}},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"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...D0},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:W0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...O0},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...za({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...za({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...za({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[B0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},V0={element:_0,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...so.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...so.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})},schema:j0,sourceCode:N0},qi=500,nu="cubic-bezier(0.25, 1, 0.5, 1)",G0=300,X0=5,Y0=.15,q0=.4,U0=100,Fi=100,hc={color:"#000000",hover:"#cccccc"},bo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},K0={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ja={offset:{x:0,y:0},linkColor:"#cccccc"},fc={sizeType:"drag",value:3},Z0="left";function J0(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)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:Z0,color:(e==null?void 0:e.titleColor)??"#000000"};return qt(n,t)}function _i(e,t,n){return`${e}: ${O.scalingValue(t/1440,n)};`}function Io(e,t){return t<=0?0:(e%t+t)%t}function Q0(e,t,n,i){if(!i)return{position:Io(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function eb(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function tb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}px)`;const w=n.getBoundingClientRect();return{x:w.left,y:w.top}},o=i(0,0),r=i(Fi,0),l=i(0,Fi);e.removeChild(n);const d={x:(r.x-o.x)/Fi,y:(r.y-o.y)/Fi},c={x:(l.x-o.x)/Fi,y:(l.y-o.y)/Fi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function nb(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function ib(e,t){return`
|
|
19299
|
+
`,H0="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>'),Yn={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 D0(e){const t={};return t[rt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[rt(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[rt(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[rt(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[rt(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[rt(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[rt(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[rt(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const so=oi.filter(e=>e!=="count"),O0=so.reduce((e,t)=>({...e,...D0(t)}),{}),B0=so.reduce((e,t)=>({...e,[rt(t,"fontFamily")]:"Arial",[rt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[rt(t,"letterSpacing")]:0,[rt(t,"wordSpacing")]:0,[rt(t,"textAlign")]:"left",[rt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function za(e){return so.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[rt(n,"fontSize")]=i),o!==void 0&&(t[rt(n,"lineHeight")]=o),t},{})}const z0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(so.map(e=>[Xs[e],Ys(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},j0=[{title:"Salton Sea from Above",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],V0={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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:j0},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},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"]}},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"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...O0},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:H0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...B0},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...za({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...za({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...za({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[z0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},G0={element:N0,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...so.map(e=>({path:`${rt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...so.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${rt(t,"fontFamily")}`}),{})},schema:V0,sourceCode:W0},qi=500,nu="cubic-bezier(0.25, 1, 0.5, 1)",X0=300,Y0=5,q0=.15,U0=.4,K0=100,Fi=100,hc={color:"#000000",hover:"#cccccc"},bo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},Z0={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ja={offset:{x:0,y:0},linkColor:"#cccccc"},fc={sizeType:"drag",value:3},J0="left";function Q0(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)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:J0,color:(e==null?void 0:e.titleColor)??"#000000"};return qt(n,t)}function _i(e,t,n){return`${e}: ${D.scalingValue(t/1440,n)};`}function Io(e,t){return t<=0?0:(e%t+t)%t}function eb(e,t,n,i){if(!i)return{position:Io(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function tb(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function nb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}px)`;const w=n.getBoundingClientRect();return{x:w.left,y:w.top}},o=i(0,0),r=i(Fi,0),l=i(0,Fi);e.removeChild(n);const d={x:(r.x-o.x)/Fi,y:(r.y-o.y)/Fi},c={x:(l.x-o.x)/Fi,y:(l.y-o.y)/Fi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function ib(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function ob(e,t){return`
|
|
19300
19300
|
.${e}-wrapper {
|
|
19301
19301
|
position: relative;
|
|
19302
19302
|
width: 100%;
|
|
@@ -19566,7 +19566,7 @@ export function Waterfall({
|
|
|
19566
19566
|
from { clip-path: inset(100% 0 0 0); }
|
|
19567
19567
|
to { clip-path: inset(0 0 0 0); }
|
|
19568
19568
|
}
|
|
19569
|
-
`}function ob({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=O.useScopedStyles(),l=J0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??fc,p=u.sizeType??"drag",x=u.value??fc.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",v=K0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Ie=>O.scalingValue(Ie*C,n),S=(e==null?void 0:e.show)??"always",G=(e==null?void 0:e.controls)??null,W=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,H=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,I=(e==null?void 0:e.controlsColor)??hc.color,z=(e==null?void 0:e.controlsHoverColor)??hc.hover,$=(e==null?void 0:e.navColor)??bo.colors.inactive,T=(e==null?void 0:e.navPaginationColor)??bo.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??bo.colors.background,_=(e==null?void 0:e.linkColor)??ja.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,D=w==="horizontal",P=p==="click",q=p==="drag",ie=p==="auto"&&(!n||!!i),L=!n,B=m==="slide",K=h==="classic",ue=S!=="never",le=S==="on hover",F=O.scalingValue(W,n),pe={width:F,height:F,maxWidth:F},j=B&&c>1,[se,ne]=s.useState(0),[ve,ke]=s.useState(j?1:0),[xe,b]=s.useState(!1),[M,E]=s.useState(!1),[V,Ce]=s.useState(!1),[te,$e]=s.useState(0),[ae,ge]=s.useState(!1),[ye,Z]=s.useState(!1),J=s.useRef(!1),de=s.useRef(ve);de.current=ve;const be=s.useRef(null),Pe=s.useRef(0),Se=s.useRef(null),X=s.useRef(null),me=s.useRef(null),re=s.useRef(null),Y=s.useCallback(Ie=>{J.current=Ie,b(Ie)},[]),ce=s.useCallback(Ie=>{if(c<2||Ie===0)return;const We=Ie>0?1:-1,je=Math.abs(Ie);if(ge(!0),Y(!0),!B){ne(Be=>Io(Be+Ie,c));return}let Ue=de.current;const A=j&&(Ue===0||Ue===c+1),ee=A?se+1:null;A&&(Ue=se+1);let Te=je;for(;Te>0;){const Be=Q0(Ue,We,c,j);if(Ue=Be.position,Te-=1,Be.hitBoundary){Pe.current=Te*We;break}}const He=je-Te;if(He>0&&ne(Be=>Io(Be+He*We,c)),de.current=Ue,ee!==null){if(de.current=ee,Ue===ee){E(!0),ke(Ue);return}be.current=Ue,E(!0),ke(ee);return}E(!1),ke(Ue)},[se,c,j,B,Y]),Ee=s.useCallback(Ie=>{ce(Ie)},[ce]),he=s.useCallback(Ie=>{if(c<2)return;const We=Io(Ie,c);if(!(We===se&&!J.current)&&(ge(!0),Y(!0),ne(We),B)){const je=We+(j?1:0);be.current=null,Pe.current=0,de.current=je,E(!1),ke(je)}},[se,c,j,B,Y]);s.useEffect(()=>{if(!xe)return;const Ie=window.setTimeout(()=>{if(j&&(ve===0||ve===c+1)){be.current=null,E(!0),ke(se+1);return}Y(!1)},qi);return()=>window.clearTimeout(Ie)},[se,c,j,xe,Y,ve]),s.useEffect(()=>{if(!M)return;let Ie=0;const We=requestAnimationFrame(()=>{Ie=requestAnimationFrame(()=>{const je=be.current;be.current=null;const Ue=Pe.current;if(Pe.current=0,E(!1),je!==null){de.current=je,ke(je);return}if(Ue!==0){ce(Ue);return}Y(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Ie)}},[ce,Y,M]);const Q=`${j}:${c}`,Ne=s.useRef(Q);s.useEffect(()=>{if(Ne.current===Q)return;Ne.current=Q;const Ie=c>0?Math.min(se,c-1):0;me.current=null,re.current=null,Ce(!1),$e(0),ne(Ie),E(!0),ke(Ie+(j?1:0))},[se,c,j,Q]),s.useEffect(()=>{if(!ae)return;const Ie=window.setTimeout(()=>ge(!1),G0);return()=>window.clearTimeout(Ie)},[ae,se]),s.useEffect(()=>{if(!ie||c<2)return;const Ie=Math.max(x,.1)*1e3,We=window.setInterval(()=>{L&&ye||Ee(1)},Ie);return()=>window.clearInterval(We)},[x,c,Ee,ie,ye,L]);const Fe=s.useCallback(Ie=>{const We=me.current;if(!We||We.pointerId!==Ie.pointerId)return;me.current=null,re.current=null;const je=Se.current;if(je!=null&&je.hasPointerCapture(Ie.pointerId)&&je.releasePointerCapture(Ie.pointerId),!We.isActive){B&&$e(0);return}const A=!(Ie.timeStamp-We.lastTime>U0)&&Math.abs(We.velocity)>q0,ee=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*Y0;if(Ce(!1),!A&&!ee){$e(0);return}const Te=ee?We.offset-We.baseOffset:We.velocity;let He=1;ee&&We.size>0&&(He=Math.max(1,Math.round(Math.abs(Te)/We.size))),$e(0),ce(Te<0?He:-He)},[ce,B]);s.useEffect(()=>{const Ie=We=>{re.current===null||We.pointerId!==re.current||Fe(We)};return window.addEventListener("pointerup",Ie),window.addEventListener("pointercancel",Ie),()=>{window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie)}},[Fe]);const et=Ie=>{const We=Se.current;if(!q||c<2||!We||Ie.pointerType==="mouse"&&Ie.button!==0)return;be.current=null,Pe.current=0,J.current&&Y(!1);let je=0;const Ue=X.current;if(B&&Ue){const A=D?Ue.offsetWidth:Ue.offsetHeight;if(A>0){const ee=eb(Ue,D);let Te=de.current;j&&(Te===0||Te===c+1)?(Te=se+1,de.current=Te,E(!0),ke(Te),je=0):je=ee+Te*A,$e(je)}}We.setPointerCapture(Ie.pointerId),re.current=Ie.pointerId,me.current={pointerId:Ie.pointerId,startClientX:Ie.clientX,startClientY:Ie.clientY,axes:tb(We,`${r}-axis-probe`),size:D?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:je,offset:je,lastTime:Ie.timeStamp,velocity:0}},Je=Ie=>{const We=me.current;if(!We||We.pointerId!==Ie.pointerId)return;if(Ie.pointerType==="mouse"&&Ie.buttons===0){Fe(Ie);return}const je=Ie.clientX-We.startClientX,Ue=Ie.clientY-We.startClientY,A=We.axes?nb(We.axes,je,Ue):{x:je,y:Ue},ee=D?A.x:A.y,Te=D?A.y:A.x,He=We.baseOffset+ee;if(!We.isActive){if(Math.max(Math.abs(ee),Math.abs(Te))<X0)return;if(Math.abs(Te)>Math.abs(ee)){const Ve=Se.current;Ve!=null&&Ve.hasPointerCapture(We.pointerId)&&Ve.releasePointerCapture(We.pointerId),me.current=null,re.current=null,B&&$e(0);return}We.isActive=!0,Ce(!0)}const Be=Ie.timeStamp-We.lastTime;Be>0&&(We.velocity=(He-We.offset)/Be,We.lastTime=Ie.timeStamp),We.offset=He,B&&$e(He)},dt=Ie=>{Fe(Ie)},tt=D?`translate3d(calc(${-ve*100}% + ${te}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${te}px), 0)`,De=j?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ib(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!D}),onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Se,className:pt(`${r}-track`,{[`${r}-track-draggable`]:q,[`${r}-track-draggable-vertical`]:q&&!D}),onPointerDown:et,onPointerMove:Je,onPointerUp:dt,onPointerCancel:dt,onLostPointerCapture:Ie=>{re.current===Ie.pointerId&&Fe(Ie)},children:a.jsx("div",{ref:X,className:pt(`${r}-list`,{[`${r}-list-slide`]:B,[`${r}-list-slide-vertical`]:B&&!D,[`${r}-list-fade`]:!B}),style:B?{transform:tt,transition:V||M?"none":`transform ${qi}ms ${nu}`}:void 0,children:De.map((Ie,We)=>{const je=j?Io(We-1,c):We,A=j&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${je}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!B&&je===se}),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`]:Ie.image.objectFit==="contain",[`${r}-cover`]:Ie.image.objectFit==="cover"}),src:Ie.image.url,alt:Ie.image.name??"",draggable:!1})})})},A)})})}),ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:D,[`${r}-arrow-prev-vertical`]:!D,[`${r}-hover-arrow`]:le}),style:{color:I,"--arrow-hover-color":z,...pe},children:a.jsxs("button",{onClick:Ie=>{Ie.stopPropagation(),Ee(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${O.scalingValue(U,n)}, ${O.scalingValue(H*(D?1:-1),n)}) rotate(${D?"0deg":"90deg"})`},children:[G&&a.jsx(sn,{url:G,fill:I,hoverFill:z,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:pe}),!G&&a.jsx(yc,{color:I,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`]:le}),style:{color:I,"--arrow-hover-color":z,...pe},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Ie=>{Ie.stopPropagation(),Ee(1)},style:{transform:`translate(${O.scalingValue(U*(D?-1:1),n)}, ${O.scalingValue(H,n)}) rotate(${D?"0deg":"90deg"})`},children:[G&&a.jsx(sn,{url:G,fill:I,hoverFill:z,className:`${r}-arrow-img`,style:pe}),!G&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),P&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ee(1)}),K&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:D,[`${r}-pagination-inside-left`]:!D}),style:D?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!D,[`${r}-animate-dots`]:ae}),style:{backgroundColor:k,gap:y(v.gapInactive-v.activeDot+v.dot),...D?{height:y(v.activeDot+v.paddingY*2),paddingTop:y(v.paddingY),paddingBottom:y(v.paddingY),paddingLeft:y(v.paddingActive),paddingRight:y(v.paddingActive)}:{width:y(v.activeDot+v.paddingY*2),paddingLeft:y(v.paddingY),paddingRight:y(v.paddingY),paddingTop:y(v.paddingActive),paddingBottom:y(v.paddingActive)},borderRadius:y(v.borderRadius),transform:`translate(${O.scalingValue(bo.offset.x,n)}, ${O.scalingValue(bo.offset.y,n)})`},children:d.map((Ie,We)=>{const je=We===se,Ue=je?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>he(We),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:je?T:$,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:O.scalingValue(g,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Ie,We)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===se&&n,[`${r}-active`]:We===se}),style:{...l,width:"max-content",transitionDuration:`${Math.round(qi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":_,"--link-hover-color":_,position:"relative",top:O.scalingValue(ja.offset.y,n),left:O.scalingValue(ja.offset.x,n)},children:a.jsx(Ri,{content:Ie.imageCaption})})},We))})]})]})]})}function yc({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 rb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19569
|
+
`}function rb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=Q0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??fc,p=u.sizeType??"drag",x=u.value??fc.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",v=Z0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=$e=>D.scalingValue($e*C,n),S=(e==null?void 0:e.show)??"always",X=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,W=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,I=(e==null?void 0:e.controlsColor)??hc.color,B=(e==null?void 0:e.controlsHoverColor)??hc.hover,$=(e==null?void 0:e.navColor)??bo.colors.inactive,T=(e==null?void 0:e.navPaginationColor)??bo.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??bo.colors.background,F=(e==null?void 0:e.linkColor)??ja.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,H=w==="horizontal",P=p==="click",q=p==="drag",ne=p==="auto"&&(!n||!!i),L=!n,O=m==="slide",Z=h==="classic",ue=S!=="never",ae=S==="on hover",A=D.scalingValue(N,n),pe={width:A,height:A,maxWidth:A},z=O&&c>1,[re,te]=s.useState(0),[be,Ae]=s.useState(z?1:0),[ve,b]=s.useState(!1),[M,E]=s.useState(!1),[j,Ce]=s.useState(!1),[ee,Ie]=s.useState(0),[oe,me]=s.useState(!1),[xe,J]=s.useState(!1),Q=s.useRef(!1),se=s.useRef(be);se.current=be;const we=s.useRef(null),Ee=s.useRef(0),Te=s.useRef(null),Y=s.useRef(null),de=s.useRef(null),ce=s.useRef(null),G=s.useCallback($e=>{Q.current=$e,b($e)},[]),le=s.useCallback($e=>{if(c<2||$e===0)return;const He=$e>0?1:-1,Be=Math.abs($e);if(me(!0),G(!0),!O){te(ze=>Io(ze+$e,c));return}let Ue=se.current;const he=z&&(Ue===0||Ue===c+1),V=he?re+1:null;he&&(Ue=re+1);let ye=Be;for(;ye>0;){const ze=eb(Ue,He,c,z);if(Ue=ze.position,ye-=1,ze.hitBoundary){Ee.current=ye*He;break}}const Ne=Be-ye;if(Ne>0&&te(ze=>Io(ze+Ne*He,c)),se.current=Ue,V!==null){if(se.current=V,Ue===V){E(!0),Ae(Ue);return}we.current=Ue,E(!0),Ae(V);return}E(!1),Ae(Ue)},[re,c,z,O,G]),Me=s.useCallback($e=>{le($e)},[le]),fe=s.useCallback($e=>{if(c<2)return;const He=Io($e,c);if(!(He===re&&!Q.current)&&(me(!0),G(!0),te(He),O)){const Be=He+(z?1:0);we.current=null,Ee.current=0,se.current=Be,E(!1),Ae(Be)}},[re,c,z,O,G]);s.useEffect(()=>{if(!ve)return;const $e=window.setTimeout(()=>{if(z&&(be===0||be===c+1)){we.current=null,E(!0),Ae(re+1);return}G(!1)},qi);return()=>window.clearTimeout($e)},[re,c,z,ve,G,be]),s.useEffect(()=>{if(!M)return;let $e=0;const He=requestAnimationFrame(()=>{$e=requestAnimationFrame(()=>{const Be=we.current;we.current=null;const Ue=Ee.current;if(Ee.current=0,E(!1),Be!==null){se.current=Be,Ae(Be);return}if(Ue!==0){le(Ue);return}G(!1)})});return()=>{cancelAnimationFrame(He),cancelAnimationFrame($e)}},[le,G,M]);const K=`${z}:${c}`,Xe=s.useRef(K);s.useEffect(()=>{if(Xe.current===K)return;Xe.current=K;const $e=c>0?Math.min(re,c-1):0;de.current=null,ce.current=null,Ce(!1),Ie(0),te($e),E(!0),Ae($e+(z?1:0))},[re,c,z,K]),s.useEffect(()=>{if(!oe)return;const $e=window.setTimeout(()=>me(!1),X0);return()=>window.clearTimeout($e)},[oe,re]),s.useEffect(()=>{if(!ne||c<2)return;const $e=Math.max(x,.1)*1e3,He=window.setInterval(()=>{L&&xe||Me(1)},$e);return()=>window.clearInterval(He)},[x,c,Me,ne,xe,L]);const Le=s.useCallback($e=>{const He=de.current;if(!He||He.pointerId!==$e.pointerId)return;de.current=null,ce.current=null;const Be=Te.current;if(Be!=null&&Be.hasPointerCapture($e.pointerId)&&Be.releasePointerCapture($e.pointerId),!He.isActive){O&&Ie(0);return}const he=!($e.timeStamp-He.lastTime>K0)&&Math.abs(He.velocity)>U0,V=He.size>0&&Math.abs(He.offset-He.baseOffset)>He.size*q0;if(Ce(!1),!he&&!V){Ie(0);return}const ye=V?He.offset-He.baseOffset:He.velocity;let Ne=1;V&&He.size>0&&(Ne=Math.max(1,Math.round(Math.abs(ye)/He.size))),Ie(0),le(ye<0?Ne:-Ne)},[le,O]);s.useEffect(()=>{const $e=He=>{ce.current===null||He.pointerId!==ce.current||Le(He)};return window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",$e),()=>{window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",$e)}},[Le]);const Ze=$e=>{const He=Te.current;if(!q||c<2||!He||$e.pointerType==="mouse"&&$e.button!==0)return;we.current=null,Ee.current=0,Q.current&&G(!1);let Be=0;const Ue=Y.current;if(O&&Ue){const he=H?Ue.offsetWidth:Ue.offsetHeight;if(he>0){const V=tb(Ue,H);let ye=se.current;z&&(ye===0||ye===c+1)?(ye=re+1,se.current=ye,E(!0),Ae(ye),Be=0):Be=V+ye*he,Ie(Be)}}He.setPointerCapture($e.pointerId),ce.current=$e.pointerId,de.current={pointerId:$e.pointerId,startClientX:$e.clientX,startClientY:$e.clientY,axes:nb(He,`${r}-axis-probe`),size:H?He.offsetWidth:He.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:$e.timeStamp,velocity:0}},Qe=$e=>{const He=de.current;if(!He||He.pointerId!==$e.pointerId)return;if($e.pointerType==="mouse"&&$e.buttons===0){Le($e);return}const Be=$e.clientX-He.startClientX,Ue=$e.clientY-He.startClientY,he=He.axes?ib(He.axes,Be,Ue):{x:Be,y:Ue},V=H?he.x:he.y,ye=H?he.y:he.x,Ne=He.baseOffset+V;if(!He.isActive){if(Math.max(Math.abs(V),Math.abs(ye))<Y0)return;if(Math.abs(ye)>Math.abs(V)){const We=Te.current;We!=null&&We.hasPointerCapture(He.pointerId)&&We.releasePointerCapture(He.pointerId),de.current=null,ce.current=null,O&&Ie(0);return}He.isActive=!0,Ce(!0)}const ze=$e.timeStamp-He.lastTime;ze>0&&(He.velocity=(Ne-He.offset)/ze,He.lastTime=$e.timeStamp),He.offset=Ne,O&&Ie(Ne)},ct=$e=>{Le($e)},nt=H?`translate3d(calc(${-be*100}% + ${ee}px), 0, 0)`:`translate3d(0, calc(${-be*100}% + ${ee}px), 0)`,Ve=z?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ob(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!H}),onMouseEnter:()=>J(!0),onMouseLeave:()=>J(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Te,className:pt(`${r}-track`,{[`${r}-track-draggable`]:q,[`${r}-track-draggable-vertical`]:q&&!H}),onPointerDown:Ze,onPointerMove:Qe,onPointerUp:ct,onPointerCancel:ct,onLostPointerCapture:$e=>{ce.current===$e.pointerId&&Le($e)},children:a.jsx("div",{ref:Y,className:pt(`${r}-list`,{[`${r}-list-slide`]:O,[`${r}-list-slide-vertical`]:O&&!H,[`${r}-list-fade`]:!O}),style:O?{transform:nt,transition:j||M?"none":`transform ${qi}ms ${nu}`}:void 0,children:Ve.map(($e,He)=>{const Be=z?Io(He-1,c):He,he=z&&(He===0||He===c+1)?`clone-${He===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!O&&Be===re}),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`]:$e.image.objectFit==="contain",[`${r}-cover`]:$e.image.objectFit==="cover"}),src:$e.image.url,alt:$e.image.name??"",draggable:!1})})})},he)})})}),ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:H,[`${r}-arrow-prev-vertical`]:!H,[`${r}-hover-arrow`]:ae}),style:{color:I,"--arrow-hover-color":B,...pe},children:a.jsxs("button",{onClick:$e=>{$e.stopPropagation(),Me(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(U,n)}, ${D.scalingValue(W*(H?1:-1),n)}) rotate(${H?"0deg":"90deg"})`},children:[X&&a.jsx(sn,{url:X,fill:I,hoverFill:B,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:pe}),!X&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-next`]:H,[`${r}-arrow-next-vertical`]:!H,[`${r}-hover-arrow`]:ae}),style:{color:I,"--arrow-hover-color":B,...pe},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:$e=>{$e.stopPropagation(),Me(1)},style:{transform:`translate(${D.scalingValue(U*(H?-1:1),n)}, ${D.scalingValue(W,n)}) rotate(${H?"0deg":"90deg"})`},children:[X&&a.jsx(sn,{url:X,fill:I,hoverFill:B,className:`${r}-arrow-img`,style:pe}),!X&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),P&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Me(1)}),Z&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:H,[`${r}-pagination-inside-left`]:!H}),style:H?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!H,[`${r}-animate-dots`]:oe}),style:{backgroundColor:k,gap:y(v.gapInactive-v.activeDot+v.dot),...H?{height:y(v.activeDot+v.paddingY*2),paddingTop:y(v.paddingY),paddingBottom:y(v.paddingY),paddingLeft:y(v.paddingActive),paddingRight:y(v.paddingActive)}:{width:y(v.activeDot+v.paddingY*2),paddingLeft:y(v.paddingY),paddingRight:y(v.paddingY),paddingTop:y(v.paddingActive),paddingBottom:y(v.paddingActive)},borderRadius:y(v.borderRadius),transform:`translate(${D.scalingValue(bo.offset.x,n)}, ${D.scalingValue(bo.offset.y,n)})`},children:d.map(($e,He)=>{const Be=He===re,Ue=Be?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>fe(He),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?T:$,width:y(Ue)}})},He)})},`${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:D.scalingValue(g,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map(($e,He)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:He===re&&n,[`${r}-active`]:He===re}),style:{...l,width:"max-content",transitionDuration:`${Math.round(qi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":F,"--link-hover-color":F,position:"relative",top:D.scalingValue(ja.offset.y,n),left:D.scalingValue(ja.offset.x,n)},children:a.jsx(Ri,{content:$e.imageCaption})})},He))})]})]})]})}function yc({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 ab=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19570
19570
|
import cn from 'classnames';
|
|
19571
19571
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19572
19572
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20747,14 +20747,14 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20747
20747
|
</svg>
|
|
20748
20748
|
);
|
|
20749
20749
|
}
|
|
20750
|
-
`,
|
|
20750
|
+
`,sb={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{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"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},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/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},lb={element:rb,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:sb,sourceCode:ab,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Oi=300/1440,cb=8/1440,vi=.004;function db(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function vc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function ub(e){return`
|
|
20751
20751
|
.${e}-wrapper {
|
|
20752
20752
|
box-sizing: border-box;
|
|
20753
20753
|
display: flex;
|
|
20754
20754
|
flex-direction: column;
|
|
20755
20755
|
position: relative;
|
|
20756
20756
|
width: 100%;
|
|
20757
|
-
min-height: ${
|
|
20757
|
+
min-height: ${db(48)};
|
|
20758
20758
|
}
|
|
20759
20759
|
.${e}-single-title-layer {
|
|
20760
20760
|
position: absolute;
|
|
@@ -20964,7 +20964,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20964
20964
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
20965
20965
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
20966
20966
|
}
|
|
20967
|
-
`}const ub="rgba(28,31,34,0.9)",An=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",pb=72,mb=50,gb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},hb=[];function fb(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 yb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function xb(e){const[t]=e.media;return t!=null&&t.url?t:null}function vb(e){if(!Array.isArray(e)||e.length===0)return[];if(fb(e)){const t=[];for(const n of e){const i=yb(n);if(!i)continue;const o=xb(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 us(e){return e.type==="video"}function bb(e){e.pause(),e.removeAttribute("src"),e.load()}function Sr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function wb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Sb=1140/1440;function Cb(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 $b(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 Tb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ib({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()=>{bb(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 Rb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),G=s.useRef(!1),W=s.useRef(null),[U,H]=s.useState(null),[I,z]=s.useState("opening"),[$,T]=s.useState(0),[k,_]=s.useState(0),[g,D]=s.useState(!1),[P,q]=s.useState(!1),[ie,L]=s.useState(!1),B=s.useRef(n),K=t[n],ue=K?us(K):!1,le=k!==0||g,F=s.useCallback(ae=>{G.current=ae,D(ae)},[]),pe=s.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),j=s.useCallback(()=>{pe(),W.current=window.setTimeout(()=>{pe(),F(!1)},An+32)},[pe,F]),se=s.useCallback(()=>{const ae=w.current,ge=m.current;if(!ae)return;const ye=ae.getBoundingClientRect(),Z=ye.width,J=ye.height;if(!Z||!J)return;if(i==="cover"){H({width:Z,height:J,left:ye.left,top:ye.top});return}if(!ge){H(Sr(ae));return}const{width:de,height:be}=wb(ge);if(!de||!be){H(Sr(ae));return}const Pe=de/be,Se=Z/J;if(Pe>Se){const X=Z/Pe;H({width:Z,height:X,left:ye.left,top:ye.top+(J-X)/2})}else{const X=J*Pe;H({width:X,height:J,left:ye.left+(Z-X)/2,top:ye.top})}},[i]);s.useEffect(()=>{se();const ae=w.current;if(!ae)return;const ge=new ResizeObserver(()=>se());return ge.observe(ae),()=>ge.disconnect()},[se,n]),s.useEffect(()=>{I==="opening"&&U&&z("open")},[I,U]),s.useEffect(()=>{if(I!=="closing")return;const ae=setTimeout(()=>r(),An);return()=>clearTimeout(ae)},[I,r]),s.useEffect(()=>()=>{pe()},[pe]),s.useLayoutEffect(()=>{if(B.current===n)return;pe(),T(0),_(0),F(!1),L(!1),q(!1),f.current=0,v.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const ae=w.current;ae&&H(Sr(ae)),B.current=n},[n,F,pe]),s.useEffect(()=>{if(I!=="open")return;let ae=null;const ge=()=>{ae&&(document.removeEventListener("click",ae,!0),ae=null)},ye=()=>{ge(),ae=Se=>{Se.stopPropagation(),Se.preventDefault(),ge()},document.addEventListener("click",ae,!0)},Z=Se=>{pe(),G.current=!1,D(!1),_(0),q(!1),y.current=!1,v.current=0,C.current="none";const X=w.current;X&&H(Sr(X)),Se<0?d():l()},J=Se=>{if(Math.abs(Se)>mb&&t.length>1){Z(Se);return}F(!0),_(0),j()},de=Se=>{if(Se.touches.length!==1||G.current)return;const X=Se.touches[0];S.current=!0,h.current={x:X.clientX,y:X.clientY},C.current="none",v.current=0,y.current=!1},be=Se=>{if(!h.current||Se.touches.length!==1||G.current)return;const X=Se.touches[0],me=X.clientX-h.current.x,re=X.clientY-h.current.y;if(C.current==="none"){if(Math.abs(me)<10&&Math.abs(re)<10)return;if(Math.abs(me)>Math.abs(re)){if(t.length<=1)return;C.current="horizontal"}else if(re>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,q(!0),v.current=me,_(me),Se.preventDefault();return}C.current==="vertical"&&(y.current=!0,q(!0),f.current=re,T(re),Se.preventDefault())},Pe=()=>{if(!h.current)return;const Se=C.current,X=y.current;if(X&&Se==="horizontal")J(v.current),ye();else if(X&&Se==="vertical")if(f.current>pb){const re=window.innerHeight;f.current=re,L(!0),T(re),z("closing")}else f.current=0,T(0),ye();else Se==="horizontal"&&Math.abs(v.current)>0&&(J(v.current),ye());h.current=null,C.current="none",v.current=0,y.current=!1,q(!1)};return document.addEventListener("touchstart",de,{passive:!0}),document.addEventListener("touchmove",be,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",de),document.removeEventListener("touchmove",be),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),ge()}},[I,t.length,d,l,F,j,pe]),s.useEffect(()=>{const ae=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),I!=="closing"&&z("closing"))};return window.addEventListener("keydown",ae,!0),()=>window.removeEventListener("keydown",ae,!0)},[I]);const ne=()=>{I!=="closing"&&z("closing")},ve=I==="open",ke=I==="closing",xe=$>0?Math.max(0,1-$/500):1,b=$>0?Math.max(.35,1-$/500):1,M=ae=>{if(ae.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ge=ae.currentTarget.getBoundingClientRect(),ye=ae.clientY-ge.top,Z=Math.min(52,ge.height*.2);if(!(ye>ge.height-Z)){if(ae.clientX-ge.left<ge.width/2){l();return}d()}},E=ae=>{if(t.length<=1)return;const ge=ae.currentTarget.getBoundingClientRect(),ye=ae.clientX-ge.left,Z=ae.clientY-ge.top,J=Math.min(52,ge.height*.2);if(Z>ge.height-J){ae.currentTarget.style.cursor="default";return}ae.currentTarget.style.cursor=ye<ge.width/2?"w-resize":"e-resize"},V=s.useCallback(ae=>{ae.propertyName!=="transform"||!G.current||(pe(),F(!1))},[pe,F]),Ce=le?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,te={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:Ce,opacity:$>0?b:I==="opening"||ke?0:1,transition:P&&!g?"none":g?`transform ${An}ms ${xi}`:ie?`transform ${An}ms ${xi}, opacity ${An}ms ${xi}`:I==="opening"||ke?`opacity ${An}ms ${xi}`:"none",pointerEvents:ue&&ve&&!le?"auto":"none",touchAction:ue&&ve?"none":void 0,zIndex:9998},$e=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:I==="open"?"none":void 0},onClick:ne,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?xe:0,transition:P?"none":`opacity ${An}ms ${xi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?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:ve?1:0,transition:`opacity ${An}ms ${xi}`,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:ve?1:0,transition:`opacity ${An}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&K&&(ue?a.jsx(Ib,{src:K.url,phase:I,mediaRef:m,mediaStyle:te,onLoadedMetadata:se,onClick:M,onMouseMove:E,onTransitionEnd:V},`${n}-${K.url}`):a.jsx("img",{ref:m,src:K.url,alt:K.name,onLoad:se,onTransitionEnd:V,style:te},`${n}-${K.url}`)),ve&&$e&&t.length>1&&!ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...$e,left:U.left,cursor:"w-resize",pointerEvents:le?"none":"auto"},onClick:ae=>{if(S.current){S.current=!1;return}ae.stopPropagation(),l()}}),a.jsx("div",{style:{...$e,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:le?"none":"auto"},onClick:ae=>{if(S.current){S.current=!1;return}ae.stopPropagation(),d()}})]})]})}function bc({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 x=`${e}-gallery-${us(t)?"video":"image"}`,w=r.display==="cover",m=$b(r),h=I=>O.scalingValue(I,l??!1),f=n??Oi,v=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},C=i?{borderRadius:h(i)}:{},y={...v,...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},W={className:x,style:S,onClick:p?I=>{I.stopPropagation(),p()}:void 0},U=Math.max(d,vi),H=us(t)?a.jsx("video",{...W,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...W,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[w?a.jsx("div",{style:y,children:H}):H,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(U)}})]})}function Lb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,w=x>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(x)},"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(x)},"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 Pb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function wc({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 Sc({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 Va({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),[x,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 v=()=>w(f.offsetHeight);v();const C=new ResizeObserver(v);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`]:`${x}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 Cc=45;function $c(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 Eb(e){const t=$c(e,"--cntrl-viewport-height",window.innerHeight),n=$c(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function Mb(e,t,n){const{top:i,centerY:o}=Eb(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 kb(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=Mb(u,n,c);return Math.exp(-(p*p)/(2*Cc*Cc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Ab(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(kb(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 Fb(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 _b({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var nt;const{prefix:l}=O.useScopedStyles(),d=s.useMemo(()=>db(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??Oi,w=(e==null?void 0:e.titleWidth)??Sb,m=Cb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??lb,f=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,S=Pb(e==null?void 0:e.transition),G=(e==null?void 0:e.lightbox)??"on",W=p==="b",U=S==="fade"||S==="retype",{setTitleRef:H,dominantIndex:I}=Ab(c.length,U,f),z=((nt=c[I])==null?void 0:nt.title)??"",$=Fb(z,S==="retype"),T=S==="fade"||S==="retype",k=S==="retype"?$:z,_=W?void 0:{width:O.scalingValue(x,n??!1)},g=G==="on"&&(!n||i||o),D=o??!1,P=(e==null?void 0:e.galleryPaddingRight)??0,q=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,L=at=>O.scalingValue(at,n??!1),K={width:L(w)},ue=p==="a"?P:q,le=W?{width:"100%"}:{width:`calc(100% - ${L(x)} - ${L(ue)})`,...p==="c"?{marginLeft:"auto"}:{}},F=Math.max(P,vi),pe=Math.max(q,vi),j=Math.max(ie,vi),se=Math.max(v,vi),ne=Math.max(C,vi),ve=Math.max(y,vi),ke=Math.max(0,(u??1)-(x??Oi)),xe=p==="a"?Math.max(0,(u??1)-(x??Oi)-P):p==="c"?Math.max(0,(u??1)-(x??Oi)-q):p==="b"?u??1:1,b=D&&(p==="a"||p==="b"||p==="c")&&f==="top",M=D&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),E=D&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),V=c.length>1,Ce=W?void 0:L((p==="c"?q:P)+(x??Oi)),te=p==="c"&&Ce?{left:Ce}:void 0,$e=p==="a"&&Ce?{right:Ce}:void 0,ae=W?{left:0,width:"100%"}:p==="a"?{right:L(P),width:L(x)}:{left:L(q),width:L(x)},{titleColor:ge,titleFontFamily:ye,titleFontSettings:Z,titleFontSize:J,titleLineHeight:de,titleLetterSpacing:be,titleWordSpacing:Pe,titleAlign:Se,titleTextAppearance:X,lightboxCounterColor:me,lightboxCounterFontFamily:re,lightboxCounterFontSettings:Y,lightboxCounterFontSize:ce,lightboxCounterLineHeight:Ee,lightboxCounterLetterSpacing:he,lightboxCounterWordSpacing:Q,lightboxCounterTextAppearance:Ne}=e??{},Fe={fontSettings:{fontFamily:ye,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:J??.01,lineHeight:de,letterSpacing:be??0,wordSpacing:Pe??0,textAlign:Se??"left",textAppearance:X,color:ge??"#000000"},Je=an(qt(Fe,n)),dt=K,tt=vc(J,de,l,n),De=xc(J,de,`${l}-title`,`${l}-text-tight-leading`),Ie={fontSettings:{fontFamily:re,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:ce??.01,lineHeight:Ee,letterSpacing:he??0,wordSpacing:Q??0,textAppearance:Ne,color:me??"#DEDDDD"},je={...an(qt(Ie,n)),...vc(ce,Ee,l,n)},Ue=xc(ce,Ee,`${l}-lightbox-counter`,`${l}-text-tight-leading`),A=O.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:me??"#DEDDDD"},gb,hb),ee=s.useRef(null),[Te,He]=s.useState(!1),[Be,Ve]=s.useState([]),[rt,Ze]=s.useState(0),_e=s.useCallback((at,st)=>{g&&(Ve(at),Ze(st),He(!0))},[g]),qe=s.useCallback(()=>{He(!1)},[]),Oe=s.useMemo(()=>{const at={...A},st=ee.current?getComputedStyle(ee.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(at["--cntrl-article-width"]=st),at},[A,Te]);return s.useEffect(()=>{if(!Te||G!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Te,G]),s.useEffect(()=>{!n||o||i||He(!1)},[n,o,i]),s.useEffect(()=>{G==="off"&&He(!1)},[G]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:A,children:a.jsxs("div",{ref:ee,className:`${l}-wrapper`,style:{width:O.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?L(v):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:[T&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Va,{P:l,title:k,position:f,titleRef:()=>{},titleClassName:`${De} ${l}-single-title`,titleContainerStyle:{...tt,...le},titleTextBoxStyle:dt,titleStyle:Je,showTextBoxOutline:D,topPaddingControl:b?wc({P:l,scaled:L,height:se,paired:!1}):void 0})}),c.map((at,st)=>{const St=vb(at.gallery),Yt=st<c.length-1,Zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),vt={P:l,position:f,titleRef:H(st),titleClassName:De,titleContainerStyle:tt,titleTextBoxStyle:T?{maxWidth:"100%"}:dt,titleStyle:Je,showTextBoxOutline:D&&!T,topPaddingControl:b&&!T?wc({P:l,scaled:L,height:se,paired:V}):void 0};return a.jsxs("div",{"data-item-index":st,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Yt?L(ie):void 0},children:[M&&Sc({P:l,controlKey:"titleLeftPadding",scaled:L,width:ne,maxFraction:xe,side:"left",paired:V,anchorStyle:te}),E&&Sc({P:l,controlKey:"titleRightPadding",scaled:L,width:ve,maxFraction:xe,side:"right",paired:V,anchorStyle:$e}),D&&Yt&&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),...ae}}),W?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const xt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(bc,{P:l,media:wt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:D,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...vt,title:T?"":at.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...vt,title:T?"":at.title}),St.length>0&&a.jsx(Lb,{P:l,layoutType:p,galleryWidthStyle:_,galleryPaddingRight:P,galleryPaddingLeft:q,galleryPaddingRightWidth:F,galleryPaddingLeftWidth:pe,galleryPaddingMaxFraction:ke,showControls:D,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const xt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(bc,{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?()=>_e(Zt,xt):void 0},`${wt.url}-${At}`)})})]})]},st)})]})}),Te&&G==="on"&&typeof document<"u"&&e&&(()=>{const at=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:Oe,"data-selection":"none",children:a.jsx(Rb,{prefix:l,items:Be,index:rt,imageDisplay:Tb(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Ze(st=>(st-1+Be.length)%Be.length),onNext:()=>Ze(st=>(st+1)%Be.length),counterClassName:Ue,counterStyle:je,backgroundColor:e.backgroundColor??ub})}),at)})()]})}const Nb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20967
|
+
`}const pb="rgba(28,31,34,0.9)",An=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",mb=72,gb=50,hb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},fb=[];function yb(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 xb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vb(e){const[t]=e.media;return t!=null&&t.url?t:null}function bb(e){if(!Array.isArray(e)||e.length===0)return[];if(yb(e)){const t=[];for(const n of e){const i=xb(n);if(!i)continue;const o=vb(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 us(e){return e.type==="video"}function wb(e){e.pause(),e.removeAttribute("src"),e.load()}function Sr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Sb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Cb=1140/1440;function $b(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 Tb(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 Ib(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Rb({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()=>{wb(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 Lb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),X=s.useRef(!1),N=s.useRef(null),[U,W]=s.useState(null),[I,B]=s.useState("opening"),[$,T]=s.useState(0),[k,F]=s.useState(0),[g,H]=s.useState(!1),[P,q]=s.useState(!1),[ne,L]=s.useState(!1),O=s.useRef(n),Z=t[n],ue=Z?us(Z):!1,ae=k!==0||g,A=s.useCallback(oe=>{X.current=oe,H(oe)},[]),pe=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),z=s.useCallback(()=>{pe(),N.current=window.setTimeout(()=>{pe(),A(!1)},An+32)},[pe,A]),re=s.useCallback(()=>{const oe=w.current,me=m.current;if(!oe)return;const xe=oe.getBoundingClientRect(),J=xe.width,Q=xe.height;if(!J||!Q)return;if(i==="cover"){W({width:J,height:Q,left:xe.left,top:xe.top});return}if(!me){W(Sr(oe));return}const{width:se,height:we}=Sb(me);if(!se||!we){W(Sr(oe));return}const Ee=se/we,Te=J/Q;if(Ee>Te){const Y=J/Ee;W({width:J,height:Y,left:xe.left,top:xe.top+(Q-Y)/2})}else{const Y=Q*Ee;W({width:Y,height:Q,left:xe.left+(J-Y)/2,top:xe.top})}},[i]);s.useEffect(()=>{re();const oe=w.current;if(!oe)return;const me=new ResizeObserver(()=>re());return me.observe(oe),()=>me.disconnect()},[re,n]),s.useEffect(()=>{I==="opening"&&U&&B("open")},[I,U]),s.useEffect(()=>{if(I!=="closing")return;const oe=setTimeout(()=>r(),An);return()=>clearTimeout(oe)},[I,r]),s.useEffect(()=>()=>{pe()},[pe]),s.useLayoutEffect(()=>{if(O.current===n)return;pe(),T(0),F(0),A(!1),L(!1),q(!1),f.current=0,v.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const oe=w.current;oe&&W(Sr(oe)),O.current=n},[n,A,pe]),s.useEffect(()=>{if(I!=="open")return;let oe=null;const me=()=>{oe&&(document.removeEventListener("click",oe,!0),oe=null)},xe=()=>{me(),oe=Te=>{Te.stopPropagation(),Te.preventDefault(),me()},document.addEventListener("click",oe,!0)},J=Te=>{pe(),X.current=!1,H(!1),F(0),q(!1),y.current=!1,v.current=0,C.current="none";const Y=w.current;Y&&W(Sr(Y)),Te<0?d():l()},Q=Te=>{if(Math.abs(Te)>gb&&t.length>1){J(Te);return}A(!0),F(0),z()},se=Te=>{if(Te.touches.length!==1||X.current)return;const Y=Te.touches[0];S.current=!0,h.current={x:Y.clientX,y:Y.clientY},C.current="none",v.current=0,y.current=!1},we=Te=>{if(!h.current||Te.touches.length!==1||X.current)return;const Y=Te.touches[0],de=Y.clientX-h.current.x,ce=Y.clientY-h.current.y;if(C.current==="none"){if(Math.abs(de)<10&&Math.abs(ce)<10)return;if(Math.abs(de)>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,q(!0),v.current=de,F(de),Te.preventDefault();return}C.current==="vertical"&&(y.current=!0,q(!0),f.current=ce,T(ce),Te.preventDefault())},Ee=()=>{if(!h.current)return;const Te=C.current,Y=y.current;if(Y&&Te==="horizontal")Q(v.current),xe();else if(Y&&Te==="vertical")if(f.current>mb){const ce=window.innerHeight;f.current=ce,L(!0),T(ce),B("closing")}else f.current=0,T(0),xe();else Te==="horizontal"&&Math.abs(v.current)>0&&(Q(v.current),xe());h.current=null,C.current="none",v.current=0,y.current=!1,q(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Ee),document.addEventListener("touchcancel",Ee),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Ee),document.removeEventListener("touchcancel",Ee),me()}},[I,t.length,d,l,A,z,pe]),s.useEffect(()=>{const oe=me=>{me.key==="Escape"&&(me.preventDefault(),me.stopPropagation(),I!=="closing"&&B("closing"))};return window.addEventListener("keydown",oe,!0),()=>window.removeEventListener("keydown",oe,!0)},[I]);const te=()=>{I!=="closing"&&B("closing")},be=I==="open",Ae=I==="closing",ve=$>0?Math.max(0,1-$/500):1,b=$>0?Math.max(.35,1-$/500):1,M=oe=>{if(oe.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const me=oe.currentTarget.getBoundingClientRect(),xe=oe.clientY-me.top,J=Math.min(52,me.height*.2);if(!(xe>me.height-J)){if(oe.clientX-me.left<me.width/2){l();return}d()}},E=oe=>{if(t.length<=1)return;const me=oe.currentTarget.getBoundingClientRect(),xe=oe.clientX-me.left,J=oe.clientY-me.top,Q=Math.min(52,me.height*.2);if(J>me.height-Q){oe.currentTarget.style.cursor="default";return}oe.currentTarget.style.cursor=xe<me.width/2?"w-resize":"e-resize"},j=s.useCallback(oe=>{oe.propertyName!=="transform"||!X.current||(pe(),A(!1))},[pe,A]),Ce=ae?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,ee={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:Ce,opacity:$>0?b:I==="opening"||Ae?0:1,transition:P&&!g?"none":g?`transform ${An}ms ${xi}`:ne?`transform ${An}ms ${xi}, opacity ${An}ms ${xi}`:I==="opening"||Ae?`opacity ${An}ms ${xi}`:"none",pointerEvents:ue&&be&&!ae?"auto":"none",touchAction:ue&&be?"none":void 0,zIndex:9998},Ie=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:I==="open"?"none":void 0},onClick:te,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:be?ve:0,transition:P?"none":`opacity ${An}ms ${xi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?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:be?1:0,transition:`opacity ${An}ms ${xi}`,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:be?1:0,transition:`opacity ${An}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&Z&&(ue?a.jsx(Rb,{src:Z.url,phase:I,mediaRef:m,mediaStyle:ee,onLoadedMetadata:re,onClick:M,onMouseMove:E,onTransitionEnd:j},`${n}-${Z.url}`):a.jsx("img",{ref:m,src:Z.url,alt:Z.name,onLoad:re,onTransitionEnd:j,style:ee},`${n}-${Z.url}`)),be&&Ie&&t.length>1&&!ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ie,left:U.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:oe=>{if(S.current){S.current=!1;return}oe.stopPropagation(),l()}}),a.jsx("div",{style:{...Ie,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:oe=>{if(S.current){S.current=!1;return}oe.stopPropagation(),d()}})]})]})}function bc({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 x=`${e}-gallery-${us(t)?"video":"image"}`,w=r.display==="cover",m=Tb(r),h=I=>D.scalingValue(I,l??!1),f=n??Oi,v=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},C=i?{borderRadius:h(i)}:{},y={...v,...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:x,style:S,onClick:p?I=>{I.stopPropagation(),p()}:void 0},U=Math.max(d,vi),W=us(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:W}):W,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(U)}})]})}function Pb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,w=x>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(x)},"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(x)},"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 Eb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function wc({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 Sc({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 Va({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),[x,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 v=()=>w(f.offsetHeight);v();const C=new ResizeObserver(v);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`]:`${x}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 Cc=45;function $c(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 Mb(e){const t=$c(e,"--cntrl-viewport-height",window.innerHeight),n=$c(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function kb(e,t,n){const{top:i,centerY:o}=Mb(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 Ab(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=kb(u,n,c);return Math.exp(-(p*p)/(2*Cc*Cc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Fb(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(Ab(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 _b(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 Nb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var it;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>ub(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??Oi,w=(e==null?void 0:e.titleWidth)??Cb,m=$b(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??cb,f=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,S=Eb(e==null?void 0:e.transition),X=(e==null?void 0:e.lightbox)??"on",N=p==="b",U=S==="fade"||S==="retype",{setTitleRef:W,dominantIndex:I}=Fb(c.length,U,f),B=((it=c[I])==null?void 0:it.title)??"",$=_b(B,S==="retype"),T=S==="fade"||S==="retype",k=S==="retype"?$:B,F=N?void 0:{width:D.scalingValue(x,n??!1)},g=X==="on"&&(!n||i||o),H=o??!1,P=(e==null?void 0:e.galleryPaddingRight)??0,q=(e==null?void 0:e.galleryPaddingLeft)??0,ne=(e==null?void 0:e.galleryPaddingBetween)??0,L=at=>D.scalingValue(at,n??!1),Z={width:L(w)},ue=p==="a"?P:q,ae=N?{width:"100%"}:{width:`calc(100% - ${L(x)} - ${L(ue)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(P,vi),pe=Math.max(q,vi),z=Math.max(ne,vi),re=Math.max(v,vi),te=Math.max(C,vi),be=Math.max(y,vi),Ae=Math.max(0,(u??1)-(x??Oi)),ve=p==="a"?Math.max(0,(u??1)-(x??Oi)-P):p==="c"?Math.max(0,(u??1)-(x??Oi)-q):p==="b"?u??1:1,b=H&&(p==="a"||p==="b"||p==="c")&&f==="top",M=H&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),E=H&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),j=c.length>1,Ce=N?void 0:L((p==="c"?q:P)+(x??Oi)),ee=p==="c"&&Ce?{left:Ce}:void 0,Ie=p==="a"&&Ce?{right:Ce}:void 0,oe=N?{left:0,width:"100%"}:p==="a"?{right:L(P),width:L(x)}:{left:L(q),width:L(x)},{titleColor:me,titleFontFamily:xe,titleFontSettings:J,titleFontSize:Q,titleLineHeight:se,titleLetterSpacing:we,titleWordSpacing:Ee,titleAlign:Te,titleTextAppearance:Y,lightboxCounterColor:de,lightboxCounterFontFamily:ce,lightboxCounterFontSettings:G,lightboxCounterFontSize:le,lightboxCounterLineHeight:Me,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:K,lightboxCounterTextAppearance:Xe}=e??{},Le={fontSettings:{fontFamily:xe,fontWeight:(J==null?void 0:J.fontWeight)??400,fontStyle:(J==null?void 0:J.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:se,letterSpacing:we??0,wordSpacing:Ee??0,textAlign:Te??"left",textAppearance:Y,color:me??"#000000"},Qe=an(qt(Le,n)),ct=Z,nt=vc(Q,se,l,n),Ve=xc(Q,se,`${l}-title`,`${l}-text-tight-leading`),$e={fontSettings:{fontFamily:ce,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:le??.01,lineHeight:Me,letterSpacing:fe??0,wordSpacing:K??0,textAppearance:Xe,color:de??"#DEDDDD"},Be={...an(qt($e,n)),...vc(le,Me,l,n)},Ue=xc(le,Me,`${l}-lightbox-counter`,`${l}-text-tight-leading`),he=D.buildColorVars(l,{titleColor:me??"#000000",lightboxCounterColor:de??"#DEDDDD"},hb,fb),V=s.useRef(null),[ye,Ne]=s.useState(!1),[ze,We]=s.useState([]),[et,Je]=s.useState(0),_e=s.useCallback((at,dt)=>{g&&(We(at),Je(dt),Ne(!0))},[g]),qe=s.useCallback(()=>{Ne(!1)},[]),De=s.useMemo(()=>{const at={...he},dt=V.current?getComputedStyle(V.current).getPropertyValue("--cntrl-article-width").trim():"";return dt&&(at["--cntrl-article-width"]=dt),at},[he,ye]);return s.useEffect(()=>{if(!ye||X!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[ye,X]),s.useEffect(()=>{!n||o||i||Ne(!1)},[n,o,i]),s.useEffect(()=>{X==="off"&&Ne(!1)},[X]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:he,children:a.jsxs("div",{ref:V,className:`${l}-wrapper`,style:{width:D.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?L(v):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:[T&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Va,{P:l,title:k,position:f,titleRef:()=>{},titleClassName:`${Ve} ${l}-single-title`,titleContainerStyle:{...nt,...ae},titleTextBoxStyle:ct,titleStyle:Qe,showTextBoxOutline:H,topPaddingControl:b?wc({P:l,scaled:L,height:re,paired:!1}):void 0})}),c.map((at,dt)=>{const St=bb(at.gallery),At=dt<c.length-1,Zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),vt={P:l,position:f,titleRef:W(dt),titleClassName:Ve,titleContainerStyle:nt,titleTextBoxStyle:T?{maxWidth:"100%"}:ct,titleStyle:Qe,showTextBoxOutline:H&&!T,topPaddingControl:b&&!T?wc({P:l,scaled:L,height:re,paired:j}):void 0};return a.jsxs("div",{"data-item-index":dt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:At?L(ne):void 0},children:[M&&Sc({P:l,controlKey:"titleLeftPadding",scaled:L,width:te,maxFraction:ve,side:"left",paired:j,anchorStyle:ee}),E&&Sc({P:l,controlKey:"titleRightPadding",scaled:L,width:be,maxFraction:ve,side:"right",paired:j,anchorStyle:Ie}),H&&At&&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(z),...oe}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:zt},Ft)=>{const xt=zt?Zt.findIndex(_t=>_t.url===zt.url):-1;return a.jsx(bc,{P:l,media:wt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Ft<St.length-1,showControls:H,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${Ft}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...vt,title:T?"":at.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...vt,title:T?"":at.title}),St.length>0&&a.jsx(Pb,{P:l,layoutType:p,galleryWidthStyle:F,galleryPaddingRight:P,galleryPaddingLeft:q,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:pe,galleryPaddingMaxFraction:Ae,showControls:H,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:zt},Ft)=>{const xt=zt?Zt.findIndex(_t=>_t.url===zt.url):-1;return a.jsx(bc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Ft<St.length-1,showControls:H,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${Ft}`)})})]})]},dt)})]})}),ye&&X==="on"&&typeof document<"u"&&e&&(()=>{const at=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:De,"data-selection":"none",children:a.jsx(Lb,{prefix:l,items:ze,index:et,imageDisplay:Ib(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Je(dt=>(dt-1+ze.length)%ze.length),onNext:()=>Je(dt=>(dt+1)%ze.length),counterClassName:Ue,counterStyle:Be,backgroundColor:e.backgroundColor??pb})}),at)})()]})}const Wb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20968
20968
|
import { createPortal } from 'react-dom';
|
|
20969
20969
|
import type React from 'react';
|
|
20970
20970
|
import { CommonComponentProps } from '../props';
|
|
@@ -23014,7 +23014,7 @@ export function Mercury({
|
|
|
23014
23014
|
</>
|
|
23015
23015
|
);
|
|
23016
23016
|
}
|
|
23017
|
-
`;function Ni(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},Wb={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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.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"}]},{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-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},galleryPaddingRight:Ni("Gallery Padding Right"),galleryPaddingLeft:Ni("Gallery Padding Left"),galleryPaddingBetween:Ni("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Ni("Title Top Padding"),titleLeftPadding:Ni("Title Left Padding"),titleRightPadding:Ni("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ga.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"}},titleAlign:{...Ga.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Ga.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},Hb={element:_b,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:Wb,sourceCode:Nb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Tc=48,Db=10,Ob=400,Bb=1,zb=1120/1440,jb=140/1440,Vb=550/1440,Gb=13,Xb=4,Yb=38/100,qb=28/100,iu=2.8,Ub=.9,ou=.22,Kb=.5,Zb=1,Jb=1.5,Qb=0,ew=.85;function tw(e,t){return`
|
|
23017
|
+
`;function Ni(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},Hb={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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.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"}]},{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-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},galleryPaddingRight:Ni("Gallery Padding Right"),galleryPaddingLeft:Ni("Gallery Padding Left"),galleryPaddingBetween:Ni("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Ni("Title Top Padding"),titleLeftPadding:Ni("Title Left Padding"),titleRightPadding:Ni("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ga.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"}},titleAlign:{...Ga.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Ga.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},Db={element:Nb,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:Hb,sourceCode:Wb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Tc=48,Ob=10,Bb=400,zb=1,jb=1120/1440,Vb=140/1440,Gb=550/1440,Xb=13,Yb=4,qb=38/100,Ub=28/100,iu=2.8,Kb=.9,ou=.22,Zb=.5,Jb=1,Qb=1.5,ew=0,tw=.85;function nw(e,t){return`
|
|
23018
23018
|
.${e}-wrapper {
|
|
23019
23019
|
position: relative;
|
|
23020
23020
|
box-sizing: border-box;
|
|
@@ -23059,10 +23059,10 @@ export function Mercury({
|
|
|
23059
23059
|
object-position: center;
|
|
23060
23060
|
}
|
|
23061
23061
|
${t}
|
|
23062
|
-
`}function er(e){return Number(e.toFixed(4))}function Ic(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 Xa(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
|
|
23062
|
+
`}function er(e){return Number(e.toFixed(4))}function Ic(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 Xa(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 iw(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 ow(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function rw(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 ru(e,t){return(1-e)/(1-e*Math.cos(t))}function aw(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)*ru(e,i)))}return t||1}function sw(e,t){return e?1:1+ou*(.35+t)}function lw(e,t,n,i){const o=t*sw(n,i);return Math.max(0,(e-o)/2)}function au(e,t,n){const i=ru(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function su(e,t,n){return e/2+t*n}function cw(e,t,n){return e(t-n/2)}function dw(e,t){return e*t}function lu(e){return Math.round(e*1e3)}function cu(e,t,n){const i=Math.cos(e),o=Math.cos(tw*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return er(t+(n-t)*r)}function du(e){return cu(e,Zb,Jb)}function uw(e){return cu(e,Qb,ew)}function uu(e,t){if(!t)return"none";const n=uw(e);return n<=0?"none":`blur(${n}px)`}function pw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=au(i,o,r*Math.PI*2),p=r*Math.PI*2,x=su(t,n,c),w=er(u),m=`calc(${e(x)} - 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: ${lu(u)}; transform: translateY(-50%); opacity: ${du(p)}; filter: ${uu(p,d)};`}function mw(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=Tc;u+=1){const p=u/Tc;c.push(` ${er(p*100)}% { ${pw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
|
|
23063
23063
|
${c.join(`
|
|
23064
23064
|
`)}
|
|
23065
|
-
}`}function pu(e,t){return(e%t+t)%t}function
|
|
23065
|
+
}`}function pu(e,t){return(e%t+t)%t}function gw(e,t){return tl(e,t)/t}function tl(e,t){return pu(e,t)}function hw(e,t){return Math.floor(e/t)}function fw(e,t,n,i){return hw(e,t)*n+tl(e,t)*i}function yw(e,t,n){const i=n==="left"?1-e:e;return`${er(-i*t)}s`}function Rc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function mu(e){const t=e%1;return t<0?t+1:t}function xw(e,t,n){const i=t/iu,o=n==="left"?-e*i:e*i;return mu(o)}function vw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=D.useScopedStyles(),r=s.useRef(null),l=Xa((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),jb),d=Xa(e==null?void 0:e.imageWidth,Vb),c=Xa(e==null?void 0:e.turnHeight,Gb),u=Ic(e==null?void 0:e.itemsPerTurn,Xb,3,40),p=Ic(e==null?void 0:e.turns,Yb,1,30),x=Math.min(Kb,Math.max(0,qb)),w=Math.min(1,Math.max(0,Ub)),m=Math.max(0,(e==null?void 0:e.speed)??iu),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",v=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>iw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",X=ae=>D.scalingValue(ae,n??!1),N=s.useMemo(()=>aw(x),[x]),U=s.useMemo(()=>lw(l,d,S,w),[l,d,S,w]),W=s.useMemo(()=>nw(o,mw(o,X,l,U,x,N,S,C)),[o,l,U,x,N,S,C,n]),I=s.useMemo(()=>(t??[]).filter(ae=>{var A;return!!((A=ae.image)!=null&&A.url)}),[t]),B=c/u,$=d*ow(y),T=Math.min(Bb,p*u),k=zb*u,F=T+k*2,H=Math.max(0,p-1)*c+(u-1)*B,P=m>0,q=f==="scroll"&&P,ne=f==="autoplay"&&P&&(n?!!i:!0),[L,O]=s.useState(0);s.useEffect(()=>{if(!q)return;const ae=r.current;if(!ae)return;const A=()=>{const z=ae.getBoundingClientRect(),re=window.innerHeight||document.documentElement.clientHeight,te=re+z.height;te<=0||O(Math.min(1,Math.max(0,(re-z.top)/te)))};A(),window.addEventListener("scroll",A,{passive:!0}),window.addEventListener("resize",A);const pe=new ResizeObserver(A);return pe.observe(ae),()=>{window.removeEventListener("scroll",A),window.removeEventListener("resize",A),pe.disconnect()}},[q]);const Z=q?xw(L,m,h):0,ue=P&&f==="autoplay"?360/(m*Ob):0;return I.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:W}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:X(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:W}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:X(l),height:X(H),marginInline:"auto"},children:Array.from({length:F},(ae,A)=>{const pe=A-k,re=I[pu(pe,I.length)].image,te=tl(pe,u),be=gw(pe,u),Ae=q?mu(be+Z):be,ve=fw(pe,u,c,B),b=w===0?0:(Rc(te+7.3)-.5)*w*B,M=S?1:1+(Rc(te+3.1)-.5)*2*ou*(.35+w),E=Ae*Math.PI*2,{offset:j,scale:Ce}=au(x,N,E),ee=d*M,Ie=dw(ee,Ce),oe=su(l,U,j),me={"--helix-base-w":X(ee),...S?{"--helix-base-h":X($)}:{}},xe={top:X(ve+b),transform:"translateY(-50%)",...me,...ne?{animationDuration:`${er(ue)}s`,animationDelay:yw(be,ue,h),animationDirection:h==="left"?"reverse":"normal"}:{left:cw(X,oe,Ie),width:X(Ie),...S?{height:X($*Ce)}:{},zIndex:lu(Ce),opacity:du(E),filter:uu(E,C)}},J=v>0?{borderRadius:X(v)}:{},Q=S?{...J,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:J,se=rw(re)?a.jsx("video",{className:`${o}-media`,style:Q,src:re.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:Q,src:re.url,alt:re.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ne?`${o}-item`:`${o}-item ${o}-item-static`,style:xe,children:S?a.jsx("div",{className:`${o}-cover`,style:J,children:se}):se},`${p}-${u}-${pe}`)})})]})}const bw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
23066
23066
|
import { CommonComponentProps } from '../props';
|
|
23067
23067
|
import { scalingValue } from '../utils/scalingValue';
|
|
23068
23068
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23600,7 +23600,7 @@ export function Helix({
|
|
|
23600
23600
|
</>
|
|
23601
23601
|
);
|
|
23602
23602
|
}
|
|
23603
|
-
`,bw=["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"],ww={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:bw.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"]}]}]},Sw={element:xw,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:ww,sourceCode:vw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,jo=120,Lc=3,Cw=.12,Ya=.25,$w=10,Tw=4e3,Iw=.12,Rw=3,Lw=2,gu=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Gr(e){return e<0?0:e>1?1:e}function Pw(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 Ew(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,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}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 wo(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(e,t=jo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Ar(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 ps(e,t){switch(e){case"ellipse":return[qa(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[qa(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[wo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[wo([[0,0],[1,0],[.5,1]])];case"diamond":return[wo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[wo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Ar([qa(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(jo/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=jo,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[wo([[0,0],[1,0],[1,1],[0,1]])]}}const hu={x:0,y:0,width:100,height:100};function Mw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?hu:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Fr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const ms=16,kw=12,Aw=16,Xr="0 0 100 100",Yr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Fw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function _w(e){const t=e.match(Fw);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 gs(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 Nw(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(Nw)}))}function ti(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 Pc(e,t,n,i=n){return ti(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Ww(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),x=Math.sin(u),w=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*w+x*m,f=-x*w+p*m,v=h*h/(d*d)+f*f/(c*c);if(v>1){const ie=Math.sqrt(v);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),G=y===0?0:C*Math.sqrt(S/y),W=G*d*f/c,U=-G*c*h/d,H=p*W-x*U+(e.x+l.x)/2,I=x*W+p*U+(e.y+l.y)/2,z=Math.atan2((f-U)/c,(h-W)/d);let T=Math.atan2((-f-U)/c,(-h-W)/d)-z;!r&&T>0&&(T-=Math.PI*2),r&&T<0&&(T+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2))),_=T/k,g=4/3*Math.tan(_/4),D=(ie,L)=>({x:H+p*d*ie-x*c*L,y:I+x*d*ie+p*c*L}),P=[];let q=z;for(let ie=0;ie<k;ie+=1){const L=q+_,B=Math.cos(q),K=Math.sin(q),ue=Math.cos(L),le=Math.sin(L);P.push({c1:D(B-g*K,K+g*B),c2:D(ue+g*le,le-g*ue),p:ie===k-1?on(l):D(ue,le)}),q=L}return P}function Vo(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},x=m=>{i.length&&(i[i.length-1].out=m)};Ua.lastIndex=0;let w=Ua.exec(t);for(;w!==null;){const m=w[1],h=m.toUpperCase(),f=m!==h,v=_w(w[2]),C=y=>f?{x:r.x+v[y],y:r.y+v[y+1]}:{x:v[y],y:v[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<v.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<v.length;y+=2)p(C(y));d=null,c=null}else if(h==="H"){for(const y of v)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of v)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<v.length;y+=6){const S=C(y),G=C(y+2),W=C(y+4);x(S),p(W,G),d=G}c=null}else if(h==="S"){for(let y=0;y+3<v.length;y+=4){const S=d?gs(d,r):on(r),G=C(y),W=C(y+2);x(S),p(W,G),d=G}c=null}else if(h==="Q")for(let y=0;y+3<v.length;y+=4){const S=C(y),G=C(y+2);x(gn(r,S,2/3)),p(G,gn(G,S,2/3)),c=S,d=null}else if(h==="T")for(let y=0;y+1<v.length;y+=2){const S=c?gs(c,r):on(r),G=C(y);x(gn(r,S,2/3)),p(G,gn(G,S,2/3)),c=S,d=null}else if(h==="A")for(let y=0;y+6<v.length;y+=7){const S=f?{x:r.x+v[y+5],y:r.y+v[y+6]}:{x:v[y+5],y:v[y+6]};for(const G of Ww(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,S))x(G.c1),p(G.p,G.c2);d=null,c=null}w=Ua.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function tr(e,t){return!e.out&&!t.in}function Ec(e,t){if(tr(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 Go(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(Ec(r,l)),r=l;if(n.closed){const l=Ec(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fu(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 hs(e,t,n){if(tr(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 nl(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fu(n)){if(tr(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ms;r+=1)i.push(hs(o.from,o.to,r/ms))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Jn(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of nl(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 Hw(e){const t=Jn(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function yu(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 xu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=kw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Aw)),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),...yu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Dw(e){const t={x:0,y:0,width:Yr,height:Yr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Xr||!e.customPath)return t;const n=Vo(e.customPath);if(!n.length)return t;const i=Jn(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 vu(e,t,n=1){if(!e.length)return!1;const i=Jn(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 Ow(e,t){if(!e.length)return e;const n=Jn(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 ti(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Bw(e,t=1,n){const i=Dw(n),o=ps(e==="custom"?"rectangle":e,t),r=Ow(ti(xu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:Go(r),pathFit:"viewbox",pathViewBox:Xr}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function zw(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 Mc(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 jw(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=bu(i,r,d)}),i}function Vw(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]=gs(o,c.p)}return d}function Gw(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 Xw(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(tr(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,x=l.in??l.p,w=gn(r.p,p,i),m=gn(p,x,i),h=gn(x,l.p,i),f=gn(w,m,i),v=gn(m,h,i),C=gn(f,v,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:v}),{contours:d,nodeIndex:u}}function bu(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 kc(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=yu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Yw(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 qw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fu(i)){const l=tr(r.from,r.to)?1:ms;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Yw(t,hs(r.from,r.to,c),hs(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 Uw(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Ac(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Fc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}const _c=Math.PI/4,Kw=8,Zw=Math.PI/18,Jw=8,zi=24,ji=[];function Qw(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function eS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function fs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function tS(e,t){const n=fs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function ys(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Nc(e,t,n,i,o){if(e.axis===null)return tS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ys(o(r)[t],t,i)}function nS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Nc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Nc(n,"y",l,i,o)),r}function iS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return fs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return fs(i(p),r)}function oS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:ji};const w=Math.atan2(p,u),m=Math.round(w/_c)*_c;let h=o?m:null,f=!1;if(!o){const U=[];n&&U.push({angle:Math.atan2(n.y,n.x),smooth:!0}),U.push({angle:m,smooth:!1});for(const H of U){const I=eS(H.angle-w);if(!(Math.abs(I)>Zw)&&!(Math.abs(Math.sin(I))*x>Kw)){h=H.angle,f=H.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Jw;if(h===null&&!v)return{point:e,guides:ji};const C=h??w,y=v?i:x,S={x:Math.cos(C),y:Math.sin(C)},G=y+(h===null?0:zi),W=v?y:f?zi:0;return{point:l({x:d.x+S.x*y,y:d.y+S.y*y}),guides:[{kind:"angle",a:{x:d.x-S.x*W,y:d.y-S.y*W},b:{x:d.x+S.x*G,y:d.y+S.y*G}}]}}function Wc(e,t="stretch",n=hu){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Vo(i),d=nl(l);if(d.length)return t==="viewbox"?Fr(d,n):Ar(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d",x),u.appendChild(w);let m=0;try{m=w.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<jo;f+=1){const v=w.getPointAtLength(f/jo*m);h.push({x:v.x,y:v.y})}p.push(h)}return p.length?t==="viewbox"?Fr(p,n):Ar(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"?Fr([r],n):Ar([r])}function rS(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=Gr(n[o]),l=Gr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return aS(i)}function aS(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 sS(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 lS(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 cS(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 dS(e,t,n,i){let o=null;for(let r=0;r<Lc;r+=1){const l=Gr(t+(n-t)*r/Math.max(1,Lc-1)),d=rS(e,l),c=i==="avoid"?lS(d):d;if(o=o===null?c:sS(o,c),o.length===0)return[]}return o??[]}function wu(e){return!!e&&typeof e=="object"&&e.type==="link"}function uS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(wu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Hc(e){return{...e.fontFamily&&{fontFamily:po(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 pS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(wu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Dc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=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),v=w*Cw;let C=0,y=0,S=0,G=t[0].para,W=0,U=0,H=null;for(;C<t.length&&S<Tw;){const I=y+w>c;if(I&&!u)break;const z=t[C].para;if(z>G+1){y+=w*(z-G-1),G=z-1,S+=1;continue}let $=I?[{x0:0,x1:d}]:dS(i,(y+v)/c,(y+w-v)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&x>0&&!I&&$.length&&(H===null&&(H=S,W=$[0].x0,U=y),S-H<x&&($=cS($,{x0:W,x1:W+p})));const T=$.reduce((k,_)=>Math.max(k,_.x1-_.x0),0);for(const k of $){const _=k.x1-k.x0;if(_<f)continue;if(C>=t.length||t[C].para!==z)break;const g=C;let D=0;for(;C<t.length&&t[C].para===z;){const P=n[C]*l,q=C===g?P:m+P;if(D+q>_&&!(C===g&&_>=T-.5&&P>d-.5))break;D+=q,C+=1}if(C>g){const P=C>=t.length||t[C].para!==z;h.push({top:y,left:k.x0,width:_,from:g,to:C,justify:r==="justify"&&!P})}if(C>=t.length||t[C].para!==z)break}G=z,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:W,capTop:U}}function mS(e){return`
|
|
23603
|
+
`,ww=["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"],Sw={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:ww.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"]}]}]},Cw={element:vw,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:Sw,sourceCode:bw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,jo=120,Lc=3,$w=.12,Ya=.25,Tw=10,Iw=4e3,Rw=.12,Lw=3,Pw=2,gu=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Gr(e){return e<0?0:e>1?1:e}function Ew(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 Mw(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,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}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 wo(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(e,t=jo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Ar(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 ps(e,t){switch(e){case"ellipse":return[qa(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[qa(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[wo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[wo([[0,0],[1,0],[.5,1]])];case"diamond":return[wo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[wo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Ar([qa(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(jo/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=jo,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[wo([[0,0],[1,0],[1,1],[0,1]])]}}const hu={x:0,y:0,width:100,height:100};function kw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?hu:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Fr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const ms=16,Aw=12,Fw=16,Xr="0 0 100 100",Yr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,_w=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Nw(e){const t=e.match(_w);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 gs(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 Ww(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(Ww)}))}function ti(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 Pc(e,t,n,i=n){return ti(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Hw(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),x=Math.sin(u),w=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*w+x*m,f=-x*w+p*m,v=h*h/(d*d)+f*f/(c*c);if(v>1){const ne=Math.sqrt(v);d*=ne,c*=ne}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),X=y===0?0:C*Math.sqrt(S/y),N=X*d*f/c,U=-X*c*h/d,W=p*N-x*U+(e.x+l.x)/2,I=x*N+p*U+(e.y+l.y)/2,B=Math.atan2((f-U)/c,(h-N)/d);let T=Math.atan2((-f-U)/c,(-h-N)/d)-B;!r&&T>0&&(T-=Math.PI*2),r&&T<0&&(T+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2))),F=T/k,g=4/3*Math.tan(F/4),H=(ne,L)=>({x:W+p*d*ne-x*c*L,y:I+x*d*ne+p*c*L}),P=[];let q=B;for(let ne=0;ne<k;ne+=1){const L=q+F,O=Math.cos(q),Z=Math.sin(q),ue=Math.cos(L),ae=Math.sin(L);P.push({c1:H(O-g*Z,Z+g*O),c2:H(ue+g*ae,ae-g*ue),p:ne===k-1?on(l):H(ue,ae)}),q=L}return P}function Vo(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},x=m=>{i.length&&(i[i.length-1].out=m)};Ua.lastIndex=0;let w=Ua.exec(t);for(;w!==null;){const m=w[1],h=m.toUpperCase(),f=m!==h,v=Nw(w[2]),C=y=>f?{x:r.x+v[y],y:r.y+v[y+1]}:{x:v[y],y:v[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<v.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<v.length;y+=2)p(C(y));d=null,c=null}else if(h==="H"){for(const y of v)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of v)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<v.length;y+=6){const S=C(y),X=C(y+2),N=C(y+4);x(S),p(N,X),d=X}c=null}else if(h==="S"){for(let y=0;y+3<v.length;y+=4){const S=d?gs(d,r):on(r),X=C(y),N=C(y+2);x(S),p(N,X),d=X}c=null}else if(h==="Q")for(let y=0;y+3<v.length;y+=4){const S=C(y),X=C(y+2);x(gn(r,S,2/3)),p(X,gn(X,S,2/3)),c=S,d=null}else if(h==="T")for(let y=0;y+1<v.length;y+=2){const S=c?gs(c,r):on(r),X=C(y);x(gn(r,S,2/3)),p(X,gn(X,S,2/3)),c=S,d=null}else if(h==="A")for(let y=0;y+6<v.length;y+=7){const S=f?{x:r.x+v[y+5],y:r.y+v[y+6]}:{x:v[y+5],y:v[y+6]};for(const X of Hw(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,S))x(X.c1),p(X.p,X.c2);d=null,c=null}w=Ua.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function tr(e,t){return!e.out&&!t.in}function Ec(e,t){if(tr(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 Go(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(Ec(r,l)),r=l;if(n.closed){const l=Ec(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fu(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 hs(e,t,n){if(tr(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 nl(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fu(n)){if(tr(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ms;r+=1)i.push(hs(o.from,o.to,r/ms))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Jn(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of nl(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 Dw(e){const t=Jn(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function yu(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 xu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Aw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Fw)),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),...yu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Ow(e){const t={x:0,y:0,width:Yr,height:Yr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Xr||!e.customPath)return t;const n=Vo(e.customPath);if(!n.length)return t;const i=Jn(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 vu(e,t,n=1){if(!e.length)return!1;const i=Jn(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 Bw(e,t){if(!e.length)return e;const n=Jn(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 ti(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function bu(e,t=1,n){const i=Ow(n),o=ps(e==="custom"?"rectangle":e,t),r=Bw(ti(xu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:Go(r),pathFit:"viewbox",pathViewBox:Xr}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function zw(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 Mc(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 jw(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=wu(i,r,d)}),i}function Vw(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]=gs(o,c.p)}return d}function Gw(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 Xw(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(tr(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,x=l.in??l.p,w=gn(r.p,p,i),m=gn(p,x,i),h=gn(x,l.p,i),f=gn(w,m,i),v=gn(m,h,i),C=gn(f,v,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:v}),{contours:d,nodeIndex:u}}function wu(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 kc(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=yu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Yw(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 qw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fu(i)){const l=tr(r.from,r.to)?1:ms;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Yw(t,hs(r.from,r.to,c),hs(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 Uw(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Ac(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Fc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}const _c=Math.PI/4,Kw=8,Zw=Math.PI/18,Jw=8,zi=24,ji=[];function Qw(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function eS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function fs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function tS(e,t){const n=fs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function ys(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Nc(e,t,n,i,o){if(e.axis===null)return tS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ys(o(r)[t],t,i)}function nS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Nc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Nc(n,"y",l,i,o)),r}function iS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return fs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return fs(i(p),r)}function oS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:ji};const w=Math.atan2(p,u),m=Math.round(w/_c)*_c;let h=o?m:null,f=!1;if(!o){const U=[];n&&U.push({angle:Math.atan2(n.y,n.x),smooth:!0}),U.push({angle:m,smooth:!1});for(const W of U){const I=eS(W.angle-w);if(!(Math.abs(I)>Zw)&&!(Math.abs(Math.sin(I))*x>Kw)){h=W.angle,f=W.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Jw;if(h===null&&!v)return{point:e,guides:ji};const C=h??w,y=v?i:x,S={x:Math.cos(C),y:Math.sin(C)},X=y+(h===null?0:zi),N=v?y:f?zi:0;return{point:l({x:d.x+S.x*y,y:d.y+S.y*y}),guides:[{kind:"angle",a:{x:d.x-S.x*N,y:d.y-S.y*N},b:{x:d.x+S.x*X,y:d.y+S.y*X}}]}}function Wc(e,t="stretch",n=hu){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Vo(i),d=nl(l);if(d.length)return t==="viewbox"?Fr(d,n):Ar(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d",x),u.appendChild(w);let m=0;try{m=w.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<jo;f+=1){const v=w.getPointAtLength(f/jo*m);h.push({x:v.x,y:v.y})}p.push(h)}return p.length?t==="viewbox"?Fr(p,n):Ar(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"?Fr([r],n):Ar([r])}function rS(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=Gr(n[o]),l=Gr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return aS(i)}function aS(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 sS(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 lS(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 cS(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 dS(e,t,n,i){let o=null;for(let r=0;r<Lc;r+=1){const l=Gr(t+(n-t)*r/Math.max(1,Lc-1)),d=rS(e,l),c=i==="avoid"?lS(d):d;if(o=o===null?c:sS(o,c),o.length===0)return[]}return o??[]}function Su(e){return!!e&&typeof e=="object"&&e.type==="link"}function uS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Su(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Hc(e){return{...e.fontFamily&&{fontFamily:po(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 pS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Su(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Dc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=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),v=w*$w;let C=0,y=0,S=0,X=t[0].para,N=0,U=0,W=null;for(;C<t.length&&S<Iw;){const I=y+w>c;if(I&&!u)break;const B=t[C].para;if(B>X+1){y+=w*(B-X-1),X=B-1,S+=1;continue}let $=I?[{x0:0,x1:d}]:dS(i,(y+v)/c,(y+w-v)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&x>0&&!I&&$.length&&(W===null&&(W=S,N=$[0].x0,U=y),S-W<x&&($=cS($,{x0:N,x1:N+p})));const T=$.reduce((k,F)=>Math.max(k,F.x1-F.x0),0);for(const k of $){const F=k.x1-k.x0;if(F<f)continue;if(C>=t.length||t[C].para!==B)break;const g=C;let H=0;for(;C<t.length&&t[C].para===B;){const P=n[C]*l,q=C===g?P:m+P;if(H+q>F&&!(C===g&&F>=T-.5&&P>d-.5))break;H+=q,C+=1}if(C>g){const P=C>=t.length||t[C].para!==B;h.push({top:y,left:k.x0,width:F,from:g,to:C,justify:r==="justify"&&!P})}if(C>=t.length||t[C].para!==B)break}X=B,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:N,capTop:U}}function mS(e){return`
|
|
23604
23604
|
.${e}-wrapper {
|
|
23605
23605
|
box-sizing: border-box;
|
|
23606
23606
|
display: flex;
|
|
@@ -23829,7 +23829,7 @@ export function Helix({
|
|
|
23829
23829
|
clip-path: inset(50%);
|
|
23830
23830
|
white-space: nowrap;
|
|
23831
23831
|
}
|
|
23832
|
-
`}const So=7,gS=3.5,Co=9,Qn=8,ei=14,Oc=10,hS=24,Tr=14,fS=4,yS=1,xS=.05,qr=1.08;function Ur(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 Su(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function xs(e,t){const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Oc,y:n.y+o*Oc}}const vs=.1,bs=8,vS=4;function ws(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=ws(e,t)*n;return{width:t.width*i,height:t.height*i}}function Ln(e,t,n){return(e-t)*n}function Vi(e,t,n){const i=e-t;return Math.abs(i)<vS?.5:Gr(n/i)}function Bc(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=ws(e,n),p=ws(t,n),x=Math.min(bs,Math.max(vs,p>0?r*(u/p):r)),w=Si(t,n,x);return{focalX:Vi(t.width,w.width,d-t.x),focalY:Vi(t.height,w.height,c-t.y),scale:x}}function bS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,stage:l,onStageChange:d,onSelectionChange:c,onChange:u,onCommit:p}){const x=s.useRef(null),w=s.useRef(null),m=s.useRef(i);m.current=i;const h=s.useRef(null),f=s.useRef(null),v=s.useRef(null),C=s.useRef(null),[y,S]=s.useState([]),[G,W]=s.useState(ji),U=s.useCallback(b=>{W(M=>Qw(M,b)?M:b)},[]),H=l==="shape";s.useEffect(()=>{var b;H&&((b=x.current)==null||b.focus({preventScroll:!0}))},[H]),s.useEffect(()=>{H||S(b=>b.length?[]:b)},[H]);const I=y.length>0;s.useEffect(()=>{c==null||c(I)},[I,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const z=n.width>0?t.width/n.width:1,$=n.height>0?t.height/n.height:1,T=s.useCallback(b=>r?{x:(b.x-n.x)*z,y:(b.y-n.y)*$}:{x:b.x-n.x,y:b.y-n.y},[r,n,z,$]),k=s.useCallback(b=>r?{x:n.x+(z>0?b.x/z:0),y:n.y+($>0?b.y/$:0)}:{x:n.x+b.x,y:n.y+b.y},[r,n,z,$]),_=s.useMemo(()=>k({x:t.width/2,y:t.height/2}),[k,t.width,t.height]),g=s.useCallback((b,M)=>{var V;const E=(V=x.current)==null?void 0:V.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:r?{x:n.x+(b-E.left)/E.width*n.width,y:n.y+(M-E.top)/E.height*n.height}:{x:n.x+(b-E.left),y:n.y+(M-E.top)}},[r,n]),D=s.useCallback((b,M)=>{var V;const E=(V=x.current)==null?void 0:V.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(b-E.left)/E.width*t.width,y:(M-E.top)/E.height*t.height}},[t.width,t.height]),P=s.useCallback((b,M)=>{p(b,M)},[p]),q=b=>{var Se;const M=b.metaKey||b.ctrlKey,E=v.current;if(E&&b.pointerId===E.pointerId){if(b.stopPropagation(),b.preventDefault(),E.startDistance<=0)return;const X=g(b.clientX,b.clientY),me=Math.hypot(X.x-E.origin.x,X.y-E.origin.y),re=Math.max(xS,me/E.startDistance);if(!E.moved&&Math.abs(re-1)<1e-4)return;E.moved=!0,u(Pc(E.startContours,E.origin,re));return}const V=f.current;if(V&&b.pointerId===V.pointerId){b.stopPropagation(),b.preventDefault();const X=g(b.clientX,b.clientY),{bbox:me}=V,re=me.maxX-me.minX,Y=me.maxY-me.minY,ce=X.x-V.origin.x,Ee=X.y-V.origin.y;let he=ce,Q=Ee;if(isFinite(re)&&isFinite(Y))if(r){const Fe=Math.min(n.x,n.x+n.width-re),et=Math.max(n.x,n.x+n.width-re),Je=Math.min(n.y,n.y+n.height-Y),dt=Math.max(n.y,n.y+n.height-Y),tt=Math.min(et,Math.max(Fe,me.minX+ce)),De=Math.min(dt,Math.max(Je,me.minY+Ee));he=tt-me.minX,Q=De-me.minY}else{const Fe=me.minX-n.x,et=me.minY-n.y,Je=Math.min(0,t.width-re),dt=Math.max(0,t.width-re),tt=Math.min(0,t.height-Y),De=Math.max(0,t.height-Y),Ie=Math.min(dt,Math.max(Je,Fe+ce)),We=Math.min(De,Math.max(tt,et+Ee));he=Ie-Fe,Q=We-et}const Ne=[];if(!M&&isFinite(re)&&isFinite(Y)){const Fe=T({x:me.minX+re/2+he,y:me.minY+Y/2+Q}),et={x:t.width/2,y:t.height/2};Math.abs(Fe.x-et.x)<=Tr&&(he=_.x-me.minX-re/2,Ne.push(ys(et.x,"x",t))),Math.abs(Fe.y-et.y)<=Tr&&(Q=_.y-me.minY-Y/2,Ne.push(ys(et.y,"y",t)))}if(!V.moved&&he===0&&Q===0)return;V.moved=!0,U(Ne.length?Ne:ji),u(ti(V.startContours,Fe=>({x:Fe.x+he,y:Fe.y+Q})),{carryImage:!0});return}const Ce=C.current;if(Ce&&b.pointerId===Ce.pointerId){b.stopPropagation(),b.preventDefault();const X=g(b.clientX,b.clientY);let me=X.x-Ce.origin.x,re=X.y-Ce.origin.y;if(b.shiftKey&&(Math.abs(me)>Math.abs(re)?re=0:me=0),!Ce.moved&&me===0&&re===0)return;Ce.moved=!0,u(Mc(Ce.startContours,Ce.selection,me,re));return}const te=h.current;if(!te||b.pointerId!==te.pointerId)return;b.stopPropagation(),b.preventDefault();const $e=g(b.clientX,b.clientY);if(te.kind==="anchor"){const X={x:te.anchor.x+($e.x-te.origin.x),y:te.anchor.y+($e.y-te.origin.y)},me=M?[]:Uw(m.current,{contour:te.contour,node:te.node}),re=M||!te.center?[]:[te.center],Y=Fc(Ac(me,re.map(he=>he.x),"x"),X,"x",T,Tr),ce=Fc(Ac(me,re.map(he=>he.y),"y"),X,"y",T,Tr),Ee=M?X:{x:(Y==null?void 0:Y.value)??$r(X.x,o),y:(ce==null?void 0:ce.value)??$r(X.y,o)};if(b.shiftKey&&(Math.abs(Ee.x-te.anchor.x)>Math.abs(Ee.y-te.anchor.y)?Ee.y=te.anchor.y:Ee.x=te.anchor.x),!te.moved&&Ee.x===te.anchor.x&&Ee.y===te.anchor.y)return;te.moved=!0,U(nS(Ee,Y,ce,t,T)),u(zw(m.current,te.contour,te.node,Ee));return}const ae=(Se=m.current[te.contour])==null?void 0:Se.nodes[te.node],ge=te.mirror&&!b.altKey,ye=ge||M?null:te.kind==="in"?ae==null?void 0:ae.out:ae==null?void 0:ae.in,Z=ae?T(ae.p):null,J=ye?T(ye):null,de=ae&&(!M||b.shiftKey)?oS($e,ae.p,ge||M?null:iS(m.current[te.contour],te.node,te.kind,T),Z&&J?Math.hypot(J.x-Z.x,J.y-Z.y):null,b.shiftKey,T,k):{point:$e,guides:ji},be=de.guides.length?de.point:M?$e:{x:$r($e.x,o),y:$r($e.y,o)},Pe=te.kind==="in"?ae==null?void 0:ae.in:ae==null?void 0:ae.out;!te.moved&&Pe&&be.x===Pe.x&&be.y===Pe.y||(te.moved=!0,U(de.guides),u(Vw(m.current,te.contour,te.node,te.kind,be,ge)))},ie=b=>{U(ji);const M=v.current;if(M&&b.pointerId===M.pointerId){v.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(M.pointerId)&&ye.releasePointerCapture(M.pointerId),M.moved&&P(m.current,{preserveShape:!0});return}const E=f.current;if(E&&b.pointerId===E.pointerId){f.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(E.pointerId)&&ye.releasePointerCapture(E.pointerId),E.moved?P(m.current,{preserveShape:!0}):S([]);return}const V=C.current;if(V&&b.pointerId===V.pointerId){C.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(V.pointerId)&&ye.releasePointerCapture(V.pointerId),V.moved&&P(m.current);return}const Ce=h.current;if(!Ce||b.pointerId!==Ce.pointerId)return;h.current=null,b.stopPropagation();const te=x.current;te!=null&&te.hasPointerCapture(Ce.pointerId)&&te.releasePointerCapture(Ce.pointerId);const $e=Math.hypot(b.clientX-Ce.clientOrigin.x,b.clientY-Ce.clientOrigin.y);if(Ce.moved||$e>fS){Ce.moved&&P(m.current);return}if(!Ce.toggleOnRelease||b.type!=="pointerup")return;const ge=kc(m.current,Ce.contour,Ce.node);ge!==m.current&&(u(ge),P(ge))},L=b=>{b.stopPropagation()},B=b=>{var M,E;b.stopPropagation(),b.preventDefault(),(M=x.current)==null||M.focus({preventScroll:!0}),f.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),bbox:Jn(i),moved:!1},(E=x.current)==null||E.setPointerCapture(b.pointerId)},K=(b,M)=>{var $e,ae;b.stopPropagation(),b.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0}),S([]),d("shape");const E=Jn(i),V=Ur(E,Su(M)),Ce=xs(E,M),te=Math.hypot(Ce.x-V.x,Ce.y-V.y);!isFinite(te)||te<=0||(v.current={pointerId:b.pointerId,corner:M,origin:V,startDistance:te,startContours:Pn(i),moved:!1},(ae=x.current)==null||ae.setPointerCapture(b.pointerId))},ue=(b,M,E,V)=>{var $e,ae,ge,ye;b.stopPropagation(),b.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0});const Ce=(ae=i[E])==null?void 0:ae.nodes[V];if(!Ce)return;if(b.altKey){const Z=M==="anchor"?bu(i,E,V):Gw(i,E,V,M);if(Z===i)return;S(M==="anchor"?[]:[{contour:E,node:V}]),u(Z),P(Z);return}const te=b.metaKey||b.ctrlKey;if(M==="anchor"&&b.shiftKey&&!te){S(Z=>Z.some(J=>J.contour===E&&J.node===V)?Z.filter(J=>!(J.contour===E&&J.node===V)):[...Z,{contour:E,node:V}]);return}if(M==="anchor"&&!te&&y.length>1&&y.some(Z=>Z.contour===E&&Z.node===V)){C.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(ge=x.current)==null||ge.setPointerCapture(b.pointerId);return}S([{contour:E,node:V}]),h.current={kind:M,contour:E,node:V,pointerId:b.pointerId,origin:g(b.clientX,b.clientY),clientOrigin:{x:b.clientX,y:b.clientY},anchor:Ce.p,center:Hw(i),mirror:M!=="anchor"&&!!(Ce.in&&Ce.out),toggleOnRelease:te,moved:!1},(ye=x.current)==null||ye.setPointerCapture(b.pointerId)},le=b=>{b.stopPropagation(),b.preventDefault();const M=ti(i,T),E=qw(M,D(b.clientX,b.clientY));if(!E||E.distance>hS)return;const{contours:V,nodeIndex:Ce}=Xw(i,E.contour,E.segment,E.t);Ce<0||(S([{contour:E.contour,node:Ce}]),u(V),P(V))},F=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const te=Jn(i);if(!isFinite(te.minX)||!isFinite(te.maxX))return;const $e={x:(te.minX+te.maxX)/2,y:(te.minY+te.maxY)/2},ge=b.key==="="||b.key==="+"?qr:1/qr,ye=Pc(i,$e,ge);u(ye),P(ye,{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=jw(i,y);if(te===i)return;S([]),u(te),P(te);return}const M=o>0?o:yS,E=b.shiftKey?M*10:M,V={ArrowLeft:[-E,0],ArrowRight:[E,0],ArrowUp:[0,-E],ArrowDown:[0,E]}[b.key];if(!V)return;b.preventDefault(),b.stopPropagation();const Ce=Mc(i,y,V[0],V[1]);u(Ce),P(Ce)},pe=s.useMemo(()=>Go(ti(i,T)),[i,T]),j=s.useMemo(()=>Jn(i),[i]),se=T({x:j.minX,y:j.minY}),ne={width:T({x:j.maxX,y:j.minY}).x-se.x,height:T({x:j.minX,y:j.maxY}).y-se.y},ve=H&&y.length===0&&isFinite(j.minX)&&isFinite(j.maxX)&&j.maxX>j.minX&&j.maxY>j.minY,ke=y.length>0||H,xe=ke;return a.jsxs("svg",{ref:x,className:`${e}-editor${ke?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:F,onPointerDown:()=>{var b;return(b=x.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:q,onPointerUp:ie,onPointerCancel:ie,onLostPointerCapture:ie,onContextMenu:b=>{b.preventDefault()},"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:le}),xe&&a.jsx("path",{className:`${e}-editor-hit`,d:pe,onClick:le}),xe&&a.jsx("path",{className:`${e}-editor-outline`,d:pe}),xe&&G.map((b,M)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${b.kind}`,x1:b.a.x,y1:b.a.y,x2:b.b.x,y2:b.b.y},`${b.kind}-${M}`)),a.jsx("path",{ref:w,className:`${e}-editor-body`,d:pe,fillRule:"evenodd",onPointerDown:B,onClick:le}),xe&&i.map((b,M)=>b.nodes.map((E,V)=>{const Ce=y.some($e=>$e.contour===M&&$e.node===V),te=T(E.p);return a.jsxs("g",{children:[Ce&&y.length===1&&["in","out"].map($e=>{const ae=E[$e];if(!ae)return null;const ge=T(ae);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:te.x,y1:te.y,x2:ge.x,y2:ge.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ge.x,cy:ge.y,r:gS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ge.x,cy:ge.y,r:Co,onPointerDown:ye=>ue(ye,$e,M,V),onClick:L})]},$e)}),a.jsx("rect",{className:`${e}-editor-anchor${Ce?` ${e}-editor-anchor-selected`:""}`,x:te.x-So/2,y:te.y-So/2,width:So,height:So,rx:E.in||E.out?So/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:te.x-Co,y:te.y-Co,width:Co*2,height:Co*2,onPointerDown:$e=>ue($e,"anchor",M,V),onClick:L,onDoubleClick:$e=>{$e.stopPropagation(),$e.preventDefault();const ae=kc(i,M,V);u(ae),P(ae)}})]},`${M}-${V}`)})),ve&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:se.x,y:se.y,width:ne.width,height:ne.height}),["nw","ne","se","sw"].map(b=>{const M=T(xs(j,b)),E=b==="ne"||b==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:M.x-Qn/2,y:M.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:M.x-ei/2,y:M.y-ei/2,width:ei,height:ei,onPointerDown:V=>K(V,b),onClick:L})]},b)})]})]})}function wS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:w}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),v=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 _;y&&((_=m.current)==null||_.focus({preventScroll:!0}))},[y]);const S=s.useCallback((_,g)=>{var P;const D=(P=m.current)==null?void 0:P.getBoundingClientRect();return!D||D.width<=0||D.height<=0?{x:0,y:0}:{x:(_-D.left)/D.width*t.width,y:(g-D.top)/D.height*t.height}},[t.width,t.height]),G=_=>{var D,P;if(!i)return;_.stopPropagation(),_.preventDefault(),(D=m.current)==null||D.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:_.pointerId,origin:S(_.clientX,_.clientY),startX:Ln(n.width,g.width,c),startY:Ln(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(P=m.current)==null||P.setPointerCapture(_.pointerId)},W=(_,g)=>{var ue,le;if(!i)return;_.stopPropagation(),_.preventDefault(),(ue=m.current)==null||ue.focus({preventScroll:!0});const D=Si(n,i,p),P=Ln(n.width,D.width,c),q=Ln(n.height,D.height,u),ie={minX:P,minY:q,maxX:P+D.width,maxY:q+D.height},L=Ur(ie,Su(g)),B=Ur(ie,g),K=Math.hypot(B.x-L.x,B.y-L.y);!isFinite(K)||K<=0||(v.current={pointerId:_.pointerId,anchor:L,startDistance:K,startScale:p,startX:P,startY:q,moved:!1},(le=m.current)==null||le.setPointerCapture(_.pointerId))},U=_=>{if(!i)return;const g=v.current;if(g&&_.pointerId===g.pointerId){_.stopPropagation(),_.preventDefault();const P=S(_.clientX,_.clientY),q={x:P.x-n.x,y:P.y-n.y},ie=Math.hypot(q.x-g.anchor.x,q.y-g.anchor.y),L=Math.min(bs,Math.max(vs,g.startScale*(ie/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const B=L/g.startScale,K=g.anchor.x+(g.startX-g.anchor.x)*B,ue=g.anchor.y+(g.startY-g.anchor.y)*B,le=Si(n,i,L);x({focalX:Vi(n.width,le.width,K),focalY:Vi(n.height,le.height,ue),scale:L});return}const D=f.current;if(D&&_.pointerId===D.pointerId){_.stopPropagation(),_.preventDefault();const P=S(_.clientX,_.clientY),q=P.x-D.origin.x,ie=P.y-D.origin.y;if(!D.moved&&q===0&&ie===0)return;D.moved=!0,x({focalX:Vi(n.width,D.width,D.startX+q),focalY:Vi(n.height,D.height,D.startY+ie),scale:p})}},H=_=>{var P,q;const g=f.current;if(g&&_.pointerId===g.pointerId){f.current=null,_.stopPropagation(),(P=m.current)!=null&&P.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const D=v.current;D&&_.pointerId===D.pointerId&&(v.current=null,_.stopPropagation(),(q=m.current)!=null&&q.hasPointerCapture(D.pointerId)&&m.current.releasePointerCapture(D.pointerId),D.moved&&w(C.current))},I=_=>{if(_.key==="Escape"){_.stopPropagation(),d("none");return}if(_.key==="="||_.key==="+"||_.key==="-"||_.key==="_"){_.preventDefault(),_.stopPropagation();const g=_.key==="="||_.key==="+",D=Math.min(bs,Math.max(vs,p*(g?qr:1/qr))),P={focalX:c,focalY:u,scale:D};x(P),w(P)}},z=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const _=i??{width:n.width,height:n.height},g=Si(n,_,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]),k=T?{minX:T.x,minY:T.y,maxX:T.x+T.width,maxY:T.y+T.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:I,onPointerMove:U,onPointerUp:H,onPointerCancel:H,onLostPointerCapture:H,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&T&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:T.x,y:T.y,width:T.width,height:T.height,children:[a.jsx("rect",{x:T.x,y:T.y,width:T.width,height:T.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:T.x,y:T.y,width:T.width,height:T.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:T.x,y:T.y,width:T.width,height:T.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:G}),z.map(_=>{const g=xs(k,_),D=_==="ne"||_==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-Qn/2,y:g.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${D?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-ei/2,y:g.y-ei/2,width:ei,height:ei,onPointerDown:P=>W(P,_)})]},_)})]})]})}function SS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function CS(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 $S(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=SS(e);(!r||!CS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function TS(){return typeof document>"u"?null:document.body}function IS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,dropCapLines:w,dropCapSize:m,showGuides:h,typography:f,imageUrl:v,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:G,pathDragActive:W,pathCarryImage:U,onCarryImageConsumed:H,pathEditor:I,imageEditor:z}){var je,Ue;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,k]=s.useState(null),_=s.useRef(null),[g,D]=s.useState({width:0,height:0}),[P,q]=s.useState(null),[ie,L]=s.useState(0),[B,K]=s.useState("none");s.useEffect(()=>{!I&&!z&&K("none")},[I,z]);const[ue,le]=s.useState(null);s.useEffect(()=>{if(!v||typeof Image>"u"){le(null);return}let A=!1;const ee=new Image;return ee.onload=()=>{A||le({width:ee.naturalWidth,height:ee.naturalHeight})},ee.src=v,()=>{A=!0}},[v]);const F=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),pe=s.useMemo(()=>uS(F),[F]),j=s.useMemo(()=>pS(F),[F]),se=w>0?((Ue=(je=pe[0])==null?void 0:je.text)==null?void 0:Ue.charAt(0))??"":"",ne=g.height>0?g.width/g.height:1,ve=(I==null?void 0:I.contours)??null,ke=s.useMemo(()=>{if(ve){const Te=nl(ve);if(Te.length)return Fr(Te,r)}const A=i.trim(),ee=A?Wc(A,o,r):null;return ee&&ee.length?ee:ps(n==="custom"?"rectangle":n,ne)},[ve,n,i,o,r,Math.round(ne*100)/100]),xe=I==null?void 0:I.onConvert,b=(I==null?void 0:I.needsConversion)??!1,M=s.useMemo(()=>{const A=ve??(i.trim()?Vo(i):null);return!!(A&&vu(A,r))},[ve,i,r]),[E,V]=s.useState(null);Cr(()=>{if(!M){E&&V(null);return}!E&&g.width>0&&g.height>0&&V({width:g.width,height:g.height})},[M,g.width,g.height,E]);const Ce=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return ke;const A=E??g,ee=r.width/A.width,Te=r.height/A.height;return ke.map(He=>He.map(Be=>({x:Be.x*ee,y:Be.y*Te})))},[ke,M,E,r.width,r.height,g.width,g.height]),te=s.useMemo(()=>{const A=G.trim(),ee=A?Wc(A,o,r):null;return ee&&ee.length?ee:ps(n==="custom"?"rectangle":n,ne)},[n,G,o,r,Math.round(ne*100)/100]),$e=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return te;const A=E??g,ee=r.width/A.width,Te=r.height/A.height;return te.map(He=>He.map(Be=>({x:Be.x*ee,y:Be.y*Te})))},[te,M,E,r.width,r.height,g.width,g.height]),ae=s.useRef(null);s.useEffect(()=>{if(!(!xe||g.width<=0||g.height<=0)){if(M){if(ae.current===i)return;const A=ve??(i.trim()?Vo(i):null);if(!(A!=null&&A.length))return;const ee=ti(A,Te=>({x:r.x+(Te.x-r.x)/g.width*r.width,y:r.y+(Te.y-r.y)/g.height*r.height}));ae.current=Go(ee),xe(ee);return}!b||!ke.length||xe(ti(xu(ke),A=>({x:A.x*Yr,y:A.y*Yr})))}},[b,M,xe,ke,ve,i,r,g.width,g.height]),Cr(()=>{const A=T;if(!A||typeof ResizeObserver>"u")return;const ee=()=>{const He=A.getBoundingClientRect();D(Be=>Math.abs(Be.width-He.width)<.5&&Math.abs(Be.height-He.height)<.5?Be:{width:He.width,height:He.height})};ee();const Te=new ResizeObserver(ee);return Te.observe(A),()=>Te.disconnect()},[T]),s.useEffect(()=>{const A=typeof document<"u"?document.fonts:void 0;A!=null&&A.ready&&A.ready.then(()=>{L(ee=>ee+1)})},[]),Cr(()=>{const A=_.current;if(!A)return;if(!pe.length){q(null);return}const ee=[],Te=document.createDocumentFragment();for(const st of pe){const St=document.createElement("span");Object.assign(St.style,Hc(st.leaf)),St.textContent=st.text,Te.appendChild(St),ee.push(St)}const He=document.createElement("span");He.textContent=" ",Te.appendChild(He);const Be=document.createElement("span");Be.textContent=se||"H",Be.style.lineHeight="1",Te.appendChild(Be),A.replaceChildren(Te);const Ve=window.getComputedStyle(A),rt=parseFloat(Ve.fontSize)||16,Ze=parseFloat(Ve.lineHeight),_e=Number.isNaN(Ze)?rt*1.2:Ze,qe=Math.max(_e,rt);Be.style.fontSize=`${qe*m}px`;const Oe=ee.map(st=>st.getBoundingClientRect().width),nt=He.getBoundingClientRect().width,at=se?Be.getBoundingClientRect().width:0;A.replaceChildren(),q({widths:Oe,spaceWidth:nt,lineHeight:qe,capWidth:at})},[pe,f,se,w,m,ie,g.width]);const ge=P&&se?P.capWidth+P.lineHeight*Iw:0,ye=Math.max(w,Math.ceil(m)),Z=s.useMemo(()=>{if(!P||!pe.length||g.width<=0||g.height<=0||!u)return 1;const A=He=>Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:He,allowOverflow:!1,capInset:ge*He,capLines:se?ye:0});if(A(1).placed>=pe.length)return 1;if(A(Ya).placed<pe.length)return Ya;let ee=Ya,Te=1;for(let He=0;He<$w;He+=1){const Be=(ee+Te)/2;A(Be).placed>=pe.length?ee=Be:Te=Be}return ee},[P,pe,g.width,g.height,Ce,l,d,u,ge,se,ye]);s.useEffect(()=>{x(Z)},[Z,x]);const J=u?Math.min(p,Z):1,de=s.useMemo(()=>!P||!pe.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:J,allowOverflow:c,capInset:ge*J,capLines:se?ye:0}),[P,pe,g.width,g.height,Ce,l,d,J,c,ge,se,ye]),be=P?P.lineHeight*J:0,Pe=d==="justify"?"left":d,Se=!!(I&&ve&&g.width>0&&g.height>0),X=!!z,me=(Se||X)&&g.width>0&&g.height>0,re=$S(T,me),Y=me&&re?TS():null,ce=s.useRef(!1),Ee=s.useCallback(A=>{ce.current=A},[]);s.useEffect(()=>{if(!Se&&!X)return;const A=ee=>{const Te=T;if(!Te)return;const He=Te.getBoundingClientRect();ee.clientX>=He.left&&ee.clientX<=He.right&&ee.clientY>=He.top&&ee.clientY<=He.bottom&&(ee.preventDefault(),ee.stopPropagation(),K(Ve=>Ve==="shape"&&ce.current?Ve:Ve==="shape"&&X?"image":Se?"shape":"image"))};return document.addEventListener("dblclick",A,!0),()=>document.removeEventListener("dblclick",A,!0)},[Se,X,T]);const he=s.useMemo(()=>v&&g.width>0&&g.height>0?Ew($e,g):null,[v,$e,g.width,g.height]),Q=s.useRef(null),Ne=(()=>{const A=Q.current;return W||U||!z||!ue||!he||!A||G===A.customPath?null:Bc(A.bounds,he,ue,A.focalX,A.focalY,A.scale)})();Cr(()=>{if(W||!z||!ue||!he)return;const A=Q.current,ee=!!(A&&G!==A.customPath);ee&&Ne&&z.onCommit(Ne),ee&&U&&(H==null||H()),Q.current={rings:$e,bounds:he,focalX:(Ne==null?void 0:Ne.focalX)??C,focalY:(Ne==null?void 0:Ne.focalY)??y,scale:(Ne==null?void 0:Ne.scale)??S,customPath:G}},[W,U,G,$e,he,z,ue,C,y,S,Ne,H]);const Fe=s.useMemo(()=>{if(!W||U||!ue||!he)return null;const A=Q.current;return A?Bc(A.bounds,he,ue,A.focalX,A.focalY,A.scale):null},[W,U,ue,he,G,$e]),et=(Fe==null?void 0:Fe.focalX)??(Ne==null?void 0:Ne.focalX)??C,Je=(Fe==null?void 0:Fe.focalY)??(Ne==null?void 0:Ne.focalY)??y,dt=(Fe==null?void 0:Fe.scale)??(Ne==null?void 0:Ne.scale)??S,tt=s.useMemo(()=>v&&g.width>0&&g.height>0?Pw($e,g):"",[v,$e,g.width,g.height]),De=he,Ie=`${$}-clip`,We=s.useMemo(()=>{if(!De)return null;const A=ue??{width:De.width,height:De.height},ee=Si(De,A,dt);return{x:Ln(De.width,ee.width,et),y:Ln(De.height,ee.height,Je),width:ee.width,height:ee.height}},[De,ue,et,Je,dt]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[v&&tt&&De&&We?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:Ie,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:tt,fillRule:"evenodd"})})}),a.jsx("image",{href:v,x:De.x+We.x,y:De.y+We.y,width:We.width,height:We.height,preserveAspectRatio:"none",clipPath:`url(#${Ie})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:J},children:[a.jsx("div",{className:`${e}-measure`,ref:_,style:f,"aria-hidden":!0}),de.segments.map((A,ee)=>{const Te=pe.slice(A.from,A.to),He=ee===0;return a.jsx("div",{className:`${e}-line${A.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${A.top}px`,left:`${A.left}px`,width:`${A.width}px`,textAlign:A.justify?void 0:Pe},children:Te.map((Be,Ve)=>{const Ze=se&&He&&A.from===0&&Ve===0?Be.text.slice(1):Be.text,_e=Hc(Be.leaf),qe=Be.href?a.jsx("a",{className:`${e}-link`,href:Be.href,target:Be.target,style:_e,children:Ze}):a.jsx("span",{style:_e,children:Ze});return a.jsxs("span",{children:[!A.justify&&Ve>0?" ":null,qe]},Ve)})},`${A.from}-${A.to}-${ee}`)}),h&&!ve&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Ce.map((A,ee)=>a.jsx("polygon",{points:A.map(Te=>`${Te.x},${Te.y}`).join(" ")},ee))})]}),se&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${de.capTop}px`,left:`${de.capLeft}px`,fontSize:`${be*m}px`,lineHeight:`${be*m}px`},children:se}),Y&&re&&(ve&&I||z)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:re.top,left:re.left,width:re.width,height:re.height,zIndex:Lw,pointerEvents:"none"},children:[ve&&I&&a.jsx(bS,{P:e,box:{width:re.width,height:re.height},viewBox:r,contours:ve,snap:I.snap,stretchToBox:!M,stage:B,onStageChange:K,onSelectionChange:Ee,onChange:I.onChange,onCommit:I.onCommit}),z&&De&&a.jsx(wS,{P:e,box:{width:re.width,height:re.height},bounds:De,natural:ue,imageUrl:v,maskPath:tt,stage:B,onStageChange:K,focalX:et,focalY:Je,scale:dt,onChange:z.onChange,onCommit:z.onCommit})]}),Y),a.jsx("div",{className:`${e}-a11y`,children:j.map((A,ee)=>a.jsx("p",{children:A},ee))})]})}function RS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=O.useScopedStyles(),c=s.useMemo(()=>mS(d),[d]),u=n??!1,p=!!r||!!o,x=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(()=>Mw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),v=(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",G=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,W=(e==null?void 0:e.dropCapSize)??Rw,U=u&&p&&!i,[H,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const J=()=>I(!0),de=()=>I(!1),be=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Pe=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const Se of be)window.addEventListener(Se,J);for(const Se of Pe)window.addEventListener(Se,de);return()=>{for(const Se of be)window.removeEventListener(Se,J);for(const Se of Pe)window.removeEventListener(Se,de)}},[u,p]);const z=u&&p&&!i&&typeof l=="function",$=!H,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),_=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");if(g!==_.current)_.current=g,k.current=e??{};else if(e){const{customPath:J,shape:de,pathFit:be,pathViewBox:Pe,imageScale:Se,imageFocalX:X,imageFocalY:me,image:re,...Y}=e,ce=k.current;for(const Ee of Object.keys(Y))if(ce[Ee]!==Y[Ee]){k.current={...ce,...Y};break}}const[D,P]=s.useState(null),[q,ie]=s.useState(!1),[L,B]=s.useState(!1),K=s.useCallback(()=>B(!1),[]),ue=s.useMemo(()=>!D||D.serialized===m?m:D.serialized,[D,m]);s.useEffect(()=>{z||(ie(!1),B(!1))},[z]),s.useEffect(()=>{!D||q||D.serialized===m&&P(null)},[D,m,q]);const le=s.useMemo(()=>{if(!z)return null;if(D&&(D.base===m||D.serialized===m))return D.contours;const J=Vo(m);return J.length?J:null},[z,D,m]),F=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Xr&&!!(le&&!vu(le,f)),pe=s.useCallback((J,de,be)=>{const Pe=Go(J);if(P(Se=>({base:Se&&(Se.base===m||Se.serialized===m)?Se.base:m,serialized:Pe,contours:J})),de){const Se=k.current,X=be!=null&&be.preserveShape?Se.shape:"custom",me={...Se,shape:X,customPath:Pe};k.current=me,l==null||l(me)}},[m,l]),j=s.useMemo(()=>z?{contours:F?le:null,snap:T,needsConversion:!F,onConvert:J=>{const de=Go(J);P({base:de,serialized:de,contours:J});const be={...k.current,pathFit:"viewbox",pathViewBox:Xr,customPath:de};k.current=be,l==null||l(be)},onChange:(J,de)=>{ie(!0),B(!!(de!=null&&de.carryImage)),pe(J,!1)},onCommit:(J,de)=>{pe(J,!0,de),ie(!1)}}:null,[z,F,le,T,l,pe]),se=v==="avoid"&&!!(e!=null&&e.image),ne=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]),[ve,ke]=s.useState(null),xe=ve??ne,b=s.useCallback(J=>ke(J),[]),M=s.useCallback(J=>{ke(J);const de={...k.current,imageFocalX:J.focalX,imageFocalY:J.focalY,imageScale:J.scale};k.current=de,l==null||l(de)},[l]);s.useEffect(()=>{ve&&Math.abs(ve.focalX-ne.focalX)<1e-9&&Math.abs(ve.focalY-ne.focalY)<1e-9&&Math.abs(ve.scale-ne.scale)<1e-9&&ke(null)},[ve,ne]);const E=s.useMemo(()=>!z||!se?null:{onChange:b,onCommit:M},[z,se,b,M]),[V,Ce]=s.useState(void 0),te=s.useRef(void 0),$e=s.useCallback(J=>{const de=te.current;de!==void 0&&Math.abs(de-J)<.005||(te.current=J,Ce(J))},[]),ae=s.useMemo(()=>S&&typeof V=="number"?V:1,[V,S]),ge=J=>`calc(${J} * var(--${d}-fit, 1))`,ye=s.useMemo(()=>{var be,Pe,Se,X,me;const J=(e==null?void 0:e.textFontSize)??.012,de=Math.max((e==null?void 0:e.textLineHeight)??J,J);return{fontFamily:po(e==null?void 0:e.textFontFamily),fontWeight:(be=e==null?void 0:e.textFontSettings)==null?void 0:be.fontWeight,fontStyle:(Pe=e==null?void 0:e.textFontSettings)==null?void 0:Pe.fontStyle,fontSize:ge(O.scalingValue(J,u)),lineHeight:ge(O.scalingValue(de,u)),letterSpacing:ge(O.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ge(O.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(Se=e==null?void 0:e.textTextAppearance)==null?void 0:Se.textTransform,textDecoration:(X=e==null?void 0:e.textTextAppearance)==null?void 0:X.textDecoration,fontVariant:(me=e==null?void 0:e.textTextAppearance)==null?void 0:me.fontVariant}},[e,u,d]),Z={[`--${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:{...Z},children:a.jsx(IS,{P:d,item:x,shape:w,customPath:m,pathFit:h,viewBox:f,mode:v,align:C,allowOverflow:y,fitEnabled:S,scale:ae,onFitScale:$e,dropCapLines:G,dropCapSize:W,showGuides:(U||z)&&$,typography:ye,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:xe.focalX,imageFocalY:xe.focalY,imageScale:xe.scale,imageCustomPath:ue,pathDragActive:q,pathCarryImage:L,onCarryImageConsumed:K,pathEditor:$?j:null,imageEditor:$?E:null})})]})}const LS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23832
|
+
`}const So=7,gS=3.5,Co=9,Qn=8,ei=14,Oc=10,hS=24,Tr=14,fS=4,yS=1,xS=.05,qr=1.08;function Ur(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 Cu(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function xs(e,t){const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Oc,y:n.y+o*Oc}}const vs=.1,bs=8,vS=4;function ws(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=ws(e,t)*n;return{width:t.width*i,height:t.height*i}}function Ln(e,t,n){return(e-t)*n}function Vi(e,t,n){const i=e-t;return Math.abs(i)<vS?.5:Gr(n/i)}function Bc(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=ws(e,n),p=ws(t,n),x=Math.min(bs,Math.max(vs,p>0?r*(u/p):r)),w=Si(t,n,x);return{focalX:Vi(t.width,w.width,d-t.x),focalY:Vi(t.height,w.height,c-t.y),scale:x}}function bS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,stage:l,onStageChange:d,onSelectionChange:c,onChange:u,onCommit:p}){const x=s.useRef(null),w=s.useRef(null),m=s.useRef(i);m.current=i;const h=s.useRef(null),f=s.useRef(null),v=s.useRef(null),C=s.useRef(null),[y,S]=s.useState([]),[X,N]=s.useState(ji),U=s.useCallback(b=>{N(M=>Qw(M,b)?M:b)},[]),W=l==="shape";s.useEffect(()=>{var b;W&&((b=x.current)==null||b.focus({preventScroll:!0}))},[W]),s.useEffect(()=>{W||S(b=>b.length?[]:b)},[W]);const I=y.length>0;s.useEffect(()=>{c==null||c(I)},[I,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const B=n.width>0?t.width/n.width:1,$=n.height>0?t.height/n.height:1,T=s.useCallback(b=>r?{x:(b.x-n.x)*B,y:(b.y-n.y)*$}:{x:b.x-n.x,y:b.y-n.y},[r,n,B,$]),k=s.useCallback(b=>r?{x:n.x+(B>0?b.x/B:0),y:n.y+($>0?b.y/$:0)}:{x:n.x+b.x,y:n.y+b.y},[r,n,B,$]),F=s.useMemo(()=>k({x:t.width/2,y:t.height/2}),[k,t.width,t.height]),g=s.useCallback((b,M)=>{var j;const E=(j=x.current)==null?void 0:j.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:r?{x:n.x+(b-E.left)/E.width*n.width,y:n.y+(M-E.top)/E.height*n.height}:{x:n.x+(b-E.left),y:n.y+(M-E.top)}},[r,n]),H=s.useCallback((b,M)=>{var j;const E=(j=x.current)==null?void 0:j.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(b-E.left)/E.width*t.width,y:(M-E.top)/E.height*t.height}},[t.width,t.height]),P=s.useCallback((b,M)=>{p(b,M)},[p]),q=b=>{var Te;const M=b.metaKey||b.ctrlKey,E=v.current;if(E&&b.pointerId===E.pointerId){if(b.stopPropagation(),b.preventDefault(),E.startDistance<=0)return;const Y=g(b.clientX,b.clientY),de=Math.hypot(Y.x-E.origin.x,Y.y-E.origin.y),ce=Math.max(xS,de/E.startDistance);if(!E.moved&&Math.abs(ce-1)<1e-4)return;E.moved=!0,u(Pc(E.startContours,E.origin,ce));return}const j=f.current;if(j&&b.pointerId===j.pointerId){b.stopPropagation(),b.preventDefault();const Y=g(b.clientX,b.clientY),{bbox:de}=j,ce=de.maxX-de.minX,G=de.maxY-de.minY,le=Y.x-j.origin.x,Me=Y.y-j.origin.y;let fe=le,K=Me;if(isFinite(ce)&&isFinite(G))if(r){const Le=Math.min(n.x,n.x+n.width-ce),Ze=Math.max(n.x,n.x+n.width-ce),Qe=Math.min(n.y,n.y+n.height-G),ct=Math.max(n.y,n.y+n.height-G),nt=Math.min(Ze,Math.max(Le,de.minX+le)),Ve=Math.min(ct,Math.max(Qe,de.minY+Me));fe=nt-de.minX,K=Ve-de.minY}else{const Le=de.minX-n.x,Ze=de.minY-n.y,Qe=Math.min(0,t.width-ce),ct=Math.max(0,t.width-ce),nt=Math.min(0,t.height-G),Ve=Math.max(0,t.height-G),$e=Math.min(ct,Math.max(Qe,Le+le)),He=Math.min(Ve,Math.max(nt,Ze+Me));fe=$e-Le,K=He-Ze}const Xe=[];if(!M&&isFinite(ce)&&isFinite(G)){const Le=T({x:de.minX+ce/2+fe,y:de.minY+G/2+K}),Ze={x:t.width/2,y:t.height/2};Math.abs(Le.x-Ze.x)<=Tr&&(fe=F.x-de.minX-ce/2,Xe.push(ys(Ze.x,"x",t))),Math.abs(Le.y-Ze.y)<=Tr&&(K=F.y-de.minY-G/2,Xe.push(ys(Ze.y,"y",t)))}if(!j.moved&&fe===0&&K===0)return;j.moved=!0,U(Xe.length?Xe:ji),u(ti(j.startContours,Le=>({x:Le.x+fe,y:Le.y+K})),{carryImage:!0});return}const Ce=C.current;if(Ce&&b.pointerId===Ce.pointerId){b.stopPropagation(),b.preventDefault();const Y=g(b.clientX,b.clientY);let de=Y.x-Ce.origin.x,ce=Y.y-Ce.origin.y;if(b.shiftKey&&(Math.abs(de)>Math.abs(ce)?ce=0:de=0),!Ce.moved&&de===0&&ce===0)return;Ce.moved=!0,u(Mc(Ce.startContours,Ce.selection,de,ce));return}const ee=h.current;if(!ee||b.pointerId!==ee.pointerId)return;b.stopPropagation(),b.preventDefault();const Ie=g(b.clientX,b.clientY);if(ee.kind==="anchor"){const Y={x:ee.anchor.x+(Ie.x-ee.origin.x),y:ee.anchor.y+(Ie.y-ee.origin.y)},de=M?[]:Uw(m.current,{contour:ee.contour,node:ee.node}),ce=M||!ee.center?[]:[ee.center],G=Fc(Ac(de,ce.map(fe=>fe.x),"x"),Y,"x",T,Tr),le=Fc(Ac(de,ce.map(fe=>fe.y),"y"),Y,"y",T,Tr),Me=M?Y:{x:(G==null?void 0:G.value)??$r(Y.x,o),y:(le==null?void 0:le.value)??$r(Y.y,o)};if(b.shiftKey&&(Math.abs(Me.x-ee.anchor.x)>Math.abs(Me.y-ee.anchor.y)?Me.y=ee.anchor.y:Me.x=ee.anchor.x),!ee.moved&&Me.x===ee.anchor.x&&Me.y===ee.anchor.y)return;ee.moved=!0,U(nS(Me,G,le,t,T)),u(zw(m.current,ee.contour,ee.node,Me));return}const oe=(Te=m.current[ee.contour])==null?void 0:Te.nodes[ee.node],me=ee.mirror&&!b.altKey,xe=me||M?null:ee.kind==="in"?oe==null?void 0:oe.out:oe==null?void 0:oe.in,J=oe?T(oe.p):null,Q=xe?T(xe):null,se=oe&&(!M||b.shiftKey)?oS(Ie,oe.p,me||M?null:iS(m.current[ee.contour],ee.node,ee.kind,T),J&&Q?Math.hypot(Q.x-J.x,Q.y-J.y):null,b.shiftKey,T,k):{point:Ie,guides:ji},we=se.guides.length?se.point:M?Ie:{x:$r(Ie.x,o),y:$r(Ie.y,o)},Ee=ee.kind==="in"?oe==null?void 0:oe.in:oe==null?void 0:oe.out;!ee.moved&&Ee&&we.x===Ee.x&&we.y===Ee.y||(ee.moved=!0,U(se.guides),u(Vw(m.current,ee.contour,ee.node,ee.kind,we,me)))},ne=b=>{U(ji);const M=v.current;if(M&&b.pointerId===M.pointerId){v.current=null,b.stopPropagation();const xe=x.current;xe!=null&&xe.hasPointerCapture(M.pointerId)&&xe.releasePointerCapture(M.pointerId),M.moved&&P(m.current,{preserveShape:!0});return}const E=f.current;if(E&&b.pointerId===E.pointerId){f.current=null,b.stopPropagation();const xe=x.current;xe!=null&&xe.hasPointerCapture(E.pointerId)&&xe.releasePointerCapture(E.pointerId),E.moved?P(m.current,{preserveShape:!0}):S([]);return}const j=C.current;if(j&&b.pointerId===j.pointerId){C.current=null,b.stopPropagation();const xe=x.current;xe!=null&&xe.hasPointerCapture(j.pointerId)&&xe.releasePointerCapture(j.pointerId),j.moved&&P(m.current);return}const Ce=h.current;if(!Ce||b.pointerId!==Ce.pointerId)return;h.current=null,b.stopPropagation();const ee=x.current;ee!=null&&ee.hasPointerCapture(Ce.pointerId)&&ee.releasePointerCapture(Ce.pointerId);const Ie=Math.hypot(b.clientX-Ce.clientOrigin.x,b.clientY-Ce.clientOrigin.y);if(Ce.moved||Ie>fS){Ce.moved&&P(m.current);return}if(!Ce.toggleOnRelease||b.type!=="pointerup")return;const me=kc(m.current,Ce.contour,Ce.node);me!==m.current&&(u(me),P(me))},L=b=>{b.stopPropagation()},O=b=>{var M,E;b.stopPropagation(),b.preventDefault(),(M=x.current)==null||M.focus({preventScroll:!0}),f.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),bbox:Jn(i),moved:!1},(E=x.current)==null||E.setPointerCapture(b.pointerId)},Z=(b,M)=>{var Ie,oe;b.stopPropagation(),b.preventDefault(),(Ie=x.current)==null||Ie.focus({preventScroll:!0}),S([]),d("shape");const E=Jn(i),j=Ur(E,Cu(M)),Ce=xs(E,M),ee=Math.hypot(Ce.x-j.x,Ce.y-j.y);!isFinite(ee)||ee<=0||(v.current={pointerId:b.pointerId,corner:M,origin:j,startDistance:ee,startContours:Pn(i),moved:!1},(oe=x.current)==null||oe.setPointerCapture(b.pointerId))},ue=(b,M,E,j)=>{var Ie,oe,me,xe;b.stopPropagation(),b.preventDefault(),(Ie=x.current)==null||Ie.focus({preventScroll:!0});const Ce=(oe=i[E])==null?void 0:oe.nodes[j];if(!Ce)return;if(b.altKey){const J=M==="anchor"?wu(i,E,j):Gw(i,E,j,M);if(J===i)return;S(M==="anchor"?[]:[{contour:E,node:j}]),u(J),P(J);return}const ee=b.metaKey||b.ctrlKey;if(M==="anchor"&&b.shiftKey&&!ee){S(J=>J.some(Q=>Q.contour===E&&Q.node===j)?J.filter(Q=>!(Q.contour===E&&Q.node===j)):[...J,{contour:E,node:j}]);return}if(M==="anchor"&&!ee&&y.length>1&&y.some(J=>J.contour===E&&J.node===j)){C.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(me=x.current)==null||me.setPointerCapture(b.pointerId);return}S([{contour:E,node:j}]),h.current={kind:M,contour:E,node:j,pointerId:b.pointerId,origin:g(b.clientX,b.clientY),clientOrigin:{x:b.clientX,y:b.clientY},anchor:Ce.p,center:Dw(i),mirror:M!=="anchor"&&!!(Ce.in&&Ce.out),toggleOnRelease:ee,moved:!1},(xe=x.current)==null||xe.setPointerCapture(b.pointerId)},ae=b=>{b.stopPropagation(),b.preventDefault();const M=ti(i,T),E=qw(M,H(b.clientX,b.clientY));if(!E||E.distance>hS)return;const{contours:j,nodeIndex:Ce}=Xw(i,E.contour,E.segment,E.t);Ce<0||(S([{contour:E.contour,node:Ce}]),u(j),P(j))},A=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const ee=Jn(i);if(!isFinite(ee.minX)||!isFinite(ee.maxX))return;const Ie={x:(ee.minX+ee.maxX)/2,y:(ee.minY+ee.maxY)/2},me=b.key==="="||b.key==="+"?qr:1/qr,xe=Pc(i,Ie,me);u(xe),P(xe,{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=jw(i,y);if(ee===i)return;S([]),u(ee),P(ee);return}const M=o>0?o:yS,E=b.shiftKey?M*10:M,j={ArrowLeft:[-E,0],ArrowRight:[E,0],ArrowUp:[0,-E],ArrowDown:[0,E]}[b.key];if(!j)return;b.preventDefault(),b.stopPropagation();const Ce=Mc(i,y,j[0],j[1]);u(Ce),P(Ce)},pe=s.useMemo(()=>Go(ti(i,T)),[i,T]),z=s.useMemo(()=>Jn(i),[i]),re=T({x:z.minX,y:z.minY}),te={width:T({x:z.maxX,y:z.minY}).x-re.x,height:T({x:z.minX,y:z.maxY}).y-re.y},be=W&&y.length===0&&isFinite(z.minX)&&isFinite(z.maxX)&&z.maxX>z.minX&&z.maxY>z.minY,Ae=y.length>0||W,ve=Ae;return a.jsxs("svg",{ref:x,className:`${e}-editor${Ae?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:A,onPointerDown:()=>{var b;return(b=x.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:q,onPointerUp:ne,onPointerCancel:ne,onLostPointerCapture:ne,onContextMenu:b=>{b.preventDefault()},"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:ae}),ve&&a.jsx("path",{className:`${e}-editor-hit`,d:pe,onClick:ae}),ve&&a.jsx("path",{className:`${e}-editor-outline`,d:pe}),ve&&X.map((b,M)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${b.kind}`,x1:b.a.x,y1:b.a.y,x2:b.b.x,y2:b.b.y},`${b.kind}-${M}`)),a.jsx("path",{ref:w,className:`${e}-editor-body`,d:pe,fillRule:"evenodd",onPointerDown:O,onClick:ae}),ve&&i.map((b,M)=>b.nodes.map((E,j)=>{const Ce=y.some(Ie=>Ie.contour===M&&Ie.node===j),ee=T(E.p);return a.jsxs("g",{children:[Ce&&y.length===1&&["in","out"].map(Ie=>{const oe=E[Ie];if(!oe)return null;const me=T(oe);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:ee.x,y1:ee.y,x2:me.x,y2:me.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:me.x,cy:me.y,r:gS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:me.x,cy:me.y,r:Co,onPointerDown:xe=>ue(xe,Ie,M,j),onClick:L})]},Ie)}),a.jsx("rect",{className:`${e}-editor-anchor${Ce?` ${e}-editor-anchor-selected`:""}`,x:ee.x-So/2,y:ee.y-So/2,width:So,height:So,rx:E.in||E.out?So/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:ee.x-Co,y:ee.y-Co,width:Co*2,height:Co*2,onPointerDown:Ie=>ue(Ie,"anchor",M,j),onClick:L,onDoubleClick:Ie=>{Ie.stopPropagation(),Ie.preventDefault();const oe=kc(i,M,j);u(oe),P(oe)}})]},`${M}-${j}`)})),be&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:re.x,y:re.y,width:te.width,height:te.height}),["nw","ne","se","sw"].map(b=>{const M=T(xs(z,b)),E=b==="ne"||b==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:M.x-Qn/2,y:M.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:M.x-ei/2,y:M.y-ei/2,width:ei,height:ei,onPointerDown:j=>Z(j,b),onClick:L})]},b)})]})]})}function wS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:w}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),v=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 F;y&&((F=m.current)==null||F.focus({preventScroll:!0}))},[y]);const S=s.useCallback((F,g)=>{var P;const H=(P=m.current)==null?void 0:P.getBoundingClientRect();return!H||H.width<=0||H.height<=0?{x:0,y:0}:{x:(F-H.left)/H.width*t.width,y:(g-H.top)/H.height*t.height}},[t.width,t.height]),X=F=>{var H,P;if(!i)return;F.stopPropagation(),F.preventDefault(),(H=m.current)==null||H.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:F.pointerId,origin:S(F.clientX,F.clientY),startX:Ln(n.width,g.width,c),startY:Ln(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(P=m.current)==null||P.setPointerCapture(F.pointerId)},N=(F,g)=>{var ue,ae;if(!i)return;F.stopPropagation(),F.preventDefault(),(ue=m.current)==null||ue.focus({preventScroll:!0});const H=Si(n,i,p),P=Ln(n.width,H.width,c),q=Ln(n.height,H.height,u),ne={minX:P,minY:q,maxX:P+H.width,maxY:q+H.height},L=Ur(ne,Cu(g)),O=Ur(ne,g),Z=Math.hypot(O.x-L.x,O.y-L.y);!isFinite(Z)||Z<=0||(v.current={pointerId:F.pointerId,anchor:L,startDistance:Z,startScale:p,startX:P,startY:q,moved:!1},(ae=m.current)==null||ae.setPointerCapture(F.pointerId))},U=F=>{if(!i)return;const g=v.current;if(g&&F.pointerId===g.pointerId){F.stopPropagation(),F.preventDefault();const P=S(F.clientX,F.clientY),q={x:P.x-n.x,y:P.y-n.y},ne=Math.hypot(q.x-g.anchor.x,q.y-g.anchor.y),L=Math.min(bs,Math.max(vs,g.startScale*(ne/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const O=L/g.startScale,Z=g.anchor.x+(g.startX-g.anchor.x)*O,ue=g.anchor.y+(g.startY-g.anchor.y)*O,ae=Si(n,i,L);x({focalX:Vi(n.width,ae.width,Z),focalY:Vi(n.height,ae.height,ue),scale:L});return}const H=f.current;if(H&&F.pointerId===H.pointerId){F.stopPropagation(),F.preventDefault();const P=S(F.clientX,F.clientY),q=P.x-H.origin.x,ne=P.y-H.origin.y;if(!H.moved&&q===0&&ne===0)return;H.moved=!0,x({focalX:Vi(n.width,H.width,H.startX+q),focalY:Vi(n.height,H.height,H.startY+ne),scale:p})}},W=F=>{var P,q;const g=f.current;if(g&&F.pointerId===g.pointerId){f.current=null,F.stopPropagation(),(P=m.current)!=null&&P.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const H=v.current;H&&F.pointerId===H.pointerId&&(v.current=null,F.stopPropagation(),(q=m.current)!=null&&q.hasPointerCapture(H.pointerId)&&m.current.releasePointerCapture(H.pointerId),H.moved&&w(C.current))},I=F=>{if(F.key==="Escape"){F.stopPropagation(),d("none");return}if(F.key==="="||F.key==="+"||F.key==="-"||F.key==="_"){F.preventDefault(),F.stopPropagation();const g=F.key==="="||F.key==="+",H=Math.min(bs,Math.max(vs,p*(g?qr:1/qr))),P={focalX:c,focalY:u,scale:H};x(P),w(P)}},B=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const F=i??{width:n.width,height:n.height},g=Si(n,F,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]),k=T?{minX:T.x,minY:T.y,maxX:T.x+T.width,maxY:T.y+T.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:I,onPointerMove:U,onPointerUp:W,onPointerCancel:W,onLostPointerCapture:W,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&T&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:T.x,y:T.y,width:T.width,height:T.height,children:[a.jsx("rect",{x:T.x,y:T.y,width:T.width,height:T.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:T.x,y:T.y,width:T.width,height:T.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:T.x,y:T.y,width:T.width,height:T.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:X}),B.map(F=>{const g=xs(k,F),H=F==="ne"||F==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-Qn/2,y:g.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${H?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-ei/2,y:g.y-ei/2,width:ei,height:ei,onPointerDown:P=>N(P,F)})]},F)})]})]})}function SS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function CS(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 $S(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=SS(e);(!r||!CS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function TS(){return typeof document>"u"?null:document.body}function IS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,dropCapLines:w,dropCapSize:m,showGuides:h,typography:f,imageUrl:v,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:X,pathDragActive:N,pathCarryImage:U,onCarryImageConsumed:W,pathEditor:I,imageEditor:B}){var Ue,he;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,k]=s.useState(null),F=s.useRef(null),[g,H]=s.useState({width:0,height:0}),[P,q]=s.useState(null),[ne,L]=s.useState(0),[O,Z]=s.useState("none");s.useEffect(()=>{!I&&!B&&Z("none")},[I,B]);const[ue,ae]=s.useState(null);s.useEffect(()=>{if(!v||typeof Image>"u"){ae(null);return}let V=!1;const ye=new Image;return ye.onload=()=>{V||ae({width:ye.naturalWidth,height:ye.naturalHeight})},ye.src=v,()=>{V=!0}},[v]);const A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),pe=s.useMemo(()=>uS(A),[A]),z=s.useMemo(()=>pS(A),[A]),re=w>0?((he=(Ue=pe[0])==null?void 0:Ue.text)==null?void 0:he.charAt(0))??"":"",te=g.height>0?g.width/g.height:1,be=(I==null?void 0:I.contours)??null,Ae=s.useMemo(()=>{if(be){const Ne=nl(be);if(Ne.length)return Fr(Ne,r)}const V=i.trim(),ye=V?Wc(V,o,r):null;return ye&&ye.length?ye:ps(n==="custom"?"rectangle":n,te)},[be,n,i,o,r,Math.round(te*100)/100]),ve=I==null?void 0:I.onConvert,b=(I==null?void 0:I.needsConversion)??!1,M=s.useMemo(()=>{const V=be??(i.trim()?Vo(i):null);return!!(V&&vu(V,r))},[be,i,r]),[E,j]=s.useState(null);Cr(()=>{if(!M){E&&j(null);return}!E&&g.width>0&&g.height>0&&j({width:g.width,height:g.height})},[M,g.width,g.height,E]);const Ce=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return Ae;const V=E??g,ye=r.width/V.width,Ne=r.height/V.height;return Ae.map(ze=>ze.map(We=>({x:We.x*ye,y:We.y*Ne})))},[Ae,M,E,r.width,r.height,g.width,g.height]),ee=s.useMemo(()=>{const V=X.trim(),ye=V?Wc(V,o,r):null;return ye&&ye.length?ye:ps(n==="custom"?"rectangle":n,te)},[n,X,o,r,Math.round(te*100)/100]),Ie=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return ee;const V=E??g,ye=r.width/V.width,Ne=r.height/V.height;return ee.map(ze=>ze.map(We=>({x:We.x*ye,y:We.y*Ne})))},[ee,M,E,r.width,r.height,g.width,g.height]),oe=s.useRef(null),me=s.useRef(!1);s.useEffect(()=>{if(!(!ve||g.width<=0||g.height<=0)){if(M){if(oe.current===i)return;const V=be??(i.trim()?Vo(i):null);if(!(V!=null&&V.length))return;const ye=ti(V,Ne=>({x:r.x+(Ne.x-r.x)/g.width*r.width,y:r.y+(Ne.y-r.y)/g.height*r.height}));oe.current=Go(ye),ve(ye);return}!b||!Ae.length||me.current||(me.current=!0,ve(ti(xu(Ae),V=>({x:V.x*Yr,y:V.y*Yr}))))}},[b,M,ve,Ae,be,i,r,g.width,g.height]),Cr(()=>{const V=T;if(!V||typeof ResizeObserver>"u")return;const ye=()=>{const ze=V.getBoundingClientRect();H(We=>Math.abs(We.width-ze.width)<.5&&Math.abs(We.height-ze.height)<.5?We:{width:ze.width,height:ze.height})};ye();const Ne=new ResizeObserver(ye);return Ne.observe(V),()=>Ne.disconnect()},[T]),s.useEffect(()=>{const V=typeof document<"u"?document.fonts:void 0;V!=null&&V.ready&&V.ready.then(()=>{L(ye=>ye+1)})},[]),Cr(()=>{const V=F.current;if(!V)return;if(!pe.length){q(null);return}const ye=[],Ne=document.createDocumentFragment();for(const St of pe){const At=document.createElement("span");Object.assign(At.style,Hc(St.leaf)),At.textContent=St.text,Ne.appendChild(At),ye.push(At)}const ze=document.createElement("span");ze.textContent=" ",Ne.appendChild(ze);const We=document.createElement("span");We.textContent=re||"H",We.style.lineHeight="1",Ne.appendChild(We),V.replaceChildren(Ne);const et=window.getComputedStyle(V),Je=parseFloat(et.fontSize)||16,_e=parseFloat(et.lineHeight),qe=Number.isNaN(_e)?Je*1.2:_e,De=Math.max(qe,Je);We.style.fontSize=`${De*m}px`;const it=ye.map(St=>St.getBoundingClientRect().width),at=ze.getBoundingClientRect().width,dt=re?We.getBoundingClientRect().width:0;V.replaceChildren(),q({widths:it,spaceWidth:at,lineHeight:De,capWidth:dt})},[pe,f,re,w,m,ne,g.width]);const xe=P&&re?P.capWidth+P.lineHeight*Rw:0,J=Math.max(w,Math.ceil(m)),Q=s.useMemo(()=>{if(!P||!pe.length||g.width<=0||g.height<=0||!u)return 1;const V=ze=>Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:xe*ze,capLines:re?J:0});if(V(1).placed>=pe.length)return 1;if(V(Ya).placed<pe.length)return Ya;let ye=Ya,Ne=1;for(let ze=0;ze<Tw;ze+=1){const We=(ye+Ne)/2;V(We).placed>=pe.length?ye=We:Ne=We}return ye},[P,pe,g.width,g.height,Ce,l,d,u,xe,re,J]);s.useEffect(()=>{x(Q)},[Q,x]);const se=u?Math.min(p,Q):1,we=s.useMemo(()=>!P||!pe.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:se,allowOverflow:c,capInset:xe*se,capLines:re?J:0}),[P,pe,g.width,g.height,Ce,l,d,se,c,xe,re,J]),Ee=P?P.lineHeight*se:0,Te=d==="justify"?"left":d,Y=!!(I&&be&&g.width>0&&g.height>0),de=!!B,ce=(Y||de)&&g.width>0&&g.height>0,G=$S(T,ce),le=ce&&G?TS():null,Me=s.useRef(!1),fe=s.useCallback(V=>{Me.current=V},[]);s.useEffect(()=>{if(!Y&&!de)return;const V=ye=>{const Ne=T;if(!Ne)return;const ze=Ne.getBoundingClientRect();ye.clientX>=ze.left&&ye.clientX<=ze.right&&ye.clientY>=ze.top&&ye.clientY<=ze.bottom&&(ye.preventDefault(),ye.stopPropagation(),Z(et=>et==="shape"&&Me.current?et:et==="shape"&&de?"image":Y?"shape":"image"))};return document.addEventListener("dblclick",V,!0),()=>document.removeEventListener("dblclick",V,!0)},[Y,de,T]);const K=s.useMemo(()=>v&&g.width>0&&g.height>0?Mw(Ie,g):null,[v,Ie,g.width,g.height]),Xe=s.useRef(null),Le=(()=>{const V=Xe.current;return N||U||!B||!ue||!K||!V||X===V.customPath?null:Bc(V.bounds,K,ue,V.focalX,V.focalY,V.scale)})();Cr(()=>{if(N||!B||!ue||!K)return;const V=Xe.current,ye=!!(V&&X!==V.customPath);ye&&Le&&B.onCommit(Le),ye&&U&&(W==null||W()),Xe.current={rings:Ie,bounds:K,focalX:(Le==null?void 0:Le.focalX)??C,focalY:(Le==null?void 0:Le.focalY)??y,scale:(Le==null?void 0:Le.scale)??S,customPath:X}},[N,U,X,Ie,K,B,ue,C,y,S,Le,W]);const Ze=s.useMemo(()=>{if(!N||U||!ue||!K)return null;const V=Xe.current;return V?Bc(V.bounds,K,ue,V.focalX,V.focalY,V.scale):null},[N,U,ue,K,X,Ie]),Qe=(Ze==null?void 0:Ze.focalX)??(Le==null?void 0:Le.focalX)??C,ct=(Ze==null?void 0:Ze.focalY)??(Le==null?void 0:Le.focalY)??y,nt=(Ze==null?void 0:Ze.scale)??(Le==null?void 0:Le.scale)??S,Ve=s.useMemo(()=>v&&g.width>0&&g.height>0?Ew(Ie,g):"",[v,Ie,g.width,g.height]),$e=K,He=`${$}-clip`,Be=s.useMemo(()=>{if(!$e)return null;const V=ue??{width:$e.width,height:$e.height},ye=Si($e,V,nt);return{x:Ln($e.width,ye.width,Qe),y:Ln($e.height,ye.height,ct),width:ye.width,height:ye.height}},[$e,ue,Qe,ct,nt]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[v&&Ve&&$e&&Be?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:He,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Ve,fillRule:"evenodd"})})}),a.jsx("image",{href:v,x:$e.x+Be.x,y:$e.y+Be.y,width:Be.width,height:Be.height,preserveAspectRatio:"none",clipPath:`url(#${He})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:se},children:[a.jsx("div",{className:`${e}-measure`,ref:F,style:f,"aria-hidden":!0}),we.segments.map((V,ye)=>{const Ne=pe.slice(V.from,V.to),ze=ye===0;return a.jsx("div",{className:`${e}-line${V.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${V.top}px`,left:`${V.left}px`,width:`${V.width}px`,textAlign:V.justify?void 0:Te},children:Ne.map((We,et)=>{const _e=re&&ze&&V.from===0&&et===0?We.text.slice(1):We.text,qe=Hc(We.leaf),De=We.href?a.jsx("a",{className:`${e}-link`,href:We.href,target:We.target,style:qe,children:_e}):a.jsx("span",{style:qe,children:_e});return a.jsxs("span",{children:[!V.justify&&et>0?" ":null,De]},et)})},`${V.from}-${V.to}-${ye}`)}),h&&!be&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Ce.map((V,ye)=>a.jsx("polygon",{points:V.map(Ne=>`${Ne.x},${Ne.y}`).join(" ")},ye))})]}),re&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${we.capTop}px`,left:`${we.capLeft}px`,fontSize:`${Ee*m}px`,lineHeight:`${Ee*m}px`},children:re}),le&&G&&(be&&I||B)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:G.top,left:G.left,width:G.width,height:G.height,zIndex:Pw,pointerEvents:"none"},children:[be&&I&&a.jsx(bS,{P:e,box:{width:G.width,height:G.height},viewBox:r,contours:be,snap:I.snap,stretchToBox:!M,stage:O,onStageChange:Z,onSelectionChange:fe,onChange:I.onChange,onCommit:I.onCommit}),B&&$e&&a.jsx(wS,{P:e,box:{width:G.width,height:G.height},bounds:$e,natural:ue,imageUrl:v,maskPath:Ve,stage:O,onStageChange:Z,focalX:Qe,focalY:ct,scale:nt,onChange:B.onChange,onCommit:B.onCommit})]}),le),a.jsx("div",{className:`${e}-a11y`,children:z.map((V,ye)=>a.jsx("p",{children:V},ye))})]})}function RS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>mS(d),[d]),u=n??!1,p=!!r||!!o,x=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(()=>kw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),v=(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",X=((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)??Lw,U=u&&p&&!i,[W,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const Q=()=>I(!0),se=()=>I(!1),we=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Ee=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const Te of we)window.addEventListener(Te,Q);for(const Te of Ee)window.addEventListener(Te,se);return()=>{for(const Te of we)window.removeEventListener(Te,Q);for(const Te of Ee)window.removeEventListener(Te,se)}},[u,p]);const B=u&&p&&!i&&typeof l=="function",$=!W,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),F=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");if(g!==F.current)F.current=g,k.current=e??{};else if(e){const{customPath:Q,shape:se,pathFit:we,pathViewBox:Ee,imageScale:Te,imageFocalX:Y,imageFocalY:de,image:ce,...G}=e,le=k.current;for(const Me of Object.keys(G))if(le[Me]!==G[Me]){k.current={...le,...G};break}}const[H,P]=s.useState(null),[q,ne]=s.useState(!1),[L,O]=s.useState(!1),Z=s.useCallback(()=>O(!1),[]),ue=s.useMemo(()=>!H||H.serialized===m?m:H.serialized,[H,m]);s.useEffect(()=>{B||(ne(!1),O(!1))},[B]),s.useEffect(()=>{!H||q||H.serialized===m&&P(null)},[H,m,q]);const ae=s.useMemo(()=>{if(!B)return null;if(H&&(H.base===m||H.serialized===m))return H.contours;const Q=Vo(m);return Q.length?Q:null},[B,H,m]),A=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Xr&&!!(ae&&!vu(ae,f)),pe=s.useCallback((Q,se,we)=>{const Ee=Go(Q);if(P(Te=>({base:Te&&(Te.base===m||Te.serialized===m)?Te.base:m,serialized:Ee,contours:Q})),se){const Te=k.current,Y=we!=null&&we.preserveShape?Te.shape:"custom",de={...Te,shape:Y,customPath:Ee};k.current=de,l==null||l(de)}},[m,l]),z=s.useMemo(()=>B?{contours:A?ae:null,snap:T,needsConversion:!A,onConvert:Q=>{const se=Go(Q);P({base:se,serialized:se,contours:Q});const we={...k.current,pathFit:"viewbox",pathViewBox:Xr,customPath:se};k.current=we,l==null||l(we)},onChange:(Q,se)=>{ne(!0),O(!!(se!=null&&se.carryImage)),pe(Q,!1)},onCommit:(Q,se)=>{pe(Q,!0,se),ne(!1)}}:null,[B,A,ae,T,l,pe]),re=v==="avoid"&&!!(e!=null&&e.image),te=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]),[be,Ae]=s.useState(null),ve=be??te,b=s.useCallback(Q=>Ae(Q),[]),M=s.useCallback(Q=>{Ae(Q);const se={...k.current,imageFocalX:Q.focalX,imageFocalY:Q.focalY,imageScale:Q.scale};k.current=se,l==null||l(se)},[l]);s.useEffect(()=>{be&&Math.abs(be.focalX-te.focalX)<1e-9&&Math.abs(be.focalY-te.focalY)<1e-9&&Math.abs(be.scale-te.scale)<1e-9&&Ae(null)},[be,te]);const E=s.useMemo(()=>!B||!re?null:{onChange:b,onCommit:M},[B,re,b,M]),[j,Ce]=s.useState(void 0),ee=s.useRef(void 0),Ie=s.useCallback(Q=>{const se=ee.current;se!==void 0&&Math.abs(se-Q)<.005||(ee.current=Q,Ce(Q))},[]),oe=s.useMemo(()=>S&&typeof j=="number"?j:1,[j,S]),me=Q=>`calc(${Q} * var(--${d}-fit, 1))`,xe=s.useMemo(()=>{var we,Ee,Te,Y,de;const Q=(e==null?void 0:e.textFontSize)??.012,se=Math.max((e==null?void 0:e.textLineHeight)??Q,Q);return{fontFamily:po(e==null?void 0:e.textFontFamily),fontWeight:(we=e==null?void 0:e.textFontSettings)==null?void 0:we.fontWeight,fontStyle:(Ee=e==null?void 0:e.textFontSettings)==null?void 0:Ee.fontStyle,fontSize:me(D.scalingValue(Q,u)),lineHeight:me(D.scalingValue(se,u)),letterSpacing:me(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:me(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(Te=e==null?void 0:e.textTextAppearance)==null?void 0:Te.textTransform,textDecoration:(Y=e==null?void 0:e.textTextAppearance)==null?void 0:Y.textDecoration,fontVariant:(de=e==null?void 0:e.textTextAppearance)==null?void 0:de.fontVariant}},[e,u,d]),J={[`--${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:{...J},children:a.jsx(IS,{P:d,item:x,shape:w,customPath:m,pathFit:h,viewBox:f,mode:v,align:C,allowOverflow:y,fitEnabled:S,scale:oe,onFitScale:Ie,dropCapLines:X,dropCapSize:N,showGuides:(U||B)&&$,typography:xe,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:ve.focalX,imageFocalY:ve.focalY,imageScale:ve.scale,imageCustomPath:ue,pathDragActive:q,pathCarryImage:L,onCarryImageConsumed:Z,pathEditor:$?z:null,imageEditor:$?E:null})})]})}const LS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23833
23833
|
import type React from 'react';
|
|
23834
23834
|
import { createPortal } from 'react-dom';
|
|
23835
23835
|
import { CommonComponentProps } from '../props';
|
|
@@ -27195,6 +27195,9 @@ function PretextColumn({
|
|
|
27195
27195
|
}, [committedUnitRings, exceedsEditViewBox, legacyRefBox, viewBox.width, viewBox.height, box.width, box.height]);
|
|
27196
27196
|
|
|
27197
27197
|
const migratedPathRef = useRef<string | null>(null);
|
|
27198
|
+
// Auto-convert writes through onUpdateSettings (undoable). Run at most once
|
|
27199
|
+
// per mount so undoing that migration is not immediately re-applied.
|
|
27200
|
+
const didAutoConvertRef = useRef(false);
|
|
27198
27201
|
useEffect(() => {
|
|
27199
27202
|
if (!onConvertPath || box.width <= 0 || box.height <= 0) return;
|
|
27200
27203
|
|
|
@@ -27212,7 +27215,8 @@ function PretextColumn({
|
|
|
27212
27215
|
return;
|
|
27213
27216
|
}
|
|
27214
27217
|
|
|
27215
|
-
if (!needsConversion || !unitRings.length) return;
|
|
27218
|
+
if (!needsConversion || !unitRings.length || didAutoConvertRef.current) return;
|
|
27219
|
+
didAutoConvertRef.current = true;
|
|
27216
27220
|
onConvertPath(mapContours(ringsToContours(unitRings), point => ({ x: point.x * EDIT_SPAN, y: point.y * EDIT_SPAN })));
|
|
27217
27221
|
}, [
|
|
27218
27222
|
needsConversion,
|
|
@@ -27956,4 +27960,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
27956
27960
|
</>
|
|
27957
27961
|
);
|
|
27958
27962
|
}
|
|
27959
|
-
`,zc=[...gu],PS={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ES={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:zc},enum:zc},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},dropCap:{type:"string",scope:"common",title:"Drop cap",display:{type:"toggle-cycle",enum:["off","on"]}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:2,max:8,step:1,display:{type:"numeric-input"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:.5,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"Background",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...PS.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link",display:{type:"style-panel-color-picker"}}},defaults:{
|
|
27963
|
+
`,zc=[...gu],PS={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ES={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:zc},enum:zc},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},dropCap:{type:"string",scope:"common",title:"Drop cap",display:{type:"toggle-cycle",enum:["off","on"]}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:2,max:8,step:1,display:{type:"numeric-input"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:.5,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"Background",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...PS.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link",display:{type:"style-panel-color-picker"}}},defaults:{...bu("diamond"),pathSnap:0,shapeMode:"A",fitText:"off",dropCap:"off",dropCapLines:3,dropCapSize:3,image:null,backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0},d:{textFontSize:.011,textLineHeight:.0155,textLetterSpacing:0,textWordSpacing:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","dropCap","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"dropCap",value:"on",isNotEqual:!0},then:{name:"properties.dropCapSize.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",items:["shape"]},{type:"row",items:["image","dropCap"]},{type:"row",items:["dropCapSize"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}}}},default:[{text:[{type:"paragraph",children:[{text:"Style is viewed by many as a shallow obsession with disembodied surfaces. However our activities as designers are based on style’s function as a cultural communicator. A vocabulary or set of formal characteristics constitutes a particular style, recognized most frequently in retrospect. Style itself is the visual language of a culture: in fashion, in consumer goods, in art, in literature, in all media. Style is ephemeral; it is timely. To be in style is to embody the influences and values of your time."}]}]}]}},MS={element:RS,id:"pretext",name:"Shaped Type",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||gu.indexOf(n)===-1?e:{...e,...bu(n,1,t)}},defaultSize:{d:{width:380,height:382},t:{width:380,height:382},m:{width:334,height:336}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/pretext.png"},schema:ES,sourceCode:LS,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},kS=[_m,zm,Wv,Fg,jg,Qg,xh,jh,Kh,of,Pf,Sy,Ix,_x,yv,Lv,Uv,G0,a0,lb,Db,Cw,MS];exports.components=kS;exports.isSchemaV1=Iu;
|