@cntrl-site/components 1.0.64-alpha.0 → 1.0.64-alpha.1
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/Components/Pretext/Pretext.d.ts +3 -3
- package/dist/Components/Pretext/PretextComponent.d.ts +4 -1
- package/dist/index.js +356 -161
- package/dist/index.mjs +8050 -7737
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),ut=require("classnames"),W=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Dn=require("react-dom");function au(e){return e.type==="object"&&e.version===1}const su="ControlSlider-module__wrapper___sHEkd",lu="ControlSlider-module__hoverArrow___A-dOH",cu="ControlSlider-module__sliderItem___QQSkR",du="ControlSlider-module__sliderImage___9hRl-",uu="ControlSlider-module__arrow___05ghY",pu="ControlSlider-module__arrowVertical___tBfVN",mu="ControlSlider-module__nextArrow___-30Yc",gu="ControlSlider-module__arrowInner___aEra3",hu="ControlSlider-module__arrowIcon___S4ztF",fu="ControlSlider-module__arrowImg___2dwJW",yu="ControlSlider-module__mirror___brd6U",vu="ControlSlider-module__pagination___bicLF",xu="ControlSlider-module__paginationInner___bT-P-",bu="ControlSlider-module__paginationVertical___zYqKw",wu="ControlSlider-module__paginationItem___nTRbk",Su="ControlSlider-module__dot___p1Qun",$u="ControlSlider-module__activeDot___LHFaj",Cu="ControlSlider-module__paginationInsideBottom___R3FWn",Tu="ControlSlider-module__paginationInsideTop___V-qb-",Lu="ControlSlider-module__paginationOutsideBottom___14w8D",Ru="ControlSlider-module__paginationOutsideTop___SCLqB",Iu="ControlSlider-module__paginationInsideLeft___yOBRZ",Pu="ControlSlider-module__paginationInsideRight___Rtt3o",Eu="ControlSlider-module__paginationOutsideLeft___lahaw",Mu="ControlSlider-module__paginationOutsideRight___EtuQa",ku="ControlSlider-module__imgWrapper___UjEgB",Au="ControlSlider-module__captionBlock___dJ6-j",Fu="ControlSlider-module__captionTextWrapper___HFlpf",_u="ControlSlider-module__captionText___uGBVc",Wu="ControlSlider-module__active___WZK4G",Nu="ControlSlider-module__withPointerEvents___t-18M",Hu="ControlSlider-module__topLeftAlignment___zjnGM",Ou="ControlSlider-module__topCenterAlignment___gD1xW",Du="ControlSlider-module__topRightAlignment___NMapS",Bu="ControlSlider-module__middleLeftAlignment___OnUrY",ju="ControlSlider-module__middleCenterAlignment___Tdkl0",zu="ControlSlider-module__middleRightAlignment___wEbfX",Vu="ControlSlider-module__bottomLeftAlignment___cTP2-",Gu="ControlSlider-module__bottomCenterAlignment___c54fB",qu="ControlSlider-module__bottomRightAlignment___kEwrz",Xu="ControlSlider-module__clickOverlay___DZA28",Uu="ControlSlider-module__contain___pLyq7",Ku="ControlSlider-module__cover___KdDat",ct={wrapper:su,hoverArrow:lu,sliderItem:cu,sliderImage:du,arrow:uu,arrowVertical:pu,nextArrow:mu,arrowInner:gu,arrowIcon:hu,arrowImg:fu,mirror:yu,pagination:vu,paginationInner:xu,paginationVertical:bu,paginationItem:wu,dot:Su,activeDot:$u,paginationInsideBottom:Cu,paginationInsideTop:Tu,paginationOutsideBottom:Lu,paginationOutsideTop:Ru,paginationInsideLeft:Iu,paginationInsideRight:Pu,paginationOutsideLeft:Eu,paginationOutsideRight:Mu,imgWrapper:ku,captionBlock:Au,captionTextWrapper:Fu,captionText:_u,active:Wu,withPointerEvents:Nu,topLeftAlignment:Hu,topCenterAlignment:Ou,topRightAlignment:Du,middleLeftAlignment:Bu,middleCenterAlignment:ju,middleRightAlignment:zu,bottomLeftAlignment:Vu,bottomCenterAlignment:Gu,bottomRightAlignment:qu,clickOverlay:Xu,contain:Uu,cover:Ku};function Yu(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 Zu(e,t,n){return t&&Yu(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Bs="(prefers-reduced-motion: reduce)",_i=1,Ju=2,Bi=3,eo=4,No=5,fr=6,Tr=7,Qu={CREATED:_i,MOUNTED:Ju,IDLE:Bi,MOVING:eo,SCROLLING:No,DRAGGING:fr,DESTROYED:Tr};function Hn(e){e.length=0}function ti(e,t,n){return Array.prototype.slice.call(e,t,n)}function qt(e){return e.bind.apply(e,[null].concat(ti(arguments,1)))}var Tc=setTimeout,Ha=function(){};function js(e){return requestAnimationFrame(e)}function Hr(e,t){return typeof t===e}function Co(e){return!rs(e)&&Hr("object",e)}var os=Array.isArray,Lc=qt(Hr,"function"),Yn=qt(Hr,"string"),Ho=qt(Hr,"undefined");function rs(e){return e===null}function Rc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Oo(e){return os(e)?e:[e]}function xn(e,t){Oo(e).forEach(t)}function as(e,t){return e.indexOf(t)>-1}function yr(e,t){return e.push.apply(e,Oo(t)),e}function An(e,t,n){e&&xn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function In(e,t){An(e,Yn(t)?t.split(" "):t,!0)}function Do(e,t){xn(t,e.appendChild.bind(e))}function ss(e,t){xn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function To(e,t){return Rc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ic(e,t){var n=e?ti(e.children):[];return t?n.filter(function(i){return To(i,t)}):n}function Bo(e,t){return t?Ic(e,t)[0]:e.firstElementChild}var Lo=Object.keys;function yi(e,t,n){return e&&(n?Lo(e).reverse():Lo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ro(e){return ti(arguments,1).forEach(function(t){yi(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ti(arguments,1).forEach(function(t){yi(t,function(n,i){os(n)?e[i]=n.slice():Co(n)?e[i]=qn({},Co(e[i])?e[i]:{},n):e[i]=n})}),e}function zs(e,t){xn(t||Lo(e),function(n){delete e[n]})}function Pn(e,t){xn(e,function(n){xn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Co(t)?yi(t,function(i,o){$t(e,o,i)}):xn(e,function(i){rs(n)||n===""?Pn(i,t):i.setAttribute(t,String(n))})}function Wi(e,t,n){var i=document.createElement(e);return t&&(Yn(t)?In(i,t):$t(i,t)),n&&Do(n,i),i}function wn(e,t,n){if(Ho(n))return getComputedStyle(e)[t];rs(n)||(e.style[t]=""+n)}function Io(e,t){wn(e,"display",t)}function Pc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function Vs(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function xi(e){xn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ec(e){return Bo(new DOMParser().parseFromString(e,"text/html").body)}function kn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Mc(e,t){return e&&e.querySelector(t)}function ls(e,t){return t?ti(e.querySelectorAll(t)):[]}function Fn(e,t){An(e,t,!1)}function Oa(e){return e.timeStamp}function si(e){return Yn(e)?e:e?e+"px":""}var jo="splide",cs="data-"+jo;function bo(e,t){if(!e)throw new Error("["+jo+"] "+(t||""))}var Zn=Math.min,Lr=Math.max,Rr=Math.floor,Po=Math.ceil,dn=Math.abs;function kc(e,t,n){return dn(e-t)<n}function vr(e,t,n,i){var o=Zn(t,n),r=Lr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Mi(e,t,n){var i=Zn(t,n),o=Lr(t,n);return Zn(Lr(i,e),o)}function Da(e){return+(e>0)-+(e<0)}function Ba(e,t){return xn(t,function(n){e=e.replace("%s",""+n)}),e}function ds(e){return e<10?"0"+e:""+e}var Gs={};function ep(e){return""+e+ds(Gs[e]=(Gs[e]||0)+1)}function Ac(){var e=[];function t(l,c,d,u){o(l,c,function(p,v,f){var h="addEventListener"in p,g=h?p.removeEventListener.bind(p,v,d,u):p.removeListener.bind(p,d);h?p.addEventListener(v,d,u):p.addListener(d),e.push([p,v,f,d,g])})}function n(l,c,d){o(l,c,function(u,p,v){e=e.filter(function(f){return f[0]===u&&f[1]===p&&f[2]===v&&(!d||f[3]===d)?(f[4](),!1):!0})})}function i(l,c,d){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(c,{bubbles:p,detail:d}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(c,p,!1,d)),l.dispatchEvent(u),u}function o(l,c,d){xn(l,function(u){u&&xn(c,function(p){p.split(" ").forEach(function(v){var f=v.split(".");d(u,f[0],f[1])})})})}function r(){e.forEach(function(l){l[4]()}),Hn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ni="mounted",ja="ready",On="move",to="moved",us="click",Fc="active",_c="inactive",Wc="visible",Nc="hidden",en="refresh",ln="updated",ji="resize",Or="resized",Hc="drag",Oc="dragging",Dc="dragged",Dr="scroll",Si="scrolled",tp="overflow",ps="destroy",Bc="arrows:mounted",jc="arrows:updated",zc="pagination:mounted",Vc="pagination:updated",ms="navigation:mounted",gs="autoplay:play",Gc="autoplay:playing",hs="autoplay:pause",fs="lazyload:loaded",qc="sk",Xc="sh",Ir="ei";function Yt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Ac();function i(r,l){n.bind(t,Oo(r).join(" "),function(c){l.apply(l,os(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,ti(arguments,1))}return e&&e.event.on(ps,n.destroy),Ro(n,{bus:t,on:i,off:qt(n.unbind,t),emit:o})}function Br(e,t,n,i){var o=Date.now,r,l=0,c,d=!0,u=0;function p(){if(!d){if(l=e?Zn((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return f();c=js(p)}}function v(T){T||g(),r=o()-(T?l*e:0),d=!1,c=js(p)}function f(){d=!0}function h(){r=o(),l=0,n&&n(l)}function g(){c&&cancelAnimationFrame(c),l=0,c=0,d=!0}function m(T){e=T}function x(){return d}return{start:v,rewind:h,pause:f,cancel:g,set:m,isPaused:x}}function np(e){var t=e;function n(o){t=o}function i(o){return as(Oo(o),t)}return{set:n,is:i}}function ip(e,t){var n=Br(0,e,null,1);return function(){n.isPaused()&&n.start()}}function op(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Ac(),c=[];function d(){var g=n.mediaQuery==="min";Lo(o).sort(function(m,x){return g?+m-+x:+x-+m}).forEach(function(m){p(o[m],"("+(g?"min":"max")+"-width:"+m+"px)")}),p(r,Bs),v()}function u(g){g&&l.destroy()}function p(g,m){var x=matchMedia(m);l.bind(x,"change",v),c.push([g,x])}function v(){var g=i.is(Tr),m=n.direction,x=c.reduce(function(T,y){return qn(T,y[1].matches?y[0]:{})},{});zs(n),h(x),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function f(g){matchMedia(Bs).matches&&(g?qn(n,r):zs(n,Lo(r)))}function h(g,m,x){qn(n,g),m&&qn(Object.getPrototypeOf(n),g),(x||!i.is(_i))&&e.emit(ln,n)}return{setup:d,destroy:u,reduce:f,set:h}}var jr="Arrow",zr=jr+"Left",Vr=jr+"Right",Uc=jr+"Up",Kc=jr+"Down",qs="rtl",Gr="ttb",oa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Uc,Vr],ArrowRight:[Kc,zr]};function rp(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===qs&&!l?1:c===Gr?0:-1;return oa[r]&&oa[r][d]||r.replace(/width|left|right/i,function(u,p){var v=oa[u.toLowerCase()][d]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(r){return r*(n.direction===qs?1:-1)}return{resolve:i,orient:o}}var _n="role",Ni="tabindex",ap="disabled",$n="aria-",zo=$n+"controls",Yc=$n+"current",Xs=$n+"selected",yn=$n+"label",ys=$n+"labelledby",Zc=$n+"hidden",vs=$n+"orientation",Eo=$n+"roledescription",Us=$n+"live",Ks=$n+"busy",Ys=$n+"atomic",xs=[_n,Ni,ap,zo,Yc,yn,ys,Zc,vs,Eo],En=jo+"__",ii="is-",ra=jo,Zs=En+"track",sp=En+"list",qr=En+"slide",Jc=qr+"--clone",lp=qr+"__container",bs=En+"arrows",Xr=En+"arrow",Qc=Xr+"--prev",ed=Xr+"--next",Ur=En+"pagination",td=Ur+"__page",cp=En+"progress",dp=cp+"__bar",up=En+"toggle",pp=En+"spinner",mp=En+"sr",gp=ii+"initialized",bi=ii+"active",nd=ii+"prev",id=ii+"next",za=ii+"visible",Va=ii+"loading",od=ii+"focus-in",rd=ii+"overflow",hp=[bi,za,nd,id,Va,od,rd],fp={slide:qr,clone:Jc,arrows:bs,arrow:Xr,prev:Qc,next:ed,pagination:Ur,page:td,spinner:pp};function yp(e,t){if(Lc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!To(n,t);)n=n.parentElement;return n}var vp=5,Js=200,ad="touchstart mousedown",aa="touchmove mousemove",sa="touchend touchcancel mouseup click";function xp(e,t,n){var i=Yt(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],v=[],f,h,g;function m(){w(),B(),y()}function x(){o(en,T),o(en,m),o(ln,y),r(document,ad+" keydown",function(O){g=O.type==="keydown"},{capture:!0}),r(l,"focusin",function(){An(l,od,!!g)})}function T(O){var _=xs.concat("style");Hn(u),Fn(l,p),Fn(f,v),Pn([f,h],_),Pn(l,O?_:["style",Eo])}function y(){Fn(l,p),Fn(f,v),p=G(ra),v=G(Zs),In(l,p),In(f,v),$t(l,yn,n.label),$t(l,ys,n.labelledby)}function w(){f=M("."+Zs),h=Bo(f,"."+sp),bo(f&&h,"A track/list element is missing."),yr(u,Ic(h,"."+qr+":not(."+Jc+")")),yi({arrows:bs,pagination:Ur,prev:Qc,next:ed,bar:dp,toggle:up},function(O,_){d[_]=M("."+O)}),Ro(d,{root:l,track:f,list:h,slides:u})}function B(){var O=l.id||ep(jo),_=n.role;l.id=O,f.id=f.id||O+"-track",h.id=h.id||O+"-list",!Sn(l,_n)&&l.tagName!=="SECTION"&&_&&$t(l,_n,_),$t(l,Eo,c.carousel),$t(h,_n,"presentation")}function M(O){var _=Mc(l,O);return _&&yp(_,"."+ra)===l?_:void 0}function G(O){return[O+"--"+n.type,O+"--"+n.direction,n.drag&&O+"--draggable",n.isNavigation&&O+"--nav",O===ra&&bi]}return Ro(d,{setup:m,mount:x,destroy:T})}var zi="slide",no="loop",Vo="fade";function bp(e,t,n,i){var o=Yt(e),r=o.on,l=o.emit,c=o.bind,d=e.Components,u=e.root,p=e.options,v=p.isNavigation,f=p.updateOnMove,h=p.i18n,g=p.pagination,m=p.slideFocus,x=d.Direction.resolve,T=Sn(i,"style"),y=Sn(i,yn),w=n>-1,B=Bo(i,"."+lp),M;function G(){w||(i.id=u.id+"-slide"+ds(t+1),$t(i,_n,g?"tabpanel":"group"),$t(i,Eo,h.slide),$t(i,yn,y||Ba(h.slideLabel,[t+1,e.length]))),O()}function O(){c(i,"click",qt(l,us,z)),c(i,"keydown",qt(l,qc,z)),r([to,Xc,Si],H),r(ms,j),f&&r(On,b)}function _(){M=!0,o.destroy(),Fn(i,hp),Pn(i,xs),$t(i,"style",T),$t(i,yn,y||"")}function j(){var C=e.splides.map(function(R){var D=R.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");$t(i,yn,Ba(h.slideX,(w?n:t)+1)),$t(i,zo,C),$t(i,_n,m?"button":""),m&&Pn(i,Eo)}function b(){M||H()}function H(){if(!M){var C=e.index;E(),$(),An(i,nd,t===C-1),An(i,id,t===C+1)}}function E(){var C=P();C!==Vs(i,bi)&&(An(i,bi,C),$t(i,Yc,v&&C||""),l(C?Fc:_c,z))}function $(){var C=I(),R=!C&&(!P()||w);if(e.state.is([eo,No])||$t(i,Zc,R||""),$t(ls(i,p.focusableNodes||""),Ni,R?-1:""),m&&$t(i,Ni,R?-1:0),C!==Vs(i,za)&&(An(i,za,C),l(C?Wc:Nc,z)),!C&&document.activeElement===i){var D=d.Slides.getAt(e.index);D&&Pc(D.slide)}}function S(C,R,D){wn(D&&B||i,C,R)}function P(){var C=e.index;return C===t||p.cloneStatus&&C===n}function I(){if(e.is(Vo))return P();var C=hn(d.Elements.track),R=hn(i),D=x("left",!0),ie=x("right",!0);return Rr(C[D])<=Po(R[D])&&Rr(R[ie])<=Po(C[ie])}function N(C,R){var D=dn(C-t);return!w&&(p.rewind||e.is(no))&&(D=Zn(D,e.length-D)),D<=R}var z={index:t,slideIndex:n,slide:i,container:B,isClone:w,mount:G,destroy:_,update:H,style:S,isWithin:N};return z}function wp(e,t,n){var i=Yt(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function v(){f(),o(en,h),o(en,f)}function f(){d.forEach(function(H,E){m(H,E,-1)})}function h(){M(function(H){H.destroy()}),Hn(p)}function g(){M(function(H){H.update()})}function m(H,E,$){var S=bp(e,E,$,H);S.mount(),p.push(S),p.sort(function(P,I){return P.index-I.index})}function x(H){return H?G(function(E){return!E.isClone}):p}function T(H){var E=t.Controller,$=E.toIndex(H),S=E.hasFocus()?1:n.perPage;return G(function(P){return vr(P.index,$,$+S-1)})}function y(H){return G(H)[0]}function w(H,E){xn(H,function($){if(Yn($)&&($=Ec($)),Rc($)){var S=d[E];S?ss($,S):Do(u,$),In($,n.classes.slide),_($,qt(r,ji))}}),r(en)}function B(H){xi(G(H).map(function(E){return E.slide})),r(en)}function M(H,E){x(E).forEach(H)}function G(H){return p.filter(Lc(H)?H:function(E){return Yn(H)?To(E.slide,H):as(Oo(H),E.index)})}function O(H,E,$){M(function(S){S.style(H,E,$)})}function _(H,E){var $=ls(H,"img"),S=$.length;S?$.forEach(function(P){l(P,"load error",function(){--S||E()})}):E()}function j(H){return H?d.length:p.length}function b(){return p.length>n.perPage}return{mount:v,destroy:h,update:g,register:m,get:x,getIn:T,getAt:y,add:w,remove:B,forEach:M,filter:G,style:O,getLength:j,isEnough:b}}function Sp(e,t,n){var i=Yt(e),o=i.on,r=i.bind,l=i.emit,c=t.Slides,d=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,f=u.list,h=c.getAt,g=c.style,m,x,T;function y(){w(),r(window,"resize load",ip(qt(l,ji))),o([ln,en],w),o(ji,B)}function w(){m=n.direction===Gr,wn(p,"maxWidth",si(n.width)),wn(v,d("paddingLeft"),M(!1)),wn(v,d("paddingRight"),M(!0)),B(!0)}function B(z){var C=hn(p);(z||x.width!==C.width||x.height!==C.height)&&(wn(v,"height",G()),g(d("marginRight"),si(n.gap)),g("width",_()),g("height",j(),!0),x=C,l(Or),T!==(T=N())&&(An(p,rd,T),l(tp,T)))}function M(z){var C=n.padding,R=d(z?"right":"left");return C&&si(C[R]||(Co(C)?0:C))||"0px"}function G(){var z="";return m&&(z=O(),bo(z,"height or heightRatio is missing."),z="calc("+z+" - "+M(!1)+" - "+M(!0)+")"),z}function O(){return si(n.height||hn(f).width*n.heightRatio)}function _(){return n.autoWidth?null:si(n.fixedWidth)||(m?"":b())}function j(){return si(n.fixedHeight)||(m?n.autoHeight?null:b():O())}function b(){var z=si(n.gap);return"calc((100%"+(z&&" + "+z)+")/"+(n.perPage||1)+(z&&" - "+z)+")"}function H(){return hn(f)[d("width")]}function E(z,C){var R=h(z||0);return R?hn(R.slide)[d("width")]+(C?0:P()):0}function $(z,C){var R=h(z);if(R){var D=hn(R.slide)[d("right")],ie=hn(f)[d("left")];return dn(D-ie)+(C?0:P())}return 0}function S(z){return $(e.length-1)-$(0)+E(0,z)}function P(){var z=h(0);return z&&parseFloat(wn(z.slide,d("marginRight")))||0}function I(z){return parseFloat(wn(v,d("padding"+(z?"Right":"Left"))))||0}function N(){return e.is(Vo)||S(!0)>H()}return{mount:y,resize:B,listSize:H,slideSize:E,sliderSize:S,totalSize:$,getPadding:I,isOverflow:N}}var $p=2;function Cp(e,t,n){var i=Yt(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(en,v),o([ln,ji],h),(u=x())&&(g(u),t.Layout.resize(!0))}function v(){f(),p()}function f(){xi(d),Hn(d),i.destroy()}function h(){var T=x();u!==T&&(u<T||!T)&&i.emit(en)}function g(T){var y=l.get().slice(),w=y.length;if(w){for(;y.length<T;)yr(y,y);yr(y.slice(-T),y.slice(0,T)).forEach(function(B,M){var G=M<T,O=m(B.slide,M);G?ss(O,y[0].slide):Do(r.list,O),yr(d,O),l.register(O,M-T+(G?0:w),B.index)})}}function m(T,y){var w=T.cloneNode(!0);return In(w,n.classes.clone),w.id=e.root.id+"-clone"+ds(y+1),w}function x(){var T=n.clones;if(!e.is(no))T=0;else if(Ho(T)){var y=n[c("fixedWidth")]&&t.Layout.slideSize(0),w=y&&Po(hn(r.track)[c("width")]/y);T=w||n[c("autoWidth")]&&e.length||n.perPage*$p}return T}return{mount:p,destroy:f}}function Tp(e,t,n){var i=Yt(e),o=i.on,r=i.emit,l=e.state.set,c=t.Layout,d=c.slideSize,u=c.getPadding,p=c.totalSize,v=c.listSize,f=c.sliderSize,h=t.Direction,g=h.resolve,m=h.orient,x=t.Elements,T=x.list,y=x.track,w;function B(){w=t.Transition,o([ni,Or,ln,en],M)}function M(){t.Controller.isBusy()||(t.Scroll.cancel(),O(e.index),t.Slides.update())}function G(R,D,ie,ee){R!==D&&z(R>ie)&&(H(),_(b(S(),R>ie),!0)),l(eo),r(On,D,ie,R),w.start(D,function(){l(Bi),r(to,D,ie,R),ee&&ee()})}function O(R){_($(R,!0))}function _(R,D){if(!e.is(Vo)){var ie=D?R:j(R);wn(T,"transform","translate"+g("X")+"("+ie+"px)"),R!==ie&&r(Xc)}}function j(R){if(e.is(no)){var D=E(R),ie=D>t.Controller.getEnd(),ee=D<0;(ee||ie)&&(R=b(R,ie))}return R}function b(R,D){var ie=R-N(D),ee=f();return R-=m(ee*(Po(dn(ie)/ee)||1))*(D?1:-1),R}function H(){_(S(),!0),w.cancel()}function E(R){for(var D=t.Slides.get(),ie=0,ee=1/0,A=0;A<D.length;A++){var ae=D[A].index,k=dn($(ae,!0)-R);if(k<=ee)ee=k,ie=ae;else break}return ie}function $(R,D){var ie=m(p(R-1)-I(R));return D?P(ie):ie}function S(){var R=g("left");return hn(T)[R]-hn(y)[R]+m(u(!1))}function P(R){return n.trimSpace&&e.is(zi)&&(R=Mi(R,0,m(f(!0)-v()))),R}function I(R){var D=n.focus;return D==="center"?(v()-d(R,!0))/2:+D*d(R)||0}function N(R){return $(R?t.Controller.getEnd():0,!!n.trimSpace)}function z(R){var D=m(b(S(),R));return R?D>=0:D<=T[g("scrollWidth")]-hn(y)[g("width")]}function C(R,D){D=Ho(D)?S():D;var ie=R!==!0&&m(D)<m(N(!1)),ee=R!==!1&&m(D)>m(N(!0));return ie||ee}return{mount:B,move:G,jump:O,translate:_,shift:b,cancel:H,toIndex:E,toPosition:$,getPosition:S,getLimit:N,exceededLimit:C,reposition:M}}function Lp(e,t,n){var i=Yt(e),o=i.on,r=i.emit,l=t.Move,c=l.getPosition,d=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,f=p.getLength,h=n.omitEnd,g=e.is(no),m=e.is(zi),x=qt(S,!1),T=qt(S,!0),y=n.start||0,w,B=y,M,G,O;function _(){j(),o([ln,en,Ir],j),o(Or,b)}function j(){M=f(!0),G=n.perMove,O=n.perPage,w=z();var k=Mi(y,0,h?w:M-1);k!==y&&(y=k,l.reposition())}function b(){w!==z()&&r(Ir)}function H(k,J,X){if(!ae()){var me=$(k),Le=N(me);Le>-1&&(J||Le!==y)&&(ie(Le),l.move(me,Le,B,X))}}function E(k,J,X,me){t.Scroll.scroll(k,J,X,function(){var Le=N(l.toIndex(c()));ie(h?Zn(Le,w):Le),me&&me()})}function $(k){var J=y;if(Yn(k)){var X=k.match(/([+\-<>])(\d+)?/)||[],me=X[1],Le=X[2];me==="+"||me==="-"?J=P(y+ +(""+me+(+Le||1)),y):me===">"?J=Le?C(+Le):x(!0):me==="<"&&(J=T(!0))}else J=g?k:Mi(k,0,w);return J}function S(k,J){var X=G||(A()?1:O),me=P(y+X*(k?-1:1),y,!(G||A()));return me===-1&&m&&!kc(c(),d(!k),1)?k?0:w:J?me:N(me)}function P(k,J,X){if(v()||A()){var me=I(k);me!==k&&(J=k,k=me,X=!1),k<0||k>w?!G&&(vr(0,k,J,!0)||vr(w,J,k,!0))?k=C(R(k)):g?k=X?k<0?-(M%O||O):M:k:n.rewind?k=k<0?w:0:k=-1:X&&k!==J&&(k=C(R(J)+(k<J?-1:1)))}else k=-1;return k}function I(k){if(m&&n.trimSpace==="move"&&k!==y)for(var J=c();J===u(k,!0)&&vr(k,0,e.length-1,!n.rewind);)k<y?--k:++k;return k}function N(k){return g?(k+M)%M||0:k}function z(){for(var k=M-(A()||g&&G?1:O);h&&k-- >0;)if(u(M-1,!0)!==u(k,!0)){k++;break}return Mi(k,0,M-1)}function C(k){return Mi(A()?k:O*k,0,w)}function R(k){return A()?Zn(k,w):Rr((k>=w?M-1:k)/O)}function D(k){var J=l.toIndex(k);return m?Mi(J,0,w):J}function ie(k){k!==y&&(B=y,y=k)}function ee(k){return k?B:y}function A(){return!Ho(n.focus)||n.isNavigation}function ae(){return e.state.is([eo,No])&&!!n.waitForTransition}return{mount:_,go:H,scroll:E,getNext:x,getPrev:T,getAdjacent:S,getEnd:z,setIndex:ie,getIndex:ee,toIndex:C,toPage:R,toDest:D,hasFocus:A,isBusy:ae}}var Rp="http://www.w3.org/2000/svg",Ip="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",Jo=40;function Pp(e,t,n){var i=Yt(e),o=i.on,r=i.bind,l=i.emit,c=n.classes,d=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,f=u.track,h=v,g=u.prev,m=u.next,x,T,y={};function w(){M(),o(ln,B)}function B(){G(),w()}function M(){var E=n.arrows;E&&!(g&&m)&&j(),g&&m&&(Ro(y,{prev:g,next:m}),Io(h,E?"":"none"),In(h,T=bs+"--"+n.direction),E&&(O(),H(),$t([g,m],zo,f.id),l(Bc,g,m)))}function G(){i.destroy(),Fn(h,T),x?(xi(v?[g,m]:h),g=m=null):Pn([g,m],xs)}function O(){o([ni,to,en,Si,Ir],H),r(m,"click",qt(_,">")),r(g,"click",qt(_,"<"))}function _(E){p.go(E,!0)}function j(){h=v||Wi("div",c.arrows),g=b(!0),m=b(!1),x=!0,Do(h,[g,m]),!v&&ss(h,f)}function b(E){var $='<button class="'+c.arrow+" "+(E?c.prev:c.next)+'" type="button"><svg xmlns="'+Rp+'" viewBox="0 0 '+Jo+" "+Jo+'" width="'+Jo+'" height="'+Jo+'" focusable="false"><path d="'+(n.arrowPath||Ip)+'" />';return Ec($)}function H(){if(g&&m){var E=e.index,$=p.getPrev(),S=p.getNext(),P=$>-1&&E<$?d.last:d.prev,I=S>-1&&E>S?d.first:d.next;g.disabled=$<0,m.disabled=S<0,$t(g,yn,P),$t(m,yn,I),l(jc,g,m,$,S)}}return{arrows:y,mount:w,destroy:G,update:H}}var Ep=cs+"-interval";function Mp(e,t,n){var i=Yt(e),o=i.on,r=i.bind,l=i.emit,c=Br(n.interval,e.go.bind(e,">"),O),d=c.isPaused,u=t.Elements,p=t.Elements,v=p.root,f=p.toggle,h=n.autoplay,g,m,x=h==="pause";function T(){h&&(y(),f&&$t(f,zo,u.track.id),x||w(),G())}function y(){n.pauseOnHover&&r(v,"mouseenter mouseleave",function(j){g=j.type==="mouseenter",M()}),n.pauseOnFocus&&r(v,"focusin focusout",function(j){m=j.type==="focusin",M()}),f&&r(f,"click",function(){x?w():B(!0)}),o([On,Dr,en],c.rewind),o(On,_)}function w(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),m=g=x=!1,G(),l(gs))}function B(j){j===void 0&&(j=!0),x=!!j,G(),d()||(c.pause(),l(hs))}function M(){x||(g||m?B(!1):w())}function G(){f&&(An(f,bi,!x),$t(f,yn,n.i18n[x?"play":"pause"]))}function O(j){var b=u.bar;b&&wn(b,"width",j*100+"%"),l(Gc,j)}function _(j){var b=t.Slides.getAt(j);c.set(b&&+Sn(b.slide,Ep)||n.interval)}return{mount:T,destroy:c.cancel,play:w,pause:B,isPaused:d}}function kp(e,t,n){var i=Yt(e),o=i.on;function r(){n.cover&&(o(fs,qt(c,!0)),o([ni,ln,en],qt(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Bo(u.container||u.slide,"img");p&&p.src&&c(d,p,u)})}function c(d,u,p){p.style("background",d?'center/cover no-repeat url("'+u.src+'")':"",!0),Io(u,d?"none":"")}return{mount:r,destroy:qt(l,!1)}}var Ap=10,Fp=600,_p=.6,Wp=1.5,Np=800;function Hp(e,t,n){var i=Yt(e),o=i.on,r=i.emit,l=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,p=c.exceededLimit,v=c.translate,f=e.is(zi),h,g,m=1;function x(){o(On,B),o([ln,en],M)}function T(O,_,j,b,H){var E=d();if(B(),j&&(!f||!p())){var $=t.Layout.sliderSize(),S=Da(O)*$*Rr(dn(O)/$)||0;O=c.toPosition(t.Controller.toDest(O%$))+S}var P=kc(E,O,1);m=1,_=P?0:_||Lr(dn(O-E)/Wp,Np),g=b,h=Br(_,y,qt(w,E,O,H),1),l(No),r(Dr),h.start()}function y(){l(Bi),g&&g(),r(Si)}function w(O,_,j,b){var H=d(),E=O+(_-O)*G(b),$=(E-H)*m;v(H+$),f&&!j&&p()&&(m*=_p,dn($)<Ap&&T(u(p(!0)),Fp,!1,g,!0))}function B(){h&&h.cancel()}function M(){h&&!h.isPaused()&&(B(),y())}function G(O){var _=n.easingFunc;return _?_(O):1-Math.pow(1-O,4)}return{mount:x,destroy:B,scroll:T,cancel:M}}var ki={passive:!1,capture:!0};function Op(e,t,n){var i=Yt(e),o=i.on,r=i.emit,l=i.bind,c=i.unbind,d=e.state,u=t.Move,p=t.Scroll,v=t.Controller,f=t.Elements.track,h=t.Media.reduce,g=t.Direction,m=g.resolve,x=g.orient,T=u.getPosition,y=u.exceededLimit,w,B,M,G,O,_=!1,j,b,H;function E(){l(f,aa,Ha,ki),l(f,sa,Ha,ki),l(f,ad,S,ki),l(f,"click",N,{capture:!0}),l(f,"dragstart",kn),o([ni,ln],$)}function $(){var V=n.drag;K(!V),G=V==="free"}function S(V){if(j=!1,!b){var Y=Le(V);me(V.target)&&(Y||!V.button)&&(v.isBusy()?kn(V,!0):(H=Y?f:window,O=d.is([eo,No]),M=null,l(H,aa,P,ki),l(H,sa,I,ki),u.cancel(),p.cancel(),z(V)))}}function P(V){if(d.is(fr)||(d.set(fr),r(Hc)),V.cancelable)if(O){u.translate(w+X(A(V)));var Y=ae(V)>Js,Q=_!==(_=y());(Y||Q)&&z(V),j=!0,r(Oc),kn(V)}else D(V)&&(O=R(V),kn(V))}function I(V){d.is(fr)&&(d.set(Bi),r(Dc)),O&&(C(V),kn(V)),c(H,aa,P),c(H,sa,I),O=!1}function N(V){!b&&j&&kn(V,!0)}function z(V){M=B,B=V,w=T()}function C(V){var Y=ie(V),Q=ee(Y),Te=n.rewind&&n.rewindByDrag;h(!1),G?v.scroll(Q,0,n.snap):e.is(Vo)?v.go(x(Da(Y))<0?Te?"<":"-":Te?">":"+"):e.is(zi)&&_&&Te?v.go(y(!0)?">":"<"):v.go(v.toDest(Q),!0),h(!0)}function R(V){var Y=n.dragMinThreshold,Q=Co(Y),Te=Q&&Y.mouse||0,we=(Q?Y.touch:+Y)||10;return dn(A(V))>(Le(V)?we:Te)}function D(V){return dn(A(V))>dn(A(V,!0))}function ie(V){if(e.is(no)||!_){var Y=ae(V);if(Y&&Y<Js)return A(V)/Y}return 0}function ee(V){return T()+Da(V)*Zn(dn(V)*(n.flickPower||600),G?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(V,Y){return J(V,Y)-J(k(V),Y)}function ae(V){return Oa(V)-Oa(k(V))}function k(V){return B===V&&M||B}function J(V,Y){return(Le(V)?V.changedTouches[0]:V)["page"+m(Y?"Y":"X")]}function X(V){return V/(_&&e.is(zi)?vp:1)}function me(V){var Y=n.noDrag;return!To(V,"."+td+", ."+Xr)&&(!Y||!To(V,Y))}function Le(V){return typeof TouchEvent<"u"&&V instanceof TouchEvent}function he(){return O}function K(V){b=V}return{mount:E,disable:K,isDragging:he}}var Dp={Spacebar:" ",Right:Vr,Left:zr,Up:Uc,Down:Kc};function ws(e){return e=Yn(e)?e:e.key,Dp[e]||e}var Qs="keydown";function Bp(e,t,n){var i=Yt(e),o=i.on,r=i.bind,l=i.unbind,c=e.root,d=t.Direction.resolve,u,p;function v(){f(),o(ln,h),o(ln,f),o(On,m)}function f(){var T=n.keyboard;T&&(u=T==="global"?window:c,r(u,Qs,x))}function h(){l(u,Qs)}function g(T){p=T}function m(){var T=p;p=!0,Tc(function(){p=T})}function x(T){if(!p){var y=ws(T);y===d(zr)?e.go("<"):y===d(Vr)&&e.go(">")}}return{mount:v,destroy:h,disable:g}}var wo=cs+"-lazy",xr=wo+"-srcset",jp="["+wo+"], ["+xr+"]";function zp(e,t,n){var i=Yt(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[to,Si],p=[];function v(){n.lazyLoad&&(f(),o(en,f))}function f(){Hn(p),h(),d?T():(r(u),o(u,g),g())}function h(){t.Slides.forEach(function(y){ls(y.slide,jp).forEach(function(w){var B=Sn(w,wo),M=Sn(w,xr);if(B!==w.src||M!==w.srcset){var G=n.classes.spinner,O=w.parentElement,_=Bo(O,"."+G)||Wi("span",G,O);p.push([w,y,_]),w.src||Io(w,"none")}})})}function g(){p=p.filter(function(y){var w=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,w)?m(y):!0}),p.length||r(u)}function m(y){var w=y[0];In(y[1].slide,Va),l(w,"load error",qt(x,y)),$t(w,"src",Sn(w,wo)),$t(w,"srcset",Sn(w,xr)),Pn(w,wo),Pn(w,xr)}function x(y,w){var B=y[0],M=y[1];Fn(M.slide,Va),w.type!=="error"&&(xi(y[2]),Io(B,""),c(fs,B,M),c(ji)),d&&T()}function T(){p.length&&m(p.shift())}return{mount:v,destroy:qt(Hn,p),check:g}}function Vp(e,t,n){var i=Yt(e),o=i.on,r=i.emit,l=i.bind,c=t.Slides,d=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,f=u.go,h=t.Direction.resolve,g=d.pagination,m=[],x,T;function y(){w(),o([ln,en,Ir],y);var b=n.pagination;g&&Io(g,b?"":"none"),b&&(o([On,Dr,Si],j),B(),j(),r(zc,{list:x,items:m},_(e.index)))}function w(){x&&(xi(g?ti(x.children):x),Fn(x,T),Hn(m),x=null),i.destroy()}function B(){var b=e.length,H=n.classes,E=n.i18n,$=n.perPage,S=p()?u.getEnd()+1:Po(b/$);x=g||Wi("ul",H.pagination,d.track.parentElement),In(x,T=Ur+"--"+O()),$t(x,_n,"tablist"),$t(x,yn,E.select),$t(x,vs,O()===Gr?"vertical":"");for(var P=0;P<S;P++){var I=Wi("li",null,x),N=Wi("button",{class:H.page,type:"button"},I),z=c.getIn(P).map(function(R){return R.slide.id}),C=!p()&&$>1?E.pageX:E.slideX;l(N,"click",qt(M,P)),n.paginationKeyboard&&l(N,"keydown",qt(G,P)),$t(I,_n,"presentation"),$t(N,_n,"tab"),$t(N,zo,z.join(" ")),$t(N,yn,Ba(C,P+1)),$t(N,Ni,-1),m.push({li:I,button:N,page:P})}}function M(b){f(">"+b,!0)}function G(b,H){var E=m.length,$=ws(H),S=O(),P=-1;$===h(Vr,!1,S)?P=++b%E:$===h(zr,!1,S)?P=(--b+E)%E:$==="Home"?P=0:$==="End"&&(P=E-1);var I=m[P];I&&(Pc(I.button),f(">"+P),kn(H,!0))}function O(){return n.paginationDirection||n.direction}function _(b){return m[u.toPage(b)]}function j(){var b=_(v(!0)),H=_(v());if(b){var E=b.button;Fn(E,bi),Pn(E,Xs),$t(E,Ni,-1)}if(H){var $=H.button;In($,bi),$t($,Xs,!0),$t($,Ni,"")}r(Vc,{list:x,items:m},b,H)}return{items:m,mount:y,destroy:w,getAt:_,update:j}}var Gp=[" ","Enter"];function qp(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function c(){r.forEach(function(g){g.destroy()}),Hn(r)}function d(){c(),l()}function u(g,m){var x=Yt(g);x.on(On,function(T,y,w){m.go(m.is(no)?w:T)}),r.push(x)}function p(){var g=Yt(e),m=g.on;m(us,f),m(qc,h),m([ni,ln],v),r.push(g),g.emit(ms,e.splides)}function v(){$t(t.Elements.list,vs,n.direction===Gr?"vertical":"")}function f(g){e.go(g.index)}function h(g,m){as(Gp,ws(m))&&(f(g),kn(m))}return{setup:qt(t.Media.set,{slideFocus:Ho(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Xp(e,t,n){var i=Yt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",c,ki)}function c(u){if(u.cancelable){var p=u.deltaY,v=p<0,f=Oa(u),h=n.wheelMinThreshold||0,g=n.wheelSleep||0;dn(p)>h&&f-r>g&&(e.go(v?"<":">"),r=f),d(v)&&kn(u)}}function d(u){return!n.releaseWheel||e.state.is(eo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Up=90;function Kp(e,t,n){var i=Yt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=Wi("span",mp),d=Br(Up,qt(p,!1));function u(){l&&(f(!t.Autoplay.isPaused()),$t(r,Ys,!0),c.textContent="…",o(gs,qt(f,!0)),o(hs,qt(f,!1)),o([to,Si],qt(p,!0)))}function p(h){$t(r,Ks,h),h?(Do(r,c),d.start()):(xi(c),d.cancel())}function v(){Pn(r,[Us,Ys,Ks]),xi(c)}function f(h){l&&$t(r,Us,h?"off":"polite")}return{mount:u,disable:f,destroy:v}}var Yp=Object.freeze({__proto__:null,Media:op,Direction:rp,Elements:xp,Slides:wp,Layout:Sp,Clones:Cp,Move:Tp,Controller:Lp,Arrows:Pp,Autoplay:Mp,Cover:kp,Scroll:Hp,Drag:Op,Keyboard:Bp,LazyLoad:zp,Pagination:Vp,Sync:qp,Wheel:Xp,Live:Kp}),Zp={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"},Jp={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:fp,i18n:Zp,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Qp(e,t,n){var i=t.Slides;function o(){Yt(e).on([ni,en],r)}function r(){i.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function l(c,d){i.style("transition","opacity "+n.speed+"ms "+n.easing),Tc(d)}return{mount:o,start:l,cancel:Ha}}function em(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,c=qt(wn,l,"transition"),d;function u(){Yt(e).bind(l,"transitionend",function(h){h.target===l&&d&&(v(),d())})}function p(h,g){var m=i.toPosition(h,!0),x=i.getPosition(),T=f(h);dn(m-x)>=1&&T>=1?n.useScroll?r.scroll(m,T,!1,g):(c("transform "+T+"ms "+n.easing),i.translate(m,!0),d=g):(i.jump(h),g())}function v(){c(""),r.cancel()}function f(h){var g=n.rewindSpeed;if(e.is(zi)&&g){var m=o.getIndex(!0),x=o.getEnd();if(m===0&&h>=x||m>=x&&h===0)return g}return n.speed}return{mount:u,start:p,cancel:v}}var tm=(function(){function e(n,i){this.event=Yt(),this.Components={},this.state=np(_i),this.splides=[],this._o={},this._E={};var o=Yn(n)?Mc(document,n):n;bo(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,ys)||""},Jp,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,cs)))}catch{bo(!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,c=this.Components;bo(l.is([_i,Tr]),"Already mounted!"),l.set(_i),this._C=c,this._T=o||this._T||(this.is(Vo)?Qp:em),this._E=i||this._E;var d=Ro({},Yp,this._E,{Transition:this._T});return yi(d,function(u,p){var v=u(r,c,r._o);c[p]=v,v.setup&&v.setup()}),yi(c,function(u){u.mount&&u.mount()}),this.emit(ni),In(this.root,gp),l.set(Bi),this.emit(ja),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Bi)&&(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(ti(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(_i)?Yt(this).on(ja,this.destroy.bind(this,i)):(yi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(ps),o.destroy(),i&&Hn(this.splides),r.set(Tr)),this},Zu(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})(),Ss=tm;Ss.defaults={};Ss.STATES=Qu;var el=[[ni,"onMounted"],[ja,"onReady"],[On,"onMove"],[to,"onMoved"],[us,"onClick"],[Fc,"onActive"],[_c,"onInactive"],[Wc,"onVisible"],[Nc,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[ji,"onResize"],[Or,"onResized"],[Hc,"onDrag"],[Oc,"onDragging"],[Dc,"onDragged"],[Dr,"onScroll"],[Si,"onScrolled"],[ps,"onDestroy"],[Bc,"onArrowsMounted"],[jc,"onArrowsUpdated"],[zc,"onPaginationMounted"],[Vc,"onPaginationUpdated"],[ms,"onNavigationMounted"],[gs,"onAutoplayPlay"],[Gc,"onAutoplayPlaying"],[hs,"onAutoplayPause"],[fs,"onLazyLoadLoaded"]];function $s(...e){return e.filter(Boolean).join(" ")}function Pr(e){return e!==null&&typeof e=="object"}function Ga(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Ga(n,t[i]));if(Pr(e)&&Pr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Ga(e[o],t[o]))}return e===t}function nm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function im(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 qa(e,t){const n=e;return im(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Pr(i)?n[o]=qa(Pr(n[o])?n[o]:{},i):n[o]=i}),n}var om=({children:e,className:t,...n})=>s.createElement("div",{className:$s("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Cs=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 Ss(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=qa({},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&&!Ga(this.options,e)&&(this.splide.options=e,this.options=qa({},e));const t=this.getSlides();nm(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){el.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return s.createElement(t,{className:$s("splide",e),ref:this.splideRef,...this.omit(o,["options",...el.map(r=>r[1])])},n?s.createElement(om,null,i):i)}},Ts=({children:e,className:t,...n})=>s.createElement("li",{className:$s("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),ut=require("classnames"),W=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Dn=require("react-dom");function su(e){return e.type==="object"&&e.version===1}const lu="ControlSlider-module__wrapper___sHEkd",cu="ControlSlider-module__hoverArrow___A-dOH",du="ControlSlider-module__sliderItem___QQSkR",uu="ControlSlider-module__sliderImage___9hRl-",pu="ControlSlider-module__arrow___05ghY",mu="ControlSlider-module__arrowVertical___tBfVN",gu="ControlSlider-module__nextArrow___-30Yc",hu="ControlSlider-module__arrowInner___aEra3",fu="ControlSlider-module__arrowIcon___S4ztF",yu="ControlSlider-module__arrowImg___2dwJW",vu="ControlSlider-module__mirror___brd6U",xu="ControlSlider-module__pagination___bicLF",bu="ControlSlider-module__paginationInner___bT-P-",wu="ControlSlider-module__paginationVertical___zYqKw",Su="ControlSlider-module__paginationItem___nTRbk",$u="ControlSlider-module__dot___p1Qun",Cu="ControlSlider-module__activeDot___LHFaj",Tu="ControlSlider-module__paginationInsideBottom___R3FWn",Lu="ControlSlider-module__paginationInsideTop___V-qb-",Ru="ControlSlider-module__paginationOutsideBottom___14w8D",Iu="ControlSlider-module__paginationOutsideTop___SCLqB",Pu="ControlSlider-module__paginationInsideLeft___yOBRZ",Eu="ControlSlider-module__paginationInsideRight___Rtt3o",Mu="ControlSlider-module__paginationOutsideLeft___lahaw",ku="ControlSlider-module__paginationOutsideRight___EtuQa",Au="ControlSlider-module__imgWrapper___UjEgB",Fu="ControlSlider-module__captionBlock___dJ6-j",_u="ControlSlider-module__captionTextWrapper___HFlpf",Wu="ControlSlider-module__captionText___uGBVc",Nu="ControlSlider-module__active___WZK4G",Hu="ControlSlider-module__withPointerEvents___t-18M",Ou="ControlSlider-module__topLeftAlignment___zjnGM",Du="ControlSlider-module__topCenterAlignment___gD1xW",Bu="ControlSlider-module__topRightAlignment___NMapS",ju="ControlSlider-module__middleLeftAlignment___OnUrY",zu="ControlSlider-module__middleCenterAlignment___Tdkl0",Vu="ControlSlider-module__middleRightAlignment___wEbfX",Gu="ControlSlider-module__bottomLeftAlignment___cTP2-",qu="ControlSlider-module__bottomCenterAlignment___c54fB",Xu="ControlSlider-module__bottomRightAlignment___kEwrz",Uu="ControlSlider-module__clickOverlay___DZA28",Yu="ControlSlider-module__contain___pLyq7",Ku="ControlSlider-module__cover___KdDat",ct={wrapper:lu,hoverArrow:cu,sliderItem:du,sliderImage:uu,arrow:pu,arrowVertical:mu,nextArrow:gu,arrowInner:hu,arrowIcon:fu,arrowImg:yu,mirror:vu,pagination:xu,paginationInner:bu,paginationVertical:wu,paginationItem:Su,dot:$u,activeDot:Cu,paginationInsideBottom:Tu,paginationInsideTop:Lu,paginationOutsideBottom:Ru,paginationOutsideTop:Iu,paginationInsideLeft:Pu,paginationInsideRight:Eu,paginationOutsideLeft:Mu,paginationOutsideRight:ku,imgWrapper:Au,captionBlock:Fu,captionTextWrapper:_u,captionText:Wu,active:Nu,withPointerEvents:Hu,topLeftAlignment:Ou,topCenterAlignment:Du,topRightAlignment:Bu,middleLeftAlignment:ju,middleCenterAlignment:zu,middleRightAlignment:Vu,bottomLeftAlignment:Gu,bottomCenterAlignment:qu,bottomRightAlignment:Xu,clickOverlay:Uu,contain:Yu,cover:Ku};function Zu(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 Ju(e,t,n){return t&&Zu(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var js="(prefers-reduced-motion: reduce)",Wi=1,Qu=2,ji=3,to=4,Oo=5,vr=6,Rr=7,ep={CREATED:Wi,MOUNTED:Qu,IDLE:ji,MOVING:to,SCROLLING:Oo,DRAGGING:vr,DESTROYED:Rr};function Hn(e){e.length=0}function ti(e,t,n){return Array.prototype.slice.call(e,t,n)}function qt(e){return e.bind.apply(e,[null].concat(ti(arguments,1)))}var Tc=setTimeout,Da=function(){};function zs(e){return requestAnimationFrame(e)}function Or(e,t){return typeof t===e}function Co(e){return!ss(e)&&Or("object",e)}var as=Array.isArray,Lc=qt(Or,"function"),Kn=qt(Or,"string"),Do=qt(Or,"undefined");function ss(e){return e===null}function Rc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Bo(e){return as(e)?e:[e]}function xn(e,t){Bo(e).forEach(t)}function ls(e,t){return e.indexOf(t)>-1}function xr(e,t){return e.push.apply(e,Bo(t)),e}function An(e,t,n){e&&xn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function In(e,t){An(e,Kn(t)?t.split(" "):t,!0)}function jo(e,t){xn(t,e.appendChild.bind(e))}function cs(e,t){xn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function To(e,t){return Rc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ic(e,t){var n=e?ti(e.children):[];return t?n.filter(function(i){return To(i,t)}):n}function zo(e,t){return t?Ic(e,t)[0]:e.firstElementChild}var Lo=Object.keys;function yi(e,t,n){return e&&(n?Lo(e).reverse():Lo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ro(e){return ti(arguments,1).forEach(function(t){yi(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ti(arguments,1).forEach(function(t){yi(t,function(n,i){as(n)?e[i]=n.slice():Co(n)?e[i]=qn({},Co(e[i])?e[i]:{},n):e[i]=n})}),e}function Vs(e,t){xn(t||Lo(e),function(n){delete e[n]})}function Pn(e,t){xn(e,function(n){xn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Co(t)?yi(t,function(i,o){$t(e,o,i)}):xn(e,function(i){ss(n)||n===""?Pn(i,t):i.setAttribute(t,String(n))})}function Hi(e,t,n){var i=document.createElement(e);return t&&(Kn(t)?In(i,t):$t(i,t)),n&&jo(n,i),i}function wn(e,t,n){if(Do(n))return getComputedStyle(e)[t];ss(n)||(e.style[t]=""+n)}function Io(e,t){wn(e,"display",t)}function Pc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function Gs(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function bi(e){xn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ec(e){return zo(new DOMParser().parseFromString(e,"text/html").body)}function kn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Mc(e,t){return e&&e.querySelector(t)}function ds(e,t){return t?ti(e.querySelectorAll(t)):[]}function Fn(e,t){An(e,t,!1)}function Ba(e){return e.timeStamp}function si(e){return Kn(e)?e:e?e+"px":""}var Vo="splide",us="data-"+Vo;function bo(e,t){if(!e)throw new Error("["+Vo+"] "+(t||""))}var Zn=Math.min,Ir=Math.max,Pr=Math.floor,Po=Math.ceil,dn=Math.abs;function kc(e,t,n){return dn(e-t)<n}function br(e,t,n,i){var o=Zn(t,n),r=Ir(t,n);return i?o<e&&e<r:o<=e&&e<=r}function ki(e,t,n){var i=Zn(t,n),o=Ir(t,n);return Zn(Ir(i,e),o)}function ja(e){return+(e>0)-+(e<0)}function za(e,t){return xn(t,function(n){e=e.replace("%s",""+n)}),e}function ps(e){return e<10?"0"+e:""+e}var qs={};function tp(e){return""+e+ps(qs[e]=(qs[e]||0)+1)}function Ac(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,x){var g="addEventListener"in p,m=g?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);g?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,x,c,m])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(x){return x[0]===u&&x[1]===p&&x[2]===b&&(!c||x[3]===c)?(x[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){xn(l,function(u){u&&xn(d,function(p){p.split(" ").forEach(function(b){var x=b.split(".");c(u,x[0],x[1])})})})}function r(){e.forEach(function(l){l[4]()}),Hn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ni="mounted",Va="ready",On="move",no="moved",ms="click",Fc="active",_c="inactive",Wc="visible",Nc="hidden",en="refresh",ln="updated",zi="resize",Dr="resized",Hc="drag",Oc="dragging",Dc="dragged",Br="scroll",$i="scrolled",np="overflow",gs="destroy",Bc="arrows:mounted",jc="arrows:updated",zc="pagination:mounted",Vc="pagination:updated",hs="navigation:mounted",fs="autoplay:play",Gc="autoplay:playing",ys="autoplay:pause",vs="lazyload:loaded",qc="sk",Xc="sh",Er="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Ac();function i(r,l){n.bind(t,Bo(r).join(" "),function(d){l.apply(l,as(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ti(arguments,1))}return e&&e.event.on(gs,n.destroy),Ro(n,{bus:t,on:i,off:qt(n.unbind,t),emit:o})}function jr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Zn((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return x();d=zs(p)}}function b(C){C||m(),r=o()-(C?l*e:0),c=!1,d=zs(p)}function x(){c=!0}function g(){r=o(),l=0,n&&n(l)}function m(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function h(C){e=C}function f(){return c}return{start:b,rewind:g,pause:x,cancel:m,set:h,isPaused:f}}function ip(e){var t=e;function n(o){t=o}function i(o){return ls(Bo(o),t)}return{set:n,is:i}}function op(e,t){var n=jr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function rp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Ac(),d=[];function c(){var m=n.mediaQuery==="min";Lo(o).sort(function(h,f){return m?+h-+f:+f-+h}).forEach(function(h){p(o[h],"("+(m?"min":"max")+"-width:"+h+"px)")}),p(r,js),b()}function u(m){m&&l.destroy()}function p(m,h){var f=matchMedia(h);l.bind(f,"change",b),d.push([m,f])}function b(){var m=i.is(Rr),h=n.direction,f=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});Vs(n),g(f),n.destroy?e.destroy(n.destroy==="completely"):m?(u(!0),e.mount()):h!==n.direction&&e.refresh()}function x(m){matchMedia(js).matches&&(m?qn(n,r):Vs(n,Lo(r)))}function g(m,h,f){qn(n,m),h&&qn(Object.getPrototypeOf(n),m),(f||!i.is(Wi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:x,set:g}}var zr="Arrow",Vr=zr+"Left",Gr=zr+"Right",Uc=zr+"Up",Yc=zr+"Down",Xs="rtl",qr="ttb",ra={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Uc,Gr],ArrowRight:[Yc,Vr]};function ap(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===Xs&&!l?1:d===qr?0:-1;return ra[r]&&ra[r][c]||r.replace(/width|left|right/i,function(u,p){var b=ra[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(r){return r*(n.direction===Xs?1:-1)}return{resolve:i,orient:o}}var _n="role",Oi="tabindex",sp="disabled",$n="aria-",Go=$n+"controls",Kc=$n+"current",Us=$n+"selected",yn=$n+"label",xs=$n+"labelledby",Zc=$n+"hidden",bs=$n+"orientation",Eo=$n+"roledescription",Ys=$n+"live",Ks=$n+"busy",Zs=$n+"atomic",ws=[_n,Oi,sp,Go,Kc,yn,xs,Zc,bs,Eo],En=Vo+"__",ii="is-",aa=Vo,Js=En+"track",lp=En+"list",Xr=En+"slide",Jc=Xr+"--clone",cp=Xr+"__container",Ss=En+"arrows",Ur=En+"arrow",Qc=Ur+"--prev",ed=Ur+"--next",Yr=En+"pagination",td=Yr+"__page",dp=En+"progress",up=dp+"__bar",pp=En+"toggle",mp=En+"spinner",gp=En+"sr",hp=ii+"initialized",wi=ii+"active",nd=ii+"prev",id=ii+"next",Ga=ii+"visible",qa=ii+"loading",od=ii+"focus-in",rd=ii+"overflow",fp=[wi,Ga,nd,id,qa,od,rd],yp={slide:Xr,clone:Jc,arrows:Ss,arrow:Ur,prev:Qc,next:ed,pagination:Yr,page:td,spinner:mp};function vp(e,t){if(Lc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!To(n,t);)n=n.parentElement;return n}var xp=5,Qs=200,ad="touchstart mousedown",sa="touchmove mousemove",la="touchend touchcancel mouseup click";function bp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],x,g,m;function h(){R(),H(),y()}function f(){o(en,C),o(en,h),o(ln,y),r(document,ad+" keydown",function(F){m=F.type==="keydown"},{capture:!0}),r(l,"focusin",function(){An(l,od,!!m)})}function C(F){var _=ws.concat("style");Hn(u),Fn(l,p),Fn(x,b),Pn([x,g],_),Pn(l,F?_:["style",Eo])}function y(){Fn(l,p),Fn(x,b),p=U(aa),b=U(Js),In(l,p),In(x,b),$t(l,yn,n.label),$t(l,xs,n.labelledby)}function R(){x=S("."+Js),g=zo(x,"."+lp),bo(x&&g,"A track/list element is missing."),xr(u,Ic(g,"."+Xr+":not(."+Jc+")")),yi({arrows:Ss,pagination:Yr,prev:Qc,next:ed,bar:up,toggle:pp},function(F,_){c[_]=S("."+F)}),Ro(c,{root:l,track:x,list:g,slides:u})}function H(){var F=l.id||tp(Vo),_=n.role;l.id=F,x.id=x.id||F+"-track",g.id=g.id||F+"-list",!Sn(l,_n)&&l.tagName!=="SECTION"&&_&&$t(l,_n,_),$t(l,Eo,d.carousel),$t(g,_n,"presentation")}function S(F){var _=Mc(l,F);return _&&vp(_,"."+aa)===l?_:void 0}function U(F){return[F+"--"+n.type,F+"--"+n.direction,n.drag&&F+"--draggable",n.isNavigation&&F+"--nav",F===aa&&wi]}return Ro(c,{setup:h,mount:f,destroy:C})}var Vi="slide",io="loop",qo="fade";function wp(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,b=p.isNavigation,x=p.updateOnMove,g=p.i18n,m=p.pagination,h=p.slideFocus,f=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),R=n>-1,H=zo(i,"."+cp),S;function U(){R||(i.id=u.id+"-slide"+ps(t+1),$t(i,_n,m?"tabpanel":"group"),$t(i,Eo,g.slide),$t(i,yn,y||za(g.slideLabel,[t+1,e.length]))),F()}function F(){d(i,"click",qt(l,ms,$)),d(i,"keydown",qt(l,qc,$)),r([no,Xc,$i],N),r(hs,B),x&&r(On,L)}function _(){S=!0,o.destroy(),Fn(i,fp),Pn(i,ws),$t(i,"style",C),$t(i,yn,y||"")}function B(){var v=e.splides.map(function(w){var P=w.splide.Components.Slides.getAt(t);return P?P.slide.id:""}).join(" ");$t(i,yn,za(g.slideX,(R?n:t)+1)),$t(i,Go,v),$t(i,_n,h?"button":""),h&&Pn(i,Eo)}function L(){S||N()}function N(){if(!S){var v=e.index;k(),Z(),An(i,nd,t===v-1),An(i,id,t===v+1)}}function k(){var v=K();v!==Gs(i,wi)&&(An(i,wi,v),$t(i,Kc,b&&v||""),l(v?Fc:_c,$))}function Z(){var v=D(),w=!v&&(!K()||R);if(e.state.is([to,Oo])||$t(i,Zc,w||""),$t(ds(i,p.focusableNodes||""),Oi,w?-1:""),h&&$t(i,Oi,w?-1:0),v!==Gs(i,Ga)&&(An(i,Ga,v),l(v?Wc:Nc,$)),!v&&document.activeElement===i){var P=c.Slides.getAt(e.index);P&&Pc(P.slide)}}function E(v,w,P){wn(P&&H||i,v,w)}function K(){var v=e.index;return v===t||p.cloneStatus&&v===n}function D(){if(e.is(qo))return K();var v=hn(c.Elements.track),w=hn(i),P=f("left",!0),Q=f("right",!0);return Pr(v[P])<=Po(w[P])&&Pr(w[Q])<=Po(v[Q])}function j(v,w){var P=dn(v-t);return!R&&(p.rewind||e.is(io))&&(P=Zn(P,e.length-P)),P<=w}var $={index:t,slideIndex:n,slide:i,container:H,isClone:R,mount:U,destroy:_,update:N,style:E,isWithin:j};return $}function Sp(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 b(){x(),o(en,g),o(en,x)}function x(){c.forEach(function(N,k){h(N,k,-1)})}function g(){S(function(N){N.destroy()}),Hn(p)}function m(){S(function(N){N.update()})}function h(N,k,Z){var E=wp(e,k,Z,N);E.mount(),p.push(E),p.sort(function(K,D){return K.index-D.index})}function f(N){return N?U(function(k){return!k.isClone}):p}function C(N){var k=t.Controller,Z=k.toIndex(N),E=k.hasFocus()?1:n.perPage;return U(function(K){return br(K.index,Z,Z+E-1)})}function y(N){return U(N)[0]}function R(N,k){xn(N,function(Z){if(Kn(Z)&&(Z=Ec(Z)),Rc(Z)){var E=c[k];E?cs(Z,E):jo(u,Z),In(Z,n.classes.slide),_(Z,qt(r,zi))}}),r(en)}function H(N){bi(U(N).map(function(k){return k.slide})),r(en)}function S(N,k){f(k).forEach(N)}function U(N){return p.filter(Lc(N)?N:function(k){return Kn(N)?To(k.slide,N):ls(Bo(N),k.index)})}function F(N,k,Z){S(function(E){E.style(N,k,Z)})}function _(N,k){var Z=ds(N,"img"),E=Z.length;E?Z.forEach(function(K){l(K,"load error",function(){--E||k()})}):k()}function B(N){return N?c.length:p.length}function L(){return p.length>n.perPage}return{mount:b,destroy:g,update:m,register:h,get:f,getIn:C,getAt:y,add:R,remove:H,forEach:S,filter:U,style:F,getLength:B,isEnough:L}}function $p(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,b=u.track,x=u.list,g=d.getAt,m=d.style,h,f,C;function y(){R(),r(window,"resize load",op(qt(l,zi))),o([ln,en],R),o(zi,H)}function R(){h=n.direction===qr,wn(p,"maxWidth",si(n.width)),wn(b,c("paddingLeft"),S(!1)),wn(b,c("paddingRight"),S(!0)),H(!0)}function H($){var v=hn(p);($||f.width!==v.width||f.height!==v.height)&&(wn(b,"height",U()),m(c("marginRight"),si(n.gap)),m("width",_()),m("height",B(),!0),f=v,l(Dr),C!==(C=j())&&(An(p,rd,C),l(np,C)))}function S($){var v=n.padding,w=c($?"right":"left");return v&&si(v[w]||(Co(v)?0:v))||"0px"}function U(){var $="";return h&&($=F(),bo($,"height or heightRatio is missing."),$="calc("+$+" - "+S(!1)+" - "+S(!0)+")"),$}function F(){return si(n.height||hn(x).width*n.heightRatio)}function _(){return n.autoWidth?null:si(n.fixedWidth)||(h?"":L())}function B(){return si(n.fixedHeight)||(h?n.autoHeight?null:L():F())}function L(){var $=si(n.gap);return"calc((100%"+($&&" + "+$)+")/"+(n.perPage||1)+($&&" - "+$)+")"}function N(){return hn(x)[c("width")]}function k($,v){var w=g($||0);return w?hn(w.slide)[c("width")]+(v?0:K()):0}function Z($,v){var w=g($);if(w){var P=hn(w.slide)[c("right")],Q=hn(x)[c("left")];return dn(P-Q)+(v?0:K())}return 0}function E($){return Z(e.length-1)-Z(0)+k(0,$)}function K(){var $=g(0);return $&&parseFloat(wn($.slide,c("marginRight")))||0}function D($){return parseFloat(wn(b,c("padding"+($?"Right":"Left"))))||0}function j(){return e.is(qo)||E(!0)>N()}return{mount:y,resize:H,listSize:N,slideSize:k,sliderSize:E,totalSize:Z,getPadding:D,isOverflow:j}}var Cp=2;function Tp(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,b),o([ln,zi],g),(u=f())&&(m(u),t.Layout.resize(!0))}function b(){x(),p()}function x(){bi(c),Hn(c),i.destroy()}function g(){var C=f();u!==C&&(u<C||!C)&&i.emit(en)}function m(C){var y=l.get().slice(),R=y.length;if(R){for(;y.length<C;)xr(y,y);xr(y.slice(-C),y.slice(0,C)).forEach(function(H,S){var U=S<C,F=h(H.slide,S);U?cs(F,y[0].slide):jo(r.list,F),xr(c,F),l.register(F,S-C+(U?0:R),H.index)})}}function h(C,y){var R=C.cloneNode(!0);return In(R,n.classes.clone),R.id=e.root.id+"-clone"+ps(y+1),R}function f(){var C=n.clones;if(!e.is(io))C=0;else if(Do(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),R=y&&Po(hn(r.track)[d("width")]/y);C=R||n[d("autoWidth")]&&e.length||n.perPage*Cp}return C}return{mount:p,destroy:x}}function Lp(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,b=d.listSize,x=d.sliderSize,g=t.Direction,m=g.resolve,h=g.orient,f=t.Elements,C=f.list,y=f.track,R;function H(){R=t.Transition,o([ni,Dr,ln,en],S)}function S(){t.Controller.isBusy()||(t.Scroll.cancel(),F(e.index),t.Slides.update())}function U(w,P,Q,z){w!==P&&$(w>Q)&&(N(),_(L(E(),w>Q),!0)),l(to),r(On,P,Q,w),R.start(P,function(){l(ji),r(no,P,Q,w),z&&z()})}function F(w){_(Z(w,!0))}function _(w,P){if(!e.is(qo)){var Q=P?w:B(w);wn(C,"transform","translate"+m("X")+"("+Q+"px)"),w!==Q&&r(Xc)}}function B(w){if(e.is(io)){var P=k(w),Q=P>t.Controller.getEnd(),z=P<0;(z||Q)&&(w=L(w,Q))}return w}function L(w,P){var Q=w-j(P),z=x();return w-=h(z*(Po(dn(Q)/z)||1))*(P?1:-1),w}function N(){_(E(),!0),R.cancel()}function k(w){for(var P=t.Slides.get(),Q=0,z=1/0,T=0;T<P.length;T++){var O=P[T].index,M=dn(Z(O,!0)-w);if(M<=z)z=M,Q=O;else break}return Q}function Z(w,P){var Q=h(p(w-1)-D(w));return P?K(Q):Q}function E(){var w=m("left");return hn(C)[w]-hn(y)[w]+h(u(!1))}function K(w){return n.trimSpace&&e.is(Vi)&&(w=ki(w,0,h(x(!0)-b()))),w}function D(w){var P=n.focus;return P==="center"?(b()-c(w,!0))/2:+P*c(w)||0}function j(w){return Z(w?t.Controller.getEnd():0,!!n.trimSpace)}function $(w){var P=h(L(E(),w));return w?P>=0:P<=C[m("scrollWidth")]-hn(y)[m("width")]}function v(w,P){P=Do(P)?E():P;var Q=w!==!0&&h(P)<h(j(!1)),z=w!==!1&&h(P)>h(j(!0));return Q||z}return{mount:H,move:U,jump:F,translate:_,shift:L,cancel:N,toIndex:k,toPosition:Z,getPosition:E,getLimit:j,exceededLimit:v,reposition:S}}function Rp(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,b=p.isEnough,x=p.getLength,g=n.omitEnd,m=e.is(io),h=e.is(Vi),f=qt(E,!1),C=qt(E,!0),y=n.start||0,R,H=y,S,U,F;function _(){B(),o([ln,en,Er],B),o(Dr,L)}function B(){S=x(!0),U=n.perMove,F=n.perPage,R=$();var M=ki(y,0,g?R:S-1);M!==y&&(y=M,l.reposition())}function L(){R!==$()&&r(Er)}function N(M,ee,V){if(!O()){var me=Z(M),Ie=j(me);Ie>-1&&(ee||Ie!==y)&&(Q(Ie),l.move(me,Ie,H,V))}}function k(M,ee,V,me){t.Scroll.scroll(M,ee,V,function(){var Ie=j(l.toIndex(d()));Q(g?Zn(Ie,R):Ie),me&&me()})}function Z(M){var ee=y;if(Kn(M)){var V=M.match(/([+\-<>])(\d+)?/)||[],me=V[1],Ie=V[2];me==="+"||me==="-"?ee=K(y+ +(""+me+(+Ie||1)),y):me===">"?ee=Ie?v(+Ie):f(!0):me==="<"&&(ee=C(!0))}else ee=m?M:ki(M,0,R);return ee}function E(M,ee){var V=U||(T()?1:F),me=K(y+V*(M?-1:1),y,!(U||T()));return me===-1&&h&&!kc(d(),c(!M),1)?M?0:R:ee?me:j(me)}function K(M,ee,V){if(b()||T()){var me=D(M);me!==M&&(ee=M,M=me,V=!1),M<0||M>R?!U&&(br(0,M,ee,!0)||br(R,ee,M,!0))?M=v(w(M)):m?M=V?M<0?-(S%F||F):S:M:n.rewind?M=M<0?R:0:M=-1:V&&M!==ee&&(M=v(w(ee)+(M<ee?-1:1)))}else M=-1;return M}function D(M){if(h&&n.trimSpace==="move"&&M!==y)for(var ee=d();ee===u(M,!0)&&br(M,0,e.length-1,!n.rewind);)M<y?--M:++M;return M}function j(M){return m?(M+S)%S||0:M}function $(){for(var M=S-(T()||m&&U?1:F);g&&M-- >0;)if(u(S-1,!0)!==u(M,!0)){M++;break}return ki(M,0,S-1)}function v(M){return ki(T()?M:F*M,0,R)}function w(M){return T()?Zn(M,R):Pr((M>=R?S-1:M)/F)}function P(M){var ee=l.toIndex(M);return h?ki(ee,0,R):ee}function Q(M){M!==y&&(H=y,y=M)}function z(M){return M?H:y}function T(){return!Do(n.focus)||n.isNavigation}function O(){return e.state.is([to,Oo])&&!!n.waitForTransition}return{mount:_,go:N,scroll:k,getNext:f,getPrev:C,getAdjacent:E,getEnd:$,setIndex:Q,getIndex:z,toIndex:v,toPage:w,toDest:P,hasFocus:T,isBusy:O}}var Ip="http://www.w3.org/2000/svg",Pp="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",er=40;function Ep(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,b=u.arrows,x=u.track,g=b,m=u.prev,h=u.next,f,C,y={};function R(){S(),o(ln,H)}function H(){U(),R()}function S(){var k=n.arrows;k&&!(m&&h)&&B(),m&&h&&(Ro(y,{prev:m,next:h}),Io(g,k?"":"none"),In(g,C=Ss+"--"+n.direction),k&&(F(),N(),$t([m,h],Go,x.id),l(Bc,m,h)))}function U(){i.destroy(),Fn(g,C),f?(bi(b?[m,h]:g),m=h=null):Pn([m,h],ws)}function F(){o([ni,no,en,$i,Er],N),r(h,"click",qt(_,">")),r(m,"click",qt(_,"<"))}function _(k){p.go(k,!0)}function B(){g=b||Hi("div",d.arrows),m=L(!0),h=L(!1),f=!0,jo(g,[m,h]),!b&&cs(g,x)}function L(k){var Z='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Ip+'" viewBox="0 0 '+er+" "+er+'" width="'+er+'" height="'+er+'" focusable="false"><path d="'+(n.arrowPath||Pp)+'" />';return Ec(Z)}function N(){if(m&&h){var k=e.index,Z=p.getPrev(),E=p.getNext(),K=Z>-1&&k<Z?c.last:c.prev,D=E>-1&&k>E?c.first:c.next;m.disabled=Z<0,h.disabled=E<0,$t(m,yn,K),$t(h,yn,D),l(jc,m,h,Z,E)}}return{arrows:y,mount:R,destroy:U,update:N}}var Mp=us+"-interval";function kp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=jr(n.interval,e.go.bind(e,">"),F),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,x=p.toggle,g=n.autoplay,m,h,f=g==="pause";function C(){g&&(y(),x&&$t(x,Go,u.track.id),f||R(),U())}function y(){n.pauseOnHover&&r(b,"mouseenter mouseleave",function(B){m=B.type==="mouseenter",S()}),n.pauseOnFocus&&r(b,"focusin focusout",function(B){h=B.type==="focusin",S()}),x&&r(x,"click",function(){f?R():H(!0)}),o([On,Br,en],d.rewind),o(On,_)}function R(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=m=f=!1,U(),l(fs))}function H(B){B===void 0&&(B=!0),f=!!B,U(),c()||(d.pause(),l(ys))}function S(){f||(m||h?H(!1):R())}function U(){x&&(An(x,wi,!f),$t(x,yn,n.i18n[f?"play":"pause"]))}function F(B){var L=u.bar;L&&wn(L,"width",B*100+"%"),l(Gc,B)}function _(B){var L=t.Slides.getAt(B);d.set(L&&+Sn(L.slide,Mp)||n.interval)}return{mount:C,destroy:d.cancel,play:R,pause:H,isPaused:c}}function Ap(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(vs,qt(d,!0)),o([ni,ln,en],qt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=zo(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),Io(u,c?"none":"")}return{mount:r,destroy:qt(l,!1)}}var Fp=10,_p=600,Wp=.6,Np=1.5,Hp=800;function Op(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,b=d.translate,x=e.is(Vi),g,m,h=1;function f(){o(On,H),o([ln,en],S)}function C(F,_,B,L,N){var k=c();if(H(),B&&(!x||!p())){var Z=t.Layout.sliderSize(),E=ja(F)*Z*Pr(dn(F)/Z)||0;F=d.toPosition(t.Controller.toDest(F%Z))+E}var K=kc(k,F,1);h=1,_=K?0:_||Ir(dn(F-k)/Np,Hp),m=L,g=jr(_,y,qt(R,k,F,N),1),l(Oo),r(Br),g.start()}function y(){l(ji),m&&m(),r($i)}function R(F,_,B,L){var N=c(),k=F+(_-F)*U(L),Z=(k-N)*h;b(N+Z),x&&!B&&p()&&(h*=Wp,dn(Z)<Fp&&C(u(p(!0)),_p,!1,m,!0))}function H(){g&&g.cancel()}function S(){g&&!g.isPaused()&&(H(),y())}function U(F){var _=n.easingFunc;return _?_(F):1-Math.pow(1-F,4)}return{mount:f,destroy:H,scroll:C,cancel:S}}var Ai={passive:!1,capture:!0};function Dp(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,b=t.Controller,x=t.Elements.track,g=t.Media.reduce,m=t.Direction,h=m.resolve,f=m.orient,C=u.getPosition,y=u.exceededLimit,R,H,S,U,F,_=!1,B,L,N;function k(){l(x,sa,Da,Ai),l(x,la,Da,Ai),l(x,ad,E,Ai),l(x,"click",j,{capture:!0}),l(x,"dragstart",kn),o([ni,ln],Z)}function Z(){var ne=n.drag;ae(!ne),U=ne==="free"}function E(ne){if(B=!1,!L){var oe=Ie(ne);me(ne.target)&&(oe||!ne.button)&&(b.isBusy()?kn(ne,!0):(N=oe?x:window,F=c.is([to,Oo]),S=null,l(N,sa,K,Ai),l(N,la,D,Ai),u.cancel(),p.cancel(),$(ne)))}}function K(ne){if(c.is(vr)||(c.set(vr),r(Hc)),ne.cancelable)if(F){u.translate(R+V(T(ne)));var oe=O(ne)>Qs,ie=_!==(_=y());(oe||ie)&&$(ne),B=!0,r(Oc),kn(ne)}else P(ne)&&(F=w(ne),kn(ne))}function D(ne){c.is(vr)&&(c.set(ji),r(Dc)),F&&(v(ne),kn(ne)),d(N,sa,K),d(N,la,D),F=!1}function j(ne){!L&&B&&kn(ne,!0)}function $(ne){S=H,H=ne,R=C()}function v(ne){var oe=Q(ne),ie=z(oe),Ae=n.rewind&&n.rewindByDrag;g(!1),U?b.scroll(ie,0,n.snap):e.is(qo)?b.go(f(ja(oe))<0?Ae?"<":"-":Ae?">":"+"):e.is(Vi)&&_&&Ae?b.go(y(!0)?">":"<"):b.go(b.toDest(ie),!0),g(!0)}function w(ne){var oe=n.dragMinThreshold,ie=Co(oe),Ae=ie&&oe.mouse||0,be=(ie?oe.touch:+oe)||10;return dn(T(ne))>(Ie(ne)?be:Ae)}function P(ne){return dn(T(ne))>dn(T(ne,!0))}function Q(ne){if(e.is(io)||!_){var oe=O(ne);if(oe&&oe<Qs)return T(ne)/oe}return 0}function z(ne){return C()+ja(ne)*Zn(dn(ne)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function T(ne,oe){return ee(ne,oe)-ee(M(ne),oe)}function O(ne){return Ba(ne)-Ba(M(ne))}function M(ne){return H===ne&&S||H}function ee(ne,oe){return(Ie(ne)?ne.changedTouches[0]:ne)["page"+h(oe?"Y":"X")]}function V(ne){return ne/(_&&e.is(Vi)?xp:1)}function me(ne){var oe=n.noDrag;return!To(ne,"."+td+", ."+Ur)&&(!oe||!To(ne,oe))}function Ie(ne){return typeof TouchEvent<"u"&&ne instanceof TouchEvent}function ge(){return F}function ae(ne){L=ne}return{mount:k,disable:ae,isDragging:ge}}var Bp={Spacebar:" ",Right:Gr,Left:Vr,Up:Uc,Down:Yc};function $s(e){return e=Kn(e)?e:e.key,Bp[e]||e}var el="keydown";function jp(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 b(){x(),o(ln,g),o(ln,x),o(On,h)}function x(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,el,f))}function g(){l(u,el)}function m(C){p=C}function h(){var C=p;p=!0,Tc(function(){p=C})}function f(C){if(!p){var y=$s(C);y===c(Vr)?e.go("<"):y===c(Gr)&&e.go(">")}}return{mount:b,destroy:g,disable:m}}var wo=us+"-lazy",wr=wo+"-srcset",zp="["+wo+"], ["+wr+"]";function Vp(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[no,$i],p=[];function b(){n.lazyLoad&&(x(),o(en,x))}function x(){Hn(p),g(),c?C():(r(u),o(u,m),m())}function g(){t.Slides.forEach(function(y){ds(y.slide,zp).forEach(function(R){var H=Sn(R,wo),S=Sn(R,wr);if(H!==R.src||S!==R.srcset){var U=n.classes.spinner,F=R.parentElement,_=zo(F,"."+U)||Hi("span",U,F);p.push([R,y,_]),R.src||Io(R,"none")}})})}function m(){p=p.filter(function(y){var R=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,R)?h(y):!0}),p.length||r(u)}function h(y){var R=y[0];In(y[1].slide,qa),l(R,"load error",qt(f,y)),$t(R,"src",Sn(R,wo)),$t(R,"srcset",Sn(R,wr)),Pn(R,wo),Pn(R,wr)}function f(y,R){var H=y[0],S=y[1];Fn(S.slide,qa),R.type!=="error"&&(bi(y[2]),Io(H,""),d(vs,H,S),d(zi)),c&&C()}function C(){p.length&&h(p.shift())}return{mount:b,destroy:qt(Hn,p),check:m}}function Gp(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,b=u.getIndex,x=u.go,g=t.Direction.resolve,m=c.pagination,h=[],f,C;function y(){R(),o([ln,en,Er],y);var L=n.pagination;m&&Io(m,L?"":"none"),L&&(o([On,Br,$i],B),H(),B(),r(zc,{list:f,items:h},_(e.index)))}function R(){f&&(bi(m?ti(f.children):f),Fn(f,C),Hn(h),f=null),i.destroy()}function H(){var L=e.length,N=n.classes,k=n.i18n,Z=n.perPage,E=p()?u.getEnd()+1:Po(L/Z);f=m||Hi("ul",N.pagination,c.track.parentElement),In(f,C=Yr+"--"+F()),$t(f,_n,"tablist"),$t(f,yn,k.select),$t(f,bs,F()===qr?"vertical":"");for(var K=0;K<E;K++){var D=Hi("li",null,f),j=Hi("button",{class:N.page,type:"button"},D),$=d.getIn(K).map(function(w){return w.slide.id}),v=!p()&&Z>1?k.pageX:k.slideX;l(j,"click",qt(S,K)),n.paginationKeyboard&&l(j,"keydown",qt(U,K)),$t(D,_n,"presentation"),$t(j,_n,"tab"),$t(j,Go,$.join(" ")),$t(j,yn,za(v,K+1)),$t(j,Oi,-1),h.push({li:D,button:j,page:K})}}function S(L){x(">"+L,!0)}function U(L,N){var k=h.length,Z=$s(N),E=F(),K=-1;Z===g(Gr,!1,E)?K=++L%k:Z===g(Vr,!1,E)?K=(--L+k)%k:Z==="Home"?K=0:Z==="End"&&(K=k-1);var D=h[K];D&&(Pc(D.button),x(">"+K),kn(N,!0))}function F(){return n.paginationDirection||n.direction}function _(L){return h[u.toPage(L)]}function B(){var L=_(b(!0)),N=_(b());if(L){var k=L.button;Fn(k,wi),Pn(k,Us),$t(k,Oi,-1)}if(N){var Z=N.button;In(Z,wi),$t(Z,Us,!0),$t(Z,Oi,"")}r(Vc,{list:f,items:h},L,N)}return{items:h,mount:y,destroy:R,getAt:_,update:B}}var qp=[" ","Enter"];function Xp(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(m){m.isParent||(u(e,m.splide),u(m.splide,e))}),i&&p()}function d(){r.forEach(function(m){m.destroy()}),Hn(r)}function c(){d(),l()}function u(m,h){var f=Kt(m);f.on(On,function(C,y,R){h.go(h.is(io)?R:C)}),r.push(f)}function p(){var m=Kt(e),h=m.on;h(ms,x),h(qc,g),h([ni,ln],b),r.push(m),m.emit(hs,e.splides)}function b(){$t(t.Elements.list,bs,n.direction===qr?"vertical":"")}function x(m){e.go(m.index)}function g(m,h){ls(qp,$s(h))&&(x(m),kn(h))}return{setup:qt(t.Media.set,{slideFocus:Do(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Up(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ai)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,x=Ba(u),g=n.wheelMinThreshold||0,m=n.wheelSleep||0;dn(p)>g&&x-r>m&&(e.go(b?"<":">"),r=x),c(b)&&kn(u)}}function c(u){return!n.releaseWheel||e.state.is(to)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Yp=90;function Kp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Hi("span",gp),c=jr(Yp,qt(p,!1));function u(){l&&(x(!t.Autoplay.isPaused()),$t(r,Zs,!0),d.textContent="…",o(fs,qt(x,!0)),o(ys,qt(x,!1)),o([no,$i],qt(p,!0)))}function p(g){$t(r,Ks,g),g?(jo(r,d),c.start()):(bi(d),c.cancel())}function b(){Pn(r,[Ys,Zs,Ks]),bi(d)}function x(g){l&&$t(r,Ys,g?"off":"polite")}return{mount:u,disable:x,destroy:b}}var Zp=Object.freeze({__proto__:null,Media:rp,Direction:ap,Elements:bp,Slides:Sp,Layout:$p,Clones:Tp,Move:Lp,Controller:Rp,Arrows:Ep,Autoplay:kp,Cover:Ap,Scroll:Op,Drag:Dp,Keyboard:jp,LazyLoad:Vp,Pagination:Gp,Sync:Xp,Wheel:Up,Live:Kp}),Jp={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"},Qp={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:yp,i18n:Jp,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function em(e,t,n){var i=t.Slides;function o(){Kt(e).on([ni,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),Tc(c)}return{mount:o,start:l,cancel:Da}}function tm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=qt(wn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(b(),c())})}function p(g,m){var h=i.toPosition(g,!0),f=i.getPosition(),C=x(g);dn(h-f)>=1&&C>=1?n.useScroll?r.scroll(h,C,!1,m):(d("transform "+C+"ms "+n.easing),i.translate(h,!0),c=m):(i.jump(g),m())}function b(){d(""),r.cancel()}function x(g){var m=n.rewindSpeed;if(e.is(Vi)&&m){var h=o.getIndex(!0),f=o.getEnd();if(h===0&&g>=f||h>=f&&g===0)return m}return n.speed}return{mount:u,start:p,cancel:b}}var nm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=ip(Wi),this.splides=[],this._o={},this._E={};var o=Kn(n)?Mc(document,n):n;bo(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,xs)||""},Qp,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,us)))}catch{bo(!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;bo(l.is([Wi,Rr]),"Already mounted!"),l.set(Wi),this._C=d,this._T=o||this._T||(this.is(qo)?em:tm),this._E=i||this._E;var c=Ro({},Zp,this._E,{Transition:this._T});return yi(c,function(u,p){var b=u(r,d,r._o);d[p]=b,b.setup&&b.setup()}),yi(d,function(u){u.mount&&u.mount()}),this.emit(ni),In(this.root,hp),l.set(ji),this.emit(Va),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(ji)&&(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(ti(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(Wi)?Kt(this).on(Va,this.destroy.bind(this,i)):(yi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(gs),o.destroy(),i&&Hn(this.splides),r.set(Rr)),this},Ju(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})(),Cs=nm;Cs.defaults={};Cs.STATES=ep;var tl=[[ni,"onMounted"],[Va,"onReady"],[On,"onMove"],[no,"onMoved"],[ms,"onClick"],[Fc,"onActive"],[_c,"onInactive"],[Wc,"onVisible"],[Nc,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[zi,"onResize"],[Dr,"onResized"],[Hc,"onDrag"],[Oc,"onDragging"],[Dc,"onDragged"],[Br,"onScroll"],[$i,"onScrolled"],[gs,"onDestroy"],[Bc,"onArrowsMounted"],[jc,"onArrowsUpdated"],[zc,"onPaginationMounted"],[Vc,"onPaginationUpdated"],[hs,"onNavigationMounted"],[fs,"onAutoplayPlay"],[Gc,"onAutoplayPlaying"],[ys,"onAutoplayPause"],[vs,"onLazyLoadLoaded"]];function Ts(...e){return e.filter(Boolean).join(" ")}function Mr(e){return e!==null&&typeof e=="object"}function Xa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Xa(n,t[i]));if(Mr(e)&&Mr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Xa(e[o],t[o]))}return e===t}function im(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function om(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 Ua(e,t){const n=e;return om(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Mr(i)?n[o]=Ua(Mr(n[o])?n[o]:{},i):n[o]=i}),n}var rm=({children:e,className:t,...n})=>s.createElement("div",{className:Ts("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Ls=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 Cs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ua({},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&&!Xa(this.options,e)&&(this.splide.options=e,this.options=Ua({},e));const t=this.getSlides();im(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){tl.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:Ts("splide",e),ref:this.splideRef,...this.omit(o,["options",...tl.map(r=>r[1])])},n?s.createElement(rm,null,i):i)}},Rs=({children:e,className:t,...n})=>s.createElement("li",{className:Ts("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 rm="RichTextRenderer-module__link___BWeZ2",am={link:rm},sm=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))},io=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>sm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:io(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:W.scalingValue(e.letterSpacing,t),wordSpacing:W.scalingValue(e.wordSpacing,t),fontSize:W.scalingValue(n,t),lineHeight:i!==void 0?W.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const wi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:am.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:io(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 cm="SvgImage-module__svg___q3xE-",dm="SvgImage-module__img___VsTm-",tl={svg:cm,img:dm},um=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},pm=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 c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(c)}},[]),!um(e)||!r?a.jsx("img",{src:e,alt:"",className:ut(tl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:ut(tl.svg,i),style:{"--svg":pm(e),"--fill":t,"--hover-fill":n,...o??{}}})},mm={"top-left":ct.topLeftAlignment,"top-center":ct.topCenterAlignment,"top-right":ct.topRightAlignment,"middle-left":ct.middleLeftAlignment,"middle-center":ct.middleCenterAlignment,"middle-right":ct.middleRightAlignment,"bottom-left":ct.bottomLeftAlignment,"bottom-center":ct.bottomCenterAlignment,"bottom-right":ct.bottomRightAlignment};function gm({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:c,letterSpacing:d,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:f,color:h}=n.imageCaption??{},[g,m]=s.useState(void 0),[x,T]=s.useState(null),[y,w]=s.useState(0),[B,M]=s.useState(0),{direction:G,transition:O,controls:_,pagination:j,imageCaption:b,triggers:H}=e,E=s.useRef(O.type),{x:$,y:S}=e.controls.offset,P=I=>{o&&o.go(I)};return s.useEffect(()=>{if(!x)return;const I=new ResizeObserver(N=>{if(!o)return;const[z]=N;m({width:Math.round(z.contentRect.width),height:Math.round(z.contentRect.height)})});return I.observe(x),()=>I.unobserve(x)},[x]),s.useEffect(()=>{!o||E.current===O.type||(M(I=>I+1),E.current=O.type)},[O.type]),a.jsx("div",{className:ut(ct.wrapper,{[ct.editor]:i}),ref:T,children:a.jsxs("div",{className:ct.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:O.backgroundColor&&O.type==="fade in"?O.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ut(ct.captionBlock),children:a.jsx("div",{className:ct.captionTextWrapper,children:t.map((I,N)=>a.jsx("div",{className:ut(ct.captionText,mm[b.alignment],{[ct.withPointerEvents]:N===y&&i,[ct.active]:N===y}),style:{fontFamily:io(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:l.sizing==="auto"?"max-content":W.scalingValue(l.width,i),letterSpacing:W.scalingValue(d,i),wordSpacing:W.scalingValue(p,i),textAlign:u,fontSize:W.scalingValue(v.fontSize,i),lineHeight:W.scalingValue(v.lineHeight,i),textTransform:f.textTransform??"none",textDecoration:f.textDecoration??"none",fontVariant:f.fontVariant??"normal",color:h,transitionDuration:O.duration?`${Math.round(parseInt(O.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ct.captionTextInner,style:{"--link-hover-color":b.linkHoverColor,"--link-color":b.linkColor,position:"relative",top:W.scalingValue(b.offset.y,i),left:W.scalingValue(b.offset.x,i)},children:a.jsx(wi,{content:I.imageCaption})})},N))})}),a.jsx(Cs,{onMove:I=>{w(I.index)},ref:r,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,autoplay:H.autoPlay!==null,...H.autoPlay!==null&&{interval:parseInt(H.autoPlay)*1e3},direction:G==="horiz"||O.type==="fade in"?"ltr":"ttb",pagination:!1,drag:H.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:O.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((I,N)=>a.jsx(Ts,{children:a.jsx("div",{className:ct.sliderItem,children:a.jsx("div",{className:ct.imgWrapper,children:a.jsx("img",{className:ut(ct.sliderImage,{[ct.contain]:I.image.objectFit==="contain",[ct.cover]:I.image.objectFit==="cover"}),src:I.image.url,alt:I.image.name??""})})})},N))},B),_.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(ct.arrow,{[ct.arrowVertical]:G==="vert",[ct.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{onClick:()=>{P("-1")},className:ct.arrowInner,style:{transform:`translate(${W.scalingValue($,i)}, ${W.scalingValue(S*(G==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${G==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(sn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:ut(ct.arrowImg,ct.mirror)}),!_.arrowsImgUrl&&a.jsx(nl,{color:_.color,className:ut(ct.arrowIcon,ct.arrowImg,ct.mirror)})]})}),a.jsx("div",{className:ut(ct.arrow,ct.nextArrow,{[ct.arrowVertical]:G==="vert",[ct.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{className:ct.arrowInner,onClick:()=>P("+1"),style:{transform:`translate(${W.scalingValue($*(G==="horiz"?-1:1),i)}, ${W.scalingValue(S,i)}) scale(${e.controls.scale/100}) rotate(${G==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(sn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:ct.arrowImg}),!_.arrowsImgUrl&&a.jsx(nl,{color:_.color,className:ut(ct.arrowIcon,ct.arrowImg)})]})})]}),H.triggersList.click&&a.jsx("div",{className:ct.clickOverlay,onClick:()=>{o&&o.go("+1")}}),j.isActive&&a.jsx("div",{className:ut(ct.pagination,{[ct.paginationInsideBottom]:j.position==="inside-1"&&G==="horiz",[ct.paginationInsideTop]:j.position==="inside-2"&&G==="horiz",[ct.paginationOutsideBottom]:j.position==="outside-1"&&G==="horiz",[ct.paginationOutsideTop]:j.position==="outside-2"&&G==="horiz",[ct.paginationInsideLeft]:j.position==="inside-1"&&G==="vert",[ct.paginationInsideRight]:j.position==="inside-2"&&G==="vert",[ct.paginationOutsideLeft]:j.position==="outside-1"&&G==="vert",[ct.paginationOutsideRight]:j.position==="outside-2"&&G==="vert",[ct.paginationVertical]:G==="vert"}),children:a.jsx("div",{className:ct.paginationInner,style:{backgroundColor:j.colors[2],transform:`scale(${j.scale/100}) translate(${W.scalingValue(j.offset.x,i)}, ${W.scalingValue(j.offset.y,i)}) rotate(${G==="horiz"?"0deg":"90deg"})`},children:t.map((I,N)=>a.jsx("button",{onClick:()=>{o&&o.go(N)},className:ut(ct.paginationItem),children:a.jsx("div",{className:ut(ct.dot,{[ct.activeDot]:N===y}),style:{backgroundColor:N===y?j.colors[0]:j.colors[1],"--pagination-hover-color":j.hover}})},N))})})]})})}function nl({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 hm={element:gm,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"]}},fm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ym="ImageRevealSlider-module__image___Qjt-e",vm="ImageRevealSlider-module__link___N-iLG",xm="ImageRevealSlider-module__cursor___2U03d",Ti={imageRevealSlider:fm,image:ym,link:vm,cursor:xm};function il(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,c=r/2,d=l/2;if(e>=i.x-c&&e<=i.x+c&&t>=i.y-d&&t<=i.y+d)return!0}return!1}function la(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function bm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await la(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await la(e);r=l.height/l.width*o}else{const l=await la(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function wm({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[c,d]=s.useState(0),u=s.useRef(0),[p,v]=s.useState({x:0,y:0}),[f,h]=s.useState(1),[g,m]=s.useState("none"),x=s.useRef({x:0,y:0}),[T,y]=s.useState(!1),{sizeType:w,imageWidth:B,randomRangeImageWidth:M}=e.imageSize,{revealPosition:G,visible:O}=e.position,{cursorType:_,target:j,defaultCursorScale:b,defaultCursor:H,hoverCursorScale:E,hoverCursor:$}=e.cursor;s.useEffect(()=>{if(!i)return;const I=(C,R)=>{const D=i.getBoundingClientRect(),ie=C-D.left,ee=R-D.top;if(v({x:ie,y:ee}),_==="system"){m("none"),h(1);return}const A=ie,ae=ee,k=document.elementFromPoint(D.left+A,D.top+ae);if(k&&k.closest("a")){m("none"),h(1);return}const J=il(A,ae,r)||j==="area"?{img:$??"none",scale:E}:{img:H??"none",scale:b};m(J.img),h(J.scale)},N=C=>{C.stopPropagation(),x.current={x:C.clientX,y:C.clientY},I(C.clientX,C.clientY)},z=()=>{T&&I(x.current.x,x.current.y)};return i.addEventListener("mousemove",N),window.addEventListener("scroll",z,!0),()=>{i.removeEventListener("mousemove",N),window.removeEventListener("scroll",z,!0)}},[i,T,p,_,j,$,H,E,b,r]),s.useEffect(()=>{T||(m("none"),h(0))},[T]);const S=async(I,N,z,C={})=>{const{width:R,height:D,finalWidth:ie}=await bm(I.image.url,w,B,M);let ee=0,A=0;G==="same"?(ee=N/2,A=z/2):(ee=C.x??Math.random()*N,A=C.y??Math.random()*z);const ae=Math.min(Math.max(ee,R/2),N-R/2),k=Math.min(Math.max(A,D/2),z-D/2);return{id:u.current++,url:I.image.url,link:I.link,name:I.image.name,x:ae,y:k,width:ie}};s.useEffect(()=>{if(!i||t.length===0)return;const I=i.getBoundingClientRect(),N=I.width,z=I.height,C=[];(async()=>{const D=t[0],ie=await S(D,N,z);C.push(ie),l(C),d(1)})()},[w,B,M,G,i]),s.useEffect(()=>{O==="last One"&&l(I=>I.length>0?[I[I.length-1]]:[])},[O]);const P=async I=>{if(!i)return;const N=i.getBoundingClientRect(),z=I.clientX-N.left,C=I.clientY-N.top;if(j==="image"&&!il(z,C,r))return;let R=0,D=0;G==="on Click"?(R=z,D=C):G==="same"?(R=N.width/2,D=N.height/2):(R=Math.random()*N.width,D=Math.random()*N.height);const ie=t[c],ee=await S(ie,N.width,N.height,{x:R,y:D});l(A=>O==="all"?[...A,ee]:[ee]),d(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:P,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Ti.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(I=>a.jsx("div",{className:Ti.wrapper,style:{top:`${I.y}px`,left:`${I.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:I.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:j==="area"&&I.link?a.jsx("a",{href:I.link,target:"_blank",className:Ti.link,children:a.jsx("img",{src:I.url,alt:I.name,className:Ti.image},I.id)}):a.jsx("img",{src:I.url,alt:I.name,className:Ti.image},I.id)},I.id)),T&&a.jsx("div",{className:Ti.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${f})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Sm={element:wm,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},$m="LightBox-module__hidden___9s-9x",Cm="LightBox-module__heroImage___sTxNF",Tm="LightBox-module__background___rm9ml",Lm="LightBox-module__editor___4ACaY",Rm="LightBox-module__contentStyle___Bgnsq",Im="LightBox-module__imageStyle___tLIlB",Pm="LightBox-module__imgWrapper___LuFUp",Em="LightBox-module__contain___8-yaS",Mm="LightBox-module__cover___hNvOG",km="LightBox-module__caption___b6L2I",Am="LightBox-module__captionTextInner___rCGNH",Fm="LightBox-module__lightboxSplide___XFuWC",_m="LightBox-module__arrow___iz38X",Wm="LightBox-module__arrowVertical___Zfz81",Nm="LightBox-module__nextArrow___zkAQN",Hm="LightBox-module__arrowInner___p48sW",Om="LightBox-module__arrowIcon___3VaFf",Dm="LightBox-module__arrowImg___pNV88",Bm="LightBox-module__mirror___pjeXc",jm="LightBox-module__thumbsWrapper___GB-nU",zm="LightBox-module__thumbsContainerVertical___wttk5",Vm="LightBox-module__thumbsContainer___osSma",Gm="LightBox-module__thumbsAlignStart___MO6tY",qm="LightBox-module__thumbsAlignCenter___Q4sUx",Xm="LightBox-module__thumbsAlignEnd___p4y9R",Um="LightBox-module__thumbItem___HvnF3",Km="LightBox-module__closeButton___g2khP",Ym="LightBox-module__fadeIn___0m5GW",Zm="LightBox-module__slideInLeft___gPYwC",Jm="LightBox-module__slideInRight___S-pPp",Qm="LightBox-module__slideInTop___DFdAj",eg="LightBox-module__slideInBottom___m27kZ",tg="LightBox-module__fadeOut___55qBR",ng="LightBox-module__slideOutLeft___NvU7P",ig="LightBox-module__slideOutRight___SK7eC",og="LightBox-module__slideOutTop___Vgg0z",rg="LightBox-module__slideOutBottom___nJ0Ef",ag="LightBox-module__scaleSlide___vZriG",Ue={hidden:$m,heroImage:Cm,background:Tm,editor:Lm,contentStyle:Rm,imageStyle:Im,imgWrapper:Pm,contain:Em,cover:Mm,caption:km,captionTextInner:Am,lightboxSplide:Fm,arrow:_m,arrowVertical:Wm,nextArrow:Nm,arrowInner:Hm,arrowIcon:Om,arrowImg:Dm,mirror:Bm,thumbsWrapper:jm,thumbsContainerVertical:zm,thumbsContainer:Vm,thumbsAlignStart:Gm,thumbsAlignCenter:qm,thumbsAlignEnd:Xm,thumbItem:Um,closeButton:Km,fadeIn:Ym,slideInLeft:Zm,slideInRight:Jm,slideInTop:Qm,slideInBottom:eg,fadeOut:tg,slideOutLeft:ng,slideOutRight:ig,slideOutTop:og,slideOutBottom:rg,scaleSlide:ag},Qo=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), calc(-50% + ${W.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${W.scalingValue(t.x,n)}, calc(-50% + ${W.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), ${W.scalingValue(t.y,n)})`:i.transform=`translate(${W.scalingValue(t.x,n)}, ${W.scalingValue(t.y,n)})`,i};function sd(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 sg(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 ld(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 c=e;return{renderedW:c,renderedH:c/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 c=t;return{renderedW:c*r,renderedH:c}}const l=e;return{renderedW:l,renderedH:l/r}}function cd(e,t,n,i,o){const{x:r,y:l}=sg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function cg(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:c}=window.getComputedStyle(e),d=l==="cover"?lg:ld,{renderedW:u,renderedH:p}=d(n,i,o,r),{offsetX:v,offsetY:f}=cd(n,i,u,p,c),h=(v+u/2)/n*100,g=(f+p/2)/i*100;return`${h}% ${g}%`}function dg(e){return cg(e)}function Er(e){const t=e.getBoundingClientRect(),n=sd(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:c,renderedH:d}=ld(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=cd(i,o,c,d,u),f=t.left+n.left,h=t.top+n.top;return{x:p+f,y:v+h,width:c,height:d}}function ol(e){const t=e.getBoundingClientRect(),n=sd(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function rl(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 ug(e,t){const n=(()=>{if(e==="fade in")return Ue.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeIn;if(e==="slide in")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeOut;if(e==="slide in")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})(),r=(()=>{if(e==="fade in")return Ue.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const pg=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[c,d]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&d(!1),o==="open"&&d(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:Ue.heroImage,onClick:()=>d(!0)}),a.jsx(mg,{isOpen:c,onClose:()=>d(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},mg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:c})=>{var be;const{widthSettings:d,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:f,fontSizeLineHeight:h,textAppearance:g,color:m}=i.imageCaption??{},[x,T]=s.useState(0),[y,w]=s.useState(0),[B,M]=s.useState(!1),[G,O]=s.useState(!1),[_,j]=s.useState({}),b=s.useRef(null),H=s.useRef(null),E=s.useRef(null),$=s.useRef(!1),S=s.useRef(null),P=s.useRef(null),I=s.useRef(null),N=s.useRef(null),z=s.useRef(!1),C=s.useRef(null),[R,D]=s.useState(!1),{appear:ie,triggers:ee,slider:A,thumbnail:ae,controls:k,area:J,caption:X,layout:me}=o.lightboxBlock,{appearClass:Le,backdropAppearClass:he,backdropDisappearClass:K,disappearClass:V}=ug(ie.type,ie.direction),Y=(c==null?void 0:c.itemId)??null;s.useEffect(()=>{const ne=()=>{setTimeout(()=>{var ue,xe;(xe=(ue=b.current)==null?void 0:ue.splide)==null||xe.refresh()},16)},ce=()=>{w(ue=>ue+1)};return window.addEventListener("ArticleEditor.Layout:change",ne),window.addEventListener("ArticleEditor.ComponentContent:change",ce),()=>{window.removeEventListener("ArticleEditor.Layout:change",ne),window.removeEventListener("ArticleEditor.ComponentContent:change",ce)}},[]),s.useEffect(()=>{if(!e||!ae.isActive){D(!1);return}const ne=C.current;if(!ne)return;const ce=()=>{A.direction==="horiz"?D(ne.scrollWidth>ne.clientWidth):D(ne.scrollHeight>ne.clientHeight)};ce();const ue=new ResizeObserver(ce);return ue.observe(ne),()=>ue.disconnect()},[e,ae.isActive,n.length,_,A.direction]);const Q=s.useCallback(()=>{const ne=window.matchMedia("(max-width: 768px)").matches,ce=rl(J.color);ne&&!l&&ce>.9&&(document.body.style.backgroundColor=""),M(!0),$.current=!0;const ue=xe=>{xe.target===S.current&&xe.animationName&&(S.current&&P.current&&S.current.removeEventListener("animationend",P.current),P.current=null,$.current&&($.current=!1,t()),M(!1))};S.current&&(P.current=ue,S.current.addEventListener("animationend",ue))},[t,J.color,l]),Te=(ne,ce,ue)=>{var xe,Ae;if(ne){if(ee.type==="click"&&ee.switch==="image")ee.repeat==="close"&&x===n.length-1?Q():(xe=b.current)==null||xe.go("+1");else if(ee.type==="click"&&ee.switch==="50/50"){const Ie=ne.getBoundingClientRect(),U=ce-Ie.left,ve=ue-Ie.top,de=Ie.width,q=Ie.height;let re;A.direction==="horiz"?re=U<de/2?"-1":"+1":re=ve<q/2?"-1":"+1",(Ae=b.current)==null||Ae.go(re)}}},we=ne=>{if(z.current){z.current=!1;return}const ce=n[x],ue=(ce==null?void 0:ce.image.objectFit)==="cover";let xe,Ae;if("changedTouches"in ne&&ne.changedTouches.length>0)xe=ne.changedTouches[0].clientX,Ae=ne.changedTouches[0].clientY;else if("clientX"in ne)xe=ne.clientX,Ae=ne.clientY;else return;let Ie;if(ue&&E.current){const U=ol(E.current);Ie=xe>=U.left&&xe<=U.right&&Ae>=U.top&&Ae<=U.bottom}else{const U=E.current?Er(E.current):null;if(!U){ne.target===ne.currentTarget&&Q();return}Ie=xe>=U.x&&xe<=U.x+U.width&&Ae>=U.y&&Ae<=U.y+U.height}Ie?Te(E.current,xe,Ae):Q()},ke=ne=>{const ce=ne.target;(ce.classList.contains(Ue.thumbsWrapper)||ce.classList.contains(Ue.thumbsContainer))&&we(ne)};s.useEffect(()=>{if(!e)return;const ne=ce=>{var ue,xe;if(ce.key==="Escape"){Q();return}if(ce.key==="ArrowRight"){T(Ae=>(Ae+1)%Math.max(n.length,1)),(ue=b.current)==null||ue.go("+1");return}ce.key==="ArrowLeft"&&(T(Ae=>(Ae-1+Math.max(n.length,1))%Math.max(n.length,1)),(xe=b.current)==null||xe.go("-1"))};return window.addEventListener("keydown",ne),()=>{window.removeEventListener("keydown",ne)}},[e,Q,n.length]),s.useEffect(()=>{if(e){if(T(0),w(ce=>ce+1),$.current=!1,M(!1),O(!1),j({}),!Y)return;const ne=new CustomEvent("page-overlay",{detail:{itemId:Y}});window.dispatchEvent(ne)}return()=>{S.current&&P.current&&(S.current.removeEventListener("animationend",P.current),P.current=null),O(!1)}},[e,Y]),s.useEffect(()=>{H.current!==null&&H.current!==A.type&&w(ne=>ne+1),H.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const ne=document.body.style.overflow,ce=window.matchMedia("(max-width: 768px)").matches,ue=rl(J.color);document.body.style.overflow="hidden",O(!1);const xe=Ie=>{Ie.target===S.current&&!$.current&&Ie.animationName&&(ce&&!l&&ue>.9&&(document.body.style.backgroundColor=J.color),O(!0),S.current&&I.current&&S.current.removeEventListener("animationend",I.current),I.current=null)};S.current&&(I.current=xe,S.current.addEventListener("animationend",xe));const Ae=Ie=>{const U=Ie.target;U&&(U.closest(`.${Ue.thumbsWrapper}`)||U.closest(`.${Ue.thumbsContainer}`))||A.type!=="slide"&&Ie.preventDefault()};return document.addEventListener("touchmove",Ae,{passive:!1}),()=>{document.body.style.overflow=ne,document.removeEventListener("touchmove",Ae),S.current&&I.current&&(S.current.removeEventListener("animationend",I.current),I.current=null),O(!1)}},[e,l,J.color,A.type]),s.useEffect(()=>{if(!e)return;const ne=ce=>{var xe,Ae;if($.current){ce.stopPropagation();return}if(z.current){z.current=!1;return}const ue=ce.target;if(!(ue&&(ue.closest(`.${Ue.thumbsContainer}`)||ue.closest(`.${Ue.thumbItem}`)||ue.closest(`.${Ue.arrow}`)||ue.closest(`.${Ue.closeButton}`)||ue.closest(`.${Ue.caption}`)))){if(A.type==="slide"&&ee.type==="drag"&&((Ae=(xe=b.current)==null?void 0:xe.splide)!=null&&Ae.root)){const Ie=b.current.splide.root;if(ue&&(Ie.contains(ue)||Ie===ue))return}if(ce.touches.length===0&&ce.changedTouches.length>0){const Ie=n[x],U=(Ie==null?void 0:Ie.image.objectFit)==="cover",ve=ce.changedTouches[0];let de;if(U&&E.current){const q=ol(E.current);de=ve.clientX>=q.left&&ve.clientX<=q.right&&ve.clientY>=q.top&&ve.clientY<=q.bottom}else{const q=E.current?Er(E.current):null;if(!q)return;de=ve.clientX>=q.x&&ve.clientX<=q.x+q.width&&ve.clientY>=q.y&&ve.clientY<=q.y+q.height}if(!de){ce.stopPropagation(),$.current=!0;const q=re=>{re.stopPropagation(),re.preventDefault(),document.removeEventListener("click",q,!0)};document.addEventListener("click",q,!0),Q()}}}};return document.addEventListener("touchend",ne,{passive:!0}),()=>{document.removeEventListener("touchend",ne)}},[e,Q,x,n]);const le=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&ee.type==="drag";s.useEffect(()=>{var re,Fe;if(!e||!le||!((Fe=(re=b.current)==null?void 0:re.splide)!=null&&Fe.root))return;const ne=b.current.splide.root,ce=30,ue=(pe,Z)=>{if(N.current){const Xe=Math.abs(pe-N.current.x),Oe=Math.abs(Z-N.current.y);(Xe>0||Oe>0)&&(z.current=!0)}},xe=pe=>{N.current&&(pe.preventDefault(),ue(pe.clientX,pe.clientY))},Ae=pe=>{N.current&&pe.touches.length>0&&(pe.preventDefault(),ue(pe.touches[0].clientX,pe.touches[0].clientY))},Ie=(pe,Z)=>{if(!N.current||!b.current){N.current=null;return}const Xe=Math.abs(pe-N.current.x),Oe=Math.abs(Z-N.current.y);Oe>ce&&Oe>Xe&&b.current.go(Z<N.current.y?"+1":"-1"),N.current=null},U=pe=>{N.current&&Ie(pe.clientX,pe.clientY),document.removeEventListener("pointerup",U),document.removeEventListener("pointercancel",U),document.removeEventListener("pointermove",xe)},ve=pe=>{if(N.current){if(pe.changedTouches.length>0){const Z=pe.changedTouches[0];Ie(Z.clientX,Z.clientY)}document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),document.removeEventListener("touchmove",Ae)}},de=pe=>{N.current={x:pe.clientX,y:pe.clientY},z.current=!1,document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("pointerup",U),document.addEventListener("pointercancel",U)},q=pe=>{pe.touches.length>0&&(N.current={x:pe.touches[0].clientX,y:pe.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",Ae,{passive:!1}),document.addEventListener("touchend",ve),document.addEventListener("touchcancel",ve))};return ne.addEventListener("pointerdown",de),ne.addEventListener("touchstart",q),()=>{ne.removeEventListener("pointerdown",de),ne.removeEventListener("touchstart",q),document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",U),document.removeEventListener("pointercancel",U),document.removeEventListener("touchmove",Ae),document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),N.current=null,z.current=!1}},[e,le,y]);const ge={backgroundColor:J.color,backdropFilter:`blur(${J.blur}px)`,animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Dn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:S,className:ut(Ue.background,B?K:he,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{...ge,...G&&!l&&!B?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?S:null,className:ut(Ue.contentStyle,B?V:Le,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Cs,{onMove:ne=>T(ne.index),ref:b,className:Ue.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:ee.type==="drag"&&!le,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:ee.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((ne,ce)=>{const ue=Qo(me.position,me.offset,l),xe=`${W.scalingValue(me.padding.top,l)} ${W.scalingValue(me.padding.right,l)} ${W.scalingValue(me.padding.bottom,l)} ${W.scalingValue(me.padding.left,l)}`,Ae=A.type==="scale"?(()=>{const{transform:Ie,...U}=ue;return{...U,position:"absolute",padding:xe,boxSizing:"border-box","--position-transform":Ie||"none"}})():{...ue,position:"absolute",padding:xe,boxSizing:"border-box"};return a.jsx(Ts,{children:a.jsx("div",{className:Ue.imgWrapper,onClick:we,children:a.jsx("img",{ref:ce===x?E:null,className:ut(Ue.imageStyle,{[Ue.contain]:ne.image.objectFit==="contain",[Ue.cover]:ne.image.objectFit==="cover",[Ue.scaleSlide]:A.type==="scale"}),src:ne.image.url,alt:ne.image.name??"",style:{...Ae,pointerEvents:ne.image.objectFit==="contain"?"none":"auto"}})})},ce)})},y),k.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(Ue.arrow,{[Ue.arrowVertical]:A.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${W.scalingValue(k.offset.x,l)}, ${W.scalingValue(k.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${k.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var ne;return(ne=b.current)==null?void 0:ne.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&a.jsx(sn,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:ut(Ue.arrowImg,Ue.mirror)}),!k.arrowsImgUrl&&a.jsx(al,{color:k.color,className:ut(Ue.arrowIcon,Ue.arrowImg,Ue.mirror)})]})}),a.jsx("div",{className:ut(Ue.arrow,Ue.nextArrow,{[Ue.arrowVertical]:A.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${W.scalingValue(k.offset.x*(A.direction==="horiz"?-1:1),l)}, ${W.scalingValue(k.offset.y,l)}) scale(${k.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var ne;return(ne=b.current)==null?void 0:ne.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&a.jsx(sn,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:Ue.arrowImg}),!k.arrowsImgUrl&&a.jsx(al,{color:k.color,className:ut(Ue.arrowIcon,Ue.arrowImg)})]})})]}),J.closeIconUrl&&(()=>{const ne=Qo(J.closeIconAlign,J.closeIconOffset,l),ce=`scale(${J.closeIconScale})`,ue=ne.transform?`${ne.transform} ${ce}`:ce;return a.jsx("button",{className:Ue.closeButton,style:{...ne,transform:ue},onClick:Q,"aria-label":"Close lightbox",children:a.jsx(sn,{url:J.closeIconUrl,fill:J.closeIconColor??"#000000",hoverFill:J.closeIconHover??"#cccccc"})})})(),X&&X.isActive&&i.imageCaption&&((be=n[x])==null?void 0:be.imageCaption)&&a.jsx("div",{className:Ue.caption,style:{...Qo(X.alignment,X.offset,l),fontFamily:io(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:d.sizing==="auto"?"max-content":W.scalingValue(d.width,l),letterSpacing:W.scalingValue(p,l),wordSpacing:W.scalingValue(f,l),textAlign:v,fontSize:W.scalingValue(h.fontSize,l),lineHeight:W.scalingValue(h.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:m},onClick:ne=>ne.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ue.captionTextInner,style:{"--link-color":X.linkColor,"--link-hover-color":X.linkHoverColor},children:a.jsx(wi,{content:n[x].imageCaption})})}),ae.isActive&&(()=>{const[ne,ce]=ae.position.split("-"),ue=A.direction==="horiz"?`${ne}-left`:ae.position,xe=Qo(ue,ae.offset,l),Ae=()=>{if(A.direction==="horiz"){if(ce==="left")return"flex-start";if(ce==="center")return"center";if(ce==="right")return"flex-end"}else{if(ne==="top")return"flex-start";if(ne==="middle")return"center";if(ne==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:C,className:Ue.thumbsWrapper,onClick:Ie=>ke(Ie),style:{position:l?"absolute":"fixed",...xe,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ut(Ue.thumbsContainer,{[Ue.thumbsContainerVertical]:A.direction==="vert",[Ue.thumbsAlignStart]:ae.align==="start",[Ue.thumbsAlignCenter]:ae.align==="center",[Ue.thumbsAlignEnd]:ae.align==="end"}),style:{gap:W.scalingValue(ae.grid.gap,l),justifyContent:R?"flex-start":Ae()},children:n.map((Ie,U)=>{const ve=U===x,de=_[U],re=ae.grid.size*(ve?ae.activeState.scale:1),Fe=()=>{if(ae.fit!=="fit")return{};if(!de)return A.direction==="horiz"?{height:W.scalingValue(re,l)}:{width:W.scalingValue(re,l)};const pe=de.width/de.height;if(A.direction==="horiz"){const Z=re,Xe=Z*pe;return{width:W.scalingValue(Xe,l),height:W.scalingValue(Z,l)}}else{const Z=re,Xe=Z/pe;return{width:W.scalingValue(Z,l),height:W.scalingValue(Xe,l)}}};return a.jsx("button",{className:Ue.thumbItem,style:{...A.direction==="horiz"&&ae.fit!=="fit"?{height:W.scalingValue(re,l)}:{},...A.direction==="vert"&&ae.fit!=="fit"?{width:W.scalingValue(re,l)}:{},...ae.fit==="cover"?{width:W.scalingValue(re,l),height:W.scalingValue(re,l)}:{},...Fe(),transition:ve?"all 0.25s ease-out":"none",opacity:ve?ae.activeState.opacity/100:ae.opacity/100,"--thumb-hover":ae.activeState.opacity/100},onClick:pe=>{var Z;pe.stopPropagation(),T(U),(Z=b.current)==null||Z.go(U)},onMouseEnter:()=>{var pe;ae.triggers==="hov"&&((pe=b.current)==null||pe.go(U))},children:a.jsx("img",{src:Ie.image.url,alt:Ie.image.name??"",onLoad:pe=>{const Z=pe.currentTarget;Z.naturalWidth&&Z.naturalHeight&&j(Xe=>({...Xe,[U]:{width:Z.naturalWidth,height:Z.naturalHeight}}))},style:{objectFit:ae.fit==="cover"?"cover":"contain",...ae.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ae.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ie.image.name}-${U}`)})})})})()]})]}),document.getElementById(r))};function al({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 gg={element:pg,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 er(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function hg(e){return`
|
|
6
|
+
*/const am="RichTextRenderer-module__link___BWeZ2",sm={link:am},lm=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))},oo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>lm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:oo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:W.scalingValue(e.letterSpacing,t),wordSpacing:W.scalingValue(e.wordSpacing,t),fontSize:W.scalingValue(n,t),lineHeight:i!==void 0?W.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Si=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:sm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:cm(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 cm(e){return{...e.fontFamily&&{fontFamily:oo(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 dm="SvgImage-module__svg___q3xE-",um="SvgImage-module__img___VsTm-",nl={svg:dm,img:um},pm=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)}},[]),!pm(e)||!r?a.jsx("img",{src:e,alt:"",className:ut(nl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:ut(nl.svg,i),style:{"--svg":mm(e),"--fill":t,"--hover-fill":n,...o??{}}})},gm={"top-left":ct.topLeftAlignment,"top-center":ct.topCenterAlignment,"top-right":ct.topRightAlignment,"middle-left":ct.middleLeftAlignment,"middle-center":ct.middleCenterAlignment,"middle-right":ct.middleRightAlignment,"bottom-left":ct.bottomLeftAlignment,"bottom-center":ct.bottomCenterAlignment,"bottom-right":ct.bottomRightAlignment};function hm({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:b,textAppearance:x,color:g}=n.imageCaption??{},[m,h]=s.useState(void 0),[f,C]=s.useState(null),[y,R]=s.useState(0),[H,S]=s.useState(0),{direction:U,transition:F,controls:_,pagination:B,imageCaption:L,triggers:N}=e,k=s.useRef(F.type),{x:Z,y:E}=e.controls.offset,K=D=>{o&&o.go(D)};return s.useEffect(()=>{if(!f)return;const D=new ResizeObserver(j=>{if(!o)return;const[$]=j;h({width:Math.round($.contentRect.width),height:Math.round($.contentRect.height)})});return D.observe(f),()=>D.unobserve(f)},[f]),s.useEffect(()=>{!o||k.current===F.type||(S(D=>D+1),k.current=F.type)},[F.type]),a.jsx("div",{className:ut(ct.wrapper,{[ct.editor]:i}),ref:C,children:a.jsxs("div",{className:ct.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:F.backgroundColor&&F.type==="fade in"?F.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ut(ct.captionBlock),children:a.jsx("div",{className:ct.captionTextWrapper,children:t.map((D,j)=>a.jsx("div",{className:ut(ct.captionText,gm[L.alignment],{[ct.withPointerEvents]:j===y&&i,[ct.active]:j===y}),style:{fontFamily:oo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":W.scalingValue(l.width,i),letterSpacing:W.scalingValue(c,i),wordSpacing:W.scalingValue(p,i),textAlign:u,fontSize:W.scalingValue(b.fontSize,i),lineHeight:W.scalingValue(b.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:g,transitionDuration:F.duration?`${Math.round(parseInt(F.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ct.captionTextInner,style:{"--link-hover-color":L.linkHoverColor,"--link-color":L.linkColor,position:"relative",top:W.scalingValue(L.offset.y,i),left:W.scalingValue(L.offset.x,i)},children:a.jsx(Si,{content:D.imageCaption})})},j))})}),a.jsx(Ls,{onMove:D=>{R(D.index)},ref:r,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,autoplay:N.autoPlay!==null,...N.autoPlay!==null&&{interval:parseInt(N.autoPlay)*1e3},direction:U==="horiz"||F.type==="fade in"?"ltr":"ttb",pagination:!1,drag:N.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:F.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((D,j)=>a.jsx(Rs,{children:a.jsx("div",{className:ct.sliderItem,children:a.jsx("div",{className:ct.imgWrapper,children:a.jsx("img",{className:ut(ct.sliderImage,{[ct.contain]:D.image.objectFit==="contain",[ct.cover]:D.image.objectFit==="cover"}),src:D.image.url,alt:D.image.name??""})})})},j))},H),_.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(ct.arrow,{[ct.arrowVertical]:U==="vert",[ct.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{onClick:()=>{K("-1")},className:ct.arrowInner,style:{transform:`translate(${W.scalingValue(Z,i)}, ${W.scalingValue(E*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(sn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:ut(ct.arrowImg,ct.mirror)}),!_.arrowsImgUrl&&a.jsx(il,{color:_.color,className:ut(ct.arrowIcon,ct.arrowImg,ct.mirror)})]})}),a.jsx("div",{className:ut(ct.arrow,ct.nextArrow,{[ct.arrowVertical]:U==="vert",[ct.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{className:ct.arrowInner,onClick:()=>K("+1"),style:{transform:`translate(${W.scalingValue(Z*(U==="horiz"?-1:1),i)}, ${W.scalingValue(E,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(sn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:ct.arrowImg}),!_.arrowsImgUrl&&a.jsx(il,{color:_.color,className:ut(ct.arrowIcon,ct.arrowImg)})]})})]}),N.triggersList.click&&a.jsx("div",{className:ct.clickOverlay,onClick:()=>{o&&o.go("+1")}}),B.isActive&&a.jsx("div",{className:ut(ct.pagination,{[ct.paginationInsideBottom]:B.position==="inside-1"&&U==="horiz",[ct.paginationInsideTop]:B.position==="inside-2"&&U==="horiz",[ct.paginationOutsideBottom]:B.position==="outside-1"&&U==="horiz",[ct.paginationOutsideTop]:B.position==="outside-2"&&U==="horiz",[ct.paginationInsideLeft]:B.position==="inside-1"&&U==="vert",[ct.paginationInsideRight]:B.position==="inside-2"&&U==="vert",[ct.paginationOutsideLeft]:B.position==="outside-1"&&U==="vert",[ct.paginationOutsideRight]:B.position==="outside-2"&&U==="vert",[ct.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ct.paginationInner,style:{backgroundColor:B.colors[2],transform:`scale(${B.scale/100}) translate(${W.scalingValue(B.offset.x,i)}, ${W.scalingValue(B.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((D,j)=>a.jsx("button",{onClick:()=>{o&&o.go(j)},className:ut(ct.paginationItem),children:a.jsx("div",{className:ut(ct.dot,{[ct.activeDot]:j===y}),style:{backgroundColor:j===y?B.colors[0]:B.colors[1],"--pagination-hover-color":B.hover}})},j))})})]})})}function il({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:hm,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"]}},ym="ImageRevealSlider-module__imageRevealSlider___UE5Ob",vm="ImageRevealSlider-module__image___Qjt-e",xm="ImageRevealSlider-module__link___N-iLG",bm="ImageRevealSlider-module__cursor___2U03d",Li={imageRevealSlider:ym,image:vm,link:xm,cursor:bm};function ol(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 ca(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function wm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ca(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ca(e);r=l.height/l.width*o}else{const l=await ca(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Sm({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,b]=s.useState({x:0,y:0}),[x,g]=s.useState(1),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:R,imageWidth:H,randomRangeImageWidth:S}=e.imageSize,{revealPosition:U,visible:F}=e.position,{cursorType:_,target:B,defaultCursorScale:L,defaultCursor:N,hoverCursorScale:k,hoverCursor:Z}=e.cursor;s.useEffect(()=>{if(!i)return;const D=(v,w)=>{const P=i.getBoundingClientRect(),Q=v-P.left,z=w-P.top;if(b({x:Q,y:z}),_==="system"){h("none"),g(1);return}const T=Q,O=z,M=document.elementFromPoint(P.left+T,P.top+O);if(M&&M.closest("a")){h("none"),g(1);return}const ee=ol(T,O,r)||B==="area"?{img:Z??"none",scale:k}:{img:N??"none",scale:L};h(ee.img),g(ee.scale)},j=v=>{v.stopPropagation(),f.current={x:v.clientX,y:v.clientY},D(v.clientX,v.clientY)},$=()=>{C&&D(f.current.x,f.current.y)};return i.addEventListener("mousemove",j),window.addEventListener("scroll",$,!0),()=>{i.removeEventListener("mousemove",j),window.removeEventListener("scroll",$,!0)}},[i,C,p,_,B,Z,N,k,L,r]),s.useEffect(()=>{C||(h("none"),g(0))},[C]);const E=async(D,j,$,v={})=>{const{width:w,height:P,finalWidth:Q}=await wm(D.image.url,R,H,S);let z=0,T=0;U==="same"?(z=j/2,T=$/2):(z=v.x??Math.random()*j,T=v.y??Math.random()*$);const O=Math.min(Math.max(z,w/2),j-w/2),M=Math.min(Math.max(T,P/2),$-P/2);return{id:u.current++,url:D.image.url,link:D.link,name:D.image.name,x:O,y:M,width:Q}};s.useEffect(()=>{if(!i||t.length===0)return;const D=i.getBoundingClientRect(),j=D.width,$=D.height,v=[];(async()=>{const P=t[0],Q=await E(P,j,$);v.push(Q),l(v),c(1)})()},[R,H,S,U,i]),s.useEffect(()=>{F==="last One"&&l(D=>D.length>0?[D[D.length-1]]:[])},[F]);const K=async D=>{if(!i)return;const j=i.getBoundingClientRect(),$=D.clientX-j.left,v=D.clientY-j.top;if(B==="image"&&!ol($,v,r))return;let w=0,P=0;U==="on Click"?(w=$,P=v):U==="same"?(w=j.width/2,P=j.height/2):(w=Math.random()*j.width,P=Math.random()*j.height);const Q=t[d],z=await E(Q,j.width,j.height,{x:w,y:P});l(T=>F==="all"?[...T,z]:[z]),c(T=>T>=t.length-1?0:T+1)};return a.jsxs("div",{ref:o,onClick:K,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Li.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[r.map(D=>a.jsx("div",{className:Li.wrapper,style:{top:`${D.y}px`,left:`${D.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:D.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:B==="area"&&D.link?a.jsx("a",{href:D.link,target:"_blank",className:Li.link,children:a.jsx("img",{src:D.url,alt:D.name,className:Li.image},D.id)}):a.jsx("img",{src:D.url,alt:D.name,className:Li.image},D.id)},D.id)),C&&a.jsx("div",{className:Li.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const $m={element:Sm,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:""}]}}}},Cm="LightBox-module__hidden___9s-9x",Tm="LightBox-module__heroImage___sTxNF",Lm="LightBox-module__background___rm9ml",Rm="LightBox-module__editor___4ACaY",Im="LightBox-module__contentStyle___Bgnsq",Pm="LightBox-module__imageStyle___tLIlB",Em="LightBox-module__imgWrapper___LuFUp",Mm="LightBox-module__contain___8-yaS",km="LightBox-module__cover___hNvOG",Am="LightBox-module__caption___b6L2I",Fm="LightBox-module__captionTextInner___rCGNH",_m="LightBox-module__lightboxSplide___XFuWC",Wm="LightBox-module__arrow___iz38X",Nm="LightBox-module__arrowVertical___Zfz81",Hm="LightBox-module__nextArrow___zkAQN",Om="LightBox-module__arrowInner___p48sW",Dm="LightBox-module__arrowIcon___3VaFf",Bm="LightBox-module__arrowImg___pNV88",jm="LightBox-module__mirror___pjeXc",zm="LightBox-module__thumbsWrapper___GB-nU",Vm="LightBox-module__thumbsContainerVertical___wttk5",Gm="LightBox-module__thumbsContainer___osSma",qm="LightBox-module__thumbsAlignStart___MO6tY",Xm="LightBox-module__thumbsAlignCenter___Q4sUx",Um="LightBox-module__thumbsAlignEnd___p4y9R",Ym="LightBox-module__thumbItem___HvnF3",Km="LightBox-module__closeButton___g2khP",Zm="LightBox-module__fadeIn___0m5GW",Jm="LightBox-module__slideInLeft___gPYwC",Qm="LightBox-module__slideInRight___S-pPp",eg="LightBox-module__slideInTop___DFdAj",tg="LightBox-module__slideInBottom___m27kZ",ng="LightBox-module__fadeOut___55qBR",ig="LightBox-module__slideOutLeft___NvU7P",og="LightBox-module__slideOutRight___SK7eC",rg="LightBox-module__slideOutTop___Vgg0z",ag="LightBox-module__slideOutBottom___nJ0Ef",sg="LightBox-module__scaleSlide___vZriG",Ue={hidden:Cm,heroImage:Tm,background:Lm,editor:Rm,contentStyle:Im,imageStyle:Pm,imgWrapper:Em,contain:Mm,cover:km,caption:Am,captionTextInner:Fm,lightboxSplide:_m,arrow:Wm,arrowVertical:Nm,nextArrow:Hm,arrowInner:Om,arrowIcon:Dm,arrowImg:Bm,mirror:jm,thumbsWrapper:zm,thumbsContainerVertical:Vm,thumbsContainer:Gm,thumbsAlignStart:qm,thumbsAlignCenter:Xm,thumbsAlignEnd:Um,thumbItem:Ym,closeButton:Km,fadeIn:Zm,slideInLeft:Jm,slideInRight:Qm,slideInTop:eg,slideInBottom:tg,fadeOut:ng,slideOutLeft:ig,slideOutRight:og,slideOutTop:rg,slideOutBottom:ag,scaleSlide:sg},tr=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), calc(-50% + ${W.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${W.scalingValue(t.x,n)}, calc(-50% + ${W.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), ${W.scalingValue(t.y,n)})`:i.transform=`translate(${W.scalingValue(t.x,n)}, ${W.scalingValue(t.y,n)})`,i};function sd(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 lg(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 ld(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 cg(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 cd(e,t,n,i,o){const{x:r,y:l}=lg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function dg(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"?cg:ld,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:b,offsetY:x}=cd(n,i,u,p,d),g=(b+u/2)/n*100,m=(x+p/2)/i*100;return`${g}% ${m}%`}function ug(e){return dg(e)}function kr(e){const t=e.getBoundingClientRect(),n=sd(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}=ld(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=cd(i,o,d,c,u),x=t.left+n.left,g=t.top+n.top;return{x:p+x,y:b+g,width:d,height:c}}function rl(e){const t=e.getBoundingClientRect(),n=sd(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function al(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 pg(e,t){const n=(()=>{if(e==="fade in")return Ue.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeIn;if(e==="slide in")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeOut;if(e==="slide in")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})(),r=(()=>{if(e==="fade in")return Ue.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.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:Ue.heroImage,onClick:()=>c(!0)}),a.jsx(gg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},gg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var he;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:x,fontSizeLineHeight:g,textAppearance:m,color:h}=i.imageCaption??{},[f,C]=s.useState(0),[y,R]=s.useState(0),[H,S]=s.useState(!1),[U,F]=s.useState(!1),[_,B]=s.useState({}),L=s.useRef(null),N=s.useRef(null),k=s.useRef(null),Z=s.useRef(!1),E=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(null),$=s.useRef(!1),v=s.useRef(null),[w,P]=s.useState(!1),{appear:Q,triggers:z,slider:T,thumbnail:O,controls:M,area:ee,caption:V,layout:me}=o.lightboxBlock,{appearClass:Ie,backdropAppearClass:ge,backdropDisappearClass:ae,disappearClass:ne}=pg(Q.type,Q.direction),oe=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const G=()=>{setTimeout(()=>{var pe,we;(we=(pe=L.current)==null?void 0:pe.splide)==null||we.refresh()},16)},re=()=>{R(pe=>pe+1)};return window.addEventListener("ArticleEditor.Layout:change",G),window.addEventListener("ArticleEditor.ComponentContent:change",re),()=>{window.removeEventListener("ArticleEditor.Layout:change",G),window.removeEventListener("ArticleEditor.ComponentContent:change",re)}},[]),s.useEffect(()=>{if(!e||!O.isActive){P(!1);return}const G=v.current;if(!G)return;const re=()=>{T.direction==="horiz"?P(G.scrollWidth>G.clientWidth):P(G.scrollHeight>G.clientHeight)};re();const pe=new ResizeObserver(re);return pe.observe(G),()=>pe.disconnect()},[e,O.isActive,n.length,_,T.direction]);const ie=s.useCallback(()=>{const G=window.matchMedia("(max-width: 768px)").matches,re=al(ee.color);G&&!l&&re>.9&&(document.body.style.backgroundColor=""),S(!0),Z.current=!0;const pe=we=>{we.target===E.current&&we.animationName&&(E.current&&K.current&&E.current.removeEventListener("animationend",K.current),K.current=null,Z.current&&(Z.current=!1,t()),S(!1))};E.current&&(K.current=pe,E.current.addEventListener("animationend",pe))},[t,ee.color,l]),Ae=(G,re,pe)=>{var we,Pe;if(G){if(z.type==="click"&&z.switch==="image")z.repeat==="close"&&f===n.length-1?ie():(we=L.current)==null||we.go("+1");else if(z.type==="click"&&z.switch==="50/50"){const Ce=G.getBoundingClientRect(),Y=re-Ce.left,xe=pe-Ce.top,ue=Ce.width,X=Ce.height;let le;T.direction==="horiz"?le=Y<ue/2?"-1":"+1":le=xe<X/2?"-1":"+1",(Pe=L.current)==null||Pe.go(le)}}},be=G=>{if($.current){$.current=!1;return}const re=n[f],pe=(re==null?void 0:re.image.objectFit)==="cover";let we,Pe;if("changedTouches"in G&&G.changedTouches.length>0)we=G.changedTouches[0].clientX,Pe=G.changedTouches[0].clientY;else if("clientX"in G)we=G.clientX,Pe=G.clientY;else return;let Ce;if(pe&&k.current){const Y=rl(k.current);Ce=we>=Y.left&&we<=Y.right&&Pe>=Y.top&&Pe<=Y.bottom}else{const Y=k.current?kr(k.current):null;if(!Y){G.target===G.currentTarget&&ie();return}Ce=we>=Y.x&&we<=Y.x+Y.width&&Pe>=Y.y&&Pe<=Y.y+Y.height}Ce?Ae(k.current,we,Pe):ie()},Me=G=>{const re=G.target;(re.classList.contains(Ue.thumbsWrapper)||re.classList.contains(Ue.thumbsContainer))&&be(G)};s.useEffect(()=>{if(!e)return;const G=re=>{var pe,we;if(re.key==="Escape"){ie();return}if(re.key==="ArrowRight"){C(Pe=>(Pe+1)%Math.max(n.length,1)),(pe=L.current)==null||pe.go("+1");return}re.key==="ArrowLeft"&&(C(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=L.current)==null||we.go("-1"))};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[e,ie,n.length]),s.useEffect(()=>{if(e){if(C(0),R(re=>re+1),Z.current=!1,S(!1),F(!1),B({}),!oe)return;const G=new CustomEvent("page-overlay",{detail:{itemId:oe}});window.dispatchEvent(G)}return()=>{E.current&&K.current&&(E.current.removeEventListener("animationend",K.current),K.current=null),F(!1)}},[e,oe]),s.useEffect(()=>{N.current!==null&&N.current!==T.type&&R(G=>G+1),N.current=T.type},[T.type]),s.useEffect(()=>{if(!e)return;const G=document.body.style.overflow,re=window.matchMedia("(max-width: 768px)").matches,pe=al(ee.color);document.body.style.overflow="hidden",F(!1);const we=Ce=>{Ce.target===E.current&&!Z.current&&Ce.animationName&&(re&&!l&&pe>.9&&(document.body.style.backgroundColor=ee.color),F(!0),E.current&&D.current&&E.current.removeEventListener("animationend",D.current),D.current=null)};E.current&&(D.current=we,E.current.addEventListener("animationend",we));const Pe=Ce=>{const Y=Ce.target;Y&&(Y.closest(`.${Ue.thumbsWrapper}`)||Y.closest(`.${Ue.thumbsContainer}`))||T.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=G,document.removeEventListener("touchmove",Pe),E.current&&D.current&&(E.current.removeEventListener("animationend",D.current),D.current=null),F(!1)}},[e,l,ee.color,T.type]),s.useEffect(()=>{if(!e)return;const G=re=>{var we,Pe;if(Z.current){re.stopPropagation();return}if($.current){$.current=!1;return}const pe=re.target;if(!(pe&&(pe.closest(`.${Ue.thumbsContainer}`)||pe.closest(`.${Ue.thumbItem}`)||pe.closest(`.${Ue.arrow}`)||pe.closest(`.${Ue.closeButton}`)||pe.closest(`.${Ue.caption}`)))){if(T.type==="slide"&&z.type==="drag"&&((Pe=(we=L.current)==null?void 0:we.splide)!=null&&Pe.root)){const Ce=L.current.splide.root;if(pe&&(Ce.contains(pe)||Ce===pe))return}if(re.touches.length===0&&re.changedTouches.length>0){const Ce=n[f],Y=(Ce==null?void 0:Ce.image.objectFit)==="cover",xe=re.changedTouches[0];let ue;if(Y&&k.current){const X=rl(k.current);ue=xe.clientX>=X.left&&xe.clientX<=X.right&&xe.clientY>=X.top&&xe.clientY<=X.bottom}else{const X=k.current?kr(k.current):null;if(!X)return;ue=xe.clientX>=X.x&&xe.clientX<=X.x+X.width&&xe.clientY>=X.y&&xe.clientY<=X.y+X.height}if(!ue){re.stopPropagation(),Z.current=!0;const X=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),ie()}}}};return document.addEventListener("touchend",G,{passive:!0}),()=>{document.removeEventListener("touchend",G)}},[e,ie,f,n]);const q=(T.type==="scale"||T.type==="fade")&&T.direction==="vert"&&z.type==="drag";s.useEffect(()=>{var le,Fe;if(!e||!q||!((Fe=(le=L.current)==null?void 0:le.splide)!=null&&Fe.root))return;const G=L.current.splide.root,re=30,pe=(fe,J)=>{if(j.current){const Xe=Math.abs(fe-j.current.x),Oe=Math.abs(J-j.current.y);(Xe>0||Oe>0)&&($.current=!0)}},we=fe=>{j.current&&(fe.preventDefault(),pe(fe.clientX,fe.clientY))},Pe=fe=>{j.current&&fe.touches.length>0&&(fe.preventDefault(),pe(fe.touches[0].clientX,fe.touches[0].clientY))},Ce=(fe,J)=>{if(!j.current||!L.current){j.current=null;return}const Xe=Math.abs(fe-j.current.x),Oe=Math.abs(J-j.current.y);Oe>re&&Oe>Xe&&L.current.go(J<j.current.y?"+1":"-1"),j.current=null},Y=fe=>{j.current&&Ce(fe.clientX,fe.clientY),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("pointermove",we)},xe=fe=>{if(j.current){if(fe.changedTouches.length>0){const J=fe.changedTouches[0];Ce(J.clientX,J.clientY)}document.removeEventListener("touchend",xe),document.removeEventListener("touchcancel",xe),document.removeEventListener("touchmove",Pe)}},ue=fe=>{j.current={x:fe.clientX,y:fe.clientY},$.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",Y),document.addEventListener("pointercancel",Y)},X=fe=>{fe.touches.length>0&&(j.current={x:fe.touches[0].clientX,y:fe.touches[0].clientY},$.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",xe),document.addEventListener("touchcancel",xe))};return G.addEventListener("pointerdown",ue),G.addEventListener("touchstart",X),()=>{G.removeEventListener("pointerdown",ue),G.removeEventListener("touchstart",X),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",xe),document.removeEventListener("touchcancel",xe),j.current=null,$.current=!1}},[e,q,y]);const se={backgroundColor:ee.color,backdropFilter:`blur(${ee.blur}px)`,animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Dn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:E,className:ut(Ue.background,H?ae:ge,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{...se,...U&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?E:null,className:ut(Ue.contentStyle,H?ne:Ie,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ls,{onMove:G=>C(G.index),ref:L,className:Ue.lightboxSplide,options:{arrows:!1,speed:T.duration?parseInt(T.duration):500,direction:T.direction==="horiz"||T.type==="fade"||T.type==="scale"?"ltr":"ttb",pagination:!1,drag:z.type==="drag"&&!q,perPage:1,width:"100%",height:"100%",type:T.type==="fade"||T.type==="scale"?"fade":"loop",padding:0,rewind:z.repeat!=="close",start:0},style:{"--splide-speed":T.duration},children:n.map((G,re)=>{const pe=tr(me.position,me.offset,l),we=`${W.scalingValue(me.padding.top,l)} ${W.scalingValue(me.padding.right,l)} ${W.scalingValue(me.padding.bottom,l)} ${W.scalingValue(me.padding.left,l)}`,Pe=T.type==="scale"?(()=>{const{transform:Ce,...Y}=pe;return{...Y,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...pe,position:"absolute",padding:we,boxSizing:"border-box"};return a.jsx(Rs,{children:a.jsx("div",{className:Ue.imgWrapper,onClick:be,children:a.jsx("img",{ref:re===f?k:null,className:ut(Ue.imageStyle,{[Ue.contain]:G.image.objectFit==="contain",[Ue.cover]:G.image.objectFit==="cover",[Ue.scaleSlide]:T.type==="scale"}),src:G.image.url,alt:G.image.name??"",style:{...Pe,pointerEvents:G.image.objectFit==="contain"?"none":"auto"}})})},re)})},y),M.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(Ue.arrow,{[Ue.arrowVertical]:T.direction==="vert"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${W.scalingValue(M.offset.x,l)}, ${W.scalingValue(M.offset.y*(T.direction==="horiz"?1:-1),l)}) scale(${M.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=L.current)==null?void 0:G.go("-1")},"aria-label":"Previous",children:[M.arrowsImgUrl&&a.jsx(sn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:ut(Ue.arrowImg,Ue.mirror)}),!M.arrowsImgUrl&&a.jsx(sl,{color:M.color,className:ut(Ue.arrowIcon,Ue.arrowImg,Ue.mirror)})]})}),a.jsx("div",{className:ut(Ue.arrow,Ue.nextArrow,{[Ue.arrowVertical]:T.direction==="vert"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${W.scalingValue(M.offset.x*(T.direction==="horiz"?-1:1),l)}, ${W.scalingValue(M.offset.y,l)}) scale(${M.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=L.current)==null?void 0:G.go("+1")},"aria-label":"Next",children:[M.arrowsImgUrl&&a.jsx(sn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:Ue.arrowImg}),!M.arrowsImgUrl&&a.jsx(sl,{color:M.color,className:ut(Ue.arrowIcon,Ue.arrowImg)})]})})]}),ee.closeIconUrl&&(()=>{const G=tr(ee.closeIconAlign,ee.closeIconOffset,l),re=`scale(${ee.closeIconScale})`,pe=G.transform?`${G.transform} ${re}`:re;return a.jsx("button",{className:Ue.closeButton,style:{...G,transform:pe},onClick:ie,"aria-label":"Close lightbox",children:a.jsx(sn,{url:ee.closeIconUrl,fill:ee.closeIconColor??"#000000",hoverFill:ee.closeIconHover??"#cccccc"})})})(),V&&V.isActive&&i.imageCaption&&((he=n[f])==null?void 0:he.imageCaption)&&a.jsx("div",{className:Ue.caption,style:{...tr(V.alignment,V.offset,l),fontFamily:oo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":W.scalingValue(c.width,l),letterSpacing:W.scalingValue(p,l),wordSpacing:W.scalingValue(x,l),textAlign:b,fontSize:W.scalingValue(g.fontSize,l),lineHeight:W.scalingValue(g.lineHeight,l),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h},onClick:G=>G.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ue.captionTextInner,style:{"--link-color":V.linkColor,"--link-hover-color":V.linkHoverColor},children:a.jsx(Si,{content:n[f].imageCaption})})}),O.isActive&&(()=>{const[G,re]=O.position.split("-"),pe=T.direction==="horiz"?`${G}-left`:O.position,we=tr(pe,O.offset,l),Pe=()=>{if(T.direction==="horiz"){if(re==="left")return"flex-start";if(re==="center")return"center";if(re==="right")return"flex-end"}else{if(G==="top")return"flex-start";if(G==="middle")return"center";if(G==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:v,className:Ue.thumbsWrapper,onClick:Ce=>Me(Ce),style:{position:l?"absolute":"fixed",...we,...T.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ut(Ue.thumbsContainer,{[Ue.thumbsContainerVertical]:T.direction==="vert",[Ue.thumbsAlignStart]:O.align==="start",[Ue.thumbsAlignCenter]:O.align==="center",[Ue.thumbsAlignEnd]:O.align==="end"}),style:{gap:W.scalingValue(O.grid.gap,l),justifyContent:w?"flex-start":Pe()},children:n.map((Ce,Y)=>{const xe=Y===f,ue=_[Y],le=O.grid.size*(xe?O.activeState.scale:1),Fe=()=>{if(O.fit!=="fit")return{};if(!ue)return T.direction==="horiz"?{height:W.scalingValue(le,l)}:{width:W.scalingValue(le,l)};const fe=ue.width/ue.height;if(T.direction==="horiz"){const J=le,Xe=J*fe;return{width:W.scalingValue(Xe,l),height:W.scalingValue(J,l)}}else{const J=le,Xe=J/fe;return{width:W.scalingValue(J,l),height:W.scalingValue(Xe,l)}}};return a.jsx("button",{className:Ue.thumbItem,style:{...T.direction==="horiz"&&O.fit!=="fit"?{height:W.scalingValue(le,l)}:{},...T.direction==="vert"&&O.fit!=="fit"?{width:W.scalingValue(le,l)}:{},...O.fit==="cover"?{width:W.scalingValue(le,l),height:W.scalingValue(le,l)}:{},...Fe(),transition:xe?"all 0.25s ease-out":"none",opacity:xe?O.activeState.opacity/100:O.opacity/100,"--thumb-hover":O.activeState.opacity/100},onClick:fe=>{var J;fe.stopPropagation(),C(Y),(J=L.current)==null||J.go(Y)},onMouseEnter:()=>{var fe;O.triggers==="hov"&&((fe=L.current)==null||fe.go(Y))},children:a.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:fe=>{const J=fe.currentTarget;J.naturalWidth&&J.naturalHeight&&B(Xe=>({...Xe,[Y]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:O.fit==="cover"?"cover":"contain",...O.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...O.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${Y}`)})})})})()]})]}),document.getElementById(r))};function sl({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 hg={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 nr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fg(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${nr(48)};
|
|
12
12
|
}
|
|
13
13
|
.${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
|
|
14
14
|
.${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
34
|
.${e}-field-group.${e}-labeled {
|
|
35
|
-
gap: ${
|
|
35
|
+
gap: ${nr(4)};
|
|
36
36
|
}
|
|
37
37
|
.${e}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
130
|
.${e}-success {
|
|
131
|
-
margin-top: ${
|
|
131
|
+
margin-top: ${nr(8)};
|
|
132
132
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
133
133
|
}
|
|
134
134
|
.${e}-error {
|
|
135
|
-
margin-top: ${
|
|
135
|
+
margin-top: ${nr(8)};
|
|
136
136
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
137
137
|
}
|
|
138
138
|
.${e}-overlay-anchor {
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function
|
|
158
|
+
`}function yg({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=W.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:x,gap:g,fieldsGap:m,buttonCorners:h,buttonStroke:f,buttonPadding:C,isButtonFullWidth:y,inputCorners:R,inputStroke:H,inputPadding:S,inputColor:U,inputTextColor:F,inputBorderColor:_,placeholderColor:B,buttonColor:L,buttonTextColor:N,buttonBorderColor:k,labelTextColor:Z,successColor:E,errorColor:K,fontFamily:D,inputFontSettings:j,inputFontSize:$,inputLineHeight:v,inputLetterSpacing:w,inputWordSpacing:P,inputTextAppearance:Q,buttonFontSettings:z,buttonFontSize:T,buttonLineHeight:O,buttonLetterSpacing:M,buttonWordSpacing:ee,buttonTextAppearance:V,labelFontSettings:me,labelFontSize:Ie,labelLineHeight:ge,labelLetterSpacing:ae,labelWordSpacing:ne,labelTextAppearance:oe,statusFontSettings:ie,statusFontSize:Ae,statusLineHeight:be,statusLetterSpacing:Me,statusWordSpacing:q,statusTextAppearance:se,successMessage:he,errorMessage:G,stateOverrides:re}=e,pe=u==="B",we=b.slice(0,Math.min(p,b.length)),Pe={fontSettings:{fontFamily:D,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:$??.01,lineHeight:v,letterSpacing:w??0,wordSpacing:P??0,textAppearance:Q,color:F},Ce=an(Ut(Pe,t)),Y=W.scalingValue(H??0,t),xe=W.scalingValue((v??$??.01)+((S==null?void 0:S.top)??0)+((S==null?void 0:S.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),ue={...Ce,borderStyle:"solid",borderRadius:u==="C"?0:W.scalingValue(R??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Y,borderLeftWidth:0}:{borderWidth:Y},paddingTop:W.scalingValue((S==null?void 0:S.top)??0,t),paddingRight:W.scalingValue((S==null?void 0:S.right)??0,t),paddingBottom:W.scalingValue((S==null?void 0:S.bottom)??0,t),paddingLeft:W.scalingValue((S==null?void 0:S.left)??0,t),height:xe,minHeight:xe},X={fontSettings:{fontFamily:D,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:T??.01,lineHeight:O,letterSpacing:M??0,wordSpacing:ee??0,textAppearance:V,color:N},le=an(Ut(X,t)),Fe=W.scalingValue(f??0,t),fe={fontSettings:{fontFamily:D,fontWeight:(me==null?void 0:me.fontWeight)??400,fontStyle:(me==null?void 0:me.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:ge,letterSpacing:ae??0,wordSpacing:ne??0,textAppearance:oe,color:Z},J=Ut(fe,t),Xe={fontSettings:{fontFamily:D,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:Ae??.01,lineHeight:be,letterSpacing:Me??0,wordSpacing:q??0,textAppearance:se,color:E},Oe=an(Ut(Xe,t)),dt=W.buildColorVars(c,{inputColor:U,inputTextColor:F,inputBorderColor:_,placeholderColor:B!=null&&B.trim()?B:"#cccccc",buttonColor:L,buttonTextColor:N,buttonBorderColor:k,labelTextColor:Z,successColor:E,errorColor:K},vg,xg,re),[nt,ht]=s.useState(()=>Object.fromEntries(we.map(ke=>[ke.name,""]))),[st,ze]=s.useState("idle"),[Se,_e]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":st,Ye=r==="error"?G:Se,de=r==="filled",ve=s.useMemo(()=>{if(!de)return nt;let ke=null;for(const qe of we)(nt[qe.name]??"").trim().length>0||(ke=ke??{...nt},ke[qe.name]="Filled");return ke??nt},[nt,de,we]),Ee=Be==="error"?W.getFormFieldValidationError(we,ve):null,Ze=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Ve=o==null?void 0:o.submitUrl,at=(ke,qe)=>{ht(We=>({...We,[ke]:qe}))},Je=async ke=>{if(ke.preventDefault(),!d)return;const qe=Object.fromEntries(we.map(tt=>{var rt;return[tt.name,((rt=nt[tt.name])==null?void 0:rt.trim())??""]}).filter(([,tt])=>tt));if(!Ve){ze("error"),_e("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const We=W.getFormFieldValidationError(we,nt);if(We){ze("error"),_e(We);return}ze("submitting"),_e(null);try{const tt=await fetch(Ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!tt.ok){const rt=await tt.text();throw new Error(rt||`Request failed: ${tt.status}`)}ze("success"),ht(Object.fromEntries(we.map(rt=>[rt.name,""])))}catch(tt){ze("error"),_e(tt instanceof Error?tt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Ze}`.trim(),style:dt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:fg(c)}}),a.jsxs("form",{onSubmit:Je,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:we.map((ke,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:W.scalingValue(m??0,t)}}),a.jsxs("div",{className:`${c}-field-group${pe?` ${c}-labeled`:""}`,children:[pe&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:ke.label||ke.name}),ke.type==="textarea"?a.jsx("textarea",{name:ke.name,autoComplete:"off",value:ve[ke.name]??"",onChange:We=>at(ke.name,We.target.value),placeholder:ke.placeholder,className:`${c}-input`,style:ue,rows:1,"data-filled":de||(ve[ke.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:ke.type==="phone"?"tel":ke.type==="email"?"email":"text",name:ke.name,autoComplete:"off",value:ve[ke.name]??"",onChange:We=>at(ke.name,We.target.value),placeholder:ke.placeholder,required:ke.isRequired??ke.type==="email",className:`${c}-input`,style:ue,"data-filled":de||(ve[ke.name]??"").trim().length>0})]})]},qe))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:W.scalingValue(g??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:W.scalingValue(h??0,t),borderWidth:Fe,paddingTop:W.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:W.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:W.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:W.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...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:st==="submitting"?"...":x})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Oe},children:he}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:Ee??Ye??G})]})}const vg={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"},xg=["hover","focus","filled","success","error"],bg=`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
|
-
`,bg=[{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"}],tr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},wg=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Sg={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:{...tr.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:{...tr.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:{...tr.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:{...tr.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:bg,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:[...wg],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"]},$g={element:fg,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:Sg,sourceCode:xg,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function nr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cg(e){return`
|
|
792
|
+
`,wg=[{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"}],ir={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Sg=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],$g={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:{...ir.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:{...ir.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:{...ir.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:{...ir.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:wg,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:[...Sg],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"]},Cg={element:yg,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:$g,sourceCode:bg,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function or(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Tg(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -971,16 +971,16 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
971
971
|
align-items: center;
|
|
972
972
|
}
|
|
973
973
|
.${e}-success {
|
|
974
|
-
margin-top: ${
|
|
975
|
-
font-size: ${
|
|
974
|
+
margin-top: ${or(8)};
|
|
975
|
+
font-size: ${or(14)};
|
|
976
976
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
977
977
|
}
|
|
978
978
|
.${e}-error {
|
|
979
|
-
margin-top: ${
|
|
980
|
-
font-size: ${
|
|
979
|
+
margin-top: ${or(8)};
|
|
980
|
+
font-size: ${or(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const Lg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=W.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:x,inputFontSize:g,inputLineHeight:m,inputLetterSpacing:h,inputWordSpacing:f,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:R,buttonLineHeight:H,buttonLetterSpacing:S,buttonWordSpacing:U,buttonTextAppearance:F,statusFontSettings:_,statusFontSize:B,statusLineHeight:L,statusLetterSpacing:N,statusWordSpacing:k,statusTextAppearance:Z,iconMaxWidth:E,minHeight:K,corners:D,stroke:j,stateOverrides:$,inputPadding:v,buttonPadding:w,successMessage:P="Thanks for subscribing!",errorMessage:Q="Please, fill all required fields."}=e,z=d.slice(0,Math.min(p,d.length)),[T,O]=s.useState(()=>Object.fromEntries(z.map(fe=>[fe.name,""]))),[M,ee]=s.useState("idle"),[V,me]=s.useState(null),Ie=o==="success"?"success":o==="error"?"error":M,ge=o==="error"?Q:V,ae=o==="filled",ne=s.useMemo(()=>{if(!ae)return T;let fe=null;for(const J of z)(T[J.name]??"").trim().length>0||(fe=fe??{...T},fe[J.name]="Filled");return fe??T},[ae,T,z]),oe=Ie==="error"?W.getFormFieldValidationError(z,ne):null,ie=o&&o!=="default"?`${r}-state-${o}`:"",Ae=z.some(fe=>(ne[fe.name]??"").trim().length>0),be=ie!==`${r}-state-filled`&&Ae?`${r}-state-filled`:"",Me=`${ie} ${be}`.trim(),q=i==null?void 0:i.submitUrl,se=u??"",he=(c==null?void 0:c.icon)??"",G=(c==null?void 0:c.mode)==="On",re=se||"Submit",pe={fontSettings:{fontFamily:b,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:g??.01,lineHeight:m,letterSpacing:h??0,wordSpacing:f??0,textAppearance:C,color:e.inputTextColor??"#111111"},we={fontSettings:{fontFamily:b,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:R??.01,lineHeight:H,letterSpacing:S??0,wordSpacing:U??0,textAppearance:F,color:e.buttonTextColor??"#ffffff"},Pe={fontSettings:{fontFamily:b,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:B??.01,lineHeight:L,letterSpacing:N??0,wordSpacing:k??0,textAppearance:Z,color:e.successColor??"#22c55e"},Ce=an(Ut(pe,t)),Y=an(Ut(we,t)),xe=an(Ut(Pe,t)),ue=W.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(pe==null?void 0:pe.color)??"#111111",buttonTextColor:e.buttonTextColor??(we==null?void 0:we.color)??"#ffffff"},Rg,Ig,$),X={borderRadius:W.scalingValue(D,t),borderWidth:W.scalingValue(j,t),borderStyle:"solid"},le={borderLeftWidth:W.scalingValue(j,t)},Fe=async fe=>{if(fe.preventDefault(),!l)return;const J=Object.fromEntries(z.map(Oe=>{var dt;return[Oe.name,((dt=T[Oe.name])==null?void 0:dt.trim())??""]}).filter(([,Oe])=>Oe));if(!q){ee("error"),me("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const Xe=W.getFormFieldValidationError(z,T);if(Xe){ee("error"),me(Xe);return}ee("submitting"),me(null);try{const Oe=await fetch(q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!Oe.ok){const dt=await Oe.text();throw new Error(dt||`Request failed: ${Oe.status}`)}ee("success"),O(Object.fromEntries(z.map(dt=>[dt.name,""])))}catch(Oe){ee("error"),me(Oe instanceof Error?Oe.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Me}`.trim(),style:ue,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Tg(r)}}),a.jsxs("form",{onSubmit:Fe,className:`${r}-form`,style:{...X,height:W.scalingValue(K,t),minHeight:W.scalingValue(K,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:z.map(fe=>a.jsx("input",{type:fe.type==="email"?"email":fe.type==="phone"?"tel":"text",name:fe.name,autoComplete:"off",value:ne[fe.name]??"",onChange:J=>O(Xe=>({...Xe,[fe.name]:J.target.value})),placeholder:fe.placeholder,required:fe.isRequired??fe.type==="email",className:`${r}-input`,style:{...Ce,paddingRight:W.scalingValue(v.right,t),paddingLeft:W.scalingValue(v.left,t),paddingTop:W.scalingValue(v.top,t),paddingBottom:W.scalingValue(v.bottom,t)}},fe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":re,style:{...Y,...le,paddingRight:W.scalingValue(w.right,t),paddingLeft:W.scalingValue(w.left,t),paddingTop:W.scalingValue(w.top,t),paddingBottom:W.scalingValue(w.bottom,t),pointerEvents:l?"auto":void 0},children:M==="submitting"?"...":G?he&&a.jsx(sn,{url:he,className:`${r}-submitBtnIcon`,style:{maxWidth:W.scalingValue(E??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):se})})]}),Ie==="success"&&a.jsx("p",{className:`${r}-success`,style:{...xe},children:P}),Ie==="error"&&a.jsx("p",{className:`${r}-error`,style:{...xe},role:"alert",children:oe??ge??Q})]})},Rg={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"},Ig=["hover","focus","filled","success","error"],Pg=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,Pg="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>'),Eg=[{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."}],ca={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Mg=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],kg={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:{...ca.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:{...ca.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:{...ca.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:Eg,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Pg},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:[...Mg],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"]},Ag={element:Tg,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:kg,sourceCode:Ig};function Fg(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1560
|
+
`,Eg="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>'),Mg=[{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."}],da={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"],Ag={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:{...da.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:{...da.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:{...da.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:Mg,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Eg},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"]},Fg={element:Lg,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:Ag,sourceCode:Pg};function _g(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover video {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const
|
|
1692
|
+
`}const Wg=30,Ng=20,ua=3,Hg=12,Og=32,Dg=3,Bg=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")},jg=(e,t)=>Array.from({length:t},()=>e).flat(),zg=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},dd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),ll=(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=dd(d);return c<=0?0:c+r*Math.max(0,t-1)},Vg=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=dd(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},Gg=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},qg=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Gg(i,e))},Xg=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??"")},Ug=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Yg=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,Z,E,K;const p=s.useRef(null),b=!!((k=e.image)!=null&&k.url&&Xg(e.image));s.useLayoutEffect(()=>{d&&Ug(p.current)&&(u==null||u())},[d,(Z=e.image)==null?void 0:Z.url,u]);const x=n.display==="cover",g=n.ratioValue??"1:1",m=n.reversed??!1,[h,f]=g.split(":").map(Number),R=(m?f:h)/(m?h:f),H=i/R,S=H>o?o:H,U=H>o?o*R:i,F=c(U),_=c(S),B={borderRadius:c(r)},L=x?{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},N=((E=e.image)==null?void 0:E.url)&&(b?a.jsx("video",{ref:D=>{p.current=D},src:e.image.url,style:L,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:D=>{p.current=D},src:e.image.url,alt:((K=e.image)==null?void 0:K.name)??"",style:L,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...x?{width:F}:{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,...x?{width:F,height:_,overflow:"hidden",...B}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:N&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:ut(`${t}-marquee-link`,!x&&`${t}-marquee-link-contain`),children:N}):N})})},Kg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>_g(r,c),[r,c]),{speed:p,direction:b,pauseOnHover:x,gap:g,imageMaxWidth:m,imageMaxHeight:h,hoverEffect:f,cornerRadius:C=0}=e,y=s.useMemo(()=>zg(e.imageFit),[e.imageFit]),R=(t==null?void 0:t.length)??0,H=!!o,S=!n||!!i,U=S&&f!=="off"&&f!=="randomize"?`${r}-image-hover-${f}`:void 0,F=n?!!i:!0,B=((t==null?void 0:t.length)??0)>0&&(F||!!n),L=Math.max(0,p)*Wg,N=be=>W.scalingValue(be,n??!1),k=s.useRef(null),Z=s.useRef(null),E=s.useRef(null),[K,D]=s.useState(0),j=F&&x==="on",[$,v]=s.useState(!1),[w,P]=s.useState({}),Q=s.useRef(w);Q.current=w;const z=s.useRef(null),T=s.useRef(0),O=s.useRef(null),M=s.useMemo(()=>(t??[]).map(be=>{var Me;return((Me=be.image)==null?void 0:Me.url)??""}).join("\0"),[t]),[ee,V]=s.useState(ua),me=s.useMemo(()=>{const be=t??[];return be.length===0||!(F||!!n)?be:jg(be,ee)},[t,F,ee,n]),Ie=s.useMemo(()=>(t??[]).filter(be=>{var Me;return!!((Me=be.image)!=null&&Me.url)}).length,[t]),ge=B?Dg:1;s.useLayoutEffect(()=>{T.current=0,P({}),z.current=null,V(ua),d(0)},[M]),s.useEffect(()=>{if(!S||f!=="randomize")return;const be=k.current;if(!be)return;const Me=G=>{P(re=>{const pe=Array.from(G).filter(Pe=>Pe in re&&!qg(be,Pe));if(pe.length===0)return re;const we={...re};return pe.forEach(Pe=>{delete we[Pe]}),we})},q=new IntersectionObserver(G=>{const re=new Set;for(const pe of G){const we=pe.target.dataset.marqueeItemIndex,Pe=we!==void 0?Number(we):NaN;Number.isNaN(Pe)||re.add(Pe)}re.size>0&&Me(re)},{root:be,threshold:0});Object.keys(w).forEach(G=>{const re=Number(G);be.querySelectorAll(`[data-marquee-item-index="${re}"]`).forEach(pe=>q.observe(pe))});const se={current:0},he=()=>{const G=Object.keys(Q.current);G.length!==0&&(Me(G.map(Number)),se.current=requestAnimationFrame(he))};return Object.keys(Q.current).length>0&&(se.current=requestAnimationFrame(he)),()=>{cancelAnimationFrame(se.current),q.disconnect()}},[f,w,S]),s.useLayoutEffect(()=>{if(!B)return;const be=k.current,Me=E.current;if(!be||!Me)return;const q={current:0},se=()=>{const re=be.getBoundingClientRect().width||be.offsetWidth,pe=Vg(Me),we=z.current,Pe=typeof we=="number"&&Math.abs(we-pe)<=.25;z.current=pe;let Ce=ee,Y=0;if((F||n)&&R>0&&re>0){const X=ll(Me,R);if(X>=Og){Y=X;const le=Math.min(Hg,Math.max(ua,Math.ceil(re/X)+1));Ce=le,le!==ee&&V(le)}}const ue=Ce!==ee&&Y>0?Y*Ce:pe>0?pe:Y>0?Y*Ce:(()=>{const X=ll(Me,R);return X>0?X*Ce:0})();ue>0?d(X=>X<=0?ue:!Pe||Math.round(X)===Math.round(ue)?X:ue):!Pe&&l<=0&&(cancelAnimationFrame(q.current),q.current=requestAnimationFrame(se))},he=()=>{cancelAnimationFrame(q.current),q.current=requestAnimationFrame(se)};O.current=he,he();const G=new ResizeObserver(he);return G.observe(be),G.observe(Me),()=>{O.current=null,cancelAnimationFrame(q.current),G.disconnect()}},[F,B,l,M,ee,R,n]),s.useLayoutEffect(()=>{if(!B||c<=0)return;const be=Z.current;be&&Bg(be)},[B,c,b,L]),s.useLayoutEffect(()=>{if(!B||l<=0){D(0);return}const be=Z.current,Me=E.current;if(!be||!Me)return;const q=()=>{const he=be.offsetHeight||be.getBoundingClientRect().height,G=Array.from(Me.children).reduce((pe,we)=>Math.max(pe,we.offsetHeight||we.getBoundingClientRect().height),0),re=he>0?he:G;D(re>0?re:0)};q();const se=new ResizeObserver(q);return se.observe(be),se.observe(Me),()=>se.disconnect()},[B,ge,me,n,g,m,h,l,y,w]),s.useLayoutEffect(()=>{if(!n||!H||!B||typeof window>"u")return;const be=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(be)},[n,H,B,b,l,K,g,me]);const ae=()=>{j&&v(!0)},ne=()=>{j&&v(!1)},oe=s.useCallback(()=>{var be;T.current=Math.min(Ie,T.current+1),(be=O.current)==null||be.call(O)},[Ie]),ie=s.useCallback((be,Me)=>{P(q=>{const se=q[be]??Me,he=(t??[]).filter(re=>re!==se);if(he.length===0)return q;const G=he[Math.floor(Math.random()*he.length)];return{...q,[be]:G}})},[t]),Ae=(be,Me,q,se)=>{const he=S&&f==="randomize"&&y.display==="cover"?w[q]??be:be,G=`max(${N(g)}, ${Ng}px)`,re=`calc(-0.5 * (${G} + ${N(g)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":q,onMouseEnter:S&&f==="randomize"&&y.display==="cover"?()=>ie(q,be):void 0,children:[a.jsx(Yg,{item:he,prefix:r,imageFit:y,imageMaxWidth:m,imageMaxHeight:h,cornerRadius:C,imageHoverClass:U,isEditor:n,isFirstSet:se,scaled:N,onFirstSetImageDone:oe}),H&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:re,width:G,height:"100%"}})]},`${Me}-${q}`)};if(B){const be=F?j&&$?"paused":"running":"paused",Me=c>0&&L>0?c/L*1e3:0,q=`${Math.max(0,Me)/1e3}s`;return a.jsxs("div",{ref:k,className:ut(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:K>0?{height:K}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:Z,className:`${r}-marquee-track`,"data-direction":b,onMouseEnter:ae,onMouseLeave:ne,style:{WebkitAnimationDuration:q,animationDuration:q,WebkitAnimationPlayState:be,animationPlayState:be},children:Array.from({length:ge},(se,he)=>a.jsx("div",{ref:he===0?E:void 0,className:ut(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:N(g),paddingRight:N(g)},"aria-hidden":he>0,children:me.map((G,re)=>Ae(G,he,re,he===0&&re<R))},`set-${he}`))})]})}return a.jsxs("div",{ref:k,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:ut(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:N(g),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((be,Me)=>Ae(be,0,Me))},"marquee-static")]})},Zg=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2472,7 +2472,7 @@ type MarqueeProps = {
|
|
|
2472
2472
|
isPreviewMode?: boolean;
|
|
2473
2473
|
isEditMode?: boolean;
|
|
2474
2474
|
} & CommonComponentProps;
|
|
2475
|
-
`,
|
|
2475
|
+
`,Jg={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:""}]}},Qg={element:Kg,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:Jg,sourceCode:Zg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function eh(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
|
|
2476
2476
|
.${e}-item-image-wrap {
|
|
2477
2477
|
display: flex;
|
|
2478
2478
|
flex: 0 0 auto;
|
|
@@ -2601,7 +2601,7 @@ ${o}
|
|
|
2601
2601
|
left: -9999px;
|
|
2602
2602
|
top: 0;
|
|
2603
2603
|
}
|
|
2604
|
-
`}const eh=30,ua=3,th=12,nh=3,Xa=.72,ih=100,oh=10,rh=e=>Math.max(0,e)/ih,ah=e=>Math.max(0,e)/oh,sh=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]),Li={ctx:void 0},ch=()=>Li.ctx!==void 0?Li.ctx:typeof document>"u"?(Li.ctx=null,Li.ctx):(Li.ctx=document.createElement("canvas").getContext("2d"),Li.ctx),dh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},uh=e=>{e.style.transform=""},ph=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},mh=(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)},gh=96,hh=(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,c=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),d=i/n;return Array.from({length:n},(u,p)=>{const v=p*d,f=v+d;o[p+1]=f,r[p+1]=r[p]+(c(v)+c(f))*.5*d}),{wavelength:i,periodArc:r[n],x:o,s:r}},fh=(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:c}=e,d=(h,g)=>{if(g-h<=1)return[h,g];const m=h+g>>1;return l[m]<=r?d(m,g):d(h,m)},[u,p]=d(0,l.length-1),v=l[p]-l[u],f=v>0?(r-l[u])/v:0;return n*(o*e.wavelength+c[u]+(c[p]-c[u])*f)},yh=(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),c=p=>t*r*Math.cos(r*p),d=Math.max(4,Math.ceil(o*4)),u=Array.from({length:d},(p,v)=>{const f=v/d*e,h=(v+1)/d*e,g=h-f,m=l(f),x=l(h),T=f+g/3,y=m+c(f)*g/3,w=h-g/3,B=x-c(h)*g/3;return`C${T.toFixed(2)} ${y.toFixed(2)} ${w.toFixed(2)} ${B.toFixed(2)} ${h.toFixed(2)} ${x.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},vh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var h;const c=o!==0?{...n,transform:`translateY(${o}px)`}:n,d=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${Xa}em`},u=((h=e.image)==null?void 0:h.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:d}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?a.jsx("span",{className:`${t}-text`,style:c,children:Array.from(e.text).map((g,m)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},m))}):a.jsx("span",{className:`${t}-text`,style:c,children:e.text}),f=a.jsxs(a.Fragment,{children:[p,v]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:f}):f})},xh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=W.useScopedStyles(),[r,l]=s.useState(0),c=r>0?Math.round(r):0,{speed:d,direction:u,pauseOnHover:p,gap:v,layoutType:f,curveAmplitude:h,curveFrequency:g,textFontFamily:m,textFontSettings:x,textFontSize:T,textLineHeight:y,textLetterSpacing:w,textWordSpacing:B,textTextAppearance:M,textColor:G,backgroundColor:O,ribbonWidth:_}=e,j=_??y,b=f==="curve",H=rh(h),E=ah(g),$=s.useMemo(()=>Qg(o,c,b),[o,c,b]),S=s.useMemo(()=>Ut({fontSettings:{fontFamily:m,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:w,wordSpacing:B,fontSize:T,lineHeight:y,textAppearance:M,color:G},n),[m,x,w,B,T,y,M,G,n]),P=se=>W.scalingValue(se,n??!1),I=((t==null?void 0:t.length)??0)>0,N=n?!!i:!0,z=I&&(N||!!n),C=Math.max(0,d)*eh,R=N&&p==="on",[D,ie]=s.useState(!1),ee=N?R&&D?"paused":"running":"paused",A=ee==="running"&&C>0&&c>0,ae=s.useRef(null),k=s.useRef(null),J=s.useRef(null),X=s.useRef(null),me=s.useRef(null),Le=s.useRef(null),he=s.useRef(A),K=s.useRef(null);he.current=A;const[V,Y]=s.useState(0),[Q,Te]=s.useState(0),[we,ke]=s.useState(0),[le,ge]=s.useState(0),[be,ne]=s.useState(0),ce=s.useMemo(()=>(t??[]).map(se=>{var ye;return`${se.text}\0${((ye=se.image)==null?void 0:ye.url)??""}`}).join("\0"),[t]),[ue,xe]=s.useState(ua),Ae=s.useMemo(()=>{const se=t??[];return se.length===0||!(N||n)?se:lh(se,ue)},[t,N,ue,n]),Ie=z?nh:1;s.useLayoutEffect(()=>{xe(ua),l(0)},[ce]),s.useLayoutEffect(()=>{var Ze;const se=Le.current;if(!se)return;const ye=()=>{const Ve=getComputedStyle(se),at=parseFloat(Ve.fontSize)||0;if(at<=0)return;const Je=ch();if(!Je){Y(at*Xa),Te(0);return}Je.font=`${Ve.fontStyle} ${Ve.fontWeight} ${at}px ${Ve.fontFamily}`;const Me=Je.measureText("H"),qe=Me.actualBoundingBoxAscent>0?Me.actualBoundingBoxAscent:at*Xa,We=Math.max(0,Me.actualBoundingBoxDescent||0),tt=Me.fontBoundingBoxAscent||0,rt=Me.fontBoundingBoxDescent||0;Y(Tt=>Math.abs(Tt-qe)>.5?qe:Tt);const lt=tt>0||rt>0?(rt-We-(tt-qe))/2:0;Te(Tt=>Math.abs(Tt-lt)>.25?lt:Tt)};ye();const Ee=typeof document<"u"?document.fonts:void 0;(Ze=Ee==null?void 0:Ee.ready)==null||Ze.then(ye).catch(()=>{});const Ge=new ResizeObserver(ye);return Ge.observe(se),()=>Ge.disconnect()},[S.fontFamily,S.fontWeight,S.fontStyle,S.fontSize,S.lineHeight]),s.useLayoutEffect(()=>{if(!z)return;const se=ae.current,ye=X.current;if(!se||!ye)return;const Ee={id:0},Ge=()=>{const Ve=se.getBoundingClientRect().width||se.offsetWidth,at=ye.getBoundingClientRect().width||ye.offsetWidth;if(I&&Ve>0&&at>0){const Je=at/ue;if(Je>0){const Me=Math.min(th,Math.max(ua,Math.ceil(Ve/Je)+1));if(Me!==ue){xe(Me);return}}}at>0&&l(at)};Ee.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ge)});return Ze.observe(se),Ze.observe(ye),()=>{cancelAnimationFrame(Ee.id),Ze.disconnect()}},[z,ce,ue,I,V]),s.useLayoutEffect(()=>{const se=me.current;if(!se)return;const ye={id:0},Ee=()=>{const Ze=se.offsetHeight;Ze>0&&ne(Ve=>Math.abs(Ve-Ze)>.5?Ze:Ve)};ye.id=requestAnimationFrame(Ee);const Ge=new ResizeObserver(()=>{cancelAnimationFrame(ye.id),ye.id=requestAnimationFrame(Ee)});return Ge.observe(se),()=>{cancelAnimationFrame(ye.id),Ge.disconnect()}},[j,n]),s.useLayoutEffect(()=>{if(!b){ke(0),ge(0);return}const se=ae.current,ye=X.current;if(!se||!ye)return;const Ee={id:0},Ge=()=>{const Ve=se.offsetWidth,at=ye.offsetHeight;Ve>0&&ge(Je=>Math.abs(Je-Ve)>.5?Ve:Je),at>0&&ke(Je=>Math.abs(Je-at)>.5?at:Je)};Ee.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ge)});return Ze.observe(se),Ze.observe(ye),()=>{cancelAnimationFrame(Ee.id),Ze.disconnect()}},[b,ce,V,y,T,z]),s.useLayoutEffect(()=>{if(!z||c<=0)return;const se=J.current;se&&sh(se)},[z,c,u,C]),s.useLayoutEffect(()=>{if(!b||!I)return;const se=ae.current;if(!se)return;const ye={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ee=()=>{for(const Me of ye.itemsCache)for(const qe of Me.glyphs)uh(qe.inner)},Ge=()=>{const Me=k.current??se;ye.itemsCache=Array.from(se.querySelectorAll("[data-marquee-text-item]"),qe=>{const We=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(tt=>{const rt=tt.firstElementChild;rt&&We.push({inner:rt,layoutLocalX:mh(tt,Me)})}),{item:qe,glyphs:We}}),ye.cacheDirty=!1},Ze=()=>{ye.cacheDirty&&Ge();const qe=(k.current??se).offsetWidth||1,We=qe*H,tt=2*Math.PI*E/qe,rt=`${qe}|${We}|${tt}`;rt!==ye.lutKey&&(ye.lutKey=rt,ye.lut=hh(We,tt,gh));const lt=J.current,Tt=lt?ph(getComputedStyle(lt).transform):0,Xt=se.getBoundingClientRect(),Zt=Xt.left,xt=Xt.right,wt=ye.lut&&ye.lut.wavelength>0?Math.max(0,(ye.lut.periodArc/ye.lut.wavelength-1)*qe):0;for(const{item:Bt,glyphs:At}of ye.itemsCache){const vt=Bt.getBoundingClientRect();if(!(vt.right<Zt||vt.left>xt+wt))for(const Ft of At){const Wt=Ft.layoutLocalX+Tt,Kt=ye.lut?fh(ye.lut,Wt):Wt,Jt=tt*Kt,Ct=We*Math.sin(Jt),Nt=We*tt*Math.cos(Jt),rn=Math.atan(Nt)*(180/Math.PI);dh(Ft.inner,Kt-Wt,Ct,rn)}}},Ve=()=>{ye.cancelled||(ye.raf=0,Ze(),he.current&&!document.hidden&&(ye.raf=requestAnimationFrame(Ve)))},at=()=>{ye.cancelled||ye.raf||(ye.raf=requestAnimationFrame(Ve))};K.current=at,at();const Je=()=>{if(document.hidden){cancelAnimationFrame(ye.raf),ye.raf=0;return}at()};return document.addEventListener("visibilitychange",Je),()=>{ye.cancelled=!0,K.current=null,cancelAnimationFrame(ye.raf),document.removeEventListener("visibilitychange",Je),Ee()}},[b,H,E,I,r,ce,ue,V]),s.useLayoutEffect(()=>{var se;(se=K.current)==null||se.call(K)},[A]);const U=()=>{R&&ie(!0)},ve=()=>{R&&ie(!1)},de=b?H*100:0,q=P(j),re={minHeight:q,...b?{paddingTop:`${de}%`,paddingBottom:`${de}%`}:{}},Fe={height:q,...b?{visibility:"hidden"}:{backgroundColor:O}},pe={gap:P(v),minHeight:q},Z=le*H,Xe=be>0?be:we,Oe=Math.max(we,Xe),dt=b&&le>0&&Oe>0?yh(le,Z,E,Z+Oe/2):"",nt=Z*2+Oe,ht=dt?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${le} ${nt}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:dt,fill:"none",stroke:O,strokeWidth:Xe,strokeLinecap:"round",strokeLinejoin:"round"})}):null,st=a.jsx("div",{ref:me,className:`${o}-ribbon`,style:Fe,"aria-hidden":!0}),ze=(se,ye,Ee)=>a.jsx(vh,{item:se,prefix:o,textCss:S,capHeightPx:V,opticalOffsetY:Q,imageGapPx:P(v),isCurve:b},`${ye}-${Ee}`),Se=a.jsx("span",{ref:Le,"aria-hidden":!0,className:`${o}-cap-ref`,style:S,children:"H"}),_e=c>0&&C>0?c/C*1e3:0,Be=`${Math.max(0,_e)/1e3}s`,Ke=z?a.jsx("div",{ref:J,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:U,onMouseLeave:ve,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:ee,animationPlayState:ee},children:Array.from({length:Ie},(se,ye)=>a.jsx("div",{ref:ye===0?X:void 0,className:`${o}-marquee-set`,style:{...pe,paddingRight:P(v)},"aria-hidden":ye>0,children:Ae.map((Ee,Ge)=>ze(Ee,ye,Ge))},`set-${ye}`))}):a.jsx("div",{ref:X,className:ut(`${o}-marquee-set`,`${o}-marquee-static`),style:pe,children:t==null?void 0:t.map((se,ye)=>ze(se,0,ye))});return a.jsxs("div",{ref:ae,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),Se,a.jsxs("div",{ref:k,className:`${o}-marquee-wrapper`,style:re,children:[st,ht,Ke]})]})},bh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2604
|
+
`}const th=30,pa=3,nh=12,ih=3,Ya=.72,oh=100,rh=10,ah=e=>Math.max(0,e)/oh,sh=e=>Math.max(0,e)/rh,lh=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")},ch=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),Ri={ctx:void 0},dh=()=>Ri.ctx!==void 0?Ri.ctx:typeof document>"u"?(Ri.ctx=null,Ri.ctx):(Ri.ctx=document.createElement("canvas").getContext("2d"),Ri.ctx),uh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ph=e=>{e.style.transform=""},mh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},gh=(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)},hh=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 b=p*c,x=b+c;o[p+1]=x,r[p+1]=r[p]+(d(b)+d(x))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},yh=(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=(g,m)=>{if(m-g<=1)return[g,m];const h=g+m>>1;return l[h]<=r?c(h,m):c(g,h)},[u,p]=c(0,l.length-1),b=l[p]-l[u],x=b>0?(r-l[u])/b:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*x)},vh=(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,b)=>{const x=b/c*e,g=(b+1)/c*e,m=g-x,h=l(x),f=l(g),C=x+m/3,y=h+d(x)*m/3,R=g-m/3,H=f-d(g)*m/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${R.toFixed(2)} ${H.toFixed(2)} ${g.toFixed(2)} ${f.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},xh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${Ya}em`},u=((g=e.image)==null?void 0:g.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),b=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((m,h)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:m===" "?" ":m})},h))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),x=a.jsxs(a.Fragment,{children:[p,b]});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:x}):x})},bh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=W.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:b,layoutType:x,curveAmplitude:g,curveFrequency:m,textFontFamily:h,textFontSettings:f,textFontSize:C,textLineHeight:y,textLetterSpacing:R,textWordSpacing:H,textTextAppearance:S,textColor:U,backgroundColor:F,ribbonWidth:_}=e,B=_??y,L=x==="curve",N=ah(g),k=sh(m),Z=s.useMemo(()=>eh(o,d,L),[o,d,L]),E=s.useMemo(()=>Ut({fontSettings:{fontFamily:h,fontWeight:f.fontWeight,fontStyle:f.fontStyle},letterSpacing:R,wordSpacing:H,fontSize:C,lineHeight:y,textAppearance:S,color:U},n),[h,f,R,H,C,y,S,U,n]),K=de=>W.scalingValue(de,n??!1),D=((t==null?void 0:t.length)??0)>0,j=n?!!i:!0,$=D&&(j||!!n),v=Math.max(0,c)*th,w=j&&p==="on",[P,Q]=s.useState(!1),z=j?w&&P?"paused":"running":"paused",T=z==="running"&&v>0&&d>0,O=s.useRef(null),M=s.useRef(null),ee=s.useRef(null),V=s.useRef(null),me=s.useRef(null),Ie=s.useRef(null),ge=s.useRef(T),ae=s.useRef(null);ge.current=T;const[ne,oe]=s.useState(0),[ie,Ae]=s.useState(0),[be,Me]=s.useState(0),[q,se]=s.useState(0),[he,G]=s.useState(0),re=s.useMemo(()=>(t??[]).map(de=>{var ve;return`${de.text}\0${((ve=de.image)==null?void 0:ve.url)??""}`}).join("\0"),[t]),[pe,we]=s.useState(pa),Pe=s.useMemo(()=>{const de=t??[];return de.length===0||!(j||n)?de:ch(de,pe)},[t,j,pe,n]),Ce=$?ih:1;s.useLayoutEffect(()=>{we(pa),l(0)},[re]),s.useLayoutEffect(()=>{var Ze;const de=Ie.current;if(!de)return;const ve=()=>{const Ve=getComputedStyle(de),at=parseFloat(Ve.fontSize)||0;if(at<=0)return;const Je=dh();if(!Je){oe(at*Ya),Ae(0);return}Je.font=`${Ve.fontStyle} ${Ve.fontWeight} ${at}px ${Ve.fontFamily}`;const ke=Je.measureText("H"),qe=ke.actualBoundingBoxAscent>0?ke.actualBoundingBoxAscent:at*Ya,We=Math.max(0,ke.actualBoundingBoxDescent||0),tt=ke.fontBoundingBoxAscent||0,rt=ke.fontBoundingBoxDescent||0;oe(Tt=>Math.abs(Tt-qe)>.5?qe:Tt);const lt=tt>0||rt>0?(rt-We-(tt-qe))/2:0;Ae(Tt=>Math.abs(Tt-lt)>.25?lt:Tt)};ve();const Ee=typeof document<"u"?document.fonts:void 0;(Ze=Ee==null?void 0:Ee.ready)==null||Ze.then(ve).catch(()=>{});const Ge=new ResizeObserver(ve);return Ge.observe(de),()=>Ge.disconnect()},[E.fontFamily,E.fontWeight,E.fontStyle,E.fontSize,E.lineHeight]),s.useLayoutEffect(()=>{if(!$)return;const de=O.current,ve=V.current;if(!de||!ve)return;const Ee={id:0},Ge=()=>{const Ve=de.getBoundingClientRect().width||de.offsetWidth,at=ve.getBoundingClientRect().width||ve.offsetWidth;if(D&&Ve>0&&at>0){const Je=at/pe;if(Je>0){const ke=Math.min(nh,Math.max(pa,Math.ceil(Ve/Je)+1));if(ke!==pe){we(ke);return}}}at>0&&l(at)};Ee.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ge)});return Ze.observe(de),Ze.observe(ve),()=>{cancelAnimationFrame(Ee.id),Ze.disconnect()}},[$,re,pe,D,ne]),s.useLayoutEffect(()=>{const de=me.current;if(!de)return;const ve={id:0},Ee=()=>{const Ze=de.offsetHeight;Ze>0&&G(Ve=>Math.abs(Ve-Ze)>.5?Ze:Ve)};ve.id=requestAnimationFrame(Ee);const Ge=new ResizeObserver(()=>{cancelAnimationFrame(ve.id),ve.id=requestAnimationFrame(Ee)});return Ge.observe(de),()=>{cancelAnimationFrame(ve.id),Ge.disconnect()}},[B,n]),s.useLayoutEffect(()=>{if(!L){Me(0),se(0);return}const de=O.current,ve=V.current;if(!de||!ve)return;const Ee={id:0},Ge=()=>{const Ve=de.offsetWidth,at=ve.offsetHeight;Ve>0&&se(Je=>Math.abs(Je-Ve)>.5?Ve:Je),at>0&&Me(Je=>Math.abs(Je-at)>.5?at:Je)};Ee.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ge)});return Ze.observe(de),Ze.observe(ve),()=>{cancelAnimationFrame(Ee.id),Ze.disconnect()}},[L,re,ne,y,C,$]),s.useLayoutEffect(()=>{if(!$||d<=0)return;const de=ee.current;de&&lh(de)},[$,d,u,v]),s.useLayoutEffect(()=>{if(!L||!D)return;const de=O.current;if(!de)return;const ve={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ee=()=>{for(const ke of ve.itemsCache)for(const qe of ke.glyphs)ph(qe.inner)},Ge=()=>{const ke=M.current??de;ve.itemsCache=Array.from(de.querySelectorAll("[data-marquee-text-item]"),qe=>{const We=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(tt=>{const rt=tt.firstElementChild;rt&&We.push({inner:rt,layoutLocalX:gh(tt,ke)})}),{item:qe,glyphs:We}}),ve.cacheDirty=!1},Ze=()=>{ve.cacheDirty&&Ge();const qe=(M.current??de).offsetWidth||1,We=qe*N,tt=2*Math.PI*k/qe,rt=`${qe}|${We}|${tt}`;rt!==ve.lutKey&&(ve.lutKey=rt,ve.lut=fh(We,tt,hh));const lt=ee.current,Tt=lt?mh(getComputedStyle(lt).transform):0,Xt=de.getBoundingClientRect(),Zt=Xt.left,xt=Xt.right,wt=ve.lut&&ve.lut.wavelength>0?Math.max(0,(ve.lut.periodArc/ve.lut.wavelength-1)*qe):0;for(const{item:Bt,glyphs:At}of ve.itemsCache){const vt=Bt.getBoundingClientRect();if(!(vt.right<Zt||vt.left>xt+wt))for(const Ft of At){const Wt=Ft.layoutLocalX+Tt,Yt=ve.lut?yh(ve.lut,Wt):Wt,Jt=tt*Yt,Ct=We*Math.sin(Jt),Nt=We*tt*Math.cos(Jt),rn=Math.atan(Nt)*(180/Math.PI);uh(Ft.inner,Yt-Wt,Ct,rn)}}},Ve=()=>{ve.cancelled||(ve.raf=0,Ze(),ge.current&&!document.hidden&&(ve.raf=requestAnimationFrame(Ve)))},at=()=>{ve.cancelled||ve.raf||(ve.raf=requestAnimationFrame(Ve))};ae.current=at,at();const Je=()=>{if(document.hidden){cancelAnimationFrame(ve.raf),ve.raf=0;return}at()};return document.addEventListener("visibilitychange",Je),()=>{ve.cancelled=!0,ae.current=null,cancelAnimationFrame(ve.raf),document.removeEventListener("visibilitychange",Je),Ee()}},[L,N,k,D,r,re,pe,ne]),s.useLayoutEffect(()=>{var de;(de=ae.current)==null||de.call(ae)},[T]);const Y=()=>{w&&Q(!0)},xe=()=>{w&&Q(!1)},ue=L?N*100:0,X=K(B),le={minHeight:X,...L?{paddingTop:`${ue}%`,paddingBottom:`${ue}%`}:{}},Fe={height:X,...L?{visibility:"hidden"}:{backgroundColor:F}},fe={gap:K(b),minHeight:X},J=q*N,Xe=he>0?he:be,Oe=Math.max(be,Xe),dt=L&&q>0&&Oe>0?vh(q,J,k,J+Oe/2):"",nt=J*2+Oe,ht=dt?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${nt}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:dt,fill:"none",stroke:F,strokeWidth:Xe,strokeLinecap:"round",strokeLinejoin:"round"})}):null,st=a.jsx("div",{ref:me,className:`${o}-ribbon`,style:Fe,"aria-hidden":!0}),ze=(de,ve,Ee)=>a.jsx(xh,{item:de,prefix:o,textCss:E,capHeightPx:ne,opticalOffsetY:ie,imageGapPx:K(b),isCurve:L},`${ve}-${Ee}`),Se=a.jsx("span",{ref:Ie,"aria-hidden":!0,className:`${o}-cap-ref`,style:E,children:"H"}),_e=d>0&&v>0?d/v*1e3:0,Be=`${Math.max(0,_e)/1e3}s`,Ye=$?a.jsx("div",{ref:ee,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:Y,onMouseLeave:xe,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:z,animationPlayState:z},children:Array.from({length:Ce},(de,ve)=>a.jsx("div",{ref:ve===0?V:void 0,className:`${o}-marquee-set`,style:{...fe,paddingRight:K(b)},"aria-hidden":ve>0,children:Pe.map((Ee,Ge)=>ze(Ee,ve,Ge))},`set-${ve}`))}):a.jsx("div",{ref:V,className:ut(`${o}-marquee-set`,`${o}-marquee-static`),style:fe,children:t==null?void 0:t.map((de,ve)=>ze(de,0,ve))});return a.jsxs("div",{ref:O,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),Se,a.jsxs("div",{ref:M,className:`${o}-marquee-wrapper`,style:le,children:[st,ht,Ye]})]})},wh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2605
2605
|
import cn from 'classnames';
|
|
2606
2606
|
import { CommonComponentProps } from '../props';
|
|
2607
2607
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -3442,7 +3442,7 @@ type MarqueeTextProps = {
|
|
|
3442
3442
|
isPreviewMode?: boolean;
|
|
3443
3443
|
isEditMode?: boolean;
|
|
3444
3444
|
} & CommonComponentProps;
|
|
3445
|
-
`,
|
|
3445
|
+
`,Sh={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},$h={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:{...Sh.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:""}]}},Ch={element:bh,id:"marquee-text",name:"Marquee Text",category:"galleries",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:$h,sourceCode:wh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function Th(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
3446
3446
|
.${e}-marquee-wrapper {
|
|
3447
3447
|
overflow: hidden;
|
|
3448
3448
|
width: 100%;
|
|
@@ -3531,7 +3531,7 @@ type MarqueeTextProps = {
|
|
|
3531
3531
|
pointer-events: auto;
|
|
3532
3532
|
z-index: 10;
|
|
3533
3533
|
}
|
|
3534
|
-
`}const
|
|
3534
|
+
`}const Lh=30,cl=2,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")},Ih=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:x,stroke:g,strokeColor:m,bgColor:h,padding:f,logoMarginTop:C,logoWidth:y,logoHeight:R,captionMarginTop:H}=e,S=!!o,U=((t==null?void 0:t.length)??0)>0,F=d>0&&(!n||i),_=U&&(F||n),B=Math.max(0,d)*Lh,L=Y=>W.scalingValue(Y,n??!1),N=s.useRef(null),k=s.useRef(null),Z=s.useRef(null),[E,K]=s.useState(0),[D,j]=s.useState(0),$=D>0?D:0,v=s.useMemo(()=>Th(r,$),[r,$]),[w,P]=s.useState(0),Q=F&&u==="on",[z,T]=s.useState(!1),O=s.useRef(null),[M,ee]=s.useState(0),[V,me]=s.useState(0),Ie=s.useRef(null),ge=Y=>{var ue,X,le,Fe,fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${Y}FontFamily`])??"Arial",fontWeight:((ue=e==null?void 0:e[`${Y}FontSettings`])==null?void 0:ue.fontWeight)??400,fontStyle:((X=e==null?void 0:e[`${Y}FontSettings`])==null?void 0:X.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${Y}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((Fe=e==null?void 0:e[`${Y}TextAppearance`])==null?void 0:Fe.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"}},ae=ge("text"),ne=ge("caption"),oe=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(Y=>{var xe,ue;return(((xe=Y.text)==null?void 0:xe.length)??0)>0||(((ue=Y.caption)==null?void 0:ue.length)??0)>0}),[t]),ie=s.useMemo(()=>!_||(t==null?void 0:t.length)===0?1:D<=0||E<=0?cl:Math.max(cl,Math.ceil(E/D)+1),[_,t==null?void 0:t.length,D,E]);s.useLayoutEffect(()=>{if(!_)return;const Y=N.current,xe=Z.current;if(!Y||!xe)return;let ue=0;const X=()=>{const fe=Y.getBoundingClientRect().width,J=xe.getBoundingClientRect().width,Xe=Ie.current,Oe=typeof Xe=="number"&&Math.abs(Xe-J)<=.25;if(Ie.current=J,K(fe),typeof J=="number"&&J>0&&D<=0){j(J);return}Oe&&J!==D?j(J):!Oe&&D<=0&&(cancelAnimationFrame(ue),ue=requestAnimationFrame(X))},le=()=>{cancelAnimationFrame(ue),ue=requestAnimationFrame(X)};le();const Fe=new ResizeObserver(le);return Fe.observe(Y),Fe.observe(xe),()=>{cancelAnimationFrame(ue),Fe.disconnect()}},[F,_,D]);const Ae=$>0&&B>0?$/B*1e3:0,be=`${Math.max(0,Ae)/1e3}s`;s.useLayoutEffect(()=>{if(!_||$<=0)return;const Y=k.current;Y&&Rh(Y)},[_,$,c]),s.useLayoutEffect(()=>{if(!_){P(0);return}const Y=Z.current,xe=k.current;if(!Y||!xe)return;const ue=()=>{let le=0;for(let Fe=0;Fe<Y.children.length;Fe++){const J=Y.children[Fe].firstElementChild;J&&(le=Math.max(le,J.offsetHeight))}le<=0&&(le=xe.offsetHeight),P(le>0?le:0)};ue();const X=new ResizeObserver(ue);return X.observe(Y),X.observe(xe),()=>{X.disconnect()}},[_,ie,t,n,p,b,f,g,x,y,R,M,V]);const Me=()=>{Q&&T(!0)},q=()=>{Q&&T(!1)},se=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),he=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),G=s.useCallback((Y,xe,ue,X)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:se,width:"100%"},children:[a.jsx("div",{"data-controls":S?X==null?void 0:X.controlsName:void 0,"data-controls-axis":S?"y":void 0,className:S?`${r}-control`:void 0,style:{height:L((X==null?void 0:X.marginTop)??0)}}),a.jsx("div",{...X!=null&&X.dataMeasureKind?{"data-testimonial-measure":X.dataMeasureKind}:{},style:{...Ut(Y,n),textAlign:he,pointerEvents:"auto",...typeof(X==null?void 0:X.minHeightPx)=="number"&&X.minHeightPx>0?{minHeight:X.minHeightPx}:{}},children:a.jsx(Si,{content:xe})})]},ue),[se,he,n,S,r,L]),re=s.useCallback((Y,xe,ue)=>{var X,le,Fe;return a.jsxs("div",{style:{padding:`${L(f.top)} ${L(f.right)} ${L(f.bottom)} ${L(f.left)}`,width:L(b+g*2),height:"100%",borderRadius:L(x),border:`${L(g)} solid ${m}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:h}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:se,textAlign:he},children:[Y.text&&G(ae,Y.text,"text",ue!=null&&ue.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ue==null?void 0:ue.textMinHeightPx)=="number"&&ue.textMinHeightPx>0?{minHeightPx:ue.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:se,width:"100%"},children:[a.jsx("div",{"data-controls":S&&!(ue!=null&&ue.dataMeasureAttrs)?"logoMarginTop":void 0,className:S&&!(ue!=null&&ue.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:L(C)}}),a.jsx("div",{style:{width:L(y),height:L(R)},children:((X=Y.logo)==null?void 0:X.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:((Fe=Y.logo)==null?void 0:Fe.objectFit)||"contain"}})})]}),Y.caption&&G(ne,Y.caption,"caption",{...ue!=null&&ue.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...ue!=null&&ue.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ue==null?void 0:ue.captionMinHeightPx)=="number"&&ue.captionMinHeightPx>0?{minHeightPx:ue.captionMinHeightPx}:{}})]})]},xe)},[h,H,ne,b,x,R,C,y,se,he,f.bottom,f.left,f.right,f.top,G,g,m,ae,n,S,r]),pe=s.useCallback(Y=>{ee(Y.maxTextPx),me(Y.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!oe){pe({maxTextPx:0,maxCaptionPx:0});return}const Y=O.current;if(!Y)return;const xe=()=>{W.readTestimonialTextMeasure(Y,pe)};xe();const ue=new ResizeObserver(xe);return ue.observe(Y),()=>{ue.disconnect()}},[oe,pe,t,re]);const we=oe?{textMinHeightPx:M,captionMinHeightPx:V}:void 0,Pe=oe?a.jsx("div",{ref:O,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((Y,xe)=>re(Y,`measure-${xe}`,{dataMeasureAttrs:!0}))}):null,Ce=(Y,xe)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[re(Y,`card-${xe}`,we),S&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${L(p)})`,width:L(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},xe);if(_){const Y=F?Q&&z?"paused":"running":"paused";return a.jsxs("div",{ref:N,className:ut(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...w>0?{height:w}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:v}}),Pe,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Me,onMouseLeave:q,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:be,WebkitAnimationDuration:be,animationPlayState:Y,WebkitAnimationPlayState:Y},children:Array.from({length:ie},(xe,ue)=>a.jsx("div",{ref:ue===0?Z:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:L(p),paddingRight:L(p)},"aria-hidden":ue>0,children:t==null?void 0:t.map((X,le)=>Ce(X,`${ue}-${le}`))},`set-${ue}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:v}}),Pe,a.jsx("div",{style:{gap:L(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((Y,xe)=>Ce(Y,xe))})]})},Ph=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3535
3535
|
import cn from 'classnames';
|
|
3536
3536
|
import { CommonComponentProps } from '../props';
|
|
3537
3537
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4162,7 +4162,7 @@ type TestimonialsSettings = {
|
|
|
4162
4162
|
logoHeight: number;
|
|
4163
4163
|
captionMarginTop: number;
|
|
4164
4164
|
};
|
|
4165
|
-
`,
|
|
4165
|
+
`,dl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Eh={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:{...dl.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:{...dl.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"}]}]}]}},Mh={element:Ih,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:Eh,sourceCode:Ph,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function kh(e){return`
|
|
4166
4166
|
.${e}-container {
|
|
4167
4167
|
position: relative;
|
|
4168
4168
|
overflow-x: clip;
|
|
@@ -4286,7 +4286,7 @@ type TestimonialsSettings = {
|
|
|
4286
4286
|
width: 100%;
|
|
4287
4287
|
height: 100%;
|
|
4288
4288
|
}
|
|
4289
|
-
`}const
|
|
4289
|
+
`}const Ah=3e3,Fh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:x,imageWidth:g,imageHeight:m,controlsWidth:h,controlsColor:f,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[R,H]=s.useState(0),[S,U]=s.useState(null),[F,_]=s.useState(!1),B=s.useRef(null),L=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),N=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{H(0),U(null),_(!1)},[l.length]);const k=l[R],Z=S===null?null:l[S],E=ge=>{var ne,oe,ie,Ae,be;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ge}FontFamily`])??"Arial",fontWeight:((ne=e==null?void 0:e[`${ge}FontSettings`])==null?void 0:ne.fontWeight)??400,fontStyle:((oe=e==null?void 0:e[`${ge}FontSettings`])==null?void 0:oe.fontStyle)??"normal"},textAppearance:{textTransform:((ie=e==null?void 0:e[`${ge}TextAppearance`])==null?void 0:ie.textTransform)??"none",textDecoration:((Ae=e==null?void 0:e[`${ge}TextAppearance`])==null?void 0:Ae.textDecoration)??"none",fontVariant:((be=e==null?void 0:e[`${ge}TextAppearance`])==null?void 0:be.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ge}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ge}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ge}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ge}WordSpacing`])??0,color:(e==null?void 0:e[`${ge}Color`])??"#000000"}},K=E("text"),D=E("caption"),j=l.length>1&&l.some(ge=>{var ae,ne;return(((ae=ge.text)==null?void 0:ae.length)??0)>0||(((ne=ge.caption)==null?void 0:ne.length)??0)>0}),$=s.useRef(null),[v,w]=s.useState(0),[P,Q]=s.useState(0),z=e.controls??{mode:"Off",icon:null},T=l.length>1,O=s.useCallback((ge,ae)=>!T||ae===ge?ge:(B.current&&window.clearTimeout(B.current),U(ge),_(!0),B.current=window.setTimeout(()=>{U(null),_(!1),B.current=null},300),ae),[T]),M=s.useCallback(()=>{T&&H(ge=>O(ge,(ge-1+l.length)%l.length))},[T,O,l.length]),ee=s.useCallback(()=>{T&&H(ge=>O(ge,(ge+1)%l.length))},[T,O,l.length]);s.useEffect(()=>{if(!y||!T)return;const ge=Math.max(300,Ah/d),ae=window.setInterval(()=>{H(ne=>O(ne,(ne+1)%l.length))},ge);return()=>{window.clearInterval(ae)}},[y,T,O,l.length,d]),s.useEffect(()=>()=>{B.current&&window.clearTimeout(B.current)},[]);const V=(ge,ae)=>{var be,Me,q,se;const ne=ae==null?void 0:ae.textMinHeightPx,oe=ae==null?void 0:ae.captionMinHeightPx,ie=ae==null?void 0:ae.dataMeasureAttrs,Ae=o&&!(ae!=null&&ae.dataMeasureAttrs)&&!(ae!=null&&ae.hideControls);return a.jsxs(a.Fragment,{children:[ge.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:L,width:"100%"},children:[a.jsx("div",{"data-controls":Ae?"textMarginTop":void 0,className:Ae?`${r}-control`:void 0,style:{height:W.scalingValue(b??0,n??!1)}}),a.jsx("div",{...ie&&{"data-testimonial-measure":"text"},style:{...Ut(K,n),...ne&&ne>0?{minHeight:ne}:{},textAlign:N,pointerEvents:"auto"},children:a.jsx(Si,{content:ge.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:L,width:"100%"},children:[a.jsx("div",{"data-controls":Ae?"imageMarginTop":void 0,className:Ae?`${r}-control`:void 0,style:{height:W.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:W.scalingValue(g??0,n??!1),height:W.scalingValue(m??0,n??!1)},children:((be=ge.image)==null?void 0:be.url)&&a.jsx("img",{src:(Me=ge.image)==null?void 0:Me.url,alt:((q=ge.image)==null?void 0:q.name)??"",className:`${r}-icon`,style:{objectFit:((se=ge.image)==null?void 0:se.objectFit)||"contain"}})})]}),ge.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:L,width:"100%"},children:[a.jsx("div",{"data-controls":Ae?"captionMarginTop":void 0,className:Ae?`${r}-control`:void 0,style:{height:W.scalingValue(x??0,n??!1)}}),a.jsx("div",{...ie?{"data-testimonial-measure":"caption"}:{},style:{...Ut(D,n),...oe&&oe>0?{minHeight:oe}:{},textAlign:N,pointerEvents:"auto"},children:a.jsx(Si,{content:ge.caption})})]})]})},me=s.useCallback(ge=>{w(ge.maxTextPx),Q(ge.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!j){me({maxTextPx:0,maxCaptionPx:0});return}const ge=$.current;if(!ge)return;const ae=()=>{W.readTestimonialTextMeasure(ge,me)};ae();const ne=new ResizeObserver(ae);return ne.observe(ge),()=>{ne.disconnect()}},[j,me,t]),!k)return a.jsx(a.Fragment,{});const Ie=j?{textMinHeightPx:v,captionMinHeightPx:P}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:kh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:W.scalingValue(u??0,n??!1),alignItems:L},children:[j&&a.jsx("div",{ref:$,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((ge,ae)=>a.jsx("div",{style:{width:"100%"},children:V(ge,{dataMeasureAttrs:!0})},ae))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[Z&&F&&a.jsx("div",{className:ut(`${r}-fade-item-prev`,`${r}-fade-out`),children:V(Z,{...Ie,hideControls:!0})}),a.jsx("div",{className:ut(`${r}-fade-item-current`,F?`${r}-fade-in`:void 0),children:V(k,Ie)})]})]}),z.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:W.scalingValue(h??.02,n??!1),height:W.scalingValue(h??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:M,disabled:!T,"aria-label":"Previous testimonial",children:z.icon&&a.jsx(sn,{url:z.icon,fill:f,hoverFill:C,className:ut(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:ut(`${r}-arrow`,`${r}-next-arrow`),style:{width:W.scalingValue(h??.02,n??!1),height:W.scalingValue(h??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ee,disabled:!T,"aria-label":"Next testimonial",children:z.icon&&a.jsx(sn,{url:z.icon,fill:f,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},_h=`import cn from 'classnames';
|
|
4290
4290
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4291
4291
|
import { CommonComponentProps } from '../props';
|
|
4292
4292
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4782,12 +4782,12 @@ type TestimonialsSettings = {
|
|
|
4782
4782
|
icon?: string | null;
|
|
4783
4783
|
};
|
|
4784
4784
|
};
|
|
4785
|
-
`,
|
|
4785
|
+
`,Wh="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>'),ul={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Nh={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:{...ul.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:{...ul.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:Wh},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"}]}]}]}},Hh={element:Fh,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:Nh,sourceCode:_h,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Oh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function pl(e){return((e==null?void 0:e.trim().length)??0)>0}function ma(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ga(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((o-t)/2,i)}}function Dh(e){return`
|
|
4786
4786
|
.${e}-wrapper {
|
|
4787
4787
|
display: grid;
|
|
4788
4788
|
align-items: start;
|
|
4789
4789
|
justify-content: center;
|
|
4790
|
-
min-height: ${
|
|
4790
|
+
min-height: ${Oh(48)};
|
|
4791
4791
|
}
|
|
4792
4792
|
.${e}-item {
|
|
4793
4793
|
display: flex;
|
|
@@ -5129,7 +5129,7 @@ type TestimonialsSettings = {
|
|
|
5129
5129
|
z-index: 2;
|
|
5130
5130
|
width: 100%;
|
|
5131
5131
|
}
|
|
5132
|
-
`}function Dh(){return Math.random()<.5?"ltr":"ttb"}function Bh(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function jh(e){const t=Dh();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Bh(e)})})}const bn=500,zh=750,Bn="cubic-bezier(0.22, 1, 0.36, 1)",Vh=72,Gh=50;function qh(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 Xh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Uh(e){const[t]=e.media;return t!=null&&t.url?t:null}function ud(e){return!Array.isArray(e)||e.length===0?[]:qh(e)?e.flatMap(t=>{const n=Xh(t);if(!n)return[];const i=Uh(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 vi(e){return e.type==="video"}function Kh(e){const t=new Set,n=[];for(const i of e){const o=ud(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 Yh({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=>vi(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 Zh(e){e.pause(),e.removeAttribute("src"),e.load()}function pl({media:e,className:t,style:n,onMediaClick:i}){return vi(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 ml(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Jh(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 Qh({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{Zh(c)}},[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 ef({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u}){const p=i==="cover",v=s.useRef(null),f=s.useRef(null),h=s.useRef(null),g=s.useRef(null),m=s.useRef(0),x=s.useRef(0),T=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),B=s.useRef(null),M=s.useRef(0),G=s.useRef(null),O=s.useRef(!1),_=s.useRef(null),j=s.useRef(null),b=s.useRef(null),H=s.useRef(()=>{}),[E,$]=s.useState(null),[S,P]=s.useState(null),[I,N]=s.useState("opening"),[z,C]=s.useState(0),[R,D]=s.useState(0),[ie,ee]=s.useState(null),[A,ae]=s.useState(!1),[k,J]=s.useState(!1),[X,me]=s.useState(!1),[Le,he]=s.useState(null),K=s.useRef(n),V=s.useRef(void 0),Y=t[n],Q=Y?vi(Y):!1,Te=R!==0||A,we=ie!==null,ke=s.useCallback(se=>{const ye=se.currentTarget,Ee=ye instanceof HTMLVideoElement?{width:ye.videoWidth,height:ye.videoHeight}:{width:ye.naturalWidth,height:ye.naturalHeight};!Ee.width||!Ee.height||he(Ee)},[]);s.useEffect(()=>{B.current=S},[S]),s.useEffect(()=>{const se=v.current;if(!se)return;const ye=()=>P(ml(se));ye();const Ee=new ResizeObserver(ye);return Ee.observe(se),()=>Ee.disconnect()},[]);const le=s.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),ge=s.useCallback(()=>{const se=j.current;j.current=null,le(),G.current=null,O.current=!1,ee(null),ae(!1),D(0),M.current=0,J(!1),y.current=!1,x.current=0,T.current="none",se===1?c():se===-1&&l()},[le,c,l]),be=s.useCallback(()=>{le(),j.current=null,G.current=null,O.current=!1,ee(null),ae(!1),D(0),M.current=0},[le]),ne=s.useCallback(()=>{le(),_.current=window.setTimeout(()=>{j.current!==null&&ge()},bn+32)},[le,ge]),ce=s.useCallback((se,ye)=>{var Ge;const Ee=((Ge=B.current)==null?void 0:Ge.width)??0;if(le(),G.current=se,ee(se),O.current=!0,ae(!0),ye){j.current=se;const Ze=-se*Ee;M.current=Ze,D(Ze),ne();return}M.current=0,D(0),_.current=window.setTimeout(()=>{_.current=null,be()},bn+32)},[le,be,ne]),ue=s.useCallback(se=>{if(!(t.length<=1)){if(O.current){if(j.current===se){b.current=se,ge();return}be()}le(),G.current=se,ee(se),O.current=!1,ae(!1),M.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(se,!0)})})}},[t.length,ce,ge,be,le]);H.current=ue;const xe=s.useCallback(se=>{se.propertyName!=="transform"||!O.current||j.current!==null&&ge()},[ge]),Ae=s.useCallback(()=>{const se=f.current;if(!se)return;const ye=ml(se);!ye.width||!ye.height||$(ye)},[]);s.useEffect(()=>{Ae();const se=f.current;if(!se)return;const ye=new ResizeObserver(()=>Ae());return ye.observe(se),()=>ye.disconnect()},[Ae]),s.useEffect(()=>{I==="opening"&&E&&N("open")},[I,E]),s.useEffect(()=>{if(I!=="closing")return;const se=setTimeout(()=>r(),bn);return()=>clearTimeout(se)},[I,r]),s.useEffect(()=>()=>{le()},[le]),s.useLayoutEffect(()=>{K.current===n&&V.current===(Y==null?void 0:Y.url)||(le(),j.current=null,ee(null),C(0),D(0),ae(!1),me(!1),J(!1),he(null),m.current=0,x.current=0,T.current="none",y.current=!1,O.current=!1,M.current=0,G.current=null,g.current=null,w.current=!1,K.current=n,V.current=Y==null?void 0:Y.url)},[n,Y==null?void 0:Y.url,le]),s.useLayoutEffect(()=>{const se=b.current;se!==null&&(b.current=null,requestAnimationFrame(()=>{H.current(se)}))},[n,Y==null?void 0:Y.url]),s.useEffect(()=>{if(I!=="open")return;let se=null;const ye=()=>{se&&(document.removeEventListener("click",se,!0),se=null)},Ee=()=>{ye(),se=Je=>{Je.stopPropagation(),Je.preventDefault(),ye()},document.addEventListener("click",se,!0)},Ge=Je=>{const Me=Je<0?1:-1;if(Math.abs(Je)>Gh&&t.length>1){ce(Me,!0);return}ce(Me,!1)},Ze=Je=>{if(Je.touches.length!==1||O.current)return;const Me=Je.touches[0];w.current=!0,g.current={x:Me.clientX,y:Me.clientY},T.current="none",x.current=0,y.current=!1},Ve=Je=>{if(!g.current||Je.touches.length!==1||O.current)return;const Me=Je.touches[0],qe=Me.clientX-g.current.x,We=Me.clientY-g.current.y;if(T.current==="none"){if(Math.abs(qe)<10&&Math.abs(We)<10)return;if(Math.abs(qe)>Math.abs(We)){if(t.length<=1)return;T.current="horizontal"}else if(We>0)T.current="vertical";else return}if(T.current==="horizontal"){y.current=!0,J(!0),x.current=qe;const tt=qe<0?1:-1;G.current!==tt&&(G.current=tt,ee(tt)),M.current=qe,D(qe),Je.preventDefault();return}T.current==="vertical"&&(y.current=!0,J(!0),m.current=We,C(We),Je.preventDefault())},at=()=>{if(!g.current)return;const Je=T.current,Me=y.current;if(Me&&Je==="horizontal")Ge(x.current),Ee();else if(Me&&Je==="vertical")if(m.current>Vh){const We=window.innerHeight;m.current=We,me(!0),C(We),N("closing")}else m.current=0,C(0),Ee();else Je==="horizontal"&&Math.abs(x.current)>0&&(Ge(x.current),Ee());g.current=null,T.current="none",x.current=0,y.current=!1,J(!1)};return document.addEventListener("touchstart",Ze,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",at),document.addEventListener("touchcancel",at),()=>{document.removeEventListener("touchstart",Ze),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",at),document.removeEventListener("touchcancel",at),ye()}},[I,t.length,ce]),s.useEffect(()=>{const se=ye=>{ye.key==="Escape"&&(ye.preventDefault(),ye.stopPropagation(),I!=="closing"&&N("closing"))};return window.addEventListener("keydown",se,!0),()=>window.removeEventListener("keydown",se,!0)},[I]);const Ie=()=>{I!=="closing"&&N("closing")},U=I==="open",ve=I==="closing",de=z>0?Math.max(0,1-z/500):1,q=z>0?Math.max(.35,1-z/500):1,re=E?p?E:Jh(E,Le):null,Fe=se=>{if(se.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const ye=re??se.currentTarget.getBoundingClientRect(),Ee=se.clientY-ye.top,Ge=Math.min(52,ye.height*.2);if(!(Ee>ye.height-Ge)){if(se.clientX-ye.left<ye.width/2){ue(-1);return}ue(1)}},pe=se=>{if(t.length<=1)return;const ye=re??se.currentTarget.getBoundingClientRect(),Ee=se.clientX-ye.left,Ge=se.clientY-ye.top,Ze=Math.min(52,ye.height*.2);if(Ge>ye.height-Ze){se.currentTarget.style.cursor="default";return}se.currentTarget.style.cursor=Ee<ye.width/2?"w-resize":"e-resize"},Z={position:"fixed",top:S==null?void 0:S.top,left:S==null?void 0:S.left,width:S==null?void 0:S.width,height:S==null?void 0:S.height,zIndex:9998},Xe=p?"cover":"contain",Oe=R!==0||z>0?`translate(${R}px, ${z}px)`:void 0,dt=k&&!A?"none":A?`transform ${bn}ms ${Bn}`:X?`transform ${bn}ms ${Bn}, opacity ${bn}ms ${Bn}`:I==="opening"||ve?`opacity ${bn}ms ${Bn}`:"none",nt={...Z,transform:Oe,opacity:z>0?q:I==="opening"||ve?0:1,transition:dt,pointerEvents:"none"},ht={position:"absolute",top:((re==null?void 0:re.top)??0)-((S==null?void 0:S.top)??0),left:((re==null?void 0:re.left)??0)-((S==null?void 0:S.left)??0),width:re==null?void 0:re.width,height:re==null?void 0:re.height,objectFit:Xe,pointerEvents:Q&&U&&!Te?"auto":"none",touchAction:Q&&U?"none":void 0},st=(S==null?void 0:S.width)??0,ze=we?(n+ie+t.length)%t.length:null,Se=ze!==null?t[ze]:null,_e={...Z,transform:we?`translateX(${ie*st+R}px)`:void 0,opacity:1,transition:A?`transform ${bn}ms ${Bn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((E==null?void 0:E.top)??0)-((S==null?void 0:S.top)??0),left:((E==null?void 0:E.left)??0)-((S==null?void 0:S.left)??0),width:E==null?void 0:E.width,height:E==null?void 0:E.height,objectFit:Xe,pointerEvents:"none"},Ke=re?{position:"fixed",top:re.top,height:re.height,width:re.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:I==="open"?"none":void 0},onClick:Ie,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:U?de:0,transition:k?"none":`opacity ${bn}ms ${Bn}`,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:f,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:U?1:0,transition:`opacity ${bn}ms ${Bn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,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:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:U?1:0,transition:`opacity ${bn}ms ${Bn}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),E&&S&&Se&&a.jsx("div",{style:_e,onTransitionEnd:xe,children:vi(Se)?a.jsx("video",{src:Se.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${ze}-${Se.url}`):a.jsx("img",{src:Se.url,alt:Se.name,style:Be},`neighbor-${ze}-${Se.url}`)}),E&&S&&Y&&a.jsx("div",{style:nt,onTransitionEnd:xe,children:Q?a.jsx(Qh,{src:Y.url,phase:I,mediaRef:h,mediaStyle:ht,onLoadedMetadata:ke,onClick:Fe,onMouseMove:pe},`${n}-${Y.url}`):a.jsx("img",{ref:h,src:Y.url,alt:Y.name,onLoad:ke,style:ht},`${n}-${Y.url}`)}),U&&Ke&&t.length>1&&!Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ke,left:re.left,cursor:"w-resize",pointerEvents:k?"none":"auto"},onClick:se=>{if(w.current){w.current=!1;return}se.stopPropagation(),ue(-1)}}),a.jsx("div",{style:{...Ke,left:re.left+re.width/2,cursor:"e-resize",pointerEvents:k?"none":"auto"},onClick:se=>{if(w.current){w.current=!1;return}se.stopPropagation(),ue(1)}})]})]})}function tf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function nf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=W.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:f=100,verticalGap:h,entriesCount:g,lightbox:m,imageDisplay:x,imageCorners:T,lightboxImageDisplay:y,slider:w,sliderTiming:B,direction:M,transition:G,titleMarginTop:O,subtitleMarginTop:_,titleColor:j,subtitleColor:b,lightboxCounterColor:H,titleFontFamily:E,titleFontSettings:$,titleFontSize:S,titleLineHeight:P,titleLetterSpacing:I,titleWordSpacing:N,titleTextAppearance:z,subtitleFontFamily:C,subtitleFontSettings:R,subtitleFontSize:D,subtitleLineHeight:ie,subtitleLetterSpacing:ee,subtitleWordSpacing:A,subtitleTextAppearance:ae,lightboxCounterFontFamily:k,lightboxCounterFontSettings:J,lightboxCounterFontSize:X,lightboxCounterLineHeight:me,lightboxCounterLetterSpacing:Le,lightboxCounterWordSpacing:he,lightboxCounterTextAppearance:K,showText:V="always",alignEntries:Y="off",align:Q="top"}=e,Te={fontSettings:{fontFamily:E,fontWeight:($==null?void 0:$.fontWeight)??400,fontStyle:($==null?void 0:$.fontStyle)??"normal"},fontSize:S??.01,lineHeight:P,letterSpacing:I??0,wordSpacing:N??0,textAppearance:z,color:j},ke={...an(Ut(Te,n))},le={fontSettings:{fontFamily:C,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:D??.01,lineHeight:ie,letterSpacing:ee??0,wordSpacing:A??0,textAppearance:ae,color:b},be={...an(Ut(le,n))},ne={fontSettings:{fontFamily:k,fontWeight:(J==null?void 0:J.fontWeight)??400,fontStyle:(J==null?void 0:J.fontStyle)??"normal"},fontSize:X??.01,lineHeight:me,letterSpacing:Le??0,wordSpacing:he??0,textAppearance:K,color:H},ue={...an(Ut(ne,n)),...ma(X,me,u,n)},xe=pa(S,P,`${u}-item-title`,`${u}-text-tight-leading`),Ae=pa(D,ie,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ie=ma(S,P,u,n),U=ma(D,ie,u,n),ve=pa(X,me,`${u}-lightbox-counter`,`${u}-text-tight-leading`),de=W.buildColorVars(u,{titleColor:j,subtitleColor:b,lightboxCounterColor:H},of,rf),Fe=`${l&&l!=="default"?`${u}-state-${l}`:""}${V==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),pe=g===0?1/0:g,Z=(t??[]).slice(0,pe),Xe=s.useMemo(()=>m==="on"?Kh(Z):[],[Z,m]),Oe=v.entryWidth??.2,dt=(x==null?void 0:x.display)==="cover",nt=(x==null?void 0:x.ratioValue)??"1:1",ht=(x==null?void 0:x.reversed)??!1,[st,ze]=nt.split(":").map(Number),Be=`${ht?ze:st} / ${ht?st:ze}`,Ke=v.columnsCount,se=W.scalingValue(Oe??0,n),ye=se,Ee=!dt&&w!=="off",Ge=Z.length%Ke||Ke,Ze=Ge<Ke&&Z.length>0,Ve=Z.length-Ge,at=Ze?Math.floor((Ke-Ge)/2)+1:1,Je=T?W.scalingValue(T,n):void 0,Me={width:ye,...dt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Je?{borderRadius:Je,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Ee?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="d"||p==="e"||p==="f",tt=Y==="on",rt=`calc(${W.scalingValue(Oe??0,n)} * (${f} / 100))`,lt=W.scalingValue(Oe*f/100,n),Tt=dt?{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}:{}},[Xt,Zt]=s.useState(0),xt=s.useRef(null),wt=G==="fade"||M==="horizontal"?"ltr":M==="vertical"?"ttb":"ltr";s.useEffect(()=>{const mt=xt.current;if(!mt)return;const Re=new ResizeObserver(De=>{Zt(Math.round(De[0].contentRect.width))});return Re.observe(mt),()=>Re.disconnect()},[]);const Bt=(()=>{const mt={...de},Re=xt.current?getComputedStyle(xt.current).getPropertyValue("--cntrl-article-width").trim():"";return Re&&(mt["--cntrl-article-width"]=Re),mt})(),[At,vt]=s.useState(!1),[Ft,Wt]=s.useState([]),[Kt,Jt]=s.useState(0),Ct=m==="on"&&(!n||i),Nt=(mt,Re)=>{n&&!i||m!=="off"&&(Wt(mt),Jt(Re),vt(!0))};s.useEffect(()=>{if(!At||m!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[At,m]),s.useEffect(()=>{!n||i||vt(!1)},[n,i]);const rn=s.useMemo(()=>Oh(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),m==="on"&&a.jsx(Yh,{mediaList:Xe}),a.jsx("div",{style:de,children:a.jsx("div",{ref:xt,className:`${u}-wrapper ${u}-type-${p}${tt?` ${u}-align-entries`:""} ${u}-image-align-${Q} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${Ke}, ${se})`,rowGap:tt?0:W.scalingValue(h??0,n),columnGap:W.scalingValue(v.horizontalGap??0,n),width:W.scalingValue(v.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:W.scalingValue(h??0,n)}:{}},children:Z.map((mt,Re)=>{var _t;const De=ul(mt.title),it=ul(mt.subtitle),gt=(((_t=mt.link)==null?void 0:_t.length)??0)>0&&m==="off"?mt.link:void 0,ft=Math.floor(Re/Ke)===Math.ceil(Z.length/Ke)-1,It=Ze&&Re>=Ve?`${at+(Re-Ve)}`:void 0,pt=We?a.jsxs("div",{className:`${u}-item-text-block`,children:[De&&a.jsx("p",{className:xe,style:{width:rt,...ke,...Ie},children:mt.title}),De&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(O??0,n),width:lt}}),it&&a.jsx("p",{className:Ae,style:{width:rt,...be,...U},children:mt.subtitle}),it&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(_??0,n),width:lt}})]}):null,jt=tt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!We&&a.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?W.scalingValue(O??0,n):0,width:lt}}),De&&a.jsx("p",{className:xe,style:{width:rt,...ke,...Ie},children:mt.title}),We&&De&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(O??0,n),width:lt}})]}):null,kt=tt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!We&&a.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?W.scalingValue(_??0,n):0,width:lt}}),it&&a.jsx("p",{className:Ae,style:{width:rt,...be,...U},children:mt.subtitle}),We&&it&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(_??0,n),width:lt}})]}):null,Mt=gt?a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:[jt,kt]}):a.jsxs(a.Fragment,{children:[jt,kt]}),Vt=ud(mt.gallery),Gt=Vt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Ht=a.jsx("div",{className:qe,style:Me,children:Vt.length===0?null:w==="off"?(()=>{const{displayMedia:St,lightboxMedia:F}=Vt[0],$e=F?Gt.findIndex(Pe=>Pe.url===F.url):-1;return a.jsx(pl,{media:St,className:`${u}-item-${vi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&$e>=0?()=>Nt(Gt,$e):void 0})})():a.jsxs(a.Fragment,{children:[Ee&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:St})=>vi(St)?a.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):a.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),a.jsx(Cs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:B*1e3,width:"100%",height:"100%",speed:zh,type:G==="fade"?"fade":"loop",rewind:G==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:St=>{M!=="random"||G==="fade"||jh(St)},children:Vt.map(({displayMedia:St,lightboxMedia:F},$e)=>{const Pe=F?Gt.findIndex(Ne=>Ne.url===F.url):-1;return a.jsx(Ts,{children:a.jsx(pl,{media:St,className:`${u}-item-${vi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&Pe>=0?()=>Nt(Gt,Pe):void 0})},$e)})},`${G}-${Oe}-${M}-${B}-${Xt}-${c}`)]})}),Ot=We?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?W.scalingValue(O??0,n):0,width:lt}}),a.jsx("p",{className:xe,style:{width:rt,...ke,...Ie},children:mt.title}),a.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?W.scalingValue(_??0,n):0,width:lt}}),a.jsx("p",{className:Ae,style:{width:rt,...be,...U},children:mt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!tt?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(f??0)>100?`calc(${se} * (${f} / 100))`:se,...It&&tt?{gridColumn:It}:{}},children:tt?a.jsx(a.Fragment,{children:We?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):gt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:[pt,Ht]}),!We&&a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:Ot})]}):a.jsxs(a.Fragment,{children:[pt,Ht,Ot]})})},Re)})})}),(!n||i)&&At&&typeof document<"u"&&m==="on"&&(()=>{const mt=(d?document.getElementById(d):null)??document.body;return Dn.createPortal(a.jsx("div",{style:Bt,"data-selection":"none",children:a.jsx(ef,{prefix:u,items:Ft,index:Kt,imageDisplay:tf(y),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Jt(Re=>(Re-1+Ft.length)%Ft.length),onNext:()=>Jt(Re=>(Re+1)%Ft.length),counterClassName:ve,counterStyle:ue})}),mt)})()]})}const of={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},rf=["hover","focus","filled","success","error"],af=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5132
|
+
`}function Bh(){return Math.random()<.5?"ltr":"ttb"}function jh(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function zh(e){const t=Bh();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{jh(e)})})}const bn=500,Vh=750,Bn="cubic-bezier(0.22, 1, 0.36, 1)",Gh=72,qh=50;function Xh(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 Uh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Yh(e){const[t]=e.media;return t!=null&&t.url?t:null}function ud(e){return!Array.isArray(e)||e.length===0?[]:Xh(e)?e.flatMap(t=>{const n=Uh(t);if(!n)return[];const i=Yh(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 vi(e){return e.type==="video"}function Kh(e){const t=new Set,n=[];for(const i of e){const o=ud(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 Zh({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=>vi(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 Jh(e){e.pause(),e.removeAttribute("src"),e.load()}function ml({media:e,className:t,style:n,onMediaClick:i}){return vi(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 gl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Qh(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 ef({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{Jh(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 tf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=s.useRef(null),x=s.useRef(null),g=s.useRef(null),m=s.useRef(null),h=s.useRef(0),f=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),R=s.useRef(!1),H=s.useRef(null),S=s.useRef(0),U=s.useRef(null),F=s.useRef(!1),_=s.useRef(null),B=s.useRef(null),L=s.useRef(null),N=s.useRef(()=>{}),[k,Z]=s.useState(null),[E,K]=s.useState(null),[D,j]=s.useState("opening"),[$,v]=s.useState(0),[w,P]=s.useState(0),[Q,z]=s.useState(null),[T,O]=s.useState(!1),[M,ee]=s.useState(!1),[V,me]=s.useState(!1),[Ie,ge]=s.useState(null),ae=s.useRef(n),ne=s.useRef(void 0),oe=t[n],ie=oe?vi(oe):!1,Ae=w!==0||T,be=Q!==null,Me=s.useCallback(de=>{const ve=de.currentTarget,Ee=ve instanceof HTMLVideoElement?{width:ve.videoWidth,height:ve.videoHeight}:{width:ve.naturalWidth,height:ve.naturalHeight};!Ee.width||!Ee.height||ge(Ee)},[]);s.useEffect(()=>{H.current=E},[E]),s.useEffect(()=>{const de=b.current;if(!de)return;const ve=()=>K(gl(de));ve();const Ee=new ResizeObserver(ve);return Ee.observe(de),()=>Ee.disconnect()},[]);const q=s.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),se=s.useCallback(()=>{const de=B.current;B.current=null,q(),U.current=null,F.current=!1,z(null),O(!1),P(0),S.current=0,ee(!1),y.current=!1,f.current=0,C.current="none",de===1?d():de===-1&&l()},[q,d,l]),he=s.useCallback(()=>{q(),B.current=null,U.current=null,F.current=!1,z(null),O(!1),P(0),S.current=0},[q]),G=s.useCallback(()=>{q(),_.current=window.setTimeout(()=>{B.current!==null&&se()},bn+32)},[q,se]),re=s.useCallback((de,ve)=>{var Ge;const Ee=((Ge=H.current)==null?void 0:Ge.width)??0;if(q(),U.current=de,z(de),F.current=!0,O(!0),ve){B.current=de;const Ze=-de*Ee;S.current=Ze,P(Ze),G();return}S.current=0,P(0),_.current=window.setTimeout(()=>{_.current=null,he()},bn+32)},[q,he,G]),pe=s.useCallback(de=>{if(!(t.length<=1)){if(F.current){if(B.current===de){L.current=de,se();return}he()}q(),U.current=de,z(de),F.current=!1,O(!1),S.current=0,P(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(de,!0)})})}},[t.length,re,se,he,q]);N.current=pe;const we=s.useCallback(de=>{de.propertyName!=="transform"||!F.current||B.current!==null&&se()},[se]),Pe=s.useCallback(()=>{const de=x.current;if(!de)return;const ve=gl(de);!ve.width||!ve.height||Z(ve)},[]);s.useEffect(()=>{Pe();const de=x.current;if(!de)return;const ve=new ResizeObserver(()=>Pe());return ve.observe(de),()=>ve.disconnect()},[Pe]),s.useEffect(()=>{D==="opening"&&k&&j("open")},[D,k]),s.useEffect(()=>{if(D!=="closing")return;const de=setTimeout(()=>r(),bn);return()=>clearTimeout(de)},[D,r]),s.useEffect(()=>()=>{q()},[q]),s.useLayoutEffect(()=>{ae.current===n&&ne.current===(oe==null?void 0:oe.url)||(q(),B.current=null,z(null),v(0),P(0),O(!1),me(!1),ee(!1),ge(null),h.current=0,f.current=0,C.current="none",y.current=!1,F.current=!1,S.current=0,U.current=null,m.current=null,R.current=!1,ae.current=n,ne.current=oe==null?void 0:oe.url)},[n,oe==null?void 0:oe.url,q]),s.useLayoutEffect(()=>{const de=L.current;de!==null&&(L.current=null,requestAnimationFrame(()=>{N.current(de)}))},[n,oe==null?void 0:oe.url]),s.useEffect(()=>{if(D!=="open")return;let de=null;const ve=()=>{de&&(document.removeEventListener("click",de,!0),de=null)},Ee=()=>{ve(),de=Je=>{Je.stopPropagation(),Je.preventDefault(),ve()},document.addEventListener("click",de,!0)},Ge=Je=>{const ke=Je<0?1:-1;if(Math.abs(Je)>qh&&t.length>1){re(ke,!0);return}re(ke,!1)},Ze=Je=>{if(Je.touches.length!==1||F.current)return;const ke=Je.touches[0];R.current=!0,m.current={x:ke.clientX,y:ke.clientY},C.current="none",f.current=0,y.current=!1},Ve=Je=>{if(!m.current||Je.touches.length!==1||F.current)return;const ke=Je.touches[0],qe=ke.clientX-m.current.x,We=ke.clientY-m.current.y;if(C.current==="none"){if(Math.abs(qe)<10&&Math.abs(We)<10)return;if(Math.abs(qe)>Math.abs(We)){if(t.length<=1)return;C.current="horizontal"}else if(We>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,ee(!0),f.current=qe;const tt=qe<0?1:-1;U.current!==tt&&(U.current=tt,z(tt)),S.current=qe,P(qe),Je.preventDefault();return}C.current==="vertical"&&(y.current=!0,ee(!0),h.current=We,v(We),Je.preventDefault())},at=()=>{if(!m.current)return;const Je=C.current,ke=y.current;if(ke&&Je==="horizontal")Ge(f.current),Ee();else if(ke&&Je==="vertical")if(h.current>Gh){const We=window.innerHeight;h.current=We,me(!0),v(We),j("closing")}else h.current=0,v(0),Ee();else Je==="horizontal"&&Math.abs(f.current)>0&&(Ge(f.current),Ee());m.current=null,C.current="none",f.current=0,y.current=!1,ee(!1)};return document.addEventListener("touchstart",Ze,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",at),document.addEventListener("touchcancel",at),()=>{document.removeEventListener("touchstart",Ze),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",at),document.removeEventListener("touchcancel",at),ve()}},[D,t.length,re]),s.useEffect(()=>{const de=ve=>{ve.key==="Escape"&&(ve.preventDefault(),ve.stopPropagation(),D!=="closing"&&j("closing"))};return window.addEventListener("keydown",de,!0),()=>window.removeEventListener("keydown",de,!0)},[D]);const Ce=()=>{D!=="closing"&&j("closing")},Y=D==="open",xe=D==="closing",ue=$>0?Math.max(0,1-$/500):1,X=$>0?Math.max(.35,1-$/500):1,le=k?p?k:Qh(k,Ie):null,Fe=de=>{if(de.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const ve=le??de.currentTarget.getBoundingClientRect(),Ee=de.clientY-ve.top,Ge=Math.min(52,ve.height*.2);if(!(Ee>ve.height-Ge)){if(de.clientX-ve.left<ve.width/2){pe(-1);return}pe(1)}},fe=de=>{if(t.length<=1)return;const ve=le??de.currentTarget.getBoundingClientRect(),Ee=de.clientX-ve.left,Ge=de.clientY-ve.top,Ze=Math.min(52,ve.height*.2);if(Ge>ve.height-Ze){de.currentTarget.style.cursor="default";return}de.currentTarget.style.cursor=Ee<ve.width/2?"w-resize":"e-resize"},J={position:"fixed",top:E==null?void 0:E.top,left:E==null?void 0:E.left,width:E==null?void 0:E.width,height:E==null?void 0:E.height,zIndex:9998},Xe=p?"cover":"contain",Oe=w!==0||$>0?`translate(${w}px, ${$}px)`:void 0,dt=M&&!T?"none":T?`transform ${bn}ms ${Bn}`:V?`transform ${bn}ms ${Bn}, opacity ${bn}ms ${Bn}`:D==="opening"||xe?`opacity ${bn}ms ${Bn}`:"none",nt={...J,transform:Oe,opacity:$>0?X:D==="opening"||xe?0:1,transition:dt,pointerEvents:"none"},ht={position:"absolute",top:((le==null?void 0:le.top)??0)-((E==null?void 0:E.top)??0),left:((le==null?void 0:le.left)??0)-((E==null?void 0:E.left)??0),width:le==null?void 0:le.width,height:le==null?void 0:le.height,objectFit:Xe,pointerEvents:ie&&Y&&!Ae?"auto":"none",touchAction:ie&&Y?"none":void 0},st=(E==null?void 0:E.width)??0,ze=be?(n+Q+t.length)%t.length:null,Se=ze!==null?t[ze]:null,_e={...J,transform:be?`translateX(${Q*st+w}px)`:void 0,opacity:1,transition:T?`transform ${bn}ms ${Bn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((E==null?void 0:E.top)??0),left:((k==null?void 0:k.left)??0)-((E==null?void 0:E.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Xe,pointerEvents:"none"},Ye=le?{position:"fixed",top:le.top,height:le.height,width:le.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:D==="open"?"none":void 0},onClick:Ce,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Y?ue:0,transition:M?"none":`opacity ${bn}ms ${Bn}`,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:x,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 ${Bn}`,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:x,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 ${Bn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&E&&Se&&a.jsx("div",{style:_e,onTransitionEnd:we,children:vi(Se)?a.jsx("video",{src:Se.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${ze}-${Se.url}`):a.jsx("img",{src:Se.url,alt:Se.name,style:Be},`neighbor-${ze}-${Se.url}`)}),k&&E&&oe&&a.jsx("div",{style:nt,onTransitionEnd:we,children:ie?a.jsx(ef,{src:oe.url,phase:D,mediaRef:g,mediaStyle:ht,onLoadedMetadata:Me,onClick:Fe,onMouseMove:fe},`${n}-${oe.url}`):a.jsx("img",{ref:g,src:oe.url,alt:oe.name,onLoad:Me,style:ht},`${n}-${oe.url}`)}),Y&&Ye&&t.length>1&&!ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ye,left:le.left,cursor:"w-resize",pointerEvents:M?"none":"auto"},onClick:de=>{if(R.current){R.current=!1;return}de.stopPropagation(),pe(-1)}}),a.jsx("div",{style:{...Ye,left:le.left+le.width/2,cursor:"e-resize",pointerEvents:M?"none":"auto"},onClick:de=>{if(R.current){R.current=!1;return}de.stopPropagation(),pe(1)}})]})]})}function nf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function of({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=W.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:x=100,verticalGap:g,entriesCount:m,lightbox:h,imageDisplay:f,imageCorners:C,lightboxImageDisplay:y,slider:R,sliderTiming:H,direction:S,transition:U,titleMarginTop:F,subtitleMarginTop:_,titleColor:B,subtitleColor:L,lightboxCounterColor:N,titleFontFamily:k,titleFontSettings:Z,titleFontSize:E,titleLineHeight:K,titleLetterSpacing:D,titleWordSpacing:j,titleTextAppearance:$,subtitleFontFamily:v,subtitleFontSettings:w,subtitleFontSize:P,subtitleLineHeight:Q,subtitleLetterSpacing:z,subtitleWordSpacing:T,subtitleTextAppearance:O,lightboxCounterFontFamily:M,lightboxCounterFontSettings:ee,lightboxCounterFontSize:V,lightboxCounterLineHeight:me,lightboxCounterLetterSpacing:Ie,lightboxCounterWordSpacing:ge,lightboxCounterTextAppearance:ae,showText:ne="always",alignEntries:oe="off",align:ie="top"}=e,Ae={fontSettings:{fontFamily:k,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:E??.01,lineHeight:K,letterSpacing:D??0,wordSpacing:j??0,textAppearance:$,color:B},Me={...an(Ut(Ae,n))},q={fontSettings:{fontFamily:v,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:P??.01,lineHeight:Q,letterSpacing:z??0,wordSpacing:T??0,textAppearance:O,color:L},he={...an(Ut(q,n))},G={fontSettings:{fontFamily:M,fontWeight:(ee==null?void 0:ee.fontWeight)??400,fontStyle:(ee==null?void 0:ee.fontStyle)??"normal"},fontSize:V??.01,lineHeight:me,letterSpacing:Ie??0,wordSpacing:ge??0,textAppearance:ae,color:N},pe={...an(Ut(G,n)),...ga(V,me,u,n)},we=ma(E,K,`${u}-item-title`,`${u}-text-tight-leading`),Pe=ma(P,Q,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=ga(E,K,u,n),Y=ga(P,Q,u,n),xe=ma(V,me,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ue=W.buildColorVars(u,{titleColor:B,subtitleColor:L,lightboxCounterColor:N},rf,af),Fe=`${l&&l!=="default"?`${u}-state-${l}`:""}${ne==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),fe=m===0?1/0:m,J=(t??[]).slice(0,fe),Xe=s.useMemo(()=>h==="on"?Kh(J):[],[J,h]),Oe=b.entryWidth??.2,dt=(f==null?void 0:f.display)==="cover",nt=(f==null?void 0:f.ratioValue)??"1:1",ht=(f==null?void 0:f.reversed)??!1,[st,ze]=nt.split(":").map(Number),Be=`${ht?ze:st} / ${ht?st:ze}`,Ye=b.columnsCount,de=W.scalingValue(Oe??0,n),ve=de,Ee=!dt&&R!=="off",Ge=J.length%Ye||Ye,Ze=Ge<Ye&&J.length>0,Ve=J.length-Ge,at=Ze?Math.floor((Ye-Ge)/2)+1:1,Je=C?W.scalingValue(C,n):void 0,ke={width:ve,...dt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Je?{borderRadius:Je,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Ee?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="d"||p==="e"||p==="f",tt=oe==="on",rt=`calc(${W.scalingValue(Oe??0,n)} * (${x} / 100))`,lt=W.scalingValue(Oe*x/100,n),Tt=dt?{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}:{}},[Xt,Zt]=s.useState(0),xt=s.useRef(null),wt=U==="fade"||S==="horizontal"?"ltr":S==="vertical"?"ttb":"ltr";s.useEffect(()=>{const mt=xt.current;if(!mt)return;const Le=new ResizeObserver(De=>{Zt(Math.round(De[0].contentRect.width))});return Le.observe(mt),()=>Le.disconnect()},[]);const Bt=(()=>{const mt={...ue},Le=xt.current?getComputedStyle(xt.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(mt["--cntrl-article-width"]=Le),mt})(),[At,vt]=s.useState(!1),[Ft,Wt]=s.useState([]),[Yt,Jt]=s.useState(0),Ct=h==="on"&&(!n||i),Nt=(mt,Le)=>{n&&!i||h!=="off"&&(Wt(mt),Jt(Le),vt(!0))};s.useEffect(()=>{if(!At||h!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[At,h]),s.useEffect(()=>{!n||i||vt(!1)},[n,i]);const rn=s.useMemo(()=>Dh(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),h==="on"&&a.jsx(Zh,{mediaList:Xe}),a.jsx("div",{style:ue,children:a.jsx("div",{ref:xt,className:`${u}-wrapper ${u}-type-${p}${tt?` ${u}-align-entries`:""} ${u}-image-align-${ie} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${Ye}, ${de})`,rowGap:tt?0:W.scalingValue(g??0,n),columnGap:W.scalingValue(b.horizontalGap??0,n),width:W.scalingValue(b.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:W.scalingValue(g??0,n)}:{}},children:J.map((mt,Le)=>{var _t;const De=pl(mt.title),it=pl(mt.subtitle),gt=(((_t=mt.link)==null?void 0:_t.length)??0)>0&&h==="off"?mt.link:void 0,ft=Math.floor(Le/Ye)===Math.ceil(J.length/Ye)-1,It=Ze&&Le>=Ve?`${at+(Le-Ve)}`:void 0,pt=We?a.jsxs("div",{className:`${u}-item-text-block`,children:[De&&a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),De&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(F??0,n),width:lt}}),it&&a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle}),it&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(_??0,n),width:lt}})]}):null,jt=tt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!We&&a.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?W.scalingValue(F??0,n):0,width:lt}}),De&&a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),We&&De&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(F??0,n),width:lt}})]}):null,kt=tt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!We&&a.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?W.scalingValue(_??0,n):0,width:lt}}),it&&a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle}),We&&it&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(_??0,n),width:lt}})]}):null,Mt=gt?a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:[jt,kt]}):a.jsxs(a.Fragment,{children:[jt,kt]}),Vt=ud(mt.gallery),Gt=Vt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Ht=a.jsx("div",{className:qe,style:ke,children:Vt.length===0?null:R==="off"?(()=>{const{displayMedia:St,lightboxMedia:A}=Vt[0],$e=A?Gt.findIndex(Re=>Re.url===A.url):-1;return a.jsx(ml,{media:St,className:`${u}-item-${vi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&$e>=0?()=>Nt(Gt,$e):void 0})})():a.jsxs(a.Fragment,{children:[Ee&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:St})=>vi(St)?a.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):a.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),a.jsx(Ls,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:Vh,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:St=>{S!=="random"||U==="fade"||zh(St)},children:Vt.map(({displayMedia:St,lightboxMedia:A},$e)=>{const Re=A?Gt.findIndex(Ne=>Ne.url===A.url):-1;return a.jsx(Rs,{children:a.jsx(ml,{media:St,className:`${u}-item-${vi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&Re>=0?()=>Nt(Gt,Re):void 0})},$e)})},`${U}-${Oe}-${S}-${H}-${Xt}-${d}`)]})}),Ot=We?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?W.scalingValue(F??0,n):0,width:lt}}),a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),a.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?W.scalingValue(_??0,n):0,width:lt}}),a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!tt?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(x??0)>100?`calc(${de} * (${x} / 100))`:de,...It&&tt?{gridColumn:It}:{}},children:tt?a.jsx(a.Fragment,{children:We?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):gt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:[pt,Ht]}),!We&&a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:Ot})]}):a.jsxs(a.Fragment,{children:[pt,Ht,Ot]})})},Le)})})}),(!n||i)&&At&&typeof document<"u"&&h==="on"&&(()=>{const mt=(c?document.getElementById(c):null)??document.body;return Dn.createPortal(a.jsx("div",{style:Bt,"data-selection":"none",children:a.jsx(tf,{prefix:u,items:Ft,index:Yt,imageDisplay:nf(y),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Jt(Le=>(Le-1+Ft.length)%Ft.length),onNext:()=>Jt(Le=>(Le+1)%Ft.length),counterClassName:xe,counterStyle:pe})}),mt)})()]})}const rf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},af=["hover","focus","filled","success","error"],sf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5133
5133
|
import '@splidejs/react-splide/css/core';
|
|
5134
5134
|
import { CommonComponentProps } from '../props';
|
|
5135
5135
|
import {
|
|
@@ -7182,12 +7182,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7182
7182
|
};
|
|
7183
7183
|
|
|
7184
7184
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7185
|
-
`,ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},sf=["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:{...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"}},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:{...ga.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:{...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:{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:[...sf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},cf={element:nf,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:af},df=50,gl=10,Ls="cntrl-lightbox-journal",Kr=Ls,Ua=`${Ls}-`,Yr=e=>`${Ls}-${e}`,Rs=e=>e===Kr||e.startsWith(Ua),hl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},fl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=hl(t.get(Yr(e)));if(i)return i}const n=hl(t.get(Kr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ua))continue;const o=i.slice(Ua.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},yl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},pd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Rs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Yr(t),String(e)):i.searchParams.set(Kr,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},uf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Yr(e)||i===Kr:Rs(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(Yr(e)):[...t.keys()].some(n=>Rs(n))},pf=(e,t)=>{if(md(t)){if(e){window.history.back();return}uf(t)}},mf=20,gf=2,ha=e=>`max(${e}, ${mf}px)`,Vi=e=>((e==null?void 0:e.image)??[]).slice(0,gf),gd=e=>e.reduce((t,n)=>t+Vi(n).length,0),hf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Vi(r).length,1),i=Vi(e[t]).length;return{start:n,end:n+i-1}},ff=(e,t)=>{const n=gd(e),{start:i,end:o}=hf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},br=(e,t)=>t==="B"?e.flatMap((n,i)=>Vi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Vi(n)})),yf=(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 ff(i,o)},vl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",vf=(e,t,n)=>e==="B"?t.length>1:gd(n)>1,fn=.004,Xn=.004,Hi={title1Width:.13,title2Width:.13,title3Width:.14},Un=(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},Gi=(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},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},Mo=(e,t)=>Gi(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)},Kn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Gi(e.length,n),effective:Mo(e.length,n)}},hd=(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),Jn=["title1","title2","title3","count"],et=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Is={title1:"1",title2:"2",title3:"3",count:"Count"},Ps=e=>[et(e,"fontFamily"),et(e,"fontSettings"),{type:"row",items:[et(e,"fontSize"),et(e,"lineHeight"),et(e,"letterSpacing"),et(e,"wordSpacing")]},et(e,"textAlign"),et(e,"textAppearance")],xf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Jn.map(e=>[Is[e],Ps(e)]))}),bf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},wf={title1:.02,title2:.02,title3:.02,count:.017},hi=(e,t)=>{const n=i=>{const o=et(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[bf[t]]}},fi=(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??wf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function yd({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:c,title2Width:d,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:f=0,titleRowMarginBottom:h=0,titleHeaderLayout:g="desktop",contentMarginTop:m=0,iconMarginRight:x=0,closeIcon:T=null,closeIconMaxWidth:y=0,closeIconColor:w="#000000",closeIconHoverColor:B="#cccccc"}=n,M=W.scalingValue(m,i),G=W.scalingValue(x,i),O=W.scalingValue(h,i),_=g==="mobile",j=fi("title1",hi(n,"title1"),i),b=fi("title2",hi(n,"title2"),i),H=fi("title3",hi(n,"title3"),i),E=s.useMemo(()=>({title1Width:c??Hi.title1Width,title2Width:d??Hi.title2Width,title3Width:u??Hi.title3Width}),[c,d,u]),$=s.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:f}),[v,f]),S=s.useMemo(()=>Un(e,t,j,b,H),[e,t,j,b,H]),P=s.useMemo(()=>S.map(q=>E[q.widthKey]),[S,E]),I=s.useMemo(()=>Gi(S.length,P),[S.length,P]),N=s.useMemo(()=>Mo(S.length,P),[S.length,P]),z=s.useMemo(()=>S.filter(q=>q.prefix==="title1"),[S]),C=s.useMemo(()=>S.filter(q=>q.prefix==="title2"||q.prefix==="title3"),[S]),R=s.useMemo(()=>Kn(z,E),[z,E]),D=s.useMemo(()=>Kn(C,E),[C,E]),ie=!!(t.title1||t.title2||t.title3),ee=T!==null;if(!(ie||ee))return null;const ae=(p??0)>0||o,k=(q,re)=>{const Fe=S.findIndex(Z=>Z.prefix===q.prefix);if(!_||re==="single-row")return{effectiveWidth:N[Fe]??0,resolvedWidth:I[Fe]??0,maxWidth:cn(Fe,I)};if(re==="two-row-top"){const Z=z.findIndex(Xe=>Xe.prefix===q.prefix);return{effectiveWidth:R.effective[Z]??0,resolvedWidth:R.resolved[Z]??0,maxWidth:cn(Z,R.resolved)}}const pe=C.findIndex(Z=>Z.prefix===q.prefix);return{effectiveWidth:D.effective[pe]??0,resolvedWidth:D.resolved[pe]??0,maxWidth:cn(pe,D.resolved)}},J=(q,re,Fe)=>{if(!_||Fe==="single-row"){const dt=q.findIndex(ze=>ze.prefix===re.prefix),nt=q.map(ze=>E[ze.widthKey]),ht=Gi(q.length,nt);return{effectiveWidth:Mo(q.length,nt)[dt]??0,resolvedWidth:ht[dt]??0,maxWidth:cn(dt,ht)}}if(Fe==="two-row-top"){const dt=q.filter(ze=>ze.prefix==="title1"),nt=dt.findIndex(ze=>ze.prefix===re.prefix),{resolved:ht,effective:st}=Kn(dt,E);return{effectiveWidth:st[nt]??0,resolvedWidth:ht[nt]??0,maxWidth:cn(nt,ht)}}const pe=q.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),Z=pe.findIndex(dt=>dt.prefix===re.prefix),{resolved:Xe,effective:Oe}=Kn(pe,E);return{effectiveWidth:Oe[Z]??0,resolvedWidth:Xe[Z]??0,maxWidth:cn(Z,Xe)}},X=q=>fd(S,I,$,q)+(_?0:p??0),me=()=>_?0:p??0,Le=q=>C.slice(0,q).reduce((re,Fe,pe)=>re+(Fe.marginLeftKey?$[Fe.marginLeftKey]??0:0)+(D.resolved[pe]??0),0),he=q=>{const re=C[q];return Le(q)+(re.marginLeftKey?$[re.marginLeftKey]??0:0)+(D.resolved[q]??0)},K=(q,re,Fe)=>{const pe=q.marginLeftKey?$[q.marginLeftKey]??0:0,{effectiveWidth:Z,resolvedWidth:Xe,maxWidth:Oe}=Fe??k(q,re),dt=Math.max(pe,Xn),nt=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":q.prefix,style:{width:W.scalingValue(Z,i),...pe>0?{marginLeft:W.scalingValue(pe,i)}:{}},children:[a.jsx("p",{className:q.className,style:q.style,children:q.text}),nt&&q.marginLeftKey?a.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:W.scalingValue(-pe,i),width:W.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}}):null,nt?a.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W.scalingValue(-fn/2,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},q.className)},V=(q="two-row")=>{const re=S.findIndex(Z=>Z.prefix==="title1"),Fe=re>=0?I[re]:E.title1Width,pe=q==="two-row"&&o;return a.jsx("div",{...pe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe)}:{},style:{width:W.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...pe?{pointerEvents:"auto"}:{}}})},Y=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:j,"aria-hidden":"true",children:" "}),Q=q=>{const re=Un(e,q,j,b,H);return a.jsx(a.Fragment,{children:re.map(Fe=>K(Fe,"single-row",J(re,Fe,"single-row")))})},Te=q=>{const re=Un(e,q,j,b,H),Fe=re.find(pe=>pe.prefix==="title1");return Fe?K(Fe,"two-row-top",J(re,Fe,"two-row-top")):null},we=(q,re=!1)=>{const Fe=Un(e,q,j,b,H),pe=Fe.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),Z=o&&re;return pe.length>0||Z||(h??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[pe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:pe.map(Oe=>K(Oe,"two-row-bottom",J(Fe,Oe,"two-row-bottom")))}),re&&o?a.jsxs(a.Fragment,{children:[xe(),Ae()]}):null]}):null,(h??0)>0||Z?a.jsx("div",{"data-controls":Z?"titleRowMarginBottom":void 0,"data-controls-axis":Z?"y":void 0,"data-controls-reverse":Z?"":void 0,className:Z?`${e}-control`:void 0,style:{height:O,width:"100%",flexShrink:0,pointerEvents:Z?"auto":"none"}}):null]}):null},ke=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(y??0,i),height:W.scalingValue(y??0,i),marginRight:G,"--close-icon-hover-color":B},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:q=>{q.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:w,hoverFill:i&&!r?w:B,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:G,height:"100%",pointerEvents:"auto"}})]}),le=()=>ee?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,ge=q=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:q})}),be=q=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ee||ie?Y():null,ae?V("two-row"):null,ge(q),le()]}),ne=(q,re=!1)=>a.jsxs(a.Fragment,{children:[be(Te(q)),we(q,re)]}),ce=()=>{const q=_?-1:S.findIndex(pe=>pe.prefix==="title1"),re=!_&&(o||(p??0)>0)?(()=>{const pe=p??0,Z=q>=0?I[q]:E.title1Width,Xe=Math.max(pe,Xn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Z),style:{position:"absolute",top:0,left:0,width:W.scalingValue(Xe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Fe=S.flatMap((pe,Z)=>{if(!pe.marginLeftKey)return[];const Xe=$[pe.marginLeftKey]??0,Oe=hd(S,I,$,Z)+me(),dt=Math.max(Xe,Xn);return a.jsx("div",{"data-controls":pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(I[Z]),style:{position:"absolute",top:0,left:W.scalingValue(Oe,i),width:W.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}},pe.marginLeftKey)});return re?[re,...Fe]:Fe},ue=()=>S.map((q,re)=>{const Fe=cn(re,I),Z=X(re)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":q.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:W.scalingValue(Z,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${q.widthKey}-junction`)}),xe=()=>C.flatMap((q,re)=>{if(!q.marginLeftKey)return[];const Fe=$[q.marginLeftKey]??0,pe=Le(re),Z=Math.max(Fe,Xn),{resolvedWidth:Xe}=k(q,"two-row-bottom");return a.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:W.scalingValue(pe,i),width:W.scalingValue(Z,i),height:"100%",pointerEvents:"auto"}},q.marginLeftKey)}),Ae=()=>C.map((q,re)=>{const{maxWidth:Fe}=k(q,"two-row-bottom"),Z=he(re)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":q.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:W.scalingValue(Z,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${q.widthKey}-junction`)}),Ie=()=>!o||_?null:a.jsxs(a.Fragment,{children:[ce(),ue()]}),U=!!(t.title2||t.title3||(h??0)>0||o),ve=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ee||ie?Y():null,ae?V("single-row"):null,ie?ge(Q(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),le(),Ie()]}),de=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...U?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:U?void 0:{flex:"0 0 auto",height:"auto"},children:ne(t,!0)}),Ie()]});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:M,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",..._?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${_?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${_?` ${e}-text-bar-cell-stacked`:""}`,style:_?void 0:{flex:1,minWidth:0,width:"100%"},children:_?de():ve()})})})]})}function Sf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $f(e){return`
|
|
7185
|
+
`,ha={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},lf=["titleColor","subtitleColor","lightboxCounterColor"],cf={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:{...ha.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:{...ha.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:{...ha.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:[...lf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},df={element:of,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:cf,sourceCode:sf},uf=50,hl=10,Is="cntrl-lightbox-journal",Kr=Is,Ka=`${Is}-`,Zr=e=>`${Is}-${e}`,Ps=e=>e===Kr||e.startsWith(Ka),fl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},yl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=fl(t.get(Zr(e)));if(i)return i}const n=fl(t.get(Kr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ka))continue;const o=i.slice(Ka.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},vl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},pd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Ps(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Zr(t),String(e)):i.searchParams.set(Kr,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},pf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Zr(e)||i===Kr:Ps(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(Zr(e)):[...t.keys()].some(n=>Ps(n))},mf=(e,t)=>{if(md(t)){if(e){window.history.back();return}pf(t)}},gf=20,hf=2,fa=e=>`max(${e}, ${gf}px)`,Gi=e=>((e==null?void 0:e.image)??[]).slice(0,hf),gd=e=>e.reduce((t,n)=>t+Gi(n).length,0),ff=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Gi(r).length,1),i=Gi(e[t]).length;return{start:n,end:n+i-1}},yf=(e,t)=>{const n=gd(e),{start:i,end:o}=ff(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Sr=(e,t)=>t==="B"?e.flatMap((n,i)=>Gi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Gi(n)})),vf=(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 yf(i,o)},xl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",xf=(e,t,n)=>e==="B"?t.length>1:gd(n)>1,fn=.004,Xn=.004,Di={title1Width:.13,title2Width:.13,title3Width:.14},Un=(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},Mo=(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)},Yn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:qi(e.length,n),effective:Mo(e.length,n)}},hd=(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),Jn=["title1","title2","title3","count"],et=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Es={title1:"1",title2:"2",title3:"3",count:"Count"},Ms=e=>[et(e,"fontFamily"),et(e,"fontSettings"),{type:"row",items:[et(e,"fontSize"),et(e,"lineHeight"),et(e,"letterSpacing"),et(e,"wordSpacing")]},et(e,"textAlign"),et(e,"textAppearance")],bf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Jn.map(e=>[Es[e],Ms(e)]))}),wf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Sf={title1:.02,title2:.02,title3:.02,count:.017},hi=(e,t)=>{const n=i=>{const o=et(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[wf[t]]}},fi=(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??Sf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function yd({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:b=0,title3MarginLeft:x=0,titleRowMarginBottom:g=0,titleHeaderLayout:m="desktop",contentMarginTop:h=0,iconMarginRight:f=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:R="#000000",closeIconHoverColor:H="#cccccc"}=n,S=W.scalingValue(h,i),U=W.scalingValue(f,i),F=W.scalingValue(g,i),_=m==="mobile",B=fi("title1",hi(n,"title1"),i),L=fi("title2",hi(n,"title2"),i),N=fi("title3",hi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Di.title1Width,title2Width:c??Di.title2Width,title3Width:u??Di.title3Width}),[d,c,u]),Z=s.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:x}),[b,x]),E=s.useMemo(()=>Un(e,t,B,L,N),[e,t,B,L,N]),K=s.useMemo(()=>E.map(X=>k[X.widthKey]),[E,k]),D=s.useMemo(()=>qi(E.length,K),[E.length,K]),j=s.useMemo(()=>Mo(E.length,K),[E.length,K]),$=s.useMemo(()=>E.filter(X=>X.prefix==="title1"),[E]),v=s.useMemo(()=>E.filter(X=>X.prefix==="title2"||X.prefix==="title3"),[E]),w=s.useMemo(()=>Yn($,k),[$,k]),P=s.useMemo(()=>Yn(v,k),[v,k]),Q=!!(t.title1||t.title2||t.title3),z=C!==null;if(!(Q||z))return null;const O=(p??0)>0||o,M=(X,le)=>{const Fe=E.findIndex(J=>J.prefix===X.prefix);if(!_||le==="single-row")return{effectiveWidth:j[Fe]??0,resolvedWidth:D[Fe]??0,maxWidth:cn(Fe,D)};if(le==="two-row-top"){const J=$.findIndex(Xe=>Xe.prefix===X.prefix);return{effectiveWidth:w.effective[J]??0,resolvedWidth:w.resolved[J]??0,maxWidth:cn(J,w.resolved)}}const fe=v.findIndex(J=>J.prefix===X.prefix);return{effectiveWidth:P.effective[fe]??0,resolvedWidth:P.resolved[fe]??0,maxWidth:cn(fe,P.resolved)}},ee=(X,le,Fe)=>{if(!_||Fe==="single-row"){const dt=X.findIndex(ze=>ze.prefix===le.prefix),nt=X.map(ze=>k[ze.widthKey]),ht=qi(X.length,nt);return{effectiveWidth:Mo(X.length,nt)[dt]??0,resolvedWidth:ht[dt]??0,maxWidth:cn(dt,ht)}}if(Fe==="two-row-top"){const dt=X.filter(ze=>ze.prefix==="title1"),nt=dt.findIndex(ze=>ze.prefix===le.prefix),{resolved:ht,effective:st}=Yn(dt,k);return{effectiveWidth:st[nt]??0,resolvedWidth:ht[nt]??0,maxWidth:cn(nt,ht)}}const fe=X.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),J=fe.findIndex(dt=>dt.prefix===le.prefix),{resolved:Xe,effective:Oe}=Yn(fe,k);return{effectiveWidth:Oe[J]??0,resolvedWidth:Xe[J]??0,maxWidth:cn(J,Xe)}},V=X=>fd(E,D,Z,X)+(_?0:p??0),me=()=>_?0:p??0,Ie=X=>v.slice(0,X).reduce((le,Fe,fe)=>le+(Fe.marginLeftKey?Z[Fe.marginLeftKey]??0:0)+(P.resolved[fe]??0),0),ge=X=>{const le=v[X];return Ie(X)+(le.marginLeftKey?Z[le.marginLeftKey]??0:0)+(P.resolved[X]??0)},ae=(X,le,Fe)=>{const fe=X.marginLeftKey?Z[X.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Xe,maxWidth:Oe}=Fe??M(X,le),dt=Math.max(fe,Xn),nt=o&&le==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":X.prefix,style:{width:W.scalingValue(J,i),...fe>0?{marginLeft:W.scalingValue(fe,i)}:{}},children:[a.jsx("p",{className:X.className,style:X.style,children:X.text}),nt&&X.marginLeftKey?a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:W.scalingValue(-fe,i),width:W.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}}):null,nt?a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W.scalingValue(-fn/2,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},X.className)},ne=(X="two-row")=>{const le=E.findIndex(J=>J.prefix==="title1"),Fe=le>=0?D[le]:k.title1Width,fe=X==="two-row"&&o;return a.jsx("div",{...fe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe)}:{},style:{width:W.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...fe?{pointerEvents:"auto"}:{}}})},oe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:B,"aria-hidden":"true",children:" "}),ie=X=>{const le=Un(e,X,B,L,N);return a.jsx(a.Fragment,{children:le.map(Fe=>ae(Fe,"single-row",ee(le,Fe,"single-row")))})},Ae=X=>{const le=Un(e,X,B,L,N),Fe=le.find(fe=>fe.prefix==="title1");return Fe?ae(Fe,"two-row-top",ee(le,Fe,"two-row-top")):null},be=(X,le=!1)=>{const Fe=Un(e,X,B,L,N),fe=Fe.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),J=o&≤return fe.length>0||J||(g??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(Oe=>ae(Oe,"two-row-bottom",ee(Fe,Oe,"two-row-bottom")))}),le&&o?a.jsxs(a.Fragment,{children:[we(),Pe()]}):null]}):null,(g??0)>0||J?a.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:F,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},Me=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(y??0,i),height:W.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:X=>{X.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:R,hoverFill:i&&!r?R:H,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"}})]}),q=()=>z?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,se=X=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:X})}),he=X=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[z||Q?oe():null,O?ne("two-row"):null,se(X),q()]}),G=(X,le=!1)=>a.jsxs(a.Fragment,{children:[he(Ae(X)),be(X,le)]}),re=()=>{const X=_?-1:E.findIndex(fe=>fe.prefix==="title1"),le=!_&&(o||(p??0)>0)?(()=>{const fe=p??0,J=X>=0?D[X]:k.title1Width,Xe=Math.max(fe,Xn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J),style:{position:"absolute",top:0,left:0,width:W.scalingValue(Xe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Fe=E.flatMap((fe,J)=>{if(!fe.marginLeftKey)return[];const Xe=Z[fe.marginLeftKey]??0,Oe=hd(E,D,Z,J)+me(),dt=Math.max(Xe,Xn);return a.jsx("div",{"data-controls":fe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D[J]),style:{position:"absolute",top:0,left:W.scalingValue(Oe,i),width:W.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}},fe.marginLeftKey)});return le?[le,...Fe]:Fe},pe=()=>E.map((X,le)=>{const Fe=cn(le,D),J=V(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.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:W.scalingValue(J,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),we=()=>v.flatMap((X,le)=>{if(!X.marginLeftKey)return[];const Fe=Z[X.marginLeftKey]??0,fe=Ie(le),J=Math.max(Fe,Xn),{resolvedWidth:Xe}=M(X,"two-row-bottom");return a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:W.scalingValue(fe,i),width:W.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},X.marginLeftKey)}),Pe=()=>v.map((X,le)=>{const{maxWidth:Fe}=M(X,"two-row-bottom"),J=ge(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.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:W.scalingValue(J,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),Ce=()=>!o||_?null:a.jsxs(a.Fragment,{children:[re(),pe()]}),Y=!!(t.title2||t.title3||(g??0)>0||o),xe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[z||Q?oe():null,O?ne("single-row"):null,Q?se(ie(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),q(),Ce()]}),ue=()=>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:G(t,!0)}),Ce()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:S,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",..._?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${_?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${_?` ${e}-text-bar-cell-stacked`:""}`,style:_?void 0:{flex:1,minWidth:0,width:"100%"},children:_?ue():xe()})})})]})}function $f(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cf(e){return`
|
|
7186
7186
|
.${e}-wrapper {
|
|
7187
7187
|
display: grid;
|
|
7188
7188
|
align-items: start;
|
|
7189
7189
|
justify-content: center;
|
|
7190
|
-
min-height: ${
|
|
7190
|
+
min-height: ${$f(48)};
|
|
7191
7191
|
}
|
|
7192
7192
|
.${e}-item {
|
|
7193
7193
|
display: flex;
|
|
@@ -7502,7 +7502,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7502
7502
|
pointer-events: auto;
|
|
7503
7503
|
flex-shrink: 0;
|
|
7504
7504
|
}
|
|
7505
|
-
`}const xl={url:"",name:"",objectFit:"cover"},Tn=500,so=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Cf=72,Tf=50,Lf=1e4,Rf=650,If=500;function Pf(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 vd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Er(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 Ef(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?vd(i,n):null}function Mf(e){return e.reduce((t,n,i)=>{const o=Es(n.gallery),l=Ms(o).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function fo(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 bl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return fo(e,i,n)}const kf=.03;function xd(e){return e.width*kf}const fa={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function ir(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function wl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Af(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ka(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function Ff(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ka(e,t.width,t.height)}function _f(e,t){if(oo(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 Wf(e){const t=new Set,n=[];for(const i of e){const o=Es(i.gallery),r=Ms(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.url&&!t.has(c.url)&&(t.add(c.url),n.push(c))}return n}function Nf({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=>oo(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 qi(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=xd(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function Mr(e,t,n){const i=qi(e,t,n);return{...i,left:2*i.left-e.left}}function Hf(e,t,n){const{left:i,width:o}=n,r=xd(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function bd(e,t,n,i){const o=qi(e,"left",i),r=qi(e,"right",i),l=Mr(e,"left",i),c=Mr(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:c,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:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Of(e,t,n,i){const{start:o,end:r}=bd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Df(e,t,n){const i=qi(e,t,n),o=Mr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function wd(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 Es(e){if(!e)return;if(wd(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??xl,i??o??xl]}]}function Bf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function jf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ms(e){if(!Array.isArray(e)||e.length===0)return[];if(wd(e)){const t=[];for(const n of e){const i=Bf(n);if(!i)continue;const o=jf(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 oo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function zf({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return oo(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 Vf({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function or({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return oo(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 Gf({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:f,resolveCloseSourceRect:h,onClose:g,onPrev:m,onNext:x}){const T=s.useRef(null),y=s.useRef(null),w=s.useRef(null),B=s.useRef(new Map),[M,G]=s.useState(0),O=s.useRef(null),_=s.useRef(0),j=s.useRef(0),b=s.useRef("none"),H=s.useRef(!1),E=s.useRef(!1),$=s.useRef(!1),S=s.useRef(null),P=s.useRef(null),I=s.useRef(null),N=s.useRef(()=>{}),z=s.useRef(null),C=s.useRef(null),R=s.useRef(null),D=s.useRef(!1),[ie,ee]=s.useState(null),[A,ae]=s.useState(fa),[k,J]=s.useState(0),[X,me]=s.useState("opening"),[Le,he]=s.useState(0),[K,V]=s.useState(0),[Y,Q]=s.useState(!1),[Te,we]=s.useState(null),[ke,le]=s.useState(null),[ge,be]=s.useState(null),[ne,ce]=s.useState(!1),[ue,xe]=s.useState(null),[Ae,Ie]=s.useState(!1),U=s.useRef(!1),[ve,de]=s.useState(!1),[q,re]=s.useState(!1),Fe=s.useRef(n),pe=s.useRef(void 0),Z=t[n],Xe=Z?oo(Z):!1,Oe=K!==0||Y,dt=!l&&(!r||!!c),nt=d&&!l,ht=u.length>1,st=s.useCallback((F,$e)=>t.length<=1?null:t[(F+$e+t.length)%t.length]??null,[t]),ze=ht?fo(u,p,-1):st(n,-1),Se=ht?fo(u,p,1):st(n,1),_e=Te===-1&&Oe?ht&&ke!==null?fo(u,ke,-1):ge!==null?st(ge,-1):null:null,Be=Te===1&&Oe?ht&&ke!==null?fo(u,ke,1):ge!==null?st(ge,1):null:null,Ke=_e&&_e.url!==(ze==null?void 0:ze.url)?_e:null,se=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,ye=ze&&nt?(()=>{const F=ht?bl(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return F&&F.url!==ze.url?F:null})():null,Ee=Se&&nt?(()=>{const F=ht?bl(u,p,1):t.length>2?st((n+1)%t.length,1):null;return F&&F.url!==Se.url?F:null})():null,Ge=Ke??ye,Ze=se??Ee,Ve=s.useCallback((F,$e,Pe)=>{if(!F||!$e||!Pe)return;const Ne=B.current,ot=Ne.get(F);(ot==null?void 0:ot.width)===$e&&(ot==null?void 0:ot.height)===Pe||(Ne.set(F,{width:$e,height:Pe}),G(Et=>Et+1))},[]),at=s.useCallback(F=>{if(!(F!=null&&F.url))return null;const $e=B.current.get(F.url);return Ff(y.current,$e)},[M,k]),Je=s.useCallback(()=>{if(!Z)return;const F=at(Z);if(F){ee(F);return}const $e=y.current;$e&&ee(wl($e))},[Z,at]),Me=s.useCallback(F=>{if(ht){const $e=u.length;le((p+F+$e)%$e),be(null);return}t.length>1&&(be((n+F+t.length)%t.length),le(null))},[ht,u.length,p,t.length,n]),qe=s.useCallback(F=>{$.current=F,Q(F)},[]),We=s.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null)},[]),tt=s.useCallback(()=>{We(),S.current=window.setTimeout(()=>{We(),qe(!1)},so+32)},[We,qe]),rt=s.useCallback(()=>{const F=T.current;if(!F){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:fa.width,height:typeof window<"u"?window.innerHeight:fa.height});return}const $e=F.getBoundingClientRect();ae({left:$e.left,top:$e.top,width:$e.width,height:$e.height})},[]),lt=s.useCallback((F,$e)=>{if(Oe){if(ve&&!Y)return`translate(${K}px, 0px)`;if(Y&&Te!==null){const Pe=at(F);if(!Pe)return;const{x:Ne,y:ot}=Of(Pe,$e,Te,A);return`translate(${Ne}px, ${ot}px)`}if(Y)return"translate(0px, 0px)"}},[Oe,ve,Y,K,Te,A,at]),Tt=s.useCallback(()=>{const F=P.current;P.current=null,We(),qe(!1),we(null),le(null),be(null),V(0),de(!1),H.current=!1,j.current=0,b.current="none",F===-1?m():F===1&&x()},[We,qe,m,x]),Xt=s.useCallback(()=>{We(),S.current=window.setTimeout(()=>{P.current!==null&&Tt()},so+32)},[We,Tt]),Zt=s.useCallback(()=>{We(),P.current=null,qe(!1),we(null),le(null),be(null),V(0),de(!1),H.current=!1,j.current=0,b.current="none"},[We,qe]),xt=s.useCallback(F=>{if(!(!nt||!ie)){if($.current){if(P.current===F){I.current=F,Tt();return}Zt()}We(),Me(F),P.current=F,we(F),qe(!0),Xt()}},[nt,ie,Tt,Zt,We,Me,qe,Xt]);N.current=xt;const wt=s.useCallback(()=>{z.current=null,D.current=!1,C.current!==null&&(window.clearInterval(C.current),C.current=null),R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),Bt=s.useCallback(F=>{C.current!==null&&window.clearInterval(C.current);const $e=D.current?If:Rf;C.current=window.setInterval(()=>{N.current(F)},$e)},[]),At=s.useCallback(F=>{z.current!==F&&(wt(),z.current=F,D.current=!1,N.current(F),Bt(F),R.current=window.setTimeout(()=>{R.current=null,z.current===F&&(D.current=!0,Bt(F))},Lf))},[wt,Bt]),vt=s.useCallback(()=>{const F=y.current;if(!F)return;const $e=Z==null?void 0:Z.url,Pe=$e?B.current.get($e):void 0;if(Pe!=null&&Pe.width&&(Pe!=null&&Pe.height)){ee(Ka(F,Pe.width,Pe.height));return}const Ne=w.current;if(Ne&&$e&&(Ne.src===$e||Ne.currentSrc===$e)){const{width:Et,height:Qe}=Af(Ne);if(Et&&Qe){Ve($e,Et,Qe),ee(Ka(F,Et,Qe));return}}const ot=wl(F);!ot.width||!ot.height||ee(ot)},[Z==null?void 0:Z.url,Ve]),Ft=s.useCallback(F=>{if(w.current=F,!!F){if(F instanceof HTMLVideoElement){F.readyState>=1&&F.videoWidth>0&&vt();return}F.complete&&F.naturalWidth>0&&vt()}},[vt]),Wt=s.useCallback(()=>{rt(),vt(),J(F=>F+1)},[rt,vt]);s.useEffect(()=>{Wt();const F=y.current,$e=T.current,Pe=new ResizeObserver(()=>Wt());return F&&Pe.observe(F),$e&&Pe.observe($e),window.addEventListener("resize",Wt),()=>{Pe.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,v]),s.useLayoutEffect(()=>{if(!Z)return;const F=w.current;if(F){if(F instanceof HTMLImageElement&&F.complete&&F.naturalWidth>0){vt();return}F instanceof HTMLVideoElement&&F.readyState>=1&&F.videoWidth>0&&vt()}},[Z==null?void 0:Z.url,n,vt]),s.useEffect(()=>{Je()},[Je,M]),s.useEffect(()=>{const F=new Set,$e=[],Pe=Ne=>{!(Ne!=null&&Ne.url)||F.has(Ne.url)||(F.add(Ne.url),$e.push(Ne))};t.forEach(Pe),u.forEach(Ne=>Ne.items.forEach(Pe)),$e.forEach(Ne=>{B.current.has(Ne.url)||_f(Ne,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(X!=="opening"||!ie)return;if(!f){me("open");return}ce(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),me("open")})});return()=>cancelAnimationFrame(F)},[X,ie,f]),s.useEffect(()=>{if(X!=="closing")return;const F=setTimeout(()=>g(),Tn);return()=>clearTimeout(F)},[X,g]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Fe.current===n&&pe.current===(Z==null?void 0:Z.url)||(We(),P.current=null,we(null),le(null),be(null),he(0),V(0),qe(!1),re(!1),de(!1),_.current=0,j.current=0,b.current="none",H.current=!1,O.current=null,E.current=!1,w.current=null,Je(),Fe.current=n,pe.current=Z==null?void 0:Z.url)},[n,Z==null?void 0:Z.url,qe,We,Je]),s.useLayoutEffect(()=>{const F=I.current;F!==null&&(I.current=null,requestAnimationFrame(()=>{N.current(F)}))},[n,p,Z==null?void 0:Z.url]),s.useLayoutEffect(()=>{if(X==="opening"){U.current=!1,Ie(!1);return}if(X!=="open"||U.current)return;if(!ze&&!Se){U.current=!0;return}Ie(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ie(!0),U.current=!0})});return()=>cancelAnimationFrame(F)},[X,ze==null?void 0:ze.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(X!=="open")return;const F=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},$e=Qe=>{const yt=Qe<0?1:-1;We(),Me(yt),P.current=yt,we(yt),qe(!0),Xt()},Pe=Qe=>{if(Math.abs(Qe)>Tf&&nt){$e(Qe);return}P.current=null,we(null),le(null),be(null),qe(!0),V(0),tt()},Ne=Qe=>{if(Qe.touches.length!==1||$.current)return;const yt=Qe.touches[0];E.current=!0,O.current={x:yt.clientX,y:yt.clientY},b.current="none",j.current=0,H.current=!1},ot=Qe=>{if(!O.current||Qe.touches.length!==1||$.current)return;const yt=Qe.touches[0],Dt=yt.clientX-O.current.x,Lt=yt.clientY-O.current.y;if(b.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;b.current="horizontal"}else if(Lt>0){if(!dt)return;b.current="vertical"}else return}if(b.current==="horizontal"){H.current=!0,de(!0),j.current=Dt,V(Dt),Qe.preventDefault();return}b.current==="vertical"&&(H.current=!0,de(!0),_.current=Lt,he(Lt),Qe.preventDefault())},Et=()=>{if(!O.current)return;const Qe=b.current,yt=H.current;if(yt&&Qe==="horizontal")Pe(j.current),F();else if(yt&&Qe==="vertical"){const Dt=_.current;if(dt&&Dt>Cf){const Lt=window.innerHeight;_.current=Lt,re(!0),he(Lt),me("closing")}else _.current=0,he(0);F()}else Qe==="horizontal"&&Math.abs(j.current)>0&&(Pe(j.current),F());O.current=null,b.current="none",j.current=0,H.current=!1,de(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[X,nt,qe,tt,We,dt,Xt,Me]);const Kt=s.useCallback(()=>{const F=(h==null?void 0:h())??f??null;F&&ie&&(xe(F),ce(!0)),me("closing")},[h,f,ie]);s.useEffect(()=>{const F=Ne=>{if(Ne.key==="Escape"){if(r&&c||X==="closing")return;wt(),Kt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||X!=="open"||!nt)return;Ne.preventDefault();const ot=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&z.current===ot||At(ot)},$e=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ot=Ne.key==="ArrowLeft"?-1:1;z.current===ot&&wt()},Pe=()=>{wt()};return window.addEventListener("keydown",F),window.addEventListener("keyup",$e),window.addEventListener("blur",Pe),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",$e),window.removeEventListener("blur",Pe),wt()}},[X,r,c,Kt,nt,At,wt]),s.useEffect(()=>{X!=="open"&&wt()},[X,wt]);const Jt=()=>{X==="closing"||l||Kt()},Ct=X==="open",Nt=X==="closing",rn=Le>0?Math.max(0,1-Le/500):1,mt=Le>0?Math.max(.35,1-Le/500):1,Re=s.useCallback(F=>{if(!(F.propertyName!=="transform"||!$.current)){if(P.current!==null){Tt();return}We(),qe(!1)}},[We,qe,Tt]),De=X==="closing"?ue??f:f,it=De&&ie&&(X==="opening"||Nt)?Pf(De,ie):void 0,gt=Oe&&Z?lt(Z,"center"):Le>0?`translateY(${Le}px)`:it,ft=ie?ir(ie,A):null,It=!!(De&&ie),pt=It&&(X==="closing"||X==="open"&&ne),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:gt,opacity:Le>0?mt:It?1:X==="opening"||Nt?0:1,transition:ve&&!Y?"none":Y?`transform ${so}ms ${pn}`:q?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:pt?`transform ${Tn}ms ${pn}`:X==="opening"||Nt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Xe&&Ct&&!Oe?"auto":"none",touchAction:Xe&&Ct?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(F,$e,Pe="adjacent")=>{const Ne=at(F);if(!Ne)return{display:"none"};const ot=Pe==="far"?$e==="left"?"far-left":"far-right":$e==="left"?"left-adjacent":"right-adjacent",{start:Et}=Te!==null?bd(Ne,ot,Te,A):{start:Pe==="far"?Mr(Ne,$e,A):qi(Ne,$e,A)},Qe=ir(Et,A),yt=lt(F,ot),Dt=!Oe&&Pe==="adjacent"&&Ct&&!Ae?Df(Ne,$e,A):null,Lt=Pe==="far"&&Oe&&Te===($e==="left"?-1:1),nn=ve&&!Y?!1:Y,un=Pe==="adjacent"&&Ct&&Ae&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Pe==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Pe==="far"?`transform ${so}ms ${pn}`:`transform ${so}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:X==="opening"||Nt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(F,$e)=>{const Pe=at(F);return Pe?Hf(qi(Pe,$e,A),$e,A):null},Gt=F=>$e=>{if(!l){if(E.current){E.current=!1;return}$e.stopPropagation(),xt(F)}},Ht=ze?Vt(ze,"left"):null,Ot=Se?Vt(Se,"right"):null,_t=Ht?ir(Ht,A):null,St=Ot?ir(Ot,A):null;return a.jsxs("div",{ref:T,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:X==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?rn:0,transition:ve?"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:Ct?1:0,transition:ve?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(yd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Jt})})]}),Ct&&Ge&&a.jsx(or,{media:Ge,style:Mt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Re},`far-prev-${Ge.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(or,{media:ze,style:Mt(ze,"left"),onMeasure:Ve,onTransitionEnd:Re},`prev-${ze.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(or,{media:Se,style:Mt(Se,"right"),onMeasure:Ve,onTransitionEnd:Re},`next-${Se.url}`),St&&a.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&a.jsx(or,{media:Ze,style:Mt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Re},`far-next-${Ze.url}`),ie&&Z&&(Xe?a.jsx(Vf,{src:Z.url,phase:X,onMediaElement:Ft,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Re},`${n}-${Z.url}`):a.jsx("img",{ref:Ft,src:Z.url,alt:Z.name,onLoad:vt,onTransitionEnd:Re,style:jt},`${n}-${Z.url}`))]})}function qf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=W.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:v}=e,f=(v==null?void 0:v.display)==="cover",h=(v==null?void 0:v.ratioValue)??"1:1",g=(v==null?void 0:v.reversed)??!1,[m,x]=h.split(":").map(Number),w=`${g?x:m} / ${g?m:x}`,B=d.entryWidth??.2,M=d.columnsCount,G=W.scalingValue(B,n),O=W.scalingValue(d.horizontalGap??0,n),_=G,j=G,b={width:_,...f?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},H=f?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},E=s.useRef(null),[$,S]=s.useState(!1),[P,I]=s.useState([]),[N,z]=s.useState(0),[C,R]=s.useState(0),[D,ie]=s.useState(null),[ee,A]=s.useState({title1:"",title2:"",title3:""}),ae=(()=>{const ge={},be=E.current?getComputedStyle(E.current).getPropertyValue("--cntrl-article-width").trim():"";return be&&(ge["--cntrl-article-width"]=be),ge})(),k=!n||i||o,J=s.useMemo(()=>$f(c),[c]),X=t??[],me=X.length%M||M,Le=me<M&&X.length>0,he=X.length-me,K=Le?Math.floor((M-me)/2)+1:1,V=s.useMemo(()=>Mf(X),[X]),Y=s.useMemo(()=>Wf(X),[X]),Q=(ge,be,ne)=>{if(n&&!o&&!i)return;const ce=V.findIndex(xe=>xe.gridIndex===ge);if(ce<0)return;const ue=V[ce];R(ce),I(ue.items),z(be),A(ue.entry),ie(ne??null),S(!0)},Te=s.useCallback(()=>{S(!1),ie(null)},[]),we=s.useCallback(()=>{const ge=V[C];return!ge||!E.current?D:Ef(E.current,ge.gridIndex,f?"cover":"contain")??D},[V,C,D,f]),ke=s.useCallback(ge=>{if(V.length>1){const be=V.length,ne=(C+ge+be)%be,ce=V[ne],ue=Math.min(N,ce.items.length-1);R(ne),I(ce.items),z(ue),A(ce.entry);return}z(be=>(be+ge+P.length)%P.length)},[V,C,N,P.length]),le=V.length>1||P.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||S(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:J}}),a.jsx(Nf,{mediaList:Y}),a.jsx("div",{ref:E,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${M}, ${G})`,rowGap:0,columnGap:O,width:W.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:W.scalingValue(u??0,n)},children:X.map((ge,be)=>{const ne=Es(ge.gallery),ce=Ms(ne),ue=ce.filter(de=>de.lightboxMedia).map(de=>de.lightboxMedia),xe=Math.floor(be/M)===Math.ceil(X.length/M)-1,Ae=Le&&be>=he?`${K+(be-he)}`:void 0,Ie=ce[0],U=Ie!=null&&Ie.lightboxMedia?ue.findIndex(de=>de.url===Ie.lightboxMedia.url):-1,ve=a.jsx("div",{className:`${c}-item-image-wrapper`,style:b,children:ce.length>0&&a.jsx(zf,{media:Ie.displayMedia,gridIndex:be,className:`${c}-item-${oo(Ie.displayMedia)?"video":"image"}`.trim(),style:H,onMediaClick:k&&U>=0?de=>Q(be,U,vd(de.currentTarget,f?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,xe?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:G,...Ae?{gridColumn:Ae}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:j}})}),a.jsx("a",{className:`${c}-item-image-link`,children:ve}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:j}})})]})},be)})}),$&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:ae,"data-selection":"none",children:a.jsx(Gf,{prefix:c,items:P,index:N,entry:ee,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:le,lightboxEntries:V,entryIdx:C,layoutId:r,sourceRect:D,resolveCloseSourceRect:we,onClose:Te,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),ge)})()]})}const Xf=`import { CommonComponentProps } from '../props';
|
|
7505
|
+
`}const bl={url:"",name:"",objectFit:"cover"},Tn=500,lo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Tf=72,Lf=50,Rf=1e4,If=650,Pf=500;function Ef(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 vd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=kr(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 Mf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?vd(i,n):null}function kf(e){return e.reduce((t,n,i)=>{const o=ks(n.gallery),l=As(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 yo(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 yo(e,i,n)}const Af=.03;function xd(e){return e.width*Af}const ya={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function rr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Sl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ff(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Za(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 _f(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Za(e,t.width,t.height)}function Wf(e,t){if(ro(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 Nf(e){const t=new Set,n=[];for(const i of e){const o=ks(i.gallery),r=As(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 Hf({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=>ro(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 Xi(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=xd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Ar(e,t,n){const i=Xi(e,t,n);return{...i,left:2*i.left-e.left}}function Of(e,t,n){const{left:i,width:o}=n,r=xd(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function bd(e,t,n,i){const o=Xi(e,"left",i),r=Xi(e,"right",i),l=Ar(e,"left",i),d=Ar(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 Df(e,t,n,i){const{start:o,end:r}=bd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Bf(e,t,n){const i=Xi(e,t,n),o=Ar(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function wd(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 ks(e){if(!e)return;if(wd(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??bl,i??o??bl]}]}function jf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function zf(e){const[t]=e.media;return t!=null&&t.url?t:null}function As(e){if(!Array.isArray(e)||e.length===0)return[];if(wd(e)){const t=[];for(const n of e){const i=jf(n);if(!i)continue;const o=zf(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 ro(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Vf({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return ro(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 Gf({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 ar({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ro(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 qf({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:x,resolveCloseSourceRect:g,onClose:m,onPrev:h,onNext:f}){const C=s.useRef(null),y=s.useRef(null),R=s.useRef(null),H=s.useRef(new Map),[S,U]=s.useState(0),F=s.useRef(null),_=s.useRef(0),B=s.useRef(0),L=s.useRef("none"),N=s.useRef(!1),k=s.useRef(!1),Z=s.useRef(!1),E=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(()=>{}),$=s.useRef(null),v=s.useRef(null),w=s.useRef(null),P=s.useRef(!1),[Q,z]=s.useState(null),[T,O]=s.useState(ya),[M,ee]=s.useState(0),[V,me]=s.useState("opening"),[Ie,ge]=s.useState(0),[ae,ne]=s.useState(0),[oe,ie]=s.useState(!1),[Ae,be]=s.useState(null),[Me,q]=s.useState(null),[se,he]=s.useState(null),[G,re]=s.useState(!1),[pe,we]=s.useState(null),[Pe,Ce]=s.useState(!1),Y=s.useRef(!1),[xe,ue]=s.useState(!1),[X,le]=s.useState(!1),Fe=s.useRef(n),fe=s.useRef(void 0),J=t[n],Xe=J?ro(J):!1,Oe=ae!==0||oe,dt=!l&&(!r||!!d),nt=c&&!l,ht=u.length>1,st=s.useCallback((A,$e)=>t.length<=1?null:t[(A+$e+t.length)%t.length]??null,[t]),ze=ht?yo(u,p,-1):st(n,-1),Se=ht?yo(u,p,1):st(n,1),_e=Ae===-1&&Oe?ht&&Me!==null?yo(u,Me,-1):se!==null?st(se,-1):null:null,Be=Ae===1&&Oe?ht&&Me!==null?yo(u,Me,1):se!==null?st(se,1):null:null,Ye=_e&&_e.url!==(ze==null?void 0:ze.url)?_e:null,de=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,ve=ze&&nt?(()=>{const A=ht?wl(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return A&&A.url!==ze.url?A:null})():null,Ee=Se&&nt?(()=>{const A=ht?wl(u,p,1):t.length>2?st((n+1)%t.length,1):null;return A&&A.url!==Se.url?A:null})():null,Ge=Ye??ve,Ze=de??Ee,Ve=s.useCallback((A,$e,Re)=>{if(!A||!$e||!Re)return;const Ne=H.current,ot=Ne.get(A);(ot==null?void 0:ot.width)===$e&&(ot==null?void 0:ot.height)===Re||(Ne.set(A,{width:$e,height:Re}),U(Et=>Et+1))},[]),at=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const $e=H.current.get(A.url);return _f(y.current,$e)},[S,M]),Je=s.useCallback(()=>{if(!J)return;const A=at(J);if(A){z(A);return}const $e=y.current;$e&&z(Sl($e))},[J,at]),ke=s.useCallback(A=>{if(ht){const $e=u.length;q((p+A+$e)%$e),he(null);return}t.length>1&&(he((n+A+t.length)%t.length),q(null))},[ht,u.length,p,t.length,n]),qe=s.useCallback(A=>{Z.current=A,ie(A)},[]),We=s.useCallback(()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),tt=s.useCallback(()=>{We(),E.current=window.setTimeout(()=>{We(),qe(!1)},lo+32)},[We,qe]),rt=s.useCallback(()=>{const A=C.current;if(!A){O({left:0,top:0,width:typeof window<"u"?window.innerWidth:ya.width,height:typeof window<"u"?window.innerHeight:ya.height});return}const $e=A.getBoundingClientRect();O({left:$e.left,top:$e.top,width:$e.width,height:$e.height})},[]),lt=s.useCallback((A,$e)=>{if(Oe){if(xe&&!oe)return`translate(${ae}px, 0px)`;if(oe&&Ae!==null){const Re=at(A);if(!Re)return;const{x:Ne,y:ot}=Df(Re,$e,Ae,T);return`translate(${Ne}px, ${ot}px)`}if(oe)return"translate(0px, 0px)"}},[Oe,xe,oe,ae,Ae,T,at]),Tt=s.useCallback(()=>{const A=K.current;K.current=null,We(),qe(!1),be(null),q(null),he(null),ne(0),ue(!1),N.current=!1,B.current=0,L.current="none",A===-1?h():A===1&&f()},[We,qe,h,f]),Xt=s.useCallback(()=>{We(),E.current=window.setTimeout(()=>{K.current!==null&&Tt()},lo+32)},[We,Tt]),Zt=s.useCallback(()=>{We(),K.current=null,qe(!1),be(null),q(null),he(null),ne(0),ue(!1),N.current=!1,B.current=0,L.current="none"},[We,qe]),xt=s.useCallback(A=>{if(!(!nt||!Q)){if(Z.current){if(K.current===A){D.current=A,Tt();return}Zt()}We(),ke(A),K.current=A,be(A),qe(!0),Xt()}},[nt,Q,Tt,Zt,We,ke,qe,Xt]);j.current=xt;const wt=s.useCallback(()=>{$.current=null,P.current=!1,v.current!==null&&(window.clearInterval(v.current),v.current=null),w.current!==null&&(window.clearTimeout(w.current),w.current=null)},[]),Bt=s.useCallback(A=>{v.current!==null&&window.clearInterval(v.current);const $e=P.current?Pf:If;v.current=window.setInterval(()=>{j.current(A)},$e)},[]),At=s.useCallback(A=>{$.current!==A&&(wt(),$.current=A,P.current=!1,j.current(A),Bt(A),w.current=window.setTimeout(()=>{w.current=null,$.current===A&&(P.current=!0,Bt(A))},Rf))},[wt,Bt]),vt=s.useCallback(()=>{const A=y.current;if(!A)return;const $e=J==null?void 0:J.url,Re=$e?H.current.get($e):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){z(Za(A,Re.width,Re.height));return}const Ne=R.current;if(Ne&&$e&&(Ne.src===$e||Ne.currentSrc===$e)){const{width:Et,height:Qe}=Ff(Ne);if(Et&&Qe){Ve($e,Et,Qe),z(Za(A,Et,Qe));return}}const ot=Sl(A);!ot.width||!ot.height||z(ot)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(A=>{if(R.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&vt();return}A.complete&&A.naturalWidth>0&&vt()}},[vt]),Wt=s.useCallback(()=>{rt(),vt(),ee(A=>A+1)},[rt,vt]);s.useEffect(()=>{Wt();const A=y.current,$e=C.current,Re=new ResizeObserver(()=>Wt());return A&&Re.observe(A),$e&&Re.observe($e),window.addEventListener("resize",Wt),()=>{Re.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,b]),s.useLayoutEffect(()=>{if(!J)return;const A=R.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){vt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{Je()},[Je,S]),s.useEffect(()=>{const A=new Set,$e=[],Re=Ne=>{!(Ne!=null&&Ne.url)||A.has(Ne.url)||(A.add(Ne.url),$e.push(Ne))};t.forEach(Re),u.forEach(Ne=>Ne.items.forEach(Re)),$e.forEach(Ne=>{H.current.has(Ne.url)||Wf(Ne,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(V!=="opening"||!Q)return;if(!x){me("open");return}re(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),me("open")})});return()=>cancelAnimationFrame(A)},[V,Q,x]),s.useEffect(()=>{if(V!=="closing")return;const A=setTimeout(()=>m(),Tn);return()=>clearTimeout(A)},[V,m]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Fe.current===n&&fe.current===(J==null?void 0:J.url)||(We(),K.current=null,be(null),q(null),he(null),ge(0),ne(0),qe(!1),le(!1),ue(!1),_.current=0,B.current=0,L.current="none",N.current=!1,F.current=null,k.current=!1,R.current=null,Je(),Fe.current=n,fe.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,We,Je]),s.useLayoutEffect(()=>{const A=D.current;A!==null&&(D.current=null,requestAnimationFrame(()=>{j.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(V==="opening"){Y.current=!1,Ce(!1);return}if(V!=="open"||Y.current)return;if(!ze&&!Se){Y.current=!0;return}Ce(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),Y.current=!0})});return()=>cancelAnimationFrame(A)},[V,ze==null?void 0:ze.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(V!=="open")return;const A=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},$e=Qe=>{const yt=Qe<0?1:-1;We(),ke(yt),K.current=yt,be(yt),qe(!0),Xt()},Re=Qe=>{if(Math.abs(Qe)>Lf&&nt){$e(Qe);return}K.current=null,be(null),q(null),he(null),qe(!0),ne(0),tt()},Ne=Qe=>{if(Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0];k.current=!0,F.current={x:yt.clientX,y:yt.clientY},L.current="none",B.current=0,N.current=!1},ot=Qe=>{if(!F.current||Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0],Dt=yt.clientX-F.current.x,Lt=yt.clientY-F.current.y;if(L.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;L.current="horizontal"}else if(Lt>0){if(!dt)return;L.current="vertical"}else return}if(L.current==="horizontal"){N.current=!0,ue(!0),B.current=Dt,ne(Dt),Qe.preventDefault();return}L.current==="vertical"&&(N.current=!0,ue(!0),_.current=Lt,ge(Lt),Qe.preventDefault())},Et=()=>{if(!F.current)return;const Qe=L.current,yt=N.current;if(yt&&Qe==="horizontal")Re(B.current),A();else if(yt&&Qe==="vertical"){const Dt=_.current;if(dt&&Dt>Tf){const Lt=window.innerHeight;_.current=Lt,le(!0),ge(Lt),me("closing")}else _.current=0,ge(0);A()}else Qe==="horizontal"&&Math.abs(B.current)>0&&(Re(B.current),A());F.current=null,L.current="none",B.current=0,N.current=!1,ue(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[V,nt,qe,tt,We,dt,Xt,ke]);const Yt=s.useCallback(()=>{const A=(g==null?void 0:g())??x??null;A&&Q&&(we(A),re(!0)),me("closing")},[g,x,Q]);s.useEffect(()=>{const A=Ne=>{if(Ne.key==="Escape"){if(r&&d||V==="closing")return;wt(),Yt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||V!=="open"||!nt)return;Ne.preventDefault();const ot=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&$.current===ot||At(ot)},$e=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ot=Ne.key==="ArrowLeft"?-1:1;$.current===ot&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",$e),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",$e),window.removeEventListener("blur",Re),wt()}},[V,r,d,Yt,nt,At,wt]),s.useEffect(()=>{V!=="open"&&wt()},[V,wt]);const Jt=()=>{V==="closing"||l||Yt()},Ct=V==="open",Nt=V==="closing",rn=Ie>0?Math.max(0,1-Ie/500):1,mt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!Z.current)){if(K.current!==null){Tt();return}We(),qe(!1)}},[We,qe,Tt]),De=V==="closing"?pe??x:x,it=De&&Q&&(V==="opening"||Nt)?Ef(De,Q):void 0,gt=Oe&&J?lt(J,"center"):Ie>0?`translateY(${Ie}px)`:it,ft=Q?rr(Q,T):null,It=!!(De&&Q),pt=It&&(V==="closing"||V==="open"&&G),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:gt,opacity:Ie>0?mt:It?1:V==="opening"||Nt?0:1,transition:xe&&!oe?"none":oe?`transform ${lo}ms ${pn}`:X?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:pt?`transform ${Tn}ms ${pn}`:V==="opening"||Nt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Xe&&Ct&&!Oe?"auto":"none",touchAction:Xe&&Ct?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(A,$e,Re="adjacent")=>{const Ne=at(A);if(!Ne)return{display:"none"};const ot=Re==="far"?$e==="left"?"far-left":"far-right":$e==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ae!==null?bd(Ne,ot,Ae,T):{start:Re==="far"?Ar(Ne,$e,T):Xi(Ne,$e,T)},Qe=rr(Et,T),yt=lt(A,ot),Dt=!Oe&&Re==="adjacent"&&Ct&&!Pe?Bf(Ne,$e,T):null,Lt=Re==="far"&&Oe&&Ae===($e==="left"?-1:1),nn=xe&&!oe?!1:oe,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Re==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${lo}ms ${pn}`:`transform ${lo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:V==="opening"||Nt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(A,$e)=>{const Re=at(A);return Re?Of(Xi(Re,$e,T),$e,T):null},Gt=A=>$e=>{if(!l){if(k.current){k.current=!1;return}$e.stopPropagation(),xt(A)}},Ht=ze?Vt(ze,"left"):null,Ot=Se?Vt(Se,"right"):null,_t=Ht?rr(Ht,T):null,St=Ot?rr(Ot,T):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?rn:0,transition:xe?"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:Ct?1:0,transition:xe?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(yd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Ct&&Ge&&a.jsx(ar,{media:Ge,style:Mt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Le},`far-prev-${Ge.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(ar,{media:ze,style:Mt(ze,"left"),onMeasure:Ve,onTransitionEnd:Le},`prev-${ze.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(ar,{media:Se,style:Mt(Se,"right"),onMeasure:Ve,onTransitionEnd:Le},`next-${Se.url}`),St&&a.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&a.jsx(ar,{media:Ze,style:Mt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Le},`far-next-${Ze.url}`),Q&&J&&(Xe?a.jsx(Gf,{src:J.url,phase:V,onMediaElement:Ft,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Le,style:jt},`${n}-${J.url}`))]})}function Xf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,x=(b==null?void 0:b.display)==="cover",g=(b==null?void 0:b.ratioValue)??"1:1",m=(b==null?void 0:b.reversed)??!1,[h,f]=g.split(":").map(Number),R=`${m?f:h} / ${m?h:f}`,H=c.entryWidth??.2,S=c.columnsCount,U=W.scalingValue(H,n),F=W.scalingValue(c.horizontalGap??0,n),_=U,B=U,L={width:_,...x?{aspectRatio:R,height:"auto",overflow:"hidden"}:{height:"auto"}},N=x?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[Z,E]=s.useState(!1),[K,D]=s.useState([]),[j,$]=s.useState(0),[v,w]=s.useState(0),[P,Q]=s.useState(null),[z,T]=s.useState({title1:"",title2:"",title3:""}),O=(()=>{const se={},he=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return he&&(se["--cntrl-article-width"]=he),se})(),M=!n||i||o,ee=s.useMemo(()=>Cf(d),[d]),V=t??[],me=V.length%S||S,Ie=me<S&&V.length>0,ge=V.length-me,ae=Ie?Math.floor((S-me)/2)+1:1,ne=s.useMemo(()=>kf(V),[V]),oe=s.useMemo(()=>Nf(V),[V]),ie=(se,he,G)=>{if(n&&!o&&!i)return;const re=ne.findIndex(we=>we.gridIndex===se);if(re<0)return;const pe=ne[re];w(re),D(pe.items),$(he),T(pe.entry),Q(G??null),E(!0)},Ae=s.useCallback(()=>{E(!1),Q(null)},[]),be=s.useCallback(()=>{const se=ne[v];return!se||!k.current?P:Mf(k.current,se.gridIndex,x?"cover":"contain")??P},[ne,v,P,x]),Me=s.useCallback(se=>{if(ne.length>1){const he=ne.length,G=(v+se+he)%he,re=ne[G],pe=Math.min(j,re.items.length-1);w(G),D(re.items),$(pe),T(re.entry);return}$(he=>(he+se+K.length)%K.length)},[ne,v,j,K.length]),q=ne.length>1||K.length>1;return s.useEffect(()=>{if(!Z||typeof document>"u")return;const se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=se}},[Z]),s.useEffect(()=>{!n||o||i||E(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ee}}),a.jsx(Hf,{mediaList:oe}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${S}, ${U})`,rowGap:0,columnGap:F,width:W.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:W.scalingValue(u??0,n)},children:V.map((se,he)=>{const G=ks(se.gallery),re=As(G),pe=re.filter(ue=>ue.lightboxMedia).map(ue=>ue.lightboxMedia),we=Math.floor(he/S)===Math.ceil(V.length/S)-1,Pe=Ie&&he>=ge?`${ae+(he-ge)}`:void 0,Ce=re[0],Y=Ce!=null&&Ce.lightboxMedia?pe.findIndex(ue=>ue.url===Ce.lightboxMedia.url):-1,xe=a.jsx("div",{className:`${d}-item-image-wrapper`,style:L,children:re.length>0&&a.jsx(Vf,{media:Ce.displayMedia,gridIndex:he,className:`${d}-item-${ro(Ce.displayMedia)?"video":"image"}`.trim(),style:N,onMediaClick:M&&Y>=0?ue=>ie(he,Y,vd(ue.currentTarget,x?"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,...Pe?{gridColumn:Pe}:{}},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:xe}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:B}})})]})},he)})}),Z&&typeof document<"u"&&(()=>{const se=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:O,"data-selection":"none",children:a.jsx(qf,{prefix:d,items:K,index:j,entry:z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:q,lightboxEntries:ne,entryIdx:v,layoutId:r,sourceRect:P,resolveCloseSourceRect:be,onClose:Ae,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),se)})()]})}const Uf=`import { CommonComponentProps } from '../props';
|
|
7506
7506
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7507
7507
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7508
7508
|
import { createPortal } from 'react-dom';
|
|
@@ -9845,11 +9845,11 @@ export function Hive({
|
|
|
9845
9845
|
</>
|
|
9846
9846
|
);
|
|
9847
9847
|
}
|
|
9848
|
-
`,Uf="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>'),li={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 Kf(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Xi=Jn.filter(e=>e!=="count"),Yf=Xi.reduce((e,t)=>({...e,...Kf(t)}),{}),Zf=Xi.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ya(e){return Xi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const Jf={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Xi.map(e=>[Is[e],Ps(e)]))},Qf={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},ey=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Qf,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ty={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:ey},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"}},...Yf},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Uf,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Zf},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,...ya({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,...ya({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,...ya({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:[Jf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},ny={element:qf,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:[...Xi.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Xi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:ty,sourceCode:Xf};function iy(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 oy({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 va(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ry(e){return String(e??"").trim().length>0}function Sl(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 $l(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 Cl(e,t,n,i,o,r,l){const c=W.scalingValue(r,l),d=W.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?c:d,borderBottomWidth:!p||i?c:d}}function ay(e,t,n){const i=W.scalingValue(t,n),o=W.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Tl=10,Ll=10,lo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function sy(e,t,n){return Math.max(t,Math.min(n,e))}function xa(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 c=t.getBoundingClientRect();return{x:n.clientX-c.left+Tl,y:n.clientY-c.top+Tl}}switch(e){case"left":return{x:Ll+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Ll-i/2,y:l};default:return{x:o/2,y:l}}}function cy(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 h=n.current,g=i.current;h&&(h.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),c=s.useCallback(()=>{const h=i.current;t?(h.x=xa(h.x,h.targetX,lo.positionEase),h.y=xa(h.y,h.targetY,lo.positionEase),h.rotation=xa(h.rotation,h.targetRotation,lo.rotationEase)):(h.x=h.targetX,h.y=h.targetY,h.rotation=h.targetRotation),r();const g=Math.abs(h.x-h.targetX)<.4&&Math.abs(h.y-h.targetY)<.4,m=Math.abs(h.rotation-h.targetRotation)<.08;!g||!m?o.current=requestAnimationFrame(c):o.current=null},[r,t]),d=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(c))},[c]),u=s.useCallback((h,g)=>{const m=i.current;m.targetX=h,m.targetY=g,m.targetRotation=0,m.x=h,m.y=g,m.rotation=0,m.lastX=h,m.hasLastX=!0,r(),t&&d()},[r,t,d]),p=s.useCallback((h,g)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const x=h-m.lastX;m.targetRotation=sy(x*lo.rotationFactor,-20,lo.maxRotation)}else m.targetRotation=0;if(m.lastX=h,m.hasLastX=!0,m.targetX=h,m.targetY=g,t){d();return}m.x=h,m.y=g,m.rotation=m.targetRotation,r()},[e,r,t,d]),v=s.useCallback(h=>{l(),i.current.hasLastX=!1,h==null||h()},[l]),f=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||f(),l),[e,f,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:v,reset:f}}function dy(e){return`
|
|
9848
|
+
`,Yf="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>'),li={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 Kf(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ui=Jn.filter(e=>e!=="count"),Zf=Ui.reduce((e,t)=>({...e,...Kf(t)}),{}),Jf=Ui.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function va(e){return Ui.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const Qf={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ui.map(e=>[Es[e],Ms(e)]))},ey={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},ty=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...ey,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ny={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:ty},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"}},...Zf},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Yf,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Jf},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,...va({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,...va({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,...va({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:[Qf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},iy={element:Xf,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:[...Ui.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Ui.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:ny,sourceCode:Uf};function oy(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 ry({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 xa(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ay(e){return String(e??"").trim().length>0}function $l(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 Cl(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 Tl(e,t,n,i,o,r,l){const d=W.scalingValue(r,l),c=W.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function sy(e,t,n){const i=W.scalingValue(t,n),o=W.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ll=10,Rl=10,co={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function ly(e,t,n){return Math.max(t,Math.min(n,e))}function ba(e,t,n){return e+(t-e)*n}function cy(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+Ll,y:n.clientY-d.top+Ll}}switch(e){case"left":return{x:Rl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Rl-i/2,y:l};default:return{x:o/2,y:l}}}function dy(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 g=n.current,m=i.current;g&&(g.style.transform=`translate3d(${m.x}px, ${m.y}px, 0) translate(-50%, -50%) rotate(${m.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const g=i.current;t?(g.x=ba(g.x,g.targetX,co.positionEase),g.y=ba(g.y,g.targetY,co.positionEase),g.rotation=ba(g.rotation,g.targetRotation,co.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),r();const m=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,h=Math.abs(g.rotation-g.targetRotation)<.08;!m||!h?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((g,m)=>{const h=i.current;h.targetX=g,h.targetY=m,h.targetRotation=0,h.x=g,h.y=m,h.rotation=0,h.lastX=g,h.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((g,m)=>{if(!e)return;const h=i.current;if(t&&h.hasLastX){const f=g-h.lastX;h.targetRotation=ly(f*co.rotationFactor,-20,co.maxRotation)}else h.targetRotation=0;if(h.lastX=g,h.hasLastX=!0,h.targetX=g,h.targetY=m,t){c();return}h.x=g,h.y=m,h.rotation=h.targetRotation,r()},[e,r,t,c]),b=s.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),x=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||x(),l),[e,x,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:b,reset:x}}function uy(e){return`
|
|
9849
9849
|
.${e}-wrapper {
|
|
9850
9850
|
display: grid;
|
|
9851
9851
|
align-items: start;
|
|
9852
|
-
min-height: ${
|
|
9852
|
+
min-height: ${xa(48)};
|
|
9853
9853
|
position: relative;
|
|
9854
9854
|
overflow: visible;
|
|
9855
9855
|
box-sizing: border-box;
|
|
@@ -9978,7 +9978,7 @@ a.${e}-list-item {
|
|
|
9978
9978
|
flex-shrink: 0;
|
|
9979
9979
|
overflow: visible;
|
|
9980
9980
|
box-sizing: border-box;
|
|
9981
|
-
min-width: ${
|
|
9981
|
+
min-width: ${xa(50)};
|
|
9982
9982
|
position: relative;
|
|
9983
9983
|
display: flex;
|
|
9984
9984
|
align-items: flex-start;
|
|
@@ -9986,7 +9986,7 @@ a.${e}-list-item {
|
|
|
9986
9986
|
|
|
9987
9987
|
.${e}-list-col-last {
|
|
9988
9988
|
flex: 1 1 auto;
|
|
9989
|
-
min-width: ${
|
|
9989
|
+
min-width: ${xa(50)};
|
|
9990
9990
|
}
|
|
9991
9991
|
|
|
9992
9992
|
.${e}-list-col-title {
|
|
@@ -10221,7 +10221,7 @@ a.${e}-list-item {
|
|
|
10221
10221
|
overflow-wrap: anywhere;
|
|
10222
10222
|
word-break: break-word;
|
|
10223
10223
|
}
|
|
10224
|
-
`}const Qn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ks=["AColumn","BColumn","CColumn","DColumn","EColumn"],Wn="cutLabel",ko=[...ks,Wn],Zr=["A","B","C","D","E"];function Sd(e){return`${e}ColumnVerticalAlign`}const Ya=["Top","Center","Bottom"];function As(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Zr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function uy(e){const t=As(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function py(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Zr.includes(n)?n:null}function $d(e,t,n){const i=py(e);return i?i===t?!1:uy(n[Sd(i)]):!0}function Ao(e){const t=As(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Zr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function my(e,t,n){if(Cd(e,t,n))return Ao(e);const i=Ao(e);return i.kind==="baseline"?{kind:"top"}:i}function gy(e){const t=Ao(e);return t.kind==="baseline"?{kind:"top"}:t}function Cd(e,t,n){return $d(e,n,t)?Ao(e).kind==="baseline":!1}function hy(e){const t={};let n=!1;for(const i of Zr){const o=Sd(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}$d(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function fy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function yy(e){const t=Ao(e).kind;return t==="baseline"?"center":t}function vy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Rl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function xy(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 ba(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=xy(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const c=r.getBoundingClientRect(),d=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(c.height-d)/2:e.kind==="bottom"&&(u=c.height-d),c.top-t+u+l}function by(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 wy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Sy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const $y={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Cy(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 Ty(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(ko.map(e=>[$y[e],Cy(e)]))}}function kr(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===Wn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Il(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return an(Ut(n,t))}function Pl(e,t,n,i){const o=kr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function El(e,t,n,i){const o=kr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((r-l)/2,i)}}const vn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ui=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ki=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Yi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Ly={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Ry=["hover","focus","filled","success","error"],Ml=.004,Ai=.004,wa=Ai,Fs=50,Fo=1440,_o=Fs/Fo;function Td(e){const t=typeof e=="number"&&e>0?e:Fo;return Fs/t}function Iy(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 Fo}const Ld={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function So(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Py(e,t=1){const n=t/e;return Object.fromEntries(vn.map(i=>[i,n]))}function Ey(){return Object.fromEntries([...Ui.map(e=>[e,0]),...Ki.map(e=>[e,0])])}function My(){return Object.fromEntries(Yi.map(e=>[e,0]))}function rr(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Ld[t]]))}function Rd(e,t,n){const i=e-_o,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 wr(e,t,n){const i=_s(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 ky(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Ui[o],l=Ki[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=Rd(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function _s(e,t,n){if(e<=0)return[];const i=vn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+_o;if(t>=l)return i;const c=[...o];let d=l-t;for(let u=c.length-1;u>=0&&d>0;u-=1){const p=c[u]-_o;if(p<=0)continue;const v=Math.min(d,p);c[u]-=v,d-=v}return[...c,i[e-1]]}function Ay(e,t,n){if(e<=1)return{};const i=_s(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=vn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function kl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Qn]}function Fy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function _y(e,t,n,i){const o=Math.min(i,e.length,vn.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=vn[d],p=Ui[d],v=Ki[d],f=Yi[d],h=vn[l],g=Ui[l],m=Ki[l],x=Yi[l],T=n[u],y=n[p],w=n[v],B=n[f];typeof T=="number"&&(r[h]=T),typeof y=="number"&&(r[g]=y),typeof w=="number"&&(r[m]=w),typeof B=="number"&&(r[x]=B)}return r}function Id(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 Wy(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=So(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Py(n,o),...Ey()};if(r)for(const c of Yi)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,My());return Id(e,l)?l:e}function Ny(e,t,n){const i=hy(e);i&&(e={...e,...i});const o=Td(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=So(e),d=So(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Qn.length,v=w=>{if(u)return w;const B=rr({...t,...w}),M=So(w),G=wr(p,M,B),O=ky(p,G,{...t,...w});return Object.keys(O).length===0?w:{...w,...O}};if(typeof r=="number"&&r!==l)return e;const f=kl(e),h=kl(t);if(!Fy(f,h))return v({...e,..._y(f,h,t,p)});if(c<d&&typeof p=="number"&&!u){const w=rr({...t,...e});return v({...e,...Ay(p,c,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,B=Math.max(0,(c-o)/2);return w>B?{...e,textPaddingLR:B}:e}const g=rr({...t,...e}),m=wr(p,d,rr(t)),T=wr(p,c,g).some((w,B)=>w<(m[B]??w)),y=vn.some(w=>{const B=e[w],M=t[w];return typeof B=="number"&&typeof M=="number"&&B!==M});return T||y?v(e):e}function Hy(e,t,n,i){const o=t.slice(0,e).reduce((l,c)=>l+c,0),r=n.slice(e+1,t.length-1).reduce((l,c)=>l+c,0);return Math.max(_o,i-o-r-_o)}function Oy(e,t){return Math.random()*(t-e)+e}function Dy(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Ld[t]]))}function Sa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function By(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=Ui[c],u=Ki[c],p=Yi[c];return{key:l,textPrefix:Sy[l],widthKey:vn[c],width:n[vn[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function jy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:c}){const{prefix:d}=W.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:f,entriesCount:h,cellMinHeight:g,dividerWidth:m,showVisibility:x,cut:T,showCut:y,cutCellMinHeight:w,cutLabel:B,imageSize:M,imageOnHover:G,imagePosition:O="cursor",imageInterpolation:_="on",entryHoverEffect:j,entryHoverShowOption:b,rowPaddingTop:H,rowPaddingBottom:E,rowPaddingTopB:$,columnsOrder:S,textPaddingLR:P,textColor:I,backgroundColor:N,dividerColor:z,textHoverColor:C,backgroundHoverColor:R,dividerHoverColor:D}=e,[ie,ee]=s.useState(void 0),[A,ae]=s.useState(null),k=s.useRef(null),J=G==="on"&&(!n||i),X=O==="cursor",me=X&&_==="on",{anchorRef:Le,onShow:he,onCursorMove:K,exit:V}=cy(!!(J&&A!==null),me),Y=(T??0)>0,Q=v==="b",Te=s.useRef(null),we=s.useRef(null),[ke,le]=s.useState(null),[ge,be]=s.useState(Fo),ne=Td(ge),ce=Math.max(0,((f??0)-ne)/2),ue=Math.min(P??0,ce),xe=Math.max(ue,Ai),Ae=((f??0)+ne)/2;s.useLayoutEffect(()=>{if(!n){be(Fo);return}const Re=()=>{be(Iy(Te.current))};Re();const De=Te.current;if(!De)return;const it=new ResizeObserver(Re);it.observe(De);let gt=De;for(;gt&&!gt.style.getPropertyValue("--cntrl-article-width");)gt=gt.parentElement;return gt&&it.observe(gt),()=>it.disconnect()},[n,l]),s.useEffect(()=>{ee(void 0)},[T,y,t,h]),s.useEffect(()=>{n&&!i&&ee(void 0)},[n,i]);const Ie=W.buildColorVars(d,{textColor:I,backgroundColor:N,dividerColor:z,textHoverColor:C,backgroundHoverColor:R,dividerHoverColor:D},Ly,Ry),U=r&&r!=="default"?`${d}-state-${r}`:"",de=`${!n||i?j==="default"?`${d}-entry-hover-default`:j==="blinds"?`${d}-entry-hover-blinds`:j==="reveal"?`${d}-entry-hover-reveal`:"":""} ${U}`.trim(),q=j==="reveal"&&(!n||i),re=(x==null?void 0:x[0])??!1,Fe=(x==null?void 0:x[1])??!1,pe=s.useRef(e),Z=s.useRef(l);s.useEffect(()=>{if(!c||!n){pe.current=e,Z.current=l;return}if(Z.current!==l){pe.current=e,Z.current=l;return}const Re=pe.current;if(!(Re!==e))return;if(typeof Re.columns=="number"&&typeof e.columns=="number"&&Re.columns!==e.columns){pe.current=e;return}const it=Ny(e,Re,{designWidth:ge});pe.current=e,Id(e,it)&&c(it)},[e,c,n,l,ge]);const Xe=s.useMemo(()=>Dy(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=s.useMemo(()=>Sa(e,Ui),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),dt=s.useMemo(()=>Sa(e,Ki),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),nt=s.useMemo(()=>Sa(e,Yi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=s.useMemo(()=>Array.isArray(S)&&S.length>0?S:[...Qn],[S]),st=s.useMemo(()=>By(ht,p,Xe,Oe,dt,nt),[ht,p,Xe,Oe,dt,nt]),ze=So(e),Se=s.useMemo(()=>vn.slice(0,p).map(Re=>Xe[Re]),[p,Xe]),_e=s.useMemo(()=>_s(p,ze,Xe),[p,ze,Xe]),Be=s.useMemo(()=>wr(p,ze,Xe),[p,ze,Xe]),Ke=s.useMemo(()=>st.map((Re,De)=>Rd(Be[De]??0,Re.paddingLeft,Re.paddingRight)),[st,Be]),se=s.useMemo(()=>{const Re=h===0?1/0:h;return(t??[]).slice(0,Re).map((it,gt)=>({id:gt,cells:Object.fromEntries(Qn.map(ft=>[ft,it[ft]??""])),image:it.image,link:it.link}))},[t,h]),ye=Y?ie??T:se.length,Ee=s.useMemo(()=>Y?se.slice(0,ye):se,[se,Y,ye]),Ge=Y&&ye<se.length,Ze=Ee.length>1||Ge,Ve=[re?`${d}-divider-top`:"",Fe||Ze?`${d}-divider-bottom`:""].filter(Boolean).join(" "),at=!n||i,Je=()=>{if(!at)return;const Re=ie??T;if(!y){ee(se.length);return}ee(Math.min(Re+y,se.length))},Me=Re=>W.scalingValue(Re,n??!1),qe=Q?$??0:H??0,We=E??0,tt=g??0,rt=Math.max(We,wa),lt=Cl(0,Ee.length,re,Fe,Ge,m??0,n??!1).borderTopWidth,Tt=Q?"rowPaddingTopB":"rowPaddingTop",Xt=st[0],Zt=st[st.length-1],xt=Ke[0],wt=Ke[Ke.length-1],Bt=Xt&&xt?Math.max(xt.paddingLeft,Ai):0,At=Zt&&wt?Math.max(wt.paddingRight,Ai):0,vt=ze,Ft=(Re,De)=>ly(O,Te.current,X?Re:null,De),Wt=(Re,De)=>{if(!J)return;const it=Re.image;if(!(it!=null&&it.url)){V(()=>ae(null));return}const gt=(M==null?void 0:M.min)??80,ft=(M==null?void 0:M.max)??320,It=(A==null?void 0:A.rowId)===Re.id,pt=It?A.widthPx:Oy(gt,ft),{x:jt,y:kt}=Ft(De,pt);if(It&&X){K(jt,kt);return}ae({rowId:Re.id,url:it.url,objectFit:"contain",isVideo:iy(it),widthPx:pt}),k.current={x:jt,y:kt}},Kt=Re=>{if(!J||!A||!X)return;const{x:De,y:it}=Ft(Re,A.widthPx);K(De,it)},Jt=()=>{A&&V(()=>ae(null))},Ct=Re=>{q&&Sl(Re,d),!(!J||!A)&&V(()=>ae(null))},Nt=Re=>{q&&$l(Re,d)};s.useLayoutEffect(()=>{if(!A||!k.current)return;const{x:Re,y:De}=k.current;k.current=null,he(Re,De)},[A==null?void 0:A.rowId,A==null?void 0:A.url,he]),s.useLayoutEffect(()=>{if(!u||Q){le(null);return}const Re=we.current,De=Re==null?void 0:Re.parentElement;if(!Re||!De){le(null);return}const it=()=>{const ft=Re.querySelector("[data-list-row]");if(!ft){le(null);return}const It=De.getBoundingClientRect(),pt=ft.getBoundingClientRect();le(pt.top-It.top+pt.height/2)};it();const gt=new ResizeObserver(it);return gt.observe(Re),gt.observe(De),()=>gt.disconnect()},[u,Q,Ee,qe,We,tt,t,e,st,Be,ge,m,re,Fe,Ge]);const rn=s.useMemo(()=>!Q&&ks.some(Re=>{const De=Re.charAt(0),it=e[`${Re}VerticalAlign`];return Cd(it,e,De)}),[Q,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var jt;const Re=Te.current;if(!Re)return;const De=()=>{Re.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${d}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Vt=kt.querySelector(`.${d}-list-col-title`);Vt&&(Vt.style.transform="")})};if(Q||!rn){De();return}const it=()=>{const kt=Array.from(Re.querySelectorAll("[data-list-row]")),Mt=`${d}-list-col`,Vt=`${d}-baseline-probe`;kt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Ot=Ht.querySelector(`.${Mt}`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const _t=Ht.querySelector(`.${d}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]"));by(Gt,Ht,Mt)}),Re.offsetHeight,kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Ot=Gt.getBoundingClientRect().top,_t=new Map,St=Ht.map(Pe=>{const Ne=Pe.querySelector(`.${d}-list-col-title`),ot={el:Pe,titleEl:Ne,letter:Pe.getAttribute("data-col-letter")??"",kind:Pe.getAttribute("data-valign")??"top",anchor:Pe.getAttribute("data-valign-anchor")};return _t.set(ot.letter,ot),ot}),F=new Map,$e=(Pe,Ne)=>{const ot=F.get(Pe.letter);if(ot!==void 0)return ot;const Et=Pe.anchor?_t.get(Pe.anchor):void 0;if(Pe.kind!=="baseline"||!Et||Ne.has(Pe.letter)){const nn=ba(Pe,Ot,Mt,Vt);return F.set(Pe.letter,nn),nn}Ne.add(Pe.letter);const Qe=$e(Et,Ne);Ne.delete(Pe.letter);const yt=ba(Pe,Ot,Mt,Vt),Dt=Qe-yt;wy(Pe.titleEl,Dt);const Lt=ba(Pe,Ot,Mt,Vt);return F.set(Pe.letter,Lt),Lt};St.forEach(Pe=>$e(Pe,new Set))})};let gt=null;const ft=()=>{gt===null&&(gt=requestAnimationFrame(()=>{gt=null,it()}))};it();const It=new ResizeObserver(()=>ft());It.observe(Re);let pt=!1;return typeof document<"u"&&((jt=document.fonts)!=null&&jt.ready)&&document.fonts.ready.then(()=>{pt||ft()}),()=>{pt=!0,gt!==null&&(cancelAnimationFrame(gt),gt=null),It.disconnect(),De()}},[rn,Q,e,t,ge,Ee,Be]);const mt=s.useMemo(()=>dy(d),[d]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:mt}}),a.jsx("div",{style:Ie,children:a.jsxs("div",{ref:Te,className:`${d}-wrapper ${de}${Ve?` ${Ve}`:""}${Q?` ${d}-type-b`:""}`.trim(),style:{width:W.scalingValue(f??0,n)},onMouseMove:J?Kt:void 0,onMouseLeave:J?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ee.map((Re,De)=>{var It;const it=(((It=Re.link)==null?void 0:It.length)??0)>0,gt=it&&(!n||i)?"a":"div",ft=Cl(De,Ee.length,re,Fe,Ge,m??0,n??!1);return a.jsxs(gt,{ref:De===0?pt=>{we.current=pt}:void 0,className:`${d}-list-item${it||b==="always"?` ${d}-list-item-has-link`:""}${Ge&&De===Ee.length-1?` ${d}-list-item-before-cut`:""}`,...it?{href:Re.link,target:"_blank"}:{},style:ft,onMouseEnter:pt=>{q&&(it||b==="always")&&Sl(pt,d),J&&Wt(Re,pt)},onMouseLeave:pt=>{q&&(it||b==="always")&&$l(pt,d)},children:[qe>0&&a.jsx("div",{className:`${d}-row-padding-handle`,style:{height:Me(qe)}}),a.jsxs("div",{className:`${d}-list-cols-row${Q?"":` ${d}-list-cols-row-h`}${u&&De===0&&Q?` ${d}-list-cols-row-controls`:""}`,...Q?{}:{"data-list-row":""},style:Q?void 0:{minHeight:Me(tt)},children:[st.map((pt,jt)=>{const kt=jt===st.length-1,Mt=Ke[jt],Vt=pt.paddingBottom,Gt=ry(Re.cells[pt.key]),Ht=Q&&Gt&&Vt>0,Ot=Q?{minHeight:Me(tt)}:{width:Me(Be[jt])},_t=Q?{paddingLeft:Me(ue),paddingRight:Me(ue)}:{paddingLeft:Me(Mt.paddingLeft),paddingRight:Me(Mt.paddingRight)},St=pt.textPrefix.charAt(0),F=Q?gy(e[`${pt.textPrefix}VerticalAlign`]):my(e[`${pt.textPrefix}VerticalAlign`],e,St),$e=Q&&Gt&&u&&De===0;return Q&&!Gt?null:a.jsxs("div",{className:Q?`${d}-list-col-wrap`:void 0,...Q?{}:{"data-list-col":"","data-col-letter":St,"data-valign":F.kind,...F.kind==="baseline"?{"data-valign-anchor":F.anchorLetter}:{}},children:[a.jsx("div",{className:`${d}-list-col${kt?` ${d}-list-col-last`:""}`,style:{..._t,...Ot,...Q?{justifyContent:Rl(F.kind)}:{}},"data-test":pt.width,children:a.jsx("span",{className:Pl(e,pt.textPrefix,`${d}-list-col-title`,`${d}-text-tight-leading`),style:{...Il(kr(e,pt.textPrefix),n),...El(e,pt.textPrefix,d,n),...Q?{}:fy(F.kind)},children:Re.cells[pt.key]??null})}),Ht&&a.jsx("div",{className:`${d}-row-padding-handle`,style:{height:Me(Vt)}}),$e&&a.jsx("div",{"data-controls":pt.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:`${d}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Me(Math.max(Vt,wa))}})]},pt.key)}),u&&De===0&&Q&&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(Ae),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${d}-control-anchor`,style:{top:0,left:0,width:Me(xe),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ae),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${d}-control-anchor`,style:{top:0,left:Me(Math.max(xe,ze-xe)),width:Me(xe),height:"100%"}})]})]}),!Q&&We>0&&a.jsx("div",{className:`${d}-row-padding-handle`,style:{height:Me(We)}}),u&&De===0&&!Q&&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:`${d}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Me(rt)}})]},Re.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Tt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Q?"center":"left-y",className:`${d}-control-anchor`,style:{top:lt,left:0,width:"100%",height:Me(Math.max(qe,wa))}})},"row-padding-handles"),u&&!Q&&Xt&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((xt==null?void 0:xt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${d}-control-anchor`,style:{top:0,left:0,width:Me(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(Be[st.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${d}-control-anchor`,style:{top:0,left:Me(vt-At),width:Me(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!Q&&st.slice(0,-1).map((Re,De)=>{const it=st[De+1],gt=_e.slice(0,De+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ke[De],It=Ke[De+1],pt=Math.max(ft.paddingRight,Ai),jt=Math.max(It.paddingLeft,Ai);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Re.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[De]-ft.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${d}-control-anchor`,style:{top:0,left:Me(gt-pt),width:Me(pt),height:"100%"}}),a.jsx("div",{"data-controls":it.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[De+1]-It.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${d}-control-anchor`,style:{top:0,left:Me(gt),width:Me(jt),height:"100%"}})]},`${Re.paddingRightKey}-padding`)}),u&&!Q&&st.slice(0,-1).map((Re,De)=>{const it=Hy(De,_e,Se,ze),ft=_e.slice(0,De+1).reduce((It,pt)=>It+pt,0)-Ml/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Re.widthKey,"data-controls-axis":"x","data-controls-min":String(Fs),"data-controls-max-fraction":String(it),"data-controls-variant":"column-width",className:`${d}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Me(ft),width:Me(Ml),height:"calc(100%)",pointerEvents:"auto"}})},`${Re.widthKey}-junction`)})]}),Ge&&(()=>{const Re=kr(e,Wn),De=yy(e.cutLabelVerticalAlign),it=Re.textTextAlign==="justify"||Q;return a.jsx("button",{type:"button",className:`${d}-cut-item`,style:{minHeight:Me(w??0),cursor:at?"pointer":"default",...ay(Fe,m??0,n??!1)},onClick:at?Je:void 0,onMouseEnter:q||J?Ct:void 0,onMouseLeave:q?Nt:void 0,children:a.jsx("div",{className:`${d}-list-cols-row`,style:{...Q?{paddingLeft:Me(ue),paddingRight:Me(ue)}:{},justifyContent:vy(Re.textTextAlign),alignItems:Rl(De)},children:a.jsx("span",{className:Pl(e,Wn,`${d}-cut-label`,`${d}-text-tight-leading`),style:{...Il(Re,n),...El(e,Wn,d,n),...it?{width:"100%"}:{}},children:B})})})})(),J&&A&&(()=>{const Re=`${A.widthPx}px`,De={width:Re,height:"auto",maxHeight:Re,objectFit:"contain"};return a.jsx("div",{ref:Le,className:`${d}-hover-media-anchor`,children:a.jsx(oy,{media:A,className:A.isVideo?`${d}-hover-video`:`${d}-hover-image`,style:De},`${A.rowId}-${A.url}`)})})()]})})]})}const zy=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10224
|
+
`}const Qn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Fs=["AColumn","BColumn","CColumn","DColumn","EColumn"],Wn="cutLabel",ko=[...Fs,Wn],Jr=["A","B","C","D","E"];function Sd(e){return`${e}ColumnVerticalAlign`}const Ja=["Top","Center","Bottom"];function _s(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Jr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function py(e){const t=_s(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 Jr.includes(n)?n:null}function $d(e,t,n){const i=my(e);return i?i===t?!1:py(n[Sd(i)]):!0}function Ao(e){const t=_s(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Jr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function gy(e,t,n){if(Cd(e,t,n))return Ao(e);const i=Ao(e);return i.kind==="baseline"?{kind:"top"}:i}function hy(e){const t=Ao(e);return t.kind==="baseline"?{kind:"top"}:t}function Cd(e,t,n){return $d(e,n,t)?Ao(e).kind==="baseline":!1}function fy(e){const t={};let n=!1;for(const i of Jr){const o=Sd(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}$d(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function yy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function vy(e){const t=Ao(e).kind;return t==="baseline"?"center":t}function xy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Il(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function by(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 wa(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=by(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 wy(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 Sy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const $y={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Cy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Ty(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 Ly(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(ko.map(e=>[Cy[e],Ty(e)]))}}function Fr(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===Wn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Pl(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return an(Ut(n,t))}function El(e,t,n,i){const o=Fr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Ml(e,t,n,i){const o=Fr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((r-l)/2,i)}}const vn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Yi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ki=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Zi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Ry={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Iy=["hover","focus","filled","success","error"],kl=.004,Fi=.004,Sa=Fi,Ws=50,Fo=1440,_o=Ws/Fo;function Td(e){const t=typeof e=="number"&&e>0?e:Fo;return Ws/t}function Py(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 Fo}const Ld={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function So(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Ey(e,t=1){const n=t/e;return Object.fromEntries(vn.map(i=>[i,n]))}function My(){return Object.fromEntries([...Yi.map(e=>[e,0]),...Ki.map(e=>[e,0])])}function ky(){return Object.fromEntries(Zi.map(e=>[e,0]))}function sr(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Ld[t]]))}function Rd(e,t,n){const i=e-_o,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 $r(e,t,n){const i=Ns(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 Ay(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Yi[o],l=Ki[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Rd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Ns(e,t,n){if(e<=0)return[];const i=vn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+_o;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]-_o;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function Fy(e,t,n){if(e<=1)return{};const i=Ns(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=vn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Al(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Qn]}function _y(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Wy(e,t,n,i){const o=Math.min(i,e.length,vn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=vn[c],p=Yi[c],b=Ki[c],x=Zi[c],g=vn[l],m=Yi[l],h=Ki[l],f=Zi[l],C=n[u],y=n[p],R=n[b],H=n[x];typeof C=="number"&&(r[g]=C),typeof y=="number"&&(r[m]=y),typeof R=="number"&&(r[h]=R),typeof H=="number"&&(r[f]=H)}return r}function Id(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 Ny(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=So(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Ey(n,o),...My()};if(r)for(const d of Zi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,ky());return Id(e,l)?l:e}function Hy(e,t,n){const i=fy(e);i&&(e={...e,...i});const o=Td(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=So(e),c=So(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Qn.length,b=R=>{if(u)return R;const H=sr({...t,...R}),S=So(R),U=$r(p,S,H),F=Ay(p,U,{...t,...R});return Object.keys(F).length===0?R:{...R,...F}};if(typeof r=="number"&&r!==l)return e;const x=Al(e),g=Al(t);if(!_y(x,g))return b({...e,...Wy(x,g,t,p)});if(d<c&&typeof p=="number"&&!u){const R=sr({...t,...e});return b({...e,...Fy(p,d,R)})}if(u){const R=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return R>H?{...e,textPaddingLR:H}:e}const m=sr({...t,...e}),h=$r(p,c,sr(t)),C=$r(p,d,m).some((R,H)=>R<(h[H]??R)),y=vn.some(R=>{const H=e[R],S=t[R];return typeof H=="number"&&typeof S=="number"&&H!==S});return C||y?b(e):e}function Oy(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(_o,i-o-r-_o)}function Dy(e,t){return Math.random()*(t-e)+e}function By(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Ld[t]]))}function $a(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function jy(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Yi[d],u=Ki[d],p=Zi[d];return{key:l,textPrefix:$y[l],widthKey:vn[d],width:n[vn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function zy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=W.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:x,entriesCount:g,cellMinHeight:m,dividerWidth:h,showVisibility:f,cut:C,showCut:y,cutCellMinHeight:R,cutLabel:H,imageSize:S,imageOnHover:U,imagePosition:F="cursor",imageInterpolation:_="on",entryHoverEffect:B,entryHoverShowOption:L,rowPaddingTop:N,rowPaddingBottom:k,rowPaddingTopB:Z,columnsOrder:E,textPaddingLR:K,textColor:D,backgroundColor:j,dividerColor:$,textHoverColor:v,backgroundHoverColor:w,dividerHoverColor:P}=e,[Q,z]=s.useState(void 0),[T,O]=s.useState(null),M=s.useRef(null),ee=U==="on"&&(!n||i),V=F==="cursor",me=V&&_==="on",{anchorRef:Ie,onShow:ge,onCursorMove:ae,exit:ne}=dy(!!(ee&&T!==null),me),oe=(C??0)>0,ie=b==="b",Ae=s.useRef(null),be=s.useRef(null),[Me,q]=s.useState(null),[se,he]=s.useState(Fo),G=Td(se),re=Math.max(0,((x??0)-G)/2),pe=Math.min(K??0,re),we=Math.max(pe,Fi),Pe=((x??0)+G)/2;s.useLayoutEffect(()=>{if(!n){he(Fo);return}const Le=()=>{he(Py(Ae.current))};Le();const De=Ae.current;if(!De)return;const it=new ResizeObserver(Le);it.observe(De);let gt=De;for(;gt&&!gt.style.getPropertyValue("--cntrl-article-width");)gt=gt.parentElement;return gt&&it.observe(gt),()=>it.disconnect()},[n,l]),s.useEffect(()=>{z(void 0)},[C,y,t,g]),s.useEffect(()=>{n&&!i&&z(void 0)},[n,i]);const Ce=W.buildColorVars(c,{textColor:D,backgroundColor:j,dividerColor:$,textHoverColor:v,backgroundHoverColor:w,dividerHoverColor:P},Ry,Iy),Y=r&&r!=="default"?`${c}-state-${r}`:"",ue=`${!n||i?B==="default"?`${c}-entry-hover-default`:B==="blinds"?`${c}-entry-hover-blinds`:B==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Y}`.trim(),X=B==="reveal"&&(!n||i),le=(f==null?void 0:f[0])??!1,Fe=(f==null?void 0:f[1])??!1,fe=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){fe.current=e,J.current=l;return}if(J.current!==l){fe.current=e,J.current=l;return}const Le=fe.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){fe.current=e;return}const it=Hy(e,Le,{designWidth:se});fe.current=e,Id(e,it)&&d(it)},[e,d,n,l,se]);const Xe=s.useMemo(()=>By(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=s.useMemo(()=>$a(e,Yi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),dt=s.useMemo(()=>$a(e,Ki),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),nt=s.useMemo(()=>$a(e,Zi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=s.useMemo(()=>Array.isArray(E)&&E.length>0?E:[...Qn],[E]),st=s.useMemo(()=>jy(ht,p,Xe,Oe,dt,nt),[ht,p,Xe,Oe,dt,nt]),ze=So(e),Se=s.useMemo(()=>vn.slice(0,p).map(Le=>Xe[Le]),[p,Xe]),_e=s.useMemo(()=>Ns(p,ze,Xe),[p,ze,Xe]),Be=s.useMemo(()=>$r(p,ze,Xe),[p,ze,Xe]),Ye=s.useMemo(()=>st.map((Le,De)=>Rd(Be[De]??0,Le.paddingLeft,Le.paddingRight)),[st,Be]),de=s.useMemo(()=>{const Le=g===0?1/0:g;return(t??[]).slice(0,Le).map((it,gt)=>({id:gt,cells:Object.fromEntries(Qn.map(ft=>[ft,it[ft]??""])),image:it.image,link:it.link}))},[t,g]),ve=oe?Q??C:de.length,Ee=s.useMemo(()=>oe?de.slice(0,ve):de,[de,oe,ve]),Ge=oe&&ve<de.length,Ze=Ee.length>1||Ge,Ve=[le?`${c}-divider-top`:"",Fe||Ze?`${c}-divider-bottom`:""].filter(Boolean).join(" "),at=!n||i,Je=()=>{if(!at)return;const Le=Q??C;if(!y){z(de.length);return}z(Math.min(Le+y,de.length))},ke=Le=>W.scalingValue(Le,n??!1),qe=ie?Z??0:N??0,We=k??0,tt=m??0,rt=Math.max(We,Sa),lt=Tl(0,Ee.length,le,Fe,Ge,h??0,n??!1).borderTopWidth,Tt=ie?"rowPaddingTopB":"rowPaddingTop",Xt=st[0],Zt=st[st.length-1],xt=Ye[0],wt=Ye[Ye.length-1],Bt=Xt&&xt?Math.max(xt.paddingLeft,Fi):0,At=Zt&&wt?Math.max(wt.paddingRight,Fi):0,vt=ze,Ft=(Le,De)=>cy(F,Ae.current,V?Le:null,De),Wt=(Le,De)=>{if(!ee)return;const it=Le.image;if(!(it!=null&&it.url)){ne(()=>O(null));return}const gt=(S==null?void 0:S.min)??80,ft=(S==null?void 0:S.max)??320,It=(T==null?void 0:T.rowId)===Le.id,pt=It?T.widthPx:Dy(gt,ft),{x:jt,y:kt}=Ft(De,pt);if(It&&V){ae(jt,kt);return}O({rowId:Le.id,url:it.url,objectFit:"contain",isVideo:oy(it),widthPx:pt}),M.current={x:jt,y:kt}},Yt=Le=>{if(!ee||!T||!V)return;const{x:De,y:it}=Ft(Le,T.widthPx);ae(De,it)},Jt=()=>{T&&ne(()=>O(null))},Ct=Le=>{X&&$l(Le,c),!(!ee||!T)&&ne(()=>O(null))},Nt=Le=>{X&&Cl(Le,c)};s.useLayoutEffect(()=>{if(!T||!M.current)return;const{x:Le,y:De}=M.current;M.current=null,ge(Le,De)},[T==null?void 0:T.rowId,T==null?void 0:T.url,ge]),s.useLayoutEffect(()=>{if(!u||ie){q(null);return}const Le=be.current,De=Le==null?void 0:Le.parentElement;if(!Le||!De){q(null);return}const it=()=>{const ft=Le.querySelector("[data-list-row]");if(!ft){q(null);return}const It=De.getBoundingClientRect(),pt=ft.getBoundingClientRect();q(pt.top-It.top+pt.height/2)};it();const gt=new ResizeObserver(it);return gt.observe(Le),gt.observe(De),()=>gt.disconnect()},[u,ie,Ee,qe,We,tt,t,e,st,Be,se,h,le,Fe,Ge]);const rn=s.useMemo(()=>!ie&&Fs.some(Le=>{const De=Le.charAt(0),it=e[`${Le}VerticalAlign`];return Cd(it,e,De)}),[ie,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var jt;const Le=Ae.current;if(!Le)return;const De=()=>{Le.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(ie||!rn){De();return}const it=()=>{const kt=Array.from(Le.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 Ot=Ht.querySelector(`.${Mt}`);Ot&&(Ot.style.minHeight="",Ot.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]"));wy(Gt,Ht,Mt)}),Le.offsetHeight,kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Ot=Gt.getBoundingClientRect().top,_t=new Map,St=Ht.map(Re=>{const Ne=Re.querySelector(`.${c}-list-col-title`),ot={el:Re,titleEl:Ne,letter:Re.getAttribute("data-col-letter")??"",kind:Re.getAttribute("data-valign")??"top",anchor:Re.getAttribute("data-valign-anchor")};return _t.set(ot.letter,ot),ot}),A=new Map,$e=(Re,Ne)=>{const ot=A.get(Re.letter);if(ot!==void 0)return ot;const Et=Re.anchor?_t.get(Re.anchor):void 0;if(Re.kind!=="baseline"||!Et||Ne.has(Re.letter)){const nn=wa(Re,Ot,Mt,Vt);return A.set(Re.letter,nn),nn}Ne.add(Re.letter);const Qe=$e(Et,Ne);Ne.delete(Re.letter);const yt=wa(Re,Ot,Mt,Vt),Dt=Qe-yt;Sy(Re.titleEl,Dt);const Lt=wa(Re,Ot,Mt,Vt);return A.set(Re.letter,Lt),Lt};St.forEach(Re=>$e(Re,new Set))})};let gt=null;const ft=()=>{gt===null&&(gt=requestAnimationFrame(()=>{gt=null,it()}))};it();const It=new ResizeObserver(()=>ft());It.observe(Le);let pt=!1;return typeof document<"u"&&((jt=document.fonts)!=null&&jt.ready)&&document.fonts.ready.then(()=>{pt||ft()}),()=>{pt=!0,gt!==null&&(cancelAnimationFrame(gt),gt=null),It.disconnect(),De()}},[rn,ie,e,t,se,Ee,Be]);const mt=s.useMemo(()=>uy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:mt}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Ae,className:`${c}-wrapper ${ue}${Ve?` ${Ve}`:""}${ie?` ${c}-type-b`:""}`.trim(),style:{width:W.scalingValue(x??0,n)},onMouseMove:ee?Yt:void 0,onMouseLeave:ee?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ee.map((Le,De)=>{var It;const it=(((It=Le.link)==null?void 0:It.length)??0)>0,gt=it&&(!n||i)?"a":"div",ft=Tl(De,Ee.length,le,Fe,Ge,h??0,n??!1);return a.jsxs(gt,{ref:De===0?pt=>{be.current=pt}:void 0,className:`${c}-list-item${it||L==="always"?` ${c}-list-item-has-link`:""}${Ge&&De===Ee.length-1?` ${c}-list-item-before-cut`:""}`,...it?{href:Le.link,target:"_blank"}:{},style:ft,onMouseEnter:pt=>{X&&(it||L==="always")&&$l(pt,c),ee&&Wt(Le,pt)},onMouseLeave:pt=>{X&&(it||L==="always")&&Cl(pt,c)},children:[qe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(qe)}}),a.jsxs("div",{className:`${c}-list-cols-row${ie?"":` ${c}-list-cols-row-h`}${u&&De===0&&ie?` ${c}-list-cols-row-controls`:""}`,...ie?{}:{"data-list-row":""},style:ie?void 0:{minHeight:ke(tt)},children:[st.map((pt,jt)=>{const kt=jt===st.length-1,Mt=Ye[jt],Vt=pt.paddingBottom,Gt=ay(Le.cells[pt.key]),Ht=ie&&Gt&&Vt>0,Ot=ie?{minHeight:ke(tt)}:{width:ke(Be[jt])},_t=ie?{paddingLeft:ke(pe),paddingRight:ke(pe)}:{paddingLeft:ke(Mt.paddingLeft),paddingRight:ke(Mt.paddingRight)},St=pt.textPrefix.charAt(0),A=ie?hy(e[`${pt.textPrefix}VerticalAlign`]):gy(e[`${pt.textPrefix}VerticalAlign`],e,St),$e=ie&&Gt&&u&&De===0;return ie&&!Gt?null:a.jsxs("div",{className:ie?`${c}-list-col-wrap`:void 0,...ie?{}:{"data-list-col":"","data-col-letter":St,"data-valign":A.kind,...A.kind==="baseline"?{"data-valign-anchor":A.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Ot,...ie?{justifyContent:Il(A.kind)}:{}},"data-test":pt.width,children:a.jsx("span",{className:El(e,pt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Pl(Fr(e,pt.textPrefix),n),...Ml(e,pt.textPrefix,c,n),...ie?{}:yy(A.kind)},children:Le.cells[pt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(Vt)}}),$e&&a.jsx("div",{"data-controls":pt.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:ke(Math.max(Vt,Sa))}})]},pt.key)}),u&&De===0&&ie&&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:ke(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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:ke(Math.max(we,ze-we)),width:ke(we),height:"100%"}})]})]}),!ie&&We>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(We)}}),u&&De===0&&!ie&&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:ke(rt)}})]},Le.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Tt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":ie?"center":"left-y",className:`${c}-control-anchor`,style:{top:lt,left:0,width:"100%",height:ke(Math.max(qe,Sa))}})},"row-padding-handles"),u&&!ie&&Xt&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((xt==null?void 0:xt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:ke(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(Be[st.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:ke(vt-At),width:ke(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!ie&&st.slice(0,-1).map((Le,De)=>{const it=st[De+1],gt=_e.slice(0,De+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ye[De],It=Ye[De+1],pt=Math.max(ft.paddingRight,Fi),jt=Math.max(It.paddingLeft,Fi);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[De]-ft.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:ke(gt-pt),width:ke(pt),height:"100%"}}),a.jsx("div",{"data-controls":it.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[De+1]-It.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:ke(gt),width:ke(jt),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!ie&&st.slice(0,-1).map((Le,De)=>{const it=Oy(De,_e,Se,ze),ft=_e.slice(0,De+1).reduce((It,pt)=>It+pt,0)-kl/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Le.widthKey,"data-controls-axis":"x","data-controls-min":String(Ws),"data-controls-max-fraction":String(it),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ke(ft),width:ke(kl),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),Ge&&(()=>{const Le=Fr(e,Wn),De=vy(e.cutLabelVerticalAlign),it=Le.textTextAlign==="justify"||ie;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:ke(R??0),cursor:at?"pointer":"default",...sy(Fe,h??0,n??!1)},onClick:at?Je:void 0,onMouseEnter:X||ee?Ct:void 0,onMouseLeave:X?Nt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...ie?{paddingLeft:ke(pe),paddingRight:ke(pe)}:{},justifyContent:xy(Le.textTextAlign),alignItems:Il(De)},children:a.jsx("span",{className:El(e,Wn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Pl(Le,n),...Ml(e,Wn,c,n),...it?{width:"100%"}:{}},children:H})})})})(),ee&&T&&(()=>{const Le=`${T.widthPx}px`,De={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return a.jsx("div",{ref:Ie,className:`${c}-hover-media-anchor`,children:a.jsx(ry,{media:T,className:T.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:De},`${T.rowId}-${T.url}`)})})()]})})]})}const Vy=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10225
10225
|
import { CommonComponentProps } from '../props';
|
|
10226
10226
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10227
10227
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13309,7 +13309,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13309
13309
|
</>
|
|
13310
13310
|
);
|
|
13311
13311
|
}
|
|
13312
|
-
`,ro=["A","B","C","D","E"],Al=[...Ya,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ci={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 Vy(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function ar(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Gy(){return Object.fromEntries(ro.map((e,t)=>{const n=Qn[t],i=`${e} column`;return[n,Vy(i)]}))}function qy(){const e={};for(const t of ro)e[`${t}ColumnWidth`]=ar(`${t} column width`),e[`${t}ColumnPaddingLeft`]=ar(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=ar(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=ar(`${t} column padding bottom`);return e}function Fl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Qn]};for(const r of ro)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 Xy(e){const t={};if(e===Wn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ya]},enum:[...Ya]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Al],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Al]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...ci.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...ci.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...ci.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...ci.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...ci.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...ci.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...ci.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Uy=ko.reduce((e,t)=>({...e,...Xy(t)}),{});function Ky(e){return{verticalAlign:e===Wn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Wn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Yy(e,t={}){var n;return{...Ky(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const _l=new Set(["textFontFamily","textFontSettings"]);function Zy(e,t,n){const i=r=>n===void 0?!0:n==="common"?_l.has(r):!_l.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=As(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 Sr(e={},t){return ko.reduce((n,i)=>({...n,...Zy(i,Yy(i,e),t)}),{})}const Jy=Sr(),Qy=Ty();function Pd(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 ev(){const e=[];return ks.forEach((t,n)=>{const i=Qn[n],o=Pd(t);for(let r=1;r<Qn.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(c,d)=>({name:`columnsOrder.${d}`,value:i,isNotEqual:!0}))];o.forEach(c=>{e.push({if:l,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const tv=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Pd(Wn);const nv=[...ro.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],di=[{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"}],iv=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:di[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:di[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:di[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:di[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:di[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:di[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:di[6],link:""}],ov=[...ro.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],rv={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:{...Gy(),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:iv},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"}},...qy(),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"}},...Uy,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",...Jy,...Sr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Fl({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},...Sr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Fl({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},...Sr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...ev(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...nv.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}},...ro.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",...ov]},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__",Qy]}],paletteBookmark:{items:[...tv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},av={element:jy,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Wy(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:[...ko.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...ko.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:rv,sourceCode:zy},Wl=300,jn=.004,sv={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"},lv=["hover","focus","filled","success","error"];function cv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Nl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Hl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:W.scalingValue((o-t)/2,i)}}function dv(e){return`
|
|
13312
|
+
`,ao=["A","B","C","D","E"],Fl=[...Ja,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ci={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 Gy(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function lr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function qy(){return Object.fromEntries(ao.map((e,t)=>{const n=Qn[t],i=`${e} column`;return[n,Gy(i)]}))}function Xy(){const e={};for(const t of ao)e[`${t}ColumnWidth`]=lr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=lr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=lr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=lr(`${t} column padding bottom`);return e}function _l(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Qn]};for(const r of ao)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 Uy(e){const t={};if(e===Wn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ja]},enum:[...Ja]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Fl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Fl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...ci.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...ci.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...ci.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...ci.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...ci.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...ci.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...ci.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Yy=ko.reduce((e,t)=>({...e,...Uy(t)}),{});function Ky(e){return{verticalAlign:e===Wn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Wn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Zy(e,t={}){var n;return{...Ky(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Wl=new Set(["textFontFamily","textFontSettings"]);function Jy(e,t,n){const i=r=>n===void 0?!0:n==="common"?Wl.has(r):!Wl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=_s(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 Cr(e={},t){return ko.reduce((n,i)=>({...n,...Jy(i,Zy(i,e),t)}),{})}const Qy=Cr(),ev=Ly();function Pd(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 tv(){const e=[];return Fs.forEach((t,n)=>{const i=Qn[n],o=Pd(t);for(let r=1;r<Qn.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 nv=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Pd(Wn);const iv=[...ao.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],di=[{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"}],ov=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:di[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:di[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:di[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:di[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:di[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:di[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:di[6],link:""}],rv=[...ao.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],av={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:{...qy(),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:ov},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"}},...Xy(),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"}},...Yy,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",...Qy,...Cr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:_l({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},...Cr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:_l({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},...Cr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...tv(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...iv.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}},...ao.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",...rv]},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__",ev]}],paletteBookmark:{items:[...nv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},sv={element:zy,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ny(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:[...ko.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...ko.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:av,sourceCode:Vy},Nl=300,jn=.004,lv={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"},cv=["hover","focus","filled","success","error"];function dv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Hl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ol(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:W.scalingValue((o-t)/2,i)}}function uv(e){return`
|
|
13313
13313
|
.${e}-wrapper {
|
|
13314
13314
|
box-sizing: border-box;
|
|
13315
13315
|
display: flex;
|
|
@@ -13371,7 +13371,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13371
13371
|
display: flex;
|
|
13372
13372
|
align-items: center;
|
|
13373
13373
|
justify-content: space-between;
|
|
13374
|
-
gap: ${
|
|
13374
|
+
gap: ${dv(20)};
|
|
13375
13375
|
width: 100%;
|
|
13376
13376
|
min-width: 0;
|
|
13377
13377
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -13399,7 +13399,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13399
13399
|
width: var(--${e}-icon-max-width);
|
|
13400
13400
|
height: var(--${e}-icon-max-width);
|
|
13401
13401
|
position: relative;
|
|
13402
|
-
transition: transform ${
|
|
13402
|
+
transition: transform ${Nl}ms ease;
|
|
13403
13403
|
}
|
|
13404
13404
|
.${e}-icon-custom {
|
|
13405
13405
|
display: flex;
|
|
@@ -13436,7 +13436,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13436
13436
|
.${e}-panel {
|
|
13437
13437
|
display: grid;
|
|
13438
13438
|
grid-template-rows: 0fr;
|
|
13439
|
-
transition: grid-template-rows ${
|
|
13439
|
+
transition: grid-template-rows ${Nl}ms ease;
|
|
13440
13440
|
}
|
|
13441
13441
|
.${e}-item-open .${e}-panel {
|
|
13442
13442
|
grid-template-rows: 1fr;
|
|
@@ -13474,7 +13474,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13474
13474
|
pointer-events: none;
|
|
13475
13475
|
z-index: 2;
|
|
13476
13476
|
}
|
|
13477
|
-
`}function
|
|
13477
|
+
`}function Dl(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 pv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=W.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:x="default",autoclose:g="off",icon:m,iconMaxWidth:h=.00833,iconPaddingRight:f=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:R="#000000",dividerColor:H="#0000001F",iconColor:S="#000000",questionHoverColor:U="#666666",iconHoverColor:F="#666666",iconActiveColor:_="#000000",dividerHoverColor:B="#000000",questionFontFamily:L,questionFontSettings:N,questionFontSize:k,questionLineHeight:Z,questionLetterSpacing:E,questionWordSpacing:K,questionTextAppearance:D,answerFontFamily:j,answerFontSettings:$,answerFontSize:v,answerLineHeight:w,answerLetterSpacing:P,answerWordSpacing:Q,answerTextAppearance:z,questionPaddingLeft:T=0,questionPaddingTop:O=0,questionPaddingBottom:M=0,answerPaddingLeft:ee=0,answerPaddingRight:V=0,answerPaddingTop:me=0,answerPaddingBottom:Ie=0}=e,ge=t??[],[ae,ne]=s.useState(()=>new Set),oe=!n||i;s.useEffect(()=>{ne(new Set)},[g]),s.useEffect(()=>{n&&!o&&!i&&ne(new Set)},[n,o,i]);const ie=Ye=>W.scalingValue(Ye,n??!1),Ae=Math.max(T,jn),be=Math.max(O,jn),Me=Math.max(M,jn),q=Math.max(ee,jn),se=Math.max(V,jn),he=Math.max(me,jn),G=Math.max(Ie,jn),re=Math.max(0,(c??1)-f-h),pe=Math.max(0,(c??1)-V),we=Math.max(0,(c??1)-ee),Pe=Math.max(f,jn),Ce=Math.max(0,(c??1)-T-h),Y=s.useMemo(()=>ae.size===0?0:Math.min(...ae),[ae]),xe=s.useCallback(Ye=>ae.has(Ye),[ae]),ue=oe&&x==="default"?`${l}-entry-hover-default`:"",X=m??"",le=X!=="",Fe=C.replace(/^rotate /,""),fe=`${l}-icon-anim-${Fe}`,J=an(Ut(Dl(L,N,k,Z,E,K,D,y),n)),Xe=an(Ut(Dl(j,$,v,w,P,Q,z,R),n)),Oe=Hl(k,Z,`${l}-question`,`${l}-text-tight-leading`),dt=Hl(v,w,`${l}-answer-text`,`${l}-text-tight-leading`),nt=Ol(k,Z,l,n),ht=Ol(v,w,l,n),st=W.buildColorVars(l,{questionColor:y,answerColor:R,dividerColor:H,iconColor:S,questionHoverColor:U,iconHoverColor:F,iconActiveColor:_,dividerHoverColor:B},lv,cv),ze=r&&r!=="default"?`${l}-state-${r}`:"",Se=s.useCallback(Ye=>{oe&&ne(de=>{if(de.has(Ye)){const Ee=new Set(de);return Ee.delete(Ye),Ee}if(g==="on")return new Set([Ye]);const ve=new Set(de);return ve.add(Ye),ve})},[oe,g]),_e=s.useMemo(()=>uv(l),[l]),Be={[`--${l}-divider-width`]:W.scalingValue(p,n??!1),[`--${l}-divider-style`]:b,[`--${l}-icon-max-width`]:W.scalingValue(h,n??!1),...u>0?{[`--${l}-question-min-height`]:W.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_e}}),a.jsx("div",{style:st,children:a.jsx("div",{className:ut(`${l}-wrapper`,n&&!i&&`${l}-editor`,ue,ze),style:{width:W.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:ge.map((Ye,de)=>{var at;const ve=xe(de),Ee=((at=Ye.question)==null?void 0:at.trim())??"",Ge=Ye.answer,Ze=((Ge==null?void 0:Ge.length)??0)>0,Ve=d&&de===Y;return a.jsxs("div",{className:ut(`${l}-item`,ve&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Ve&&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:ie(be)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(re),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ie(Ae),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:ie(Pe),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ve,style:{...J,...nt,paddingLeft:ie(T),paddingRight:ie(f)},onClick:()=>Se(de),children:[O>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:ie(O)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Oe,children:Ee}),Ze&&(le?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${fe}`,"aria-hidden":"true",children:a.jsx(sn,{url:X,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"}))]}),M>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:ie(M)},"aria-hidden":"true"})]}),Ve&&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:ie(Me)}})]}),Ze&&Ge&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!ve,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Ve&&ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:ie(he)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","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-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ie(q),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:ie(se),height:"100%"}})]}),me>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:ie(me)}}),a.jsx("div",{className:`${l}-answer`,style:{...Xe,...ht,paddingLeft:ie(ee),paddingRight:ie(V)},children:a.jsx("div",{className:dt,children:a.jsx(Si,{content:Ge})})}),Ie>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:ie(Ie)}}),Ve&&ve&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ie(G)}})]})})})]},de)})})})]})}const mv=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13478
13478
|
import cn from 'classnames';
|
|
13479
13479
|
import { CommonComponentProps } from '../props';
|
|
13480
13480
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14222,7 +14222,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14222
14222
|
</>
|
|
14223
14223
|
);
|
|
14224
14224
|
}
|
|
14225
|
-
`;function zn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Dl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],gv={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:zn("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:{...Dl.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:{...Dl.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:zn("Question Padding Left"),questionPaddingTop:zn("Question Padding Top"),questionPaddingBottom:zn("Question Padding Bottom"),answerPaddingLeft:zn("Answer Padding Left"),answerPaddingRight:zn("Answer Padding Right"),answerPaddingTop:zn("Answer Padding Top"),answerPaddingBottom:zn("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:[...mv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},hv={element:uv,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:gv,sourceCode:pv},Nn=e=>e.display==="cover",Jr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Bl=100,fv=.2,jl=8,Ed=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,c]=s.useState(!1),d=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Bl:Math.max(Bl,window.innerHeight*fv),[]),v=s.useCallback(b=>Math.max(0,1-b/(p*1.5)),[p]),f=s.useCallback(b=>Math.max(0,1-b/(p*.45)),[p]),h=s.useCallback(b=>{const H=typeof window<"u"?window.innerHeight:800,E=Math.max(.88,1-b/H*.12);return`translateY(${b}px) scale(${E})`},[]),g=s.useCallback(()=>{d.current=null},[]),m=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),g()},[n,g]),x=s.useCallback(()=>{const b=typeof window<"u"?window.innerHeight:800;c(!0),r(b),window.setTimeout(()=>{t(),g(),c(!1)},Math.min(n,200))},[n,t,g]),T=s.useCallback(b=>{!e||l||b.pointerType==="touch"&&(i!=null&&i(b.target)||(d.current={startX:b.clientX,startY:b.clientY,isLocked:null,pointerId:b.pointerId}))},[e,l,i]),y=s.useCallback(b=>{const H=d.current;if(!e||!H||b.pointerType!=="touch"||H.pointerId!==b.pointerId)return;const E=b.clientX-H.startX,$=b.clientY-H.startY;if(H.isLocked===null){if(Math.abs(E)<jl&&Math.abs($)<jl)return;if($>0&&$>Math.abs(E))H.isLocked=!0,b.currentTarget.setPointerCapture(b.pointerId);else{H.isLocked=!1,g();return}}if(!H.isLocked)return;b.preventDefault();const S=Math.max(0,$);u.current=S,r(S)},[e,g]),w=s.useCallback(b=>{const H=d.current;if(!e||!H||b.pointerType!=="touch"||H.pointerId!==b.pointerId)return;const E=H.isLocked===!0;if(b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),!E){g();return}b.clientY-H.startY>=p?x():m()},[p,x,e,g,m]),B=s.useCallback(b=>{w(b)},[w]),M=s.useCallback(b=>{w(b)},[w]),G=o>0,O=l?`transform ${n}ms ease`:"none",_=l?`opacity ${n}ms ease`:"none",j=o>0||l;return{isSwipeDragging:G,backdropStyle:{opacity:v(o),transition:_},mediaAreaStyle:{transform:h(o),transition:O,touchAction:G?"none":void 0,willChange:G?"transform":void 0},overlayContentStyle:j?{opacity:f(o),transition:_}:void 0,swipeHandlers:e?{onPointerDown:T,onPointerMove:y,onPointerUp:B,onPointerCancel:M}:{},dismissAreaStyle:e?{touchAction:G?"none":"pan-x"}:void 0}},yv="[data-lightbox-scrollable]",Md=()=>{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=c=>{const d=c.target;d instanceof Element&&d.closest(yv)||c.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"})}},[])},vv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},xv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},bv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},wv=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(g,m)=>{xv(t),e.scrollLeft=g,m&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,v=0;const f=()=>{t.removeEventListener("transitionend",h),clearTimeout(v)},h=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,f(),u(n,!0))};return t.addEventListener("transitionend",h),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(${d}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,f(),u(n,!0))},i+64),()=>{p||(p=!0,f(),u(l-bv(t),!1))}},$o=300,Sv=900,$v=1500,Cv="cubic-bezier(0.16, 1, 0.3, 1)",Tv=3e3,Lv=2,Rv=16,Iv=.05,Pv=1,sr=.3,Ev=50,Mv=20,Ri=.004,Zi=["title1","title2","title3"],kv={title1:"1",title2:"2",title3:"3"},Av={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Fv={title1:.02,title2:.02,title3:.02},lr=e=>`max(${e}, ${Mv}px)`,_v=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]}},Wv=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=_v(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Nv=e=>[zt(e,"fontFamily"),zt(e,"fontSettings"),{type:"row",items:[zt(e,"fontSize"),zt(e,"lineHeight"),zt(e,"letterSpacing"),zt(e,"wordSpacing")]},zt(e,"textAlign"),zt(e,"textAppearance")],Hv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Zi.map(e=>[kv[e],Nv(e)]))}),Ws=(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},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},kd=(e,t)=>Ws(e,t),cr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},zl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ws(e.length,n),effective:kd(e.length,n)}},Ov=(e,t,n,i,o,r,l)=>{const c=[];return t&&c.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&c.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&c.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),c},$a=(e,t)=>{const n=i=>{const o=zt(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[Av[t]]}},Dv=(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),Ca=(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??Fv[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},Bv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:f,closeIconMaxWidth:h,closeIconColor:g,closeIconHoverColor:m,thumbnailTrigger:x,thumbnailVisibility:T,thumbnailObjectFit:y,thumbnailActive:w,thumbnailActiveColor:B,title1Width:M,title2Width:G,title3Width:O,title1MarginLeft:_=0,title2MarginLeft:j=0,title3MarginLeft:b=0,titleRowMarginBottom:H=0,titleHeaderLayout:E="desktop",contentMarginTop:$,iconMarginLeft:S}=n,P=L=>W.scalingValue(L,i??!1),I=d??n.thumnailSize??.03,N=P(I),z=P(u),C=P(p??.02),R=P(v??0),D=P($??0),ie=lr(D),ee=P(S??0),[A,ae]=s.useState(0),k=s.useRef(A);k.current=A;const J=t[A],{title1:X,title2:me,title3:Le}=Wv(J),he=Ca("title1",$a(n,"title1"),i),K=Ca("title2",$a(n,"title2"),i),V=Ca("title3",$a(n,"title3"),i),Y=E==="mobile",Q=!o&&(!i||r),Te=Q,we=Q,ke=Q,le=Nn(y),ge=le?{"--image-aspect-ratio":Jr(y)}:void 0,be=!!(X||me||Le),ne=s.useMemo(()=>Ov(e,X,me,Le,he,K,V),[e,A,X,me,Le,he,K,V]),ce=s.useMemo(()=>({title1Width:M,title2Width:G,title3Width:O}),[M,G,O]),ue=s.useMemo(()=>ne.map(L=>ce[L.widthKey]),[ne,ce]),xe=s.useMemo(()=>Ws(ne.length,ue),[ne.length,ue]),Ae=s.useMemo(()=>kd(ne.length,ue),[ne.length,ue]),Ie=s.useMemo(()=>ne.filter(L=>L.prefix==="title1"),[ne]),U=s.useMemo(()=>ne.filter(L=>L.prefix==="title2"||L.prefix==="title3"),[ne]),ve=s.useMemo(()=>zl(Ie,ce),[Ie,ce]),de=s.useMemo(()=>zl(U,ce),[U,ce]),q=s.useCallback((L,te)=>{const oe=ne.indexOf(L);if(!Y||te==="single-row")return{effectiveWidth:Ae[oe]??0,resolvedWidth:xe[oe]??0,maxWidth:cr(oe,xe)};if(te==="two-row-top"){const He=Ie.indexOf(L);return{effectiveWidth:ve.effective[He]??0,resolvedWidth:ve.resolved[He]??0,maxWidth:cr(He,ve.resolved)}}const Ce=U.indexOf(L);return{effectiveWidth:de.effective[Ce]??0,resolvedWidth:de.resolved[Ce]??0,maxWidth:cr(Ce,de.resolved)}},[U,de,Ae,xe,ne,Ie,ve,Y]),re=s.useCallback(L=>W.scalingValue(L,i??!1),[i]),Fe=re(H??0),pe=s.useMemo(()=>({title1MarginLeft:_,title2MarginLeft:j,title3MarginLeft:b}),[_,j,b]),Z=s.useCallback(L=>ne.slice(0,L+1).reduce((te,oe,Ce)=>te+(oe!=null&&oe.marginLeftKey?pe[oe.marginLeftKey]??0:0)+(xe[Ce]??0),0)+(Y?0:_??0),[ne,pe,xe,Y,_]),Xe=s.useCallback(()=>Y?0:_??0,[Y,_]),Oe=s.useCallback(L=>U.slice(0,L).reduce((te,oe,Ce)=>te+(oe.marginLeftKey?pe[oe.marginLeftKey]??0:0)+(de.resolved[Ce]??0),0),[U,de.resolved,pe]),dt=s.useCallback(L=>{const te=U[L];return Oe(L)+(te.marginLeftKey?pe[te.marginLeftKey]??0:0)+(de.resolved[L]??0)},[U,de.resolved,Oe,pe]),nt=(L,te)=>{const oe=L.marginLeftKey?pe[L.marginLeftKey]??0:0,{effectiveWidth:Ce,resolvedWidth:He,maxWidth:Ye}=q(L,te),bt=o&&te==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":L.prefix,style:{...te==="single-row"?{gridArea:L.prefix}:{},width:re(Ce),...oe>0?{marginLeft:re(oe)}:{}},children:[a.jsx("p",{className:L.className,style:L.style,children:L.text}),bt&&L.marginLeftKey&&a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:re(-oe),width:`max(${re(oe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ye),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:re(-Ri/2),width:re(Ri),height:"100%",pointerEvents:"auto"}})]},L.className)},ht=()=>{const L=Y?-1:ne.findIndex(Ce=>Ce.prefix==="title1"),te=!Y&&(o||(_??0)>0)?(()=>{const Ce=_??0,He=L>=0?xe[L]:M??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:0,width:`max(${re(Ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,oe=ne.flatMap((Ce,He)=>{if(!Ce.marginLeftKey)return[];const Ye=pe[Ce.marginLeftKey]??0,bt=Dv(ne,xe,pe,He)+Xe();return a.jsx("div",{"data-controls":Ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe[He]),style:{position:"absolute",top:0,left:re(bt),width:`max(${re(Ye)}, 10px)`,height:"100%",pointerEvents:"auto"}},Ce.marginLeftKey)});return te?[te,...oe]:oe},st=()=>ne.map((L,te)=>{const oe=cr(te,xe),He=Z(te)-Ri/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:re(He),width:re(Ri),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),ze=()=>U.flatMap((L,te)=>{if(!L.marginLeftKey)return[];const oe=pe[L.marginLeftKey]??0,Ce=Oe(te),{resolvedWidth:He}=q(L,"two-row-bottom");return a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:re(Ce),width:`max(${re(oe)}, 10px)`,height:"100%",pointerEvents:"auto"}},L.marginLeftKey)}),Se=()=>U.map((L,te)=>{const{maxWidth:oe}=q(L,"two-row-bottom"),He=dt(te)-Ri/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:re(He),width:re(Ri),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),_e=s.useRef(null),Be=s.useRef(null),Ke=s.useRef(null),se=s.useRef(null),ye=s.useRef([]),Ee=s.useRef([]),Ge=s.useRef(0),Ze=s.useRef(null),Ve=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),at=s.useRef(null),Je=s.useRef(null),Me=s.useRef(0),qe=s.useRef("forward"),We=s.useRef(0),tt=s.useRef(null),rt=s.useRef(!1),lt=t.length>1&&(!o||!!r),Tt=lt?3:1,Xt=s.useMemo(()=>Array.from({length:Tt},()=>t).flat(),[t,Tt]),[Zt,xt]=s.useState(!1),[wt,Bt]=s.useState(!1),[At,vt]=s.useState(!0),Ft=s.useRef(null),Wt=s.useRef(null),Kt=s.useRef(!1),Jt=s.useRef(!1),Ct=s.useRef(null),Nt=s.useRef(null),rn=Te&&!At,mt=s.useCallback(()=>{Te&&(vt(!0),Nt.current&&clearTimeout(Nt.current),Nt.current=setTimeout(()=>{Ve.current.isActive||vt(!1)},Tv))},[Te]),Re=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,Bt(!1),Ct.current=setTimeout(()=>{l()},$o))},[o,l]),De=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:W.scalingValue(h??0,i),height:W.scalingValue(h??0,i),marginRight:ee,"--close-icon-hover-color":m},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Re,"aria-label":"Close",children:a.jsx(sn,{url:f,fill:g,hoverFill:i&&!r?g:m,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:ee,height:"100%",pointerEvents:"auto"}})]}),it=(L="two-row")=>a.jsx("div",{...L==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:re(_??0),flexShrink:0,...L==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...L==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const L=ne.find(Ce=>Ce.prefix==="title1"),te=ne.filter(Ce=>Ce.prefix==="title2"||Ce.prefix==="title3"),oe=te.length>0||o||(H??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(_??0)>0||o?it():null,L&&nt(L,"two-row-top"),f&&De()]}),oe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[te.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[te.map(Ce=>nt(Ce,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[ze(),Se()]})]}):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:Fe,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(_??0)>0||o?it("single-row"):null,ne.map(L=>nt(L,"single-row")),o?a.jsxs(a.Fragment,{children:[ht(),st()]}):null,f?De():null]}),It=s.useCallback(L=>!!(L.closest("[data-controls]")||L.closest(`.${e}-thumbnails`)||L.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:pt,backdropStyle:jt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Vt,dismissAreaStyle:Gt}=Ed({enabled:Q??!1,onClose:Re,animMs:$o,isBlockedTarget:It}),Ht=()=>{if(!lt||t.length===0)return Ge.current=0,0;const L=Ee.current[0],te=Ee.current[t.length];if(!L||!te)return Ge.current;const oe=te.offsetLeft-L.offsetLeft;return oe>0&&(Ge.current=oe),Ge.current},Ot=(L=!1)=>{if(!lt)return;const te=Be.current,oe=Ht();!te||oe<=0||oe<te.clientWidth*.25||(te.scrollLeft<=0?(te.scrollLeft+=oe,L&&(Ve.current.scrollLeft+=oe),rt.current&&(We.current+=oe)):te.scrollLeft>=oe*2&&(te.scrollLeft-=oe,L&&(Ve.current.scrollLeft-=oe),rt.current&&(We.current-=oe)))},_t=(L,te=(oe=>(oe=Be.current)==null?void 0:oe.scrollLeft)()??0)=>{if(!lt)return L;let Ce=t.length+L,He=1/0;for(let Ye=0;Ye<Tt;Ye++){const bt=Ye*t.length+L,Rt=Ee.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-te);tn<He&&(He=tn,Ce=bt)}return Ce},St=L=>{const te=Be.current;return!L||!te?!1:L.offsetWidth>te.clientWidth+1},F=L=>{const te=Be.current;if(!L||!te||!St(L))return!1;const oe=L.offsetLeft,Ce=oe+L.offsetWidth;return te.scrollLeft>=oe-1&&te.scrollLeft+te.clientWidth<=Ce+1},$e=(L=(te=>(te=Be.current)==null?void 0:te.scrollLeft)()??0)=>{for(let Ce=0;Ce<Ee.current.length;Ce+=1){const He=Ee.current[Ce];if(He&&F(He))return Ce}let oe={flatIndex:0,distance:1/0};return Ee.current.forEach((Ce,He)=>{if(!Ce)return;const Ye=Math.abs(Ce.offsetLeft-L);Ye<oe.distance&&(oe={flatIndex:He,distance:Ye})}),oe.flatIndex},Pe=L=>{Be.current&&Ee.current.forEach(te=>{te&&(te.style.scrollSnapAlign=St(te)&&L==="backward"?"end":"start")})},Ne=(L,te,oe)=>{const Ce=L-te,He=$e(te),Ye=Ee.current[He];if(F(Ye))return $e(L)%t.length;const bt=Ee.current[He+1],Rt=Ye?bt?bt.offsetLeft-Ye.offsetLeft:Ye.offsetWidth:0,tn=Rt>0?Ce>Rt*sr?1:Ce<-Rt*sr?-1:0:0;return tn===0?oe:lt?(oe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,oe+tn))},ot=s.useCallback((L=!1)=>{if(T!=="on"||o)return;const te=se.current,oe=k.current,Ce=ye.current[oe];if(!te||!Ce||te.scrollWidth<=te.clientWidth)return;const He=te.scrollLeft,Ye=He+te.clientWidth,bt=Ce.offsetLeft,Rt=bt+Ce.offsetWidth;if(bt>=He&&Rt<=Ye)return;const tn=te.scrollWidth-te.clientWidth;let Qt=He;if(!L&&Ft.current===null){const Ci=ye.current[oe-1],ao=ye.current[oe+1],Zo=Ci?Ce.offsetLeft-Ci.offsetLeft:ao?ao.offsetLeft-Ce.offsetLeft:Ce.offsetWidth;Rt>Ye?Qt+=Zo:bt<He&&(Qt-=Zo)}else Rt>Ye?Qt=Rt-te.clientWidth:Qt=bt;te.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,T]),Et=s.useCallback((L=!1)=>{L&&(Kt.current=!0),Wt.current===null&&(Wt.current=requestAnimationFrame(()=>{Wt.current=null;const te=Kt.current;Kt.current=!1,ot(te)}))},[ot]),Qe=s.useCallback(L=>{if(L===k.current)return;const te=k.current;k.current=L;const oe=Math.abs(L-te)>1,Ce=lt&&t.length>1&&(te===t.length-1&&L===0||te===0&&L===t.length-1);ae(L),Et(oe||Ce)},[t.length,lt,Et]),yt=()=>{if(!Be.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const L=Be.current.scrollLeft,te=$e(L)%t.length;te!==k.current&&Qe(te)},Dt=()=>{Ft.current=null},Lt=L=>{const te=Be.current;te&&(te.style.scrollSnapType=L?"":"none")},nn=()=>{var L;(L=Je.current)==null||L.call(Je),Je.current=null},un=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),rt.current=!1},oi=()=>{const L=Be.current;if(!L){tt.current=null,rt.current=!1;return}const te=We.current-L.scrollLeft;if(Math.abs(te)<.5){L.scrollLeft=We.current,Ot(),yt(),tt.current=null,rt.current=!1;return}L.scrollLeft+=te*Iv,Ot(),yt(),mt(),tt.current=requestAnimationFrame(oi)},ri=()=>{const L=Ke.current;L&&(L.style.transition="",L.style.transform="",L.style.willChange="")},Xo=(L,te,oe,Ce)=>{ri(),L.scrollLeft=te,Me.current=L.scrollLeft,Ot(),oe!==void 0?(k.current=oe,ae(oe)):yt(),Lt(!0),Ce==null||Ce()},Uo=(L,{behavior:te="smooth",activeIndex:oe,onComplete:Ce}={})=>{const He=Be.current,Ye=Ke.current;if(!He||!Ye)return;if(un(),nn(),Lt(!1),te==="auto"){Xo(He,L,oe,Ce);return}const bt=Math.abs(L-He.scrollLeft),Rt=vv(bt,Sv,$v,He.clientWidth*.55);Je.current=wv(He,Ye,L,{duration:Rt,easing:Cv,onComplete:()=>{Je.current=null,Xo(He,L,oe,Ce)}})},ea=(L="smooth")=>{const te=Be.current;if(!te||t.length===0)return;const oe=$e()%t.length,Ce=_t(oe,te.scrollLeft),He=Ee.current[Ce];He&&Uo(He.offsetLeft,{behavior:L,activeIndex:oe})},ta=(L,te="smooth",oe,Ce)=>{const He=Be.current;if(!He||t.length===0)return;const Ye=(Ce??He.scrollLeft)-L,bt=$e(L),Rt=Ee.current[bt];if(F(Rt)){Lt(!0),yt();return}const tn=Ee.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Ye>Qt*sr?1:Ye<-Qt*sr?-1:0:0)!==0){const ou=oe??bt%t.length,ru=Ne(Ce??He.scrollLeft,L,ou);Cn(ru,te);return}const ao=Ce??He.scrollLeft,Zo=$e(ao),Ds=Ee.current[Zo];if(Ds&&Math.abs(Ds.offsetLeft-ao)<1){Lt(!0),yt();return}ea("auto")},Cn=(L,te="smooth")=>{const oe=Be.current;if(!oe||t.length===0)return;const Ce=_t(L,oe.scrollLeft),He=Ee.current[Ce];He&&(te==="smooth"?Ft.current=L:Ft.current=null,k.current=L,ae(L),Et(!0),Uo(He.offsetLeft,{behavior:te,activeIndex:L,onComplete:te==="smooth"?Dt:void 0}))},$i=()=>{at.current&&(window.removeEventListener("pointerup",at.current),window.removeEventListener("pointercancel",at.current),at.current=null)},Ko=(L,te,oe,Ce,He)=>{const Ye=oe-L,bt=Ce-te,Rt=Math.abs(Ye),tn=Math.abs(bt);if(Rt<Ev||Rt<=tn)return!1;const Qt=Ye<0?1:-1,Ci=lt?(He+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,He+Qt));return Ci===He?!1:(Cn(Ci),!0)},ai=L=>{if(!Ve.current.isActive)return;$i();const te=Be.current;if(!te)return;const{scrollLeft:oe,startActiveIndex:Ce,hasMoved:He}=Ve.current,Ye=te.scrollLeft;Ot(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},xt(!1),L!==void 0&&te.hasPointerCapture(L)&&te.releasePointerCapture(L),He?ta(oe,"smooth",Ce,Ye):(Lt(!0),yt()),mt()},Yo=(L,te)=>{const oe=Ze.current;Ze.current=null,oe&&(Ko(oe.startX,oe.startY,L,te,oe.startActiveIndex),mt())},na=L=>{if(!we)return;if(L.pointerType==="touch"){if(un(),Lt(!0),It(L.target))return;Ze.current={startX:L.clientX,startY:L.clientY,startActiveIndex:k.current};return}if(L.pointerType!=="mouse"||L.button!==0||It(L.target))return;const te=Be.current;if(!te)return;un(),nn(),ri(),Ft.current=null,Ve.current={isActive:!0,startX:L.clientX,scrollLeft:te.scrollLeft,startActiveIndex:k.current,hasMoved:!1},Lt(!1),mt(),te.setPointerCapture(L.pointerId),$i();const oe=Ce=>{Ce.pointerType==="mouse"&&ai(Ce.pointerId)};at.current=oe,window.addEventListener("pointerup",oe),window.addEventListener("pointercancel",oe)},ia=L=>{if(!we||L.pointerType!=="mouse")return;const te=Be.current;if(!te||!Ve.current.isActive)return;if(L.buttons===0){ai(L.pointerId);return}const oe=L.clientX-Ve.current.startX;Math.abs(oe)>Pv&&(Ve.current.hasMoved=!0,xt(!0)),Ve.current.hasMoved&&(L.preventDefault(),te.scrollLeft=Ve.current.scrollLeft-oe,Ot(!0),yt(),mt())},fe=L=>{if(we){if(L.pointerType==="touch"){L.type==="pointerup"?Yo(L.clientX,L.clientY):Ze.current=null;return}L.pointerType==="mouse"&&ai(L.pointerId)}},je=L=>{!we||L.pointerType!=="mouse"||ai(L.pointerId)};return Md(),s.useEffect(()=>{const L=requestAnimationFrame(()=>Bt(!0));return()=>{cancelAnimationFrame(L),nn(),$i(),Wt.current!==null&&(cancelAnimationFrame(Wt.current),Wt.current=null),Ct.current&&clearTimeout(Ct.current),Nt.current&&clearTimeout(Nt.current)}},[]),s.useEffect(()=>{if(!Te){vt(!0);return}mt();const L=_e.current;if(!L)return;const te=()=>mt();return L.addEventListener("pointermove",te),L.addEventListener("pointerdown",te),()=>{L.removeEventListener("pointermove",te),L.removeEventListener("pointerdown",te),Nt.current&&clearTimeout(Nt.current)}},[Te,mt]),s.useEffect(()=>{const L=te=>{te.key==="Escape"&&Re()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[Re]),s.useLayoutEffect(()=>{Ht()},[R,t.length,lt]),s.useLayoutEffect(()=>{o||Cn(k.current,"auto")},[R,o]),s.useLayoutEffect(()=>{Cn(0,"auto")},[t.length,lt]),s.useEffect(()=>{const L=Be.current;if(!L||o||!Q)return;const te=oe=>{if(oe.preventDefault(),Math.abs(oe.deltaY)<=Math.abs(oe.deltaX))return;const Ce=oe.deltaMode===1?Rv:oe.deltaMode===2?L.clientHeight:1,He=oe.deltaY*Ce*Lv;if(He!==0){if(nn(),rt.current||(rt.current=!0,We.current=L.scrollLeft,Ft.current=null,Lt(!1)),We.current+=He,!lt){const Ye=L.scrollWidth-L.clientWidth;We.current=Math.max(0,Math.min(Ye,We.current))}mt(),tt.current===null&&(tt.current=requestAnimationFrame(oi))}};return L.addEventListener("wheel",te,{passive:!1}),()=>{L.removeEventListener("wheel",te),un()}},[o,Q,lt]),s.useEffect(()=>{const L=Be.current;if(!L)return;const te=()=>{Ot(Ve.current.isActive);const Ce=L.scrollLeft,He=Ce-Me.current;Me.current=Ce;const Ye=Ge.current>0?Ge.current*.5:1/0;if(He!==0&&Math.abs(He)<Ye){const bt=He>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Pe(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};L.addEventListener("scroll",te,{passive:!0});const oe=new ResizeObserver(()=>{Ht(),Ot(Ve.current.isActive),Pe(qe.current),yt()});return oe.observe(L),()=>{nn(),L.removeEventListener("scroll",te),oe.disconnect()}},[t.length,lt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{pt||Re()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${$o}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...jt}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:L=>L.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:na,onPointerMove:ia,onPointerUp:fe,onPointerCancel:fe,onLostPointerCapture:je,children:a.jsx("div",{ref:Ke,className:`${e}-lightbox-strip-track`,style:{gap:R},children:Xt.map((L,te)=>{const oe=L.image.objectFit??"contain",Ce=te%t.length,He=Math.floor(te/t.length),Ye=lr(R),bt=`calc(-0.5 * (${Ye} + ${R}))`;return a.jsxs("div",{ref:Rt=>Ee.current[te]=Rt,className:`${e}-strip-item`,style:{height:E==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:L.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:oe}}),o&&Ce<t.length-1&&He===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Ye,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${He}-${L.image.url}-${Ce}`)})})})}),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:D,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:ie,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${Y?` ${e}-lightbox-content-area-stacked`:""}`,children:(be||f)&&a.jsx("div",{className:`${e}-header ${Y?`${e}-header-two-row`:`${e}-header-single-row`}`,children:Y?gt():be||f?ft():null})})})]}),t.length>1&&T==="on"&&(()=>{const L=lr(C),te=`calc(-0.5 * (${C} + ${L}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:C},children:a.jsx("div",{ref:se,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:oe=>oe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:z,"--thumbnail-active-color":B},children:[t.map((oe,Ce)=>{const He=lr(z),Ye=`calc(-0.5 * (${He} + ${z}))`;return a.jsxs("div",{ref:bt=>{ye.current[Ce]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===Ce?"true":"false",onClick:()=>Q&&x==="click"&&Cn(Ce),onMouseEnter:()=>ke&&x==="hover"&&Cn(Ce),"aria-label":oe.image.name?`View ${oe.image.name}`:`View image ${Ce+1}`,"aria-current":A===Ce?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${le?` ${e}-thumb-image-cover`:""}`,src:oe.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:N,maxHeight:N,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Ce<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ye,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${oe.image.url}-${Ce}`)}),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:te,height:L,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function jv(e){return`
|
|
14225
|
+
`;function zn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Bl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},gv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],hv={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:zn("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:{...Bl.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:{...Bl.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:zn("Question Padding Left"),questionPaddingTop:zn("Question Padding Top"),questionPaddingBottom:zn("Question Padding Bottom"),answerPaddingLeft:zn("Answer Padding Left"),answerPaddingRight:zn("Answer Padding Right"),answerPaddingTop:zn("Answer Padding Top"),answerPaddingBottom:zn("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:[...gv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},fv={element:pv,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:hv,sourceCode:mv},Nn=e=>e.display==="cover",Qr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},jl=100,yv=.2,zl=8,Ed=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?jl:Math.max(jl,window.innerHeight*yv),[]),b=s.useCallback(L=>Math.max(0,1-L/(p*1.5)),[p]),x=s.useCallback(L=>Math.max(0,1-L/(p*.45)),[p]),g=s.useCallback(L=>{const N=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-L/N*.12);return`translateY(${L}px) scale(${k})`},[]),m=s.useCallback(()=>{c.current=null},[]),h=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),m()},[n,m]),f=s.useCallback(()=>{const L=typeof window<"u"?window.innerHeight:800;d(!0),r(L),window.setTimeout(()=>{t(),m(),d(!1)},Math.min(n,200))},[n,t,m]),C=s.useCallback(L=>{!e||l||L.pointerType==="touch"&&(i!=null&&i(L.target)||(c.current={startX:L.clientX,startY:L.clientY,isLocked:null,pointerId:L.pointerId}))},[e,l,i]),y=s.useCallback(L=>{const N=c.current;if(!e||!N||L.pointerType!=="touch"||N.pointerId!==L.pointerId)return;const k=L.clientX-N.startX,Z=L.clientY-N.startY;if(N.isLocked===null){if(Math.abs(k)<zl&&Math.abs(Z)<zl)return;if(Z>0&&Z>Math.abs(k))N.isLocked=!0,L.currentTarget.setPointerCapture(L.pointerId);else{N.isLocked=!1,m();return}}if(!N.isLocked)return;L.preventDefault();const E=Math.max(0,Z);u.current=E,r(E)},[e,m]),R=s.useCallback(L=>{const N=c.current;if(!e||!N||L.pointerType!=="touch"||N.pointerId!==L.pointerId)return;const k=N.isLocked===!0;if(L.currentTarget.hasPointerCapture(L.pointerId)&&L.currentTarget.releasePointerCapture(L.pointerId),!k){m();return}L.clientY-N.startY>=p?f():h()},[p,f,e,m,h]),H=s.useCallback(L=>{R(L)},[R]),S=s.useCallback(L=>{R(L)},[R]),U=o>0,F=l?`transform ${n}ms ease`:"none",_=l?`opacity ${n}ms ease`:"none",B=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:b(o),transition:_},mediaAreaStyle:{transform:g(o),transition:F,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:B?{opacity:x(o),transition:_}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:H,onPointerCancel:S}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},vv="[data-lightbox-scrollable]",Md=()=>{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(vv)||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"})}},[])},xv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},bv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},wv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Sv=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(m,h)=>{bv(t),e.scrollLeft=m,h&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const x=()=>{t.removeEventListener("transitionend",g),clearTimeout(b)},g=m=>{m.target!==t||m.propertyName!=="transform"||p||(p=!0,x(),u(n,!0))};return t.addEventListener("transitionend",g),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)`,b=window.setTimeout(()=>{p||(p=!0,x(),u(n,!0))},i+64),()=>{p||(p=!0,x(),u(l-wv(t),!1))}},$o=300,$v=900,Cv=1500,Tv="cubic-bezier(0.16, 1, 0.3, 1)",Lv=3e3,Rv=2,Iv=16,Pv=.05,Ev=1,cr=.3,Mv=50,kv=20,Ii=.004,Ji=["title1","title2","title3"],Av={title1:"1",title2:"2",title3:"3"},Fv={title1:"title1Color",title2:"title2Color",title3:"title3Color"},_v={title1:.02,title2:.02,title3:.02},dr=e=>`max(${e}, ${kv}px)`,Wv=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=Wv(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Hv=e=>[zt(e,"fontFamily"),zt(e,"fontSettings"),{type:"row",items:[zt(e,"fontSize"),zt(e,"lineHeight"),zt(e,"letterSpacing"),zt(e,"wordSpacing")]},zt(e,"textAlign"),zt(e,"textAppearance")],Ov=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ji.map(e=>[Av[e],Hv(e)]))}),Hs=(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)=>Hs(e,t),ur=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Vl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Hs(e.length,n),effective:kd(e.length,n)}},Dv=(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},Ca=(e,t)=>{const n=i=>{const o=zt(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[Fv[t]]}},Bv=(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),Ta=(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??_v[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},jv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:x,closeIconMaxWidth:g,closeIconColor:m,closeIconHoverColor:h,thumbnailTrigger:f,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:R,thumbnailActiveColor:H,title1Width:S,title2Width:U,title3Width:F,title1MarginLeft:_=0,title2MarginLeft:B=0,title3MarginLeft:L=0,titleRowMarginBottom:N=0,titleHeaderLayout:k="desktop",contentMarginTop:Z,iconMarginLeft:E}=n,K=I=>W.scalingValue(I,i??!1),D=c??n.thumnailSize??.03,j=K(D),$=K(u),v=K(p??.02),w=K(b??0),P=K(Z??0),Q=dr(P),z=K(E??0),[T,O]=s.useState(0),M=s.useRef(T);M.current=T;const ee=t[T],{title1:V,title2:me,title3:Ie}=Nv(ee),ge=Ta("title1",Ca(n,"title1"),i),ae=Ta("title2",Ca(n,"title2"),i),ne=Ta("title3",Ca(n,"title3"),i),oe=k==="mobile",ie=!o&&(!i||r),Ae=ie,be=ie,Me=ie,q=Nn(y),se=q?{"--image-aspect-ratio":Qr(y)}:void 0,he=!!(V||me||Ie),G=s.useMemo(()=>Dv(e,V,me,Ie,ge,ae,ne),[e,T,V,me,Ie,ge,ae,ne]),re=s.useMemo(()=>({title1Width:S,title2Width:U,title3Width:F}),[S,U,F]),pe=s.useMemo(()=>G.map(I=>re[I.widthKey]),[G,re]),we=s.useMemo(()=>Hs(G.length,pe),[G.length,pe]),Pe=s.useMemo(()=>kd(G.length,pe),[G.length,pe]),Ce=s.useMemo(()=>G.filter(I=>I.prefix==="title1"),[G]),Y=s.useMemo(()=>G.filter(I=>I.prefix==="title2"||I.prefix==="title3"),[G]),xe=s.useMemo(()=>Vl(Ce,re),[Ce,re]),ue=s.useMemo(()=>Vl(Y,re),[Y,re]),X=s.useCallback((I,te)=>{const ce=G.indexOf(I);if(!oe||te==="single-row")return{effectiveWidth:Pe[ce]??0,resolvedWidth:we[ce]??0,maxWidth:ur(ce,we)};if(te==="two-row-top"){const He=Ce.indexOf(I);return{effectiveWidth:xe.effective[He]??0,resolvedWidth:xe.resolved[He]??0,maxWidth:ur(He,xe.resolved)}}const Te=Y.indexOf(I);return{effectiveWidth:ue.effective[Te]??0,resolvedWidth:ue.resolved[Te]??0,maxWidth:ur(Te,ue.resolved)}},[Y,ue,Pe,we,G,Ce,xe,oe]),le=s.useCallback(I=>W.scalingValue(I,i??!1),[i]),Fe=le(N??0),fe=s.useMemo(()=>({title1MarginLeft:_,title2MarginLeft:B,title3MarginLeft:L}),[_,B,L]),J=s.useCallback(I=>G.slice(0,I+1).reduce((te,ce,Te)=>te+(ce!=null&&ce.marginLeftKey?fe[ce.marginLeftKey]??0:0)+(we[Te]??0),0)+(oe?0:_??0),[G,fe,we,oe,_]),Xe=s.useCallback(()=>oe?0:_??0,[oe,_]),Oe=s.useCallback(I=>Y.slice(0,I).reduce((te,ce,Te)=>te+(ce.marginLeftKey?fe[ce.marginLeftKey]??0:0)+(ue.resolved[Te]??0),0),[Y,ue.resolved,fe]),dt=s.useCallback(I=>{const te=Y[I];return Oe(I)+(te.marginLeftKey?fe[te.marginLeftKey]??0:0)+(ue.resolved[I]??0)},[Y,ue.resolved,Oe,fe]),nt=(I,te)=>{const ce=I.marginLeftKey?fe[I.marginLeftKey]??0:0,{effectiveWidth:Te,resolvedWidth:He,maxWidth:Ke}=X(I,te),bt=o&&te==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":I.prefix,style:{...te==="single-row"?{gridArea:I.prefix}:{},width:le(Te),...ce>0?{marginLeft:le(ce)}:{}},children:[a.jsx("p",{className:I.className,style:I.style,children:I.text}),bt&&I.marginLeftKey&&a.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:le(-ce),width:`max(${le(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-Ii/2),width:le(Ii),height:"100%",pointerEvents:"auto"}})]},I.className)},ht=()=>{const I=oe?-1:G.findIndex(Te=>Te.prefix==="title1"),te=!oe&&(o||(_??0)>0)?(()=>{const Te=_??0,He=I>=0?we[I]:S??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:0,width:`max(${le(Te)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ce=G.flatMap((Te,He)=>{if(!Te.marginLeftKey)return[];const Ke=fe[Te.marginLeftKey]??0,bt=Bv(G,we,fe,He)+Xe();return a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[He]),style:{position:"absolute",top:0,left:le(bt),width:`max(${le(Ke)}, 10px)`,height:"100%",pointerEvents:"auto"}},Te.marginLeftKey)});return te?[te,...ce]:ce},st=()=>G.map((I,te)=>{const ce=ur(te,we),He=J(te)-Ii/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ce),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(He),width:le(Ii),height:"100%",pointerEvents:"auto"}})},`${I.widthKey}-junction`)}),ze=()=>Y.flatMap((I,te)=>{if(!I.marginLeftKey)return[];const ce=fe[I.marginLeftKey]??0,Te=Oe(te),{resolvedWidth:He}=X(I,"two-row-bottom");return a.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:le(Te),width:`max(${le(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},I.marginLeftKey)}),Se=()=>Y.map((I,te)=>{const{maxWidth:ce}=X(I,"two-row-bottom"),He=dt(te)-Ii/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ce),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(He),width:le(Ii),height:"100%",pointerEvents:"auto"}})},`${I.widthKey}-junction`)}),_e=s.useRef(null),Be=s.useRef(null),Ye=s.useRef(null),de=s.useRef(null),ve=s.useRef([]),Ee=s.useRef([]),Ge=s.useRef(0),Ze=s.useRef(null),Ve=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),at=s.useRef(null),Je=s.useRef(null),ke=s.useRef(0),qe=s.useRef("forward"),We=s.useRef(0),tt=s.useRef(null),rt=s.useRef(!1),lt=t.length>1&&(!o||!!r),Tt=lt?3:1,Xt=s.useMemo(()=>Array.from({length:Tt},()=>t).flat(),[t,Tt]),[Zt,xt]=s.useState(!1),[wt,Bt]=s.useState(!1),[At,vt]=s.useState(!0),Ft=s.useRef(null),Wt=s.useRef(null),Yt=s.useRef(!1),Jt=s.useRef(!1),Ct=s.useRef(null),Nt=s.useRef(null),rn=Ae&&!At,mt=s.useCallback(()=>{Ae&&(vt(!0),Nt.current&&clearTimeout(Nt.current),Nt.current=setTimeout(()=>{Ve.current.isActive||vt(!1)},Lv))},[Ae]),Le=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,Bt(!1),Ct.current=setTimeout(()=>{l()},$o))},[o,l]),De=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:W.scalingValue(g??0,i),height:W.scalingValue(g??0,i),marginRight:z,"--close-icon-hover-color":h},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:a.jsx(sn,{url:x,fill:m,hoverFill:i&&!r?m:h,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:z,height:"100%",pointerEvents:"auto"}})]}),it=(I="two-row")=>a.jsx("div",{...I==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(_??0),flexShrink:0,...I==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...I==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const I=G.find(Te=>Te.prefix==="title1"),te=G.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),ce=te.length>0||o||(N??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(_??0)>0||o?it():null,I&&nt(I,"two-row-top"),x&&De()]}),ce?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[te.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[te.map(Te=>nt(Te,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[ze(),Se()]})]}):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:Fe,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(_??0)>0||o?it("single-row"):null,G.map(I=>nt(I,"single-row")),o?a.jsxs(a.Fragment,{children:[ht(),st()]}):null,x?De():null]}),It=s.useCallback(I=>!!(I.closest("[data-controls]")||I.closest(`.${e}-thumbnails`)||I.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:pt,backdropStyle:jt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Vt,dismissAreaStyle:Gt}=Ed({enabled:ie??!1,onClose:Le,animMs:$o,isBlockedTarget:It}),Ht=()=>{if(!lt||t.length===0)return Ge.current=0,0;const I=Ee.current[0],te=Ee.current[t.length];if(!I||!te)return Ge.current;const ce=te.offsetLeft-I.offsetLeft;return ce>0&&(Ge.current=ce),Ge.current},Ot=(I=!1)=>{if(!lt)return;const te=Be.current,ce=Ht();!te||ce<=0||ce<te.clientWidth*.25||(te.scrollLeft<=0?(te.scrollLeft+=ce,I&&(Ve.current.scrollLeft+=ce),rt.current&&(We.current+=ce)):te.scrollLeft>=ce*2&&(te.scrollLeft-=ce,I&&(Ve.current.scrollLeft-=ce),rt.current&&(We.current-=ce)))},_t=(I,te=(ce=>(ce=Be.current)==null?void 0:ce.scrollLeft)()??0)=>{if(!lt)return I;let Te=t.length+I,He=1/0;for(let Ke=0;Ke<Tt;Ke++){const bt=Ke*t.length+I,Rt=Ee.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-te);tn<He&&(He=tn,Te=bt)}return Te},St=I=>{const te=Be.current;return!I||!te?!1:I.offsetWidth>te.clientWidth+1},A=I=>{const te=Be.current;if(!I||!te||!St(I))return!1;const ce=I.offsetLeft,Te=ce+I.offsetWidth;return te.scrollLeft>=ce-1&&te.scrollLeft+te.clientWidth<=Te+1},$e=(I=(te=>(te=Be.current)==null?void 0:te.scrollLeft)()??0)=>{for(let Te=0;Te<Ee.current.length;Te+=1){const He=Ee.current[Te];if(He&&A(He))return Te}let ce={flatIndex:0,distance:1/0};return Ee.current.forEach((Te,He)=>{if(!Te)return;const Ke=Math.abs(Te.offsetLeft-I);Ke<ce.distance&&(ce={flatIndex:He,distance:Ke})}),ce.flatIndex},Re=I=>{Be.current&&Ee.current.forEach(te=>{te&&(te.style.scrollSnapAlign=St(te)&&I==="backward"?"end":"start")})},Ne=(I,te,ce)=>{const Te=I-te,He=$e(te),Ke=Ee.current[He];if(A(Ke))return $e(I)%t.length;const bt=Ee.current[He+1],Rt=Ke?bt?bt.offsetLeft-Ke.offsetLeft:Ke.offsetWidth:0,tn=Rt>0?Te>Rt*cr?1:Te<-Rt*cr?-1:0:0;return tn===0?ce:lt?(ce+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ce+tn))},ot=s.useCallback((I=!1)=>{if(C!=="on"||o)return;const te=de.current,ce=M.current,Te=ve.current[ce];if(!te||!Te||te.scrollWidth<=te.clientWidth)return;const He=te.scrollLeft,Ke=He+te.clientWidth,bt=Te.offsetLeft,Rt=bt+Te.offsetWidth;if(bt>=He&&Rt<=Ke)return;const tn=te.scrollWidth-te.clientWidth;let Qt=He;if(!I&&Ft.current===null){const Ti=ve.current[ce-1],so=ve.current[ce+1],Qo=Ti?Te.offsetLeft-Ti.offsetLeft:so?so.offsetLeft-Te.offsetLeft:Te.offsetWidth;Rt>Ke?Qt+=Qo:bt<He&&(Qt-=Qo)}else Rt>Ke?Qt=Rt-te.clientWidth:Qt=bt;te.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((I=!1)=>{I&&(Yt.current=!0),Wt.current===null&&(Wt.current=requestAnimationFrame(()=>{Wt.current=null;const te=Yt.current;Yt.current=!1,ot(te)}))},[ot]),Qe=s.useCallback(I=>{if(I===M.current)return;const te=M.current;M.current=I;const ce=Math.abs(I-te)>1,Te=lt&&t.length>1&&(te===t.length-1&&I===0||te===0&&I===t.length-1);O(I),Et(ce||Te)},[t.length,lt,Et]),yt=()=>{if(!Be.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const I=Be.current.scrollLeft,te=$e(I)%t.length;te!==M.current&&Qe(te)},Dt=()=>{Ft.current=null},Lt=I=>{const te=Be.current;te&&(te.style.scrollSnapType=I?"":"none")},nn=()=>{var I;(I=Je.current)==null||I.call(Je),Je.current=null},un=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),rt.current=!1},oi=()=>{const I=Be.current;if(!I){tt.current=null,rt.current=!1;return}const te=We.current-I.scrollLeft;if(Math.abs(te)<.5){I.scrollLeft=We.current,Ot(),yt(),tt.current=null,rt.current=!1;return}I.scrollLeft+=te*Pv,Ot(),yt(),mt(),tt.current=requestAnimationFrame(oi)},ri=()=>{const I=Ye.current;I&&(I.style.transition="",I.style.transform="",I.style.willChange="")},Yo=(I,te,ce,Te)=>{ri(),I.scrollLeft=te,ke.current=I.scrollLeft,Ot(),ce!==void 0?(M.current=ce,O(ce)):yt(),Lt(!0),Te==null||Te()},Ko=(I,{behavior:te="smooth",activeIndex:ce,onComplete:Te}={})=>{const He=Be.current,Ke=Ye.current;if(!He||!Ke)return;if(un(),nn(),Lt(!1),te==="auto"){Yo(He,I,ce,Te);return}const bt=Math.abs(I-He.scrollLeft),Rt=xv(bt,$v,Cv,He.clientWidth*.55);Je.current=Sv(He,Ke,I,{duration:Rt,easing:Tv,onComplete:()=>{Je.current=null,Yo(He,I,ce,Te)}})},ta=(I="smooth")=>{const te=Be.current;if(!te||t.length===0)return;const ce=$e()%t.length,Te=_t(ce,te.scrollLeft),He=Ee.current[Te];He&&Ko(He.offsetLeft,{behavior:I,activeIndex:ce})},na=(I,te="smooth",ce,Te)=>{const He=Be.current;if(!He||t.length===0)return;const Ke=(Te??He.scrollLeft)-I,bt=$e(I),Rt=Ee.current[bt];if(A(Rt)){Lt(!0),yt();return}const tn=Ee.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Ke>Qt*cr?1:Ke<-Qt*cr?-1:0:0)!==0){const ru=ce??bt%t.length,au=Ne(Te??He.scrollLeft,I,ru);Cn(au,te);return}const so=Te??He.scrollLeft,Qo=$e(so),Bs=Ee.current[Qo];if(Bs&&Math.abs(Bs.offsetLeft-so)<1){Lt(!0),yt();return}ta("auto")},Cn=(I,te="smooth")=>{const ce=Be.current;if(!ce||t.length===0)return;const Te=_t(I,ce.scrollLeft),He=Ee.current[Te];He&&(te==="smooth"?Ft.current=I:Ft.current=null,M.current=I,O(I),Et(!0),Ko(He.offsetLeft,{behavior:te,activeIndex:I,onComplete:te==="smooth"?Dt:void 0}))},Ci=()=>{at.current&&(window.removeEventListener("pointerup",at.current),window.removeEventListener("pointercancel",at.current),at.current=null)},Zo=(I,te,ce,Te,He)=>{const Ke=ce-I,bt=Te-te,Rt=Math.abs(Ke),tn=Math.abs(bt);if(Rt<Mv||Rt<=tn)return!1;const Qt=Ke<0?1:-1,Ti=lt?(He+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,He+Qt));return Ti===He?!1:(Cn(Ti),!0)},ai=I=>{if(!Ve.current.isActive)return;Ci();const te=Be.current;if(!te)return;const{scrollLeft:ce,startActiveIndex:Te,hasMoved:He}=Ve.current,Ke=te.scrollLeft;Ot(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},xt(!1),I!==void 0&&te.hasPointerCapture(I)&&te.releasePointerCapture(I),He?na(ce,"smooth",Te,Ke):(Lt(!0),yt()),mt()},Jo=(I,te)=>{const ce=Ze.current;Ze.current=null,ce&&(Zo(ce.startX,ce.startY,I,te,ce.startActiveIndex),mt())},ia=I=>{if(!be)return;if(I.pointerType==="touch"){if(un(),Lt(!0),It(I.target))return;Ze.current={startX:I.clientX,startY:I.clientY,startActiveIndex:M.current};return}if(I.pointerType!=="mouse"||I.button!==0||It(I.target))return;const te=Be.current;if(!te)return;un(),nn(),ri(),Ft.current=null,Ve.current={isActive:!0,startX:I.clientX,scrollLeft:te.scrollLeft,startActiveIndex:M.current,hasMoved:!1},Lt(!1),mt(),te.setPointerCapture(I.pointerId),Ci();const ce=Te=>{Te.pointerType==="mouse"&&ai(Te.pointerId)};at.current=ce,window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",ce)},oa=I=>{if(!be||I.pointerType!=="mouse")return;const te=Be.current;if(!te||!Ve.current.isActive)return;if(I.buttons===0){ai(I.pointerId);return}const ce=I.clientX-Ve.current.startX;Math.abs(ce)>Ev&&(Ve.current.hasMoved=!0,xt(!0)),Ve.current.hasMoved&&(I.preventDefault(),te.scrollLeft=Ve.current.scrollLeft-ce,Ot(!0),yt(),mt())},ye=I=>{if(be){if(I.pointerType==="touch"){I.type==="pointerup"?Jo(I.clientX,I.clientY):Ze.current=null;return}I.pointerType==="mouse"&&ai(I.pointerId)}},je=I=>{!be||I.pointerType!=="mouse"||ai(I.pointerId)};return Md(),s.useEffect(()=>{const I=requestAnimationFrame(()=>Bt(!0));return()=>{cancelAnimationFrame(I),nn(),Ci(),Wt.current!==null&&(cancelAnimationFrame(Wt.current),Wt.current=null),Ct.current&&clearTimeout(Ct.current),Nt.current&&clearTimeout(Nt.current)}},[]),s.useEffect(()=>{if(!Ae){vt(!0);return}mt();const I=_e.current;if(!I)return;const te=()=>mt();return I.addEventListener("pointermove",te),I.addEventListener("pointerdown",te),()=>{I.removeEventListener("pointermove",te),I.removeEventListener("pointerdown",te),Nt.current&&clearTimeout(Nt.current)}},[Ae,mt]),s.useEffect(()=>{const I=te=>{te.key==="Escape"&&Le()};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[Le]),s.useLayoutEffect(()=>{Ht()},[w,t.length,lt]),s.useLayoutEffect(()=>{o||Cn(M.current,"auto")},[w,o]),s.useLayoutEffect(()=>{Cn(0,"auto")},[t.length,lt]),s.useEffect(()=>{const I=Be.current;if(!I||o||!ie)return;const te=ce=>{if(ce.preventDefault(),Math.abs(ce.deltaY)<=Math.abs(ce.deltaX))return;const Te=ce.deltaMode===1?Iv:ce.deltaMode===2?I.clientHeight:1,He=ce.deltaY*Te*Rv;if(He!==0){if(nn(),rt.current||(rt.current=!0,We.current=I.scrollLeft,Ft.current=null,Lt(!1)),We.current+=He,!lt){const Ke=I.scrollWidth-I.clientWidth;We.current=Math.max(0,Math.min(Ke,We.current))}mt(),tt.current===null&&(tt.current=requestAnimationFrame(oi))}};return I.addEventListener("wheel",te,{passive:!1}),()=>{I.removeEventListener("wheel",te),un()}},[o,ie,lt]),s.useEffect(()=>{const I=Be.current;if(!I)return;const te=()=>{Ot(Ve.current.isActive);const Te=I.scrollLeft,He=Te-ke.current;ke.current=Te;const Ke=Ge.current>0?Ge.current*.5:1/0;if(He!==0&&Math.abs(He)<Ke){const bt=He>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Re(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};I.addEventListener("scroll",te,{passive:!0});const ce=new ResizeObserver(()=>{Ht(),Ot(Ve.current.isActive),Re(qe.current),yt()});return ce.observe(I),()=>{nn(),I.removeEventListener("scroll",te),ce.disconnect()}},[t.length,lt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{pt||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${$o}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...jt}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:I=>I.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":be&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:ia,onPointerMove:oa,onPointerUp:ye,onPointerCancel:ye,onLostPointerCapture:je,children:a.jsx("div",{ref:Ye,className:`${e}-lightbox-strip-track`,style:{gap:w},children:Xt.map((I,te)=>{const ce=I.image.objectFit??"contain",Te=te%t.length,He=Math.floor(te/t.length),Ke=dr(w),bt=`calc(-0.5 * (${Ke} + ${w}))`;return a.jsxs("div",{ref:Rt=>Ee.current[te]=Rt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:I.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ce}}),o&&Te<t.length-1&&He===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${He}-${I.image.url}-${Te}`)})})})}),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:P,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:Q,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${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:(he||x)&&a.jsx("div",{className:`${e}-header ${oe?`${e}-header-two-row`:`${e}-header-single-row`}`,children:oe?gt():he||x?ft():null})})})]}),t.length>1&&C==="on"&&(()=>{const I=dr(v),te=`calc(-0.5 * (${v} + ${I}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:v},children:a.jsx("div",{ref:de,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ce=>ce.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":R,style:{gap:$,"--thumbnail-active-color":H},children:[t.map((ce,Te)=>{const He=dr($),Ke=`calc(-0.5 * (${He} + ${$}))`;return a.jsxs("div",{ref:bt=>{ve.current[Te]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":T===Te?"true":"false",onClick:()=>ie&&f==="click"&&Cn(Te),onMouseEnter:()=>Me&&f==="hover"&&Cn(Te),"aria-label":ce.image.name?`View ${ce.image.name}`:`View image ${Te+1}`,"aria-current":T===Te?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${q?` ${e}-thumb-image-cover`:""}`,src:ce.image.url,alt:"",draggable:!1,style:{...se,maxWidth:j,maxHeight:j,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Te<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ke,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ce.image.url}-${Te}`)}),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:te,height:I,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function zv(e){return`
|
|
14226
14226
|
.${e}-wrapper {
|
|
14227
14227
|
position: relative;
|
|
14228
14228
|
width: 100%;
|
|
@@ -14607,7 +14607,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14607
14607
|
pointer-events: auto;
|
|
14608
14608
|
z-index: 10;
|
|
14609
14609
|
}
|
|
14610
|
-
`}const
|
|
14610
|
+
`}const Vv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=W.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,b]=s.useState(!1),x=t??[],g=p&&x.length>0,m=()=>{x.length!==0&&b(!0)};return s.useEffect(()=>{!n||i||o||b(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:zv(l)}}),d&&a.jsx("div",{className:`${l}-cover ${Nn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>m(),style:{...Nn(c)?{"--image-aspect-ratio":Qr(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${Nn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),g&&typeof document<"u"&&(()=>{const h=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx(jv,{prefix:l,images:x,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>b(!1)}),h)})()]})},Gv=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14611
14611
|
import { createPortal } from 'react-dom';
|
|
14612
14612
|
import { CommonComponentProps } from '../props';
|
|
14613
14613
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15153,7 +15153,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15153
15153
|
</>
|
|
15154
15154
|
);
|
|
15155
15155
|
};
|
|
15156
|
-
`,Gv="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>'),ui={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 qv(e){const t={};return t[zt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[zt(e,"fontSettings")]={...ui.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[zt(e,"fontSize")]={...ui.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[zt(e,"lineHeight")]={...ui.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[zt(e,"letterSpacing")]={...ui.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[zt(e,"wordSpacing")]={...ui.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[zt(e,"textAlign")]={...ui.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[zt(e,"textAppearance")]={...ui.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Xv=Zi.reduce((e,t)=>({...e,...qv(t)}),{}),Uv=Zi.reduce((e,t)=>({...e,[zt(t,"fontFamily")]:"Goudy Bookletter 1911",[zt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[zt(t,"letterSpacing")]:0,[zt(t,"wordSpacing")]:0,[zt(t,"textAlign")]:"left",[zt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ta(e){return Zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[zt(n,"fontSize")]=i),o!==void 0&&(t[zt(n,"lineHeight")]=o),t},{})}const Kv=Hv(),Yv={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"}},...Xv,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:Gv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Uv},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,...Ta({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,...Ta({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,...Ta({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:[Kv]}],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"}]}},Zv={element:zv,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:Yv,sourceCode:Vv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Zi.map(e=>({path:`${zt(e,"fontFamily")}`}))]},fontRelations:{...Zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${zt(t,"fontFamily")}`}),{})}},Jv=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:c=!1,journalItemId:d=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:f,backgroundColor:h,imageGap:g,maxWidth:m,maxHeight:x,textTransition:T,title1Width:y,title2Width:w,title3Width:B,title1MarginLeft:M=0,title2MarginLeft:G=0,title3MarginLeft:O=0,titleRowMarginBottom:_=0,titleHeaderLayout:j="single-row",countCloseGap:b=0,closeIcon:H,closeIconMaxWidth:E,closeIconColor:$,closeIconHoverColor:S,contentMarginTop:P=0,iconMarginRight:I=0}=n,N=s.useCallback(fe=>W.scalingValue(fe,i??!1),[i]),z=N(g??0),C=`${m}%`,R=`${x}%`,D=N(b),ie=N(P),ee=N(I),A=fi("title1",hi(n,"title1"),i),ae=fi("title2",hi(n,"title2"),i),k=fi("title3",hi(n,"title3"),i),J=fi("count",hi(n,"count"),i),X=j==="mobile",me=!i||!!r,Le=!o&&(!i||!!r),he=s.useMemo(()=>br(t,v),[t,v]),[K,V]=s.useState(l),Y=he[K],Q=Y==null?void 0:Y.entry,[Te,we]=s.useState(!1),[ke,le]=s.useState(null),[ge,be]=s.useState(!1),[ne,ce]=s.useState(null),[ue,xe]=s.useState(!1),[Ae,Ie]=s.useState(0),[U,ve]=s.useState(),[de,q]=s.useState(),[re,Fe]=s.useState(null),pe=s.useRef(null),Z=s.useRef(0),Xe=s.useRef(0),Oe=s.useRef(0),dt=s.useRef(!1),nt=s.useRef(null),ht=s.useRef(null),st=s.useRef(null),ze=s.useRef(null),Se=s.useRef(null),_e=s.useRef(null),Be=s.useRef(null),Ke=s.useCallback(()=>{const fe=ht.current;if(!fe)return;const je=fe.closest(`.${e}-lightbox-content-area`);if(!je)return fe.getBoundingClientRect().width;const L=Array.from(je.children).reduce((te,oe)=>!(oe instanceof HTMLElement)||oe.contains(fe)?te:te+oe.getBoundingClientRect().width,0);return je.getBoundingClientRect().width-L},[e]),se=s.useCallback(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),ye=s.useCallback(fe=>{fe===Z.current&&(ce(null),xe(!1))},[]),Ee=s.useCallback(()=>{o||dt.current||(dt.current=!0,u==null||u(),we(!1),nt.current=setTimeout(()=>{p()},300))},[o,u,p]),Ge=s.useCallback(fe=>!!(fe.closest("[data-controls]")||fe.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ze,backdropStyle:Ve,mediaAreaStyle:at,overlayContentStyle:Je,swipeHandlers:Me,dismissAreaStyle:qe}=Ed({enabled:Le,onClose:Ee,animMs:300,isBlockedTarget:Ge}),We=s.useCallback(fe=>{c&&pd(fe+1,d,!0)},[c,d]),tt=s.useCallback(fe=>{if(fe)return fe.getBoundingClientRect().height},[]),rt=s.useCallback(fe=>{if(he.length===0)return;const je=(fe%he.length+he.length)%he.length;if(je===K)return;const L=he[K],te=he[je];Z.current+=1;const oe=Z.current,Ce=T==="fade"&&vl(L==null?void 0:L.entry)!==vl(te==null?void 0:te.entry),He=tt(st.current),Ye=Ce?(()=>{const Rt=Ke();Dn.flushSync(()=>{Fe(te.entry)}),st.current&&Rt&&(st.current.style.width=`${Rt}px`);const tn=tt(st.current);return st.current&&(st.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(He??0,(Ye==null?void 0:Ye.measuredIncomingTitlesHeight)??0)||void 0;Ie(oe),ce(K),xe(!0),V(je),We(je),Oe.current=je,Ce?(se(),bt&&ve(bt),Ye!=null&&Ye.incomingTitlesMeasureWidth&&q(Ye.incomingTitlesMeasureWidth),le((L==null?void 0:L.entryIndex)??null),be(!0),Xe.current=te.entryIndex,pe.current=setTimeout(()=>{le(null),be(!1),ve(void 0),q(void 0),Fe(null),pe.current=null},400)):(se(),le(null),be(!1),ve(void 0),q(void 0),Fe(null),Xe.current=te.entryIndex)},[K,se,Ke,tt,he,We,T]),lt=s.useCallback(()=>{Be.current=null},[]),Tt=s.useCallback(fe=>{!me||he.length<=1||fe.pointerType==="mouse"&&fe.button!==0||fe.target.closest("[data-controls]")||(Be.current={startX:fe.clientX,startY:fe.clientY,pointerId:fe.pointerId})},[me,he.length]),Xt=s.useCallback(fe=>{var Rt;if(!me||he.length<=1||fe.pointerType==="mouse"&&fe.button!==0)return;if(Ze){lt();return}const je=Be.current;if(!je||je.pointerId!==fe.pointerId||(lt(),fe.target.closest("[data-controls]")))return;const te=fe.clientX-je.startX,oe=fe.clientY-je.startY,Ce=Math.abs(te),He=Math.abs(oe);if(Ce>=df&&Ce>He){rt(te>0?K-1:K+1);return}if(Ce>gl||He>gl)return;const Ye=(Rt=ze.current)==null?void 0:Rt.getBoundingClientRect(),bt=Ye?Ye.left+Ye.width/2:window.innerWidth/2;rt(fe.clientX<bt?K-1:K+1)},[K,me,rt,Ze,lt,he.length]),Zt=s.useCallback(fe=>{const je=Be.current;(je==null?void 0:je.pointerId)===fe.pointerId&<()},[lt]);Md(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const fe=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{Se.current?Se.current.focus():ze.current&&ze.current.focus()})});return()=>{cancelAnimationFrame(fe),nt.current&&clearTimeout(nt.current),pe.current&&clearTimeout(pe.current);const je=_e.current;je&&document.contains(je)&&je.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var fe;T!=="fade"&&(Xe.current=((fe=he[K])==null?void 0:fe.entryIndex)??0,se(),le(null),be(!1),ve(void 0),q(void 0))},[K,se,he,T]),s.useEffect(()=>{const fe=je=>{if(je.key==="Escape"){Ee();return}if(je.key==="ArrowLeft"&&he.length>1){rt(K-1);return}if(je.key==="ArrowRight"&&he.length>1){rt(K+1);return}if(je.key==="Tab"&&ze.current){const L=ze.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),te=Array.from(L).filter(Ye=>!Ye.closest('[aria-hidden="true"]'));if(te.length===0)return;const oe=te[0],Ce=te[te.length-1],He=document.activeElement;je.shiftKey?(He===oe||!ze.current.contains(He))&&(je.preventDefault(),Ce.focus()):(He===Ce||!ze.current.contains(He))&&(je.preventDefault(),oe.focus())}};return window.addEventListener("keydown",fe),()=>window.removeEventListener("keydown",fe)},[rt,Ee,K,he.length]),s.useLayoutEffect(()=>{se(),Z.current=0,Ie(0),ce(null),xe(!1),le(null),be(!1),ve(void 0),q(void 0),Fe(null),V(fe=>{const je=Math.max(0,he.length-1);return Math.min(fe,je)})},[se,t.length,v,he.length]),s.useLayoutEffect(()=>{var L;const fe=Math.max(0,he.length-1),je=Math.min(Math.max(0,l),fe);Oe.current=je,Xe.current=((L=he[je])==null?void 0:L.entryIndex)??0,V(je)},[l]);const xt=ke!==null?t[ke]:null,wt=ne!==null?he[ne]:null,Bt=(Q==null?void 0:Q.title1)||(Q==null?void 0:Q.title2)||(Q==null?void 0:Q.title3)||(xt==null?void 0:xt.title1)||(xt==null?void 0:xt.title2)||(xt==null?void 0:xt.title3),At=vf(v,he,t),vt=H!==null,Ft=Bt||At||vt,Wt=At&&vt?{gap:D}:void 0,Kt=`${e}-titles-stack${X?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${X?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,Nt=(M??0)>0||o,rn=N(_),mt=s.useMemo(()=>({title1Width:y??Hi.title1Width,title2Width:w??Hi.title2Width,title3Width:B??Hi.title3Width}),[y,w,B]),Re=s.useMemo(()=>({title2MarginLeft:G,title3MarginLeft:O}),[G,O]),De=s.useMemo(()=>Q?Un(e,Q,A,ae,k):[],[e,Q,A,ae,k]),it=s.useMemo(()=>De.map(fe=>mt[fe.widthKey]),[De,mt]),gt=s.useMemo(()=>Gi(De.length,it),[De.length,it]),ft=s.useMemo(()=>Mo(De.length,it),[De.length,it]),It=s.useMemo(()=>De.filter(fe=>fe.prefix==="title1"),[De]),pt=s.useMemo(()=>De.filter(fe=>fe.prefix==="title2"||fe.prefix==="title3"),[De]),jt=s.useMemo(()=>Kn(It,mt),[It,mt]),kt=s.useMemo(()=>Kn(pt,mt),[pt,mt]),Mt=s.useCallback((fe,je)=>{const L=De.findIndex(oe=>oe.prefix===fe.prefix);if(!X||je==="single-row")return{effectiveWidth:ft[L]??0,resolvedWidth:gt[L]??0,maxWidth:cn(L,gt)};if(je==="two-row-top"){const oe=It.findIndex(Ce=>Ce.prefix===fe.prefix);return{effectiveWidth:jt.effective[oe]??0,resolvedWidth:jt.resolved[oe]??0,maxWidth:cn(oe,jt.resolved)}}const te=pt.findIndex(oe=>oe.prefix===fe.prefix);return{effectiveWidth:kt.effective[te]??0,resolvedWidth:kt.resolved[te]??0,maxWidth:cn(te,kt.resolved)}},[De,pt,kt,ft,gt,It,jt,X]),Vt=s.useCallback(fe=>fd(De,gt,Re,fe)+(X?0:M??0),[De,gt,Re,X,M]),Gt=s.useCallback(()=>X?0:M??0,[X,M]),Ht=s.useCallback(fe=>pt.slice(0,fe).reduce((je,L,te)=>je+(L.marginLeftKey?Re[L.marginLeftKey]??0:0)+(kt.resolved[te]??0),0),[pt,kt.resolved,Re]),Ot=s.useCallback(fe=>{const je=pt[fe];return Ht(fe)+(je.marginLeftKey?Re[je.marginLeftKey]??0:0)+(kt.resolved[fe]??0)},[pt,kt.resolved,Ht,Re]),_t=s.useCallback((fe,je,L)=>{if(!X||L==="single-row"){const Ye=fe.findIndex(Qt=>Qt.prefix===je.prefix),bt=fe.map(Qt=>mt[Qt.widthKey]),Rt=Gi(fe.length,bt);return{effectiveWidth:Mo(fe.length,bt)[Ye]??0,resolvedWidth:Rt[Ye]??0,maxWidth:cn(Ye,Rt)}}if(L==="two-row-top"){const Ye=fe.filter(Qt=>Qt.prefix==="title1"),bt=Ye.findIndex(Qt=>Qt.prefix===je.prefix),{resolved:Rt,effective:tn}=Kn(Ye,mt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const te=fe.filter(Ye=>Ye.prefix==="title2"||Ye.prefix==="title3"),oe=te.findIndex(Ye=>Ye.prefix===je.prefix),{resolved:Ce,effective:He}=Kn(te,mt);return{effectiveWidth:He[oe]??0,resolvedWidth:Ce[oe]??0,maxWidth:cn(oe,Ce)}},[mt,X]),St=(fe,je,L)=>{const te=fe.marginLeftKey?Re[fe.marginLeftKey]??0:0,{effectiveWidth:oe,resolvedWidth:Ce,maxWidth:He}=L??Mt(fe,je),Ye=Math.max(te,Xn),bt=o&&je==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":fe.prefix,style:{width:N(oe),...te>0?{marginLeft:N(te)}:{}},children:[a.jsx("p",{className:fe.className,style:fe.style,children:fe.text}),bt&&fe.marginLeftKey?a.jsx("div",{"data-controls":fe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ce),style:{position:"absolute",top:0,left:N(-te),width:N(Ye),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":fe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:N(-fn/2),width:N(fn),height:"100%",pointerEvents:"auto"}}):null]},fe.className)},F=(fe="two-row")=>{const je=De.findIndex(oe=>oe.prefix==="title1"),L=je>=0?gt[je]:mt.title1Width,te=fe==="two-row"&&o;return a.jsx("div",{...te?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(L)}:{},style:{width:N(M??0),flexShrink:0,alignSelf:"stretch",...te?{pointerEvents:"auto"}:{}}})},$e=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Pe=()=>a.jsx("span",{className:`${e}-entry-counter`,style:J,"aria-live":"polite","aria-atomic":"true",children:yf(he,K,v,t)}),Ne=()=>At?o&&vt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Pe(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${ha(D)} + ${D}))`,width:ha(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Pe():null,ot=()=>!At&&!vt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Wt,children:[Ne(),vt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?$e():null,Nt?F("single-row"):null,Lt(Q),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ot(),Cn()]}),Qe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?$e():null,Nt?F("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&U?{minHeight:U}:void 0,children:[a.jsx("div",{ref:st,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ri(re||Q)}),a.jsxs("div",{ref:ht,className:Kt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&de?{width:de,maxWidth:"100%"}:void 0},children:[xt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:ri(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ri(Q)})]})]}),ot(),Cn()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(E??0,i),height:W.scalingValue(E??0,i),marginRight:ee,"--close-icon-hover-color":S},children:[a.jsx("button",{ref:Se,type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(sn,{url:H??"",fill:$,hoverFill:i&&!r?$:S,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:ee,height:"100%",pointerEvents:"auto"}})]}),Dt=(fe,je)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Bt?$e():null,Nt?F("two-row"):null,je!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:je},children:fe}):a.jsxs(a.Fragment,{children:[fe,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ot()]}),Lt=fe=>{if(!fe)return null;const je=Un(e,fe,A,ae,k);return a.jsx(a.Fragment,{children:je.map(L=>St(L,"single-row",_t(je,L,"single-row")))})},nn=fe=>{if(!fe)return null;const je=Un(e,fe,A,ae,k),L=je.find(te=>te.prefix==="title1");return L?St(L,"two-row-top",_t(je,L,"two-row-top")):null},un=(fe,je=!1)=>{const L=fe?Un(e,fe,A,ae,k):[],te=L.filter(He=>He.prefix==="title2"||He.prefix==="title3"),oe=o&&je;return te.length>0||oe||(_??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[te.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[te.map(He=>St(He,"two-row-bottom",_t(L,He,"two-row-bottom"))),je&&o?a.jsxs(a.Fragment,{children:[ea(),ta()]}):null]}):null,(_??0)>0||oe?a.jsx("div",{"data-controls":oe?"titleRowMarginBottom":void 0,"data-controls-axis":oe?"y":void 0,"data-controls-reverse":oe?"":void 0,className:oe?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:oe?"auto":"none"}}):null]}):null},oi=(fe,je=!1)=>a.jsxs(a.Fragment,{children:[Dt(nn(fe)),un(fe,je)]}),ri=fe=>X?a.jsx("div",{className:`${e}-titles-row-two-row`,children:oi(fe)}):fe?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Lt(fe)}):null,Xo=()=>{const fe=X?-1:De.findIndex(te=>te.prefix==="title1"),je=!X&&(o||(M??0)>0)?(()=>{const te=M??0,oe=fe>=0?gt[fe]:mt.title1Width,Ce=Math.max(te,Xn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(oe),style:{position:"absolute",top:0,left:0,width:N(Ce),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,L=De.flatMap((te,oe)=>{if(!te.marginLeftKey)return[];const Ce=Re[te.marginLeftKey]??0,He=hd(De,gt,Re,oe)+Gt(),Ye=Math.max(Ce,Xn);return a.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[oe]),style:{position:"absolute",top:0,left:N(He),width:N(Ye),height:"100%",pointerEvents:"auto"}},te.marginLeftKey)});return je?[je,...L]:L},Uo=()=>De.map((fe,je)=>{const L=cn(je,gt),oe=Vt(je)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":fe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:N(oe),width:N(fn),height:"100%",pointerEvents:"auto"}})},`${fe.widthKey}-junction`)}),ea=()=>pt.flatMap((fe,je)=>{if(!fe.marginLeftKey)return[];const L=Re[fe.marginLeftKey]??0,te=Ht(je),oe=Math.max(L,Xn),{resolvedWidth:Ce}=Mt(fe,"two-row-bottom");return a.jsx("div",{"data-controls":fe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ce),style:{position:"absolute",top:0,left:N(te),width:N(oe),height:"100%",pointerEvents:"auto"}},fe.marginLeftKey)}),ta=()=>pt.map((fe,je)=>{const{maxWidth:L}=Mt(fe,"two-row-bottom"),oe=Ot(je)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":fe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:N(oe),width:N(fn),height:"100%",pointerEvents:"auto"}})},`${fe.widthKey}-junction`)}),Cn=()=>!o||X?null:a.jsxs(a.Fragment,{children:[Xo(),Uo()]}),$i=fe=>{const je=!fe.objectFit&&Nn(f);return{className:`${e}-slide-image-cell${je?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:C,maxHeight:R,...je?{"--image-aspect-ratio":Jr(f)}:{}}}},Ko=fe=>fe.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":fe.objectFit}}:Nn(f)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ai=fe=>{if(fe.length===0)return null;const je=fe.length>1,L=ha(z),te=`calc(-0.5 * (${L} + ${z}))`;if(fe.length===1){const oe=fe[0];return a.jsx("div",{...$i(oe),children:a.jsx("img",{...Ko(oe),src:oe.url,alt:oe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:je?{gap:z}:void 0,children:fe.map((oe,Ce)=>a.jsxs("div",{...$i(oe),children:[a.jsx("img",{...Ko(oe),src:oe.url,alt:oe.name??"",draggable:!1}),o&&je&&Ce<fe.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:te,width:L,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${oe.url}-${Ce}`))})},Yo=!!(Q!=null&&Q.title2||Q!=null&&Q.title3||xt!=null&&xt.title2||xt!=null&&xt.title3||(_??0)>0||o),na=()=>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:st,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:oi(re||Q)}),a.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...ge&&U?{minHeight:U}:void 0,...ge&&de?{width:de,maxWidth:"100%"}:void 0},children:[Dt(a.jsxs("div",{className:Kt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[xt&&ge?a.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Q)})]}),ge&&U?U:void 0),Yo?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[xt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${X?` ${e}-titles-layer-in-stacked`:""}`,children:un(Q,!0)})]}):null]})]}),ia=()=>{const fe=Yo;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...fe?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:fe?void 0:{flex:"0 0 auto",height:"auto"},children:oi(Q,!0)}),Cn()]})};return a.jsxs("div",{ref:ze,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ze||Ee()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:Te?1:0,transition:"opacity 300ms ease",pointerEvents:Te?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:h,...Ve}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...Me,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:at,onClick:fe=>fe.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":me&&he.length>1?"true":"false",onPointerDown:me?Tt:void 0,onPointerUp:me?Xt:void 0,onPointerCancel:me?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&ue?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:fe=>{fe.target===fe.currentTarget&&ye(Ae)},children:a.jsx("div",{className:`${e}-slide-area`,children:ai(wt.images)})},`slide-out-${Ae}`):null,a.jsx("div",{className:`${e}-slide-layer-in${ue?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:Y?ai(Y.images):null})},`slide-in-${Ae}-${K}`)]})})}),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:ie,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...X?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${X?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${X?` ${e}-text-bar-cell-stacked`:""}`,style:X?void 0:{flex:1,minWidth:0,width:"100%"},children:X?T==="fade"?na():ia():T==="fade"?Qe():Et()})})})]})]})]})};function Qv(e){return`
|
|
15156
|
+
`,qv="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>'),ui={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 Xv(e){const t={};return t[zt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[zt(e,"fontSettings")]={...ui.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[zt(e,"fontSize")]={...ui.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[zt(e,"lineHeight")]={...ui.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[zt(e,"letterSpacing")]={...ui.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[zt(e,"wordSpacing")]={...ui.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[zt(e,"textAlign")]={...ui.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[zt(e,"textAppearance")]={...ui.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Uv=Ji.reduce((e,t)=>({...e,...Xv(t)}),{}),Yv=Ji.reduce((e,t)=>({...e,[zt(t,"fontFamily")]:"Goudy Bookletter 1911",[zt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[zt(t,"letterSpacing")]:0,[zt(t,"wordSpacing")]:0,[zt(t,"textAlign")]:"left",[zt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function La(e){return Ji.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[zt(n,"fontSize")]=i),o!==void 0&&(t[zt(n,"lineHeight")]=o),t},{})}const Kv=Ov(),Zv={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"}},...Uv,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:qv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Yv},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,...La({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,...La({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,...La({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:[Kv]}],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"}]}},Jv={element:Vv,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:Zv,sourceCode:Gv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Ji.map(e=>({path:`${zt(e,"fontFamily")}`}))]},fontRelations:{...Ji.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${zt(t,"fontFamily")}`}),{})}},Qv=({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:b,coverFit:x,backgroundColor:g,imageGap:m,maxWidth:h,maxHeight:f,textTransition:C,title1Width:y,title2Width:R,title3Width:H,title1MarginLeft:S=0,title2MarginLeft:U=0,title3MarginLeft:F=0,titleRowMarginBottom:_=0,titleHeaderLayout:B="single-row",countCloseGap:L=0,closeIcon:N,closeIconMaxWidth:k,closeIconColor:Z,closeIconHoverColor:E,contentMarginTop:K=0,iconMarginRight:D=0}=n,j=s.useCallback(ye=>W.scalingValue(ye,i??!1),[i]),$=j(m??0),v=`${h}%`,w=`${f}%`,P=j(L),Q=j(K),z=j(D),T=fi("title1",hi(n,"title1"),i),O=fi("title2",hi(n,"title2"),i),M=fi("title3",hi(n,"title3"),i),ee=fi("count",hi(n,"count"),i),V=B==="mobile",me=!i||!!r,Ie=!o&&(!i||!!r),ge=s.useMemo(()=>Sr(t,b),[t,b]),[ae,ne]=s.useState(l),oe=ge[ae],ie=oe==null?void 0:oe.entry,[Ae,be]=s.useState(!1),[Me,q]=s.useState(null),[se,he]=s.useState(!1),[G,re]=s.useState(null),[pe,we]=s.useState(!1),[Pe,Ce]=s.useState(0),[Y,xe]=s.useState(),[ue,X]=s.useState(),[le,Fe]=s.useState(null),fe=s.useRef(null),J=s.useRef(0),Xe=s.useRef(0),Oe=s.useRef(0),dt=s.useRef(!1),nt=s.useRef(null),ht=s.useRef(null),st=s.useRef(null),ze=s.useRef(null),Se=s.useRef(null),_e=s.useRef(null),Be=s.useRef(null),Ye=s.useCallback(()=>{const ye=ht.current;if(!ye)return;const je=ye.closest(`.${e}-lightbox-content-area`);if(!je)return ye.getBoundingClientRect().width;const I=Array.from(je.children).reduce((te,ce)=>!(ce instanceof HTMLElement)||ce.contains(ye)?te:te+ce.getBoundingClientRect().width,0);return je.getBoundingClientRect().width-I},[e]),de=s.useCallback(()=>{fe.current&&(clearTimeout(fe.current),fe.current=null)},[]),ve=s.useCallback(ye=>{ye===J.current&&(re(null),we(!1))},[]),Ee=s.useCallback(()=>{o||dt.current||(dt.current=!0,u==null||u(),be(!1),nt.current=setTimeout(()=>{p()},300))},[o,u,p]),Ge=s.useCallback(ye=>!!(ye.closest("[data-controls]")||ye.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ze,backdropStyle:Ve,mediaAreaStyle:at,overlayContentStyle:Je,swipeHandlers:ke,dismissAreaStyle:qe}=Ed({enabled:Ie,onClose:Ee,animMs:300,isBlockedTarget:Ge}),We=s.useCallback(ye=>{d&&pd(ye+1,c,!0)},[d,c]),tt=s.useCallback(ye=>{if(ye)return ye.getBoundingClientRect().height},[]),rt=s.useCallback(ye=>{if(ge.length===0)return;const je=(ye%ge.length+ge.length)%ge.length;if(je===ae)return;const I=ge[ae],te=ge[je];J.current+=1;const ce=J.current,Te=C==="fade"&&xl(I==null?void 0:I.entry)!==xl(te==null?void 0:te.entry),He=tt(st.current),Ke=Te?(()=>{const Rt=Ye();Dn.flushSync(()=>{Fe(te.entry)}),st.current&&Rt&&(st.current.style.width=`${Rt}px`);const tn=tt(st.current);return st.current&&(st.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(He??0,(Ke==null?void 0:Ke.measuredIncomingTitlesHeight)??0)||void 0;Ce(ce),re(ae),we(!0),ne(je),We(je),Oe.current=je,Te?(de(),bt&&xe(bt),Ke!=null&&Ke.incomingTitlesMeasureWidth&&X(Ke.incomingTitlesMeasureWidth),q((I==null?void 0:I.entryIndex)??null),he(!0),Xe.current=te.entryIndex,fe.current=setTimeout(()=>{q(null),he(!1),xe(void 0),X(void 0),Fe(null),fe.current=null},400)):(de(),q(null),he(!1),xe(void 0),X(void 0),Fe(null),Xe.current=te.entryIndex)},[ae,de,Ye,tt,ge,We,C]),lt=s.useCallback(()=>{Be.current=null},[]),Tt=s.useCallback(ye=>{!me||ge.length<=1||ye.pointerType==="mouse"&&ye.button!==0||ye.target.closest("[data-controls]")||(Be.current={startX:ye.clientX,startY:ye.clientY,pointerId:ye.pointerId})},[me,ge.length]),Xt=s.useCallback(ye=>{var Rt;if(!me||ge.length<=1||ye.pointerType==="mouse"&&ye.button!==0)return;if(Ze){lt();return}const je=Be.current;if(!je||je.pointerId!==ye.pointerId||(lt(),ye.target.closest("[data-controls]")))return;const te=ye.clientX-je.startX,ce=ye.clientY-je.startY,Te=Math.abs(te),He=Math.abs(ce);if(Te>=uf&&Te>He){rt(te>0?ae-1:ae+1);return}if(Te>hl||He>hl)return;const Ke=(Rt=ze.current)==null?void 0:Rt.getBoundingClientRect(),bt=Ke?Ke.left+Ke.width/2:window.innerWidth/2;rt(ye.clientX<bt?ae-1:ae+1)},[ae,me,rt,Ze,lt,ge.length]),Zt=s.useCallback(ye=>{const je=Be.current;(je==null?void 0:je.pointerId)===ye.pointerId&<()},[lt]);Md(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ye=requestAnimationFrame(()=>{be(!0),requestAnimationFrame(()=>{Se.current?Se.current.focus():ze.current&&ze.current.focus()})});return()=>{cancelAnimationFrame(ye),nt.current&&clearTimeout(nt.current),fe.current&&clearTimeout(fe.current);const je=_e.current;je&&document.contains(je)&&je.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var ye;C!=="fade"&&(Xe.current=((ye=ge[ae])==null?void 0:ye.entryIndex)??0,de(),q(null),he(!1),xe(void 0),X(void 0))},[ae,de,ge,C]),s.useEffect(()=>{const ye=je=>{if(je.key==="Escape"){Ee();return}if(je.key==="ArrowLeft"&&ge.length>1){rt(ae-1);return}if(je.key==="ArrowRight"&&ge.length>1){rt(ae+1);return}if(je.key==="Tab"&&ze.current){const I=ze.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),te=Array.from(I).filter(Ke=>!Ke.closest('[aria-hidden="true"]'));if(te.length===0)return;const ce=te[0],Te=te[te.length-1],He=document.activeElement;je.shiftKey?(He===ce||!ze.current.contains(He))&&(je.preventDefault(),Te.focus()):(He===Te||!ze.current.contains(He))&&(je.preventDefault(),ce.focus())}};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[rt,Ee,ae,ge.length]),s.useLayoutEffect(()=>{de(),J.current=0,Ce(0),re(null),we(!1),q(null),he(!1),xe(void 0),X(void 0),Fe(null),ne(ye=>{const je=Math.max(0,ge.length-1);return Math.min(ye,je)})},[de,t.length,b,ge.length]),s.useLayoutEffect(()=>{var I;const ye=Math.max(0,ge.length-1),je=Math.min(Math.max(0,l),ye);Oe.current=je,Xe.current=((I=ge[je])==null?void 0:I.entryIndex)??0,ne(je)},[l]);const xt=Me!==null?t[Me]:null,wt=G!==null?ge[G]:null,Bt=(ie==null?void 0:ie.title1)||(ie==null?void 0:ie.title2)||(ie==null?void 0:ie.title3)||(xt==null?void 0:xt.title1)||(xt==null?void 0:xt.title2)||(xt==null?void 0:xt.title3),At=xf(b,ge,t),vt=N!==null,Ft=Bt||At||vt,Wt=At&&vt?{gap:P}:void 0,Yt=`${e}-titles-stack${V?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${V?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,Nt=(S??0)>0||o,rn=j(_),mt=s.useMemo(()=>({title1Width:y??Di.title1Width,title2Width:R??Di.title2Width,title3Width:H??Di.title3Width}),[y,R,H]),Le=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:F}),[U,F]),De=s.useMemo(()=>ie?Un(e,ie,T,O,M):[],[e,ie,T,O,M]),it=s.useMemo(()=>De.map(ye=>mt[ye.widthKey]),[De,mt]),gt=s.useMemo(()=>qi(De.length,it),[De.length,it]),ft=s.useMemo(()=>Mo(De.length,it),[De.length,it]),It=s.useMemo(()=>De.filter(ye=>ye.prefix==="title1"),[De]),pt=s.useMemo(()=>De.filter(ye=>ye.prefix==="title2"||ye.prefix==="title3"),[De]),jt=s.useMemo(()=>Yn(It,mt),[It,mt]),kt=s.useMemo(()=>Yn(pt,mt),[pt,mt]),Mt=s.useCallback((ye,je)=>{const I=De.findIndex(ce=>ce.prefix===ye.prefix);if(!V||je==="single-row")return{effectiveWidth:ft[I]??0,resolvedWidth:gt[I]??0,maxWidth:cn(I,gt)};if(je==="two-row-top"){const ce=It.findIndex(Te=>Te.prefix===ye.prefix);return{effectiveWidth:jt.effective[ce]??0,resolvedWidth:jt.resolved[ce]??0,maxWidth:cn(ce,jt.resolved)}}const te=pt.findIndex(ce=>ce.prefix===ye.prefix);return{effectiveWidth:kt.effective[te]??0,resolvedWidth:kt.resolved[te]??0,maxWidth:cn(te,kt.resolved)}},[De,pt,kt,ft,gt,It,jt,V]),Vt=s.useCallback(ye=>fd(De,gt,Le,ye)+(V?0:S??0),[De,gt,Le,V,S]),Gt=s.useCallback(()=>V?0:S??0,[V,S]),Ht=s.useCallback(ye=>pt.slice(0,ye).reduce((je,I,te)=>je+(I.marginLeftKey?Le[I.marginLeftKey]??0:0)+(kt.resolved[te]??0),0),[pt,kt.resolved,Le]),Ot=s.useCallback(ye=>{const je=pt[ye];return Ht(ye)+(je.marginLeftKey?Le[je.marginLeftKey]??0:0)+(kt.resolved[ye]??0)},[pt,kt.resolved,Ht,Le]),_t=s.useCallback((ye,je,I)=>{if(!V||I==="single-row"){const Ke=ye.findIndex(Qt=>Qt.prefix===je.prefix),bt=ye.map(Qt=>mt[Qt.widthKey]),Rt=qi(ye.length,bt);return{effectiveWidth:Mo(ye.length,bt)[Ke]??0,resolvedWidth:Rt[Ke]??0,maxWidth:cn(Ke,Rt)}}if(I==="two-row-top"){const Ke=ye.filter(Qt=>Qt.prefix==="title1"),bt=Ke.findIndex(Qt=>Qt.prefix===je.prefix),{resolved:Rt,effective:tn}=Yn(Ke,mt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const te=ye.filter(Ke=>Ke.prefix==="title2"||Ke.prefix==="title3"),ce=te.findIndex(Ke=>Ke.prefix===je.prefix),{resolved:Te,effective:He}=Yn(te,mt);return{effectiveWidth:He[ce]??0,resolvedWidth:Te[ce]??0,maxWidth:cn(ce,Te)}},[mt,V]),St=(ye,je,I)=>{const te=ye.marginLeftKey?Le[ye.marginLeftKey]??0:0,{effectiveWidth:ce,resolvedWidth:Te,maxWidth:He}=I??Mt(ye,je),Ke=Math.max(te,Xn),bt=o&&je==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":ye.prefix,style:{width:j(ce),...te>0?{marginLeft:j(te)}:{}},children:[a.jsx("p",{className:ye.className,style:ye.style,children:ye.text}),bt&&ye.marginLeftKey?a.jsx("div",{"data-controls":ye.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:j(-te),width:j(Ke),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:j(-fn/2),width:j(fn),height:"100%",pointerEvents:"auto"}}):null]},ye.className)},A=(ye="two-row")=>{const je=De.findIndex(ce=>ce.prefix==="title1"),I=je>=0?gt[je]:mt.title1Width,te=ye==="two-row"&&o;return a.jsx("div",{...te?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(I)}:{},style:{width:j(S??0),flexShrink:0,alignSelf:"stretch",...te?{pointerEvents:"auto"}:{}}})},$e=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:T,"aria-hidden":"true",children:" "}),Re=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ee,"aria-live":"polite","aria-atomic":"true",children:vf(ge,ae,b,t)}),Ne=()=>At?o&&vt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${fa(P)} + ${P}))`,width:fa(P),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,ot=()=>!At&&!vt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Wt,children:[Ne(),vt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?$e():null,Nt?A("single-row"):null,Lt(ie),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ot(),Cn()]}),Qe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?$e():null,Nt?A("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:se&&Y?{minHeight:Y}:void 0,children:[a.jsx("div",{ref:st,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ri(le||ie)}),a.jsxs("div",{ref:ht,className:Yt,style:{position:se?"absolute":"relative",inset:se?0:void 0,width:"100%",...se&&ue?{width:ue,maxWidth:"100%"}:void 0},children:[xt&&se?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:ri(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ri(ie)})]})]}),ot(),Cn()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(k??0,i),height:W.scalingValue(k??0,i),marginRight:z,"--close-icon-hover-color":E},children:[a.jsx("button",{ref:Se,type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(sn,{url:N??"",fill:Z,hoverFill:i&&!r?Z:E,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:z,height:"100%",pointerEvents:"auto"}})]}),Dt=(ye,je)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Bt?$e():null,Nt?A("two-row"):null,je!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:je},children:ye}):a.jsxs(a.Fragment,{children:[ye,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ot()]}),Lt=ye=>{if(!ye)return null;const je=Un(e,ye,T,O,M);return a.jsx(a.Fragment,{children:je.map(I=>St(I,"single-row",_t(je,I,"single-row")))})},nn=ye=>{if(!ye)return null;const je=Un(e,ye,T,O,M),I=je.find(te=>te.prefix==="title1");return I?St(I,"two-row-top",_t(je,I,"two-row-top")):null},un=(ye,je=!1)=>{const I=ye?Un(e,ye,T,O,M):[],te=I.filter(He=>He.prefix==="title2"||He.prefix==="title3"),ce=o&&je;return te.length>0||ce||(_??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[te.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[te.map(He=>St(He,"two-row-bottom",_t(I,He,"two-row-bottom"))),je&&o?a.jsxs(a.Fragment,{children:[ta(),na()]}):null]}):null,(_??0)>0||ce?a.jsx("div",{"data-controls":ce?"titleRowMarginBottom":void 0,"data-controls-axis":ce?"y":void 0,"data-controls-reverse":ce?"":void 0,className:ce?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ce?"auto":"none"}}):null]}):null},oi=(ye,je=!1)=>a.jsxs(a.Fragment,{children:[Dt(nn(ye)),un(ye,je)]}),ri=ye=>V?a.jsx("div",{className:`${e}-titles-row-two-row`,children:oi(ye)}):ye?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Lt(ye)}):null,Yo=()=>{const ye=V?-1:De.findIndex(te=>te.prefix==="title1"),je=!V&&(o||(S??0)>0)?(()=>{const te=S??0,ce=ye>=0?gt[ye]:mt.title1Width,Te=Math.max(te,Xn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ce),style:{position:"absolute",top:0,left:0,width:j(Te),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,I=De.flatMap((te,ce)=>{if(!te.marginLeftKey)return[];const Te=Le[te.marginLeftKey]??0,He=hd(De,gt,Le,ce)+Gt(),Ke=Math.max(Te,Xn);return a.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[ce]),style:{position:"absolute",top:0,left:j(He),width:j(Ke),height:"100%",pointerEvents:"auto"}},te.marginLeftKey)});return je?[je,...I]:I},Ko=()=>De.map((ye,je)=>{const I=cn(je,gt),ce=Vt(je)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(I),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(ce),width:j(fn),height:"100%",pointerEvents:"auto"}})},`${ye.widthKey}-junction`)}),ta=()=>pt.flatMap((ye,je)=>{if(!ye.marginLeftKey)return[];const I=Le[ye.marginLeftKey]??0,te=Ht(je),ce=Math.max(I,Xn),{resolvedWidth:Te}=Mt(ye,"two-row-bottom");return a.jsx("div",{"data-controls":ye.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:j(te),width:j(ce),height:"100%",pointerEvents:"auto"}},ye.marginLeftKey)}),na=()=>pt.map((ye,je)=>{const{maxWidth:I}=Mt(ye,"two-row-bottom"),ce=Ot(je)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(I),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(ce),width:j(fn),height:"100%",pointerEvents:"auto"}})},`${ye.widthKey}-junction`)}),Cn=()=>!o||V?null:a.jsxs(a.Fragment,{children:[Yo(),Ko()]}),Ci=ye=>{const je=!ye.objectFit&&Nn(x);return{className:`${e}-slide-image-cell${je?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:v,maxHeight:w,...je?{"--image-aspect-ratio":Qr(x)}:{}}}},Zo=ye=>ye.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ye.objectFit}}:Nn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ai=ye=>{if(ye.length===0)return null;const je=ye.length>1,I=fa($),te=`calc(-0.5 * (${I} + ${$}))`;if(ye.length===1){const ce=ye[0];return a.jsx("div",{...Ci(ce),children:a.jsx("img",{...Zo(ce),src:ce.url,alt:ce.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:je?{gap:$}:void 0,children:ye.map((ce,Te)=>a.jsxs("div",{...Ci(ce),children:[a.jsx("img",{...Zo(ce),src:ce.url,alt:ce.name??"",draggable:!1}),o&&je&&Te<ye.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:te,width:I,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ce.url}-${Te}`))})},Jo=!!(ie!=null&&ie.title2||ie!=null&&ie.title3||xt!=null&&xt.title2||xt!=null&&xt.title3||(_??0)>0||o),ia=()=>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:st,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:oi(le||ie)}),a.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...se&&Y?{minHeight:Y}:void 0,...se&&ue?{width:ue,maxWidth:"100%"}:void 0},children:[Dt(a.jsxs("div",{className:Yt,style:{position:se?"absolute":"relative",inset:se?0:void 0,width:"100%"},children:[xt&&se?a.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(ie)})]}),se&&Y?Y:void 0),Jo?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[xt&&se?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${V?` ${e}-titles-layer-in-stacked`:""}`,children:un(ie,!0)})]}):null]})]}),oa=()=>{const ye=Jo;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ye?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:ye?void 0:{flex:"0 0 auto",height:"auto"},children:oi(ie,!0)}),Cn()]})};return a.jsxs("div",{ref:ze,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ze||Ee()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:Ae?1:0,transition:"opacity 300ms ease",pointerEvents:Ae?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...Ve}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...ke,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:at,onClick:ye=>ye.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":me&&ge.length>1?"true":"false",onPointerDown:me?Tt:void 0,onPointerUp:me?Xt:void 0,onPointerCancel:me?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&pe?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ye=>{ye.target===ye.currentTarget&&ve(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:ai(wt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${pe?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:oe?ai(oe.images):null})},`slide-in-${Pe}-${ae}`)]})})}),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:Q,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...V?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${V?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${V?` ${e}-text-bar-cell-stacked`:""}`,style:V?void 0:{flex:1,minWidth:0,width:"100%"},children:V?C==="fade"?ia():oa():C==="fade"?Qe():Et()})})})]})]})]})};function ex(e){return`
|
|
15157
15157
|
.${e}-wrapper {
|
|
15158
15158
|
position: relative;
|
|
15159
15159
|
width: 100%;
|
|
@@ -15675,7 +15675,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15675
15675
|
pointer-events: auto;
|
|
15676
15676
|
z-index: 10;
|
|
15677
15677
|
}
|
|
15678
|
-
`}const
|
|
15678
|
+
`}const tx=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=W.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:b}=e,x=s.useRef(null),[g,m]=s.useState(!1),[h,f]=s.useState(0),C=s.useRef(!1),y=s.useRef(!1),R=s.useRef(!1),H=s.useMemo(()=>(t??[]).filter(L=>Gi(L).length>0),[t]),S=g&&H.length>0,U=!n,F=s.useCallback(()=>{U&&(R.current=!0,mf(y.current,c),y.current=!1)},[U,c]),_=(L=0)=>{if(H.length===0||n&&!i&&!o)return;const N=Sr(H,b),k=Math.max(0,Math.min(L,N.length-1));if(f(k),U){const Z=md();pd(k+1,c,Z),y.current=!Z}m(!0)},B=s.useCallback(()=>{m(!1),R.current=!1},[]);return s.useEffect(()=>{!n||i||o||m(!1)},[n,i,o]),s.useEffect(()=>{if(!U||C.current)return;C.current=!0;const L=yl(c);if(!L)return;const N=vl(L,Sr(H,b).length);N<0||(f(N),m(!0))},[H,c,U,b]),s.useEffect(()=>{if(!U)return;const L=()=>{if(R.current){R.current=!1,m(!1);return}const N=yl(c);if(!N){m(!1);return}const k=vl(N,Sr(H,b).length);if(k<0){m(!1);return}y.current=!1,f(k),m(!0)};return window.addEventListener("popstate",L),()=>window.removeEventListener("popstate",L)},[H,c,U,b]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:x,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ex(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Nn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>_(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Nn(p)?{"--image-aspect-ratio":Qr(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${Nn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),S&&typeof document<"u"&&(()=>{const L=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx(Qv,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:h,enableUrlSync:U,journalItemId:c,onBeforeClose:F,onClose:B}),L)})()]})},nx=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15679
15679
|
import { createPortal } from 'react-dom';
|
|
15680
15680
|
import { CommonComponentProps } from '../props';
|
|
15681
15681
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16431,7 +16431,7 @@ export type LightboxJournalSettings = {
|
|
|
16431
16431
|
closeIconColor: string;
|
|
16432
16432
|
closeIconHoverColor: string;
|
|
16433
16433
|
};
|
|
16434
|
-
`,nx="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>'),pi={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 ix(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...pi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...pi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...pi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...pi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...pi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...pi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...pi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const ox=Jn.reduce((e,t)=>({...e,...ix(t)}),{}),rx=Jn.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Goudy Bookletter 1911",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function La(e){return Jn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const ax=xf(),sx={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"}},...ox,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:nx,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...rx,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,...La({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,...La({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,...La({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:[ax]}],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"}]}]}},lx={element:ex,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:sx,sourceCode:tx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Jn.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Jn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})}},cx={sizeType:"custom",value:700,min:400,max:700};function Ar(e,t){return{widthPx:e,heightPx:e*t}}function Za(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 Vl(e,t,n,i){const{heightPx:o}=Ar(n,i);return Za(e/2,t/2,e,t,n,o)}function Ad(e,t,n){for(const i of n){const{heightPx:o}=Ar(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 dx(e,t,n,i,o,r,l,c){if(o==="system")return"none";const d=i.getBoundingClientRect(),u=document.elementFromPoint(d.left+e,d.top+t);return u&&u.closest("a")?"none":Ad(e,t,n)||r==="area"?l??"none":c??"none"}function Gl(e,t,n){var c;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((c=n.get(e))==null?void 0:c.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function ux(e){return`
|
|
16434
|
+
`,ix="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),pi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function ox(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...pi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...pi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...pi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...pi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...pi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...pi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...pi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const rx=Jn.reduce((e,t)=>({...e,...ox(t)}),{}),ax=Jn.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Goudy Bookletter 1911",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ra(e){return Jn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const sx=bf(),lx={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},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"}},...rx,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:ix,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...ax,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,...Ra({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,...Ra({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,...Ra({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:[sx]}],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"}]}]}},cx={element:tx,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:lx,sourceCode:nx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Jn.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Jn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})}},dx={sizeType:"custom",value:700,min:400,max:700};function _r(e,t){return{widthPx:e,heightPx:e*t}}function Qa(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 Gl(e,t,n,i){const{heightPx:o}=_r(n,i);return Qa(e/2,t/2,e,t,n,o)}function Ad(e,t,n){for(const i of n){const{heightPx:o}=_r(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 ux(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":Ad(e,t,n)||r==="area"?l??"none":d??"none"}function ql(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 px(e){return`
|
|
16435
16435
|
.${e}-root {
|
|
16436
16436
|
position: absolute;
|
|
16437
16437
|
top: 0;
|
|
@@ -16466,7 +16466,7 @@ export type LightboxJournalSettings = {
|
|
|
16466
16466
|
width: 32px;
|
|
16467
16467
|
height: 32px;
|
|
16468
16468
|
}
|
|
16469
|
-
`}function
|
|
16469
|
+
`}function mx(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 gx(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await mx(i)]));return new Map(n)}function hx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=W.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[b,x]=s.useState({x:0,y:0}),[g,m]=s.useState("none"),h=s.useRef({x:0,y:0}),[f,C]=s.useState(!1),[y,R]=s.useState(!1),H=s.useRef(new Map),{imageSize:S=dx,cursor:U="system",target:F="area",position:_="random",visible:B="all",defaultCursor:L=null,hoverCursor:N=null}=e,k=t.filter(v=>{var w;return!!((w=v==null?void 0:v.image)!=null&&w.url)}),Z=s.useMemo(()=>px(i),[i]),E=s.useCallback((v,w,P=l)=>{if(!o)return;const Q=o.getBoundingClientRect(),z=v-Q.left,T=w-Q.top;x({x:z,y:T}),m(ux(z,T,P,o,U,F,N,L))},[o,l,U,F,N,L]);s.useEffect(()=>{const v=[...k.map(P=>P.image.url),L,N].filter(P=>!!P);if(v.length===0){H.current=new Map,R(!0);return}let w=!1;return R(!1),gx(v).then(P=>{w||(H.current=P,R(!0))}),()=>{w=!0}},[t,L,N]),s.useEffect(()=>{if(!o)return;const v=P=>{P.stopPropagation(),h.current={x:P.clientX,y:P.clientY},E(P.clientX,P.clientY)},w=()=>{f&&E(h.current.x,h.current.y)};return o.addEventListener("mousemove",v),window.addEventListener("scroll",w,!0),()=>{o.removeEventListener("mousemove",v),window.removeEventListener("scroll",w,!0)}},[o,f,E]),s.useEffect(()=>{!o||!f||E(h.current.x,h.current.y)},[l,o,f,E]),s.useEffect(()=>{f||m("none")},[f]);const K=(v,w,P,Q={})=>{var V,me;if(!((V=v==null?void 0:v.image)!=null&&V.url))return null;const z=((me=H.current.get(v.image.url))==null?void 0:me.aspectRatio)??1,T=ql(v.image.url,S,H.current),{heightPx:O}=_r(T,z);let M=0,ee=0;return _==="same"?{x:M,y:ee}=Gl(w,P,T,z):(M=Q.x??Math.random()*w,ee=Q.y??Math.random()*P,{x:M,y:ee}=Qa(M,ee,w,P,T,O)),{id:p.current++,url:v.image.url,link:v.link,name:v.image.name,x:M,y:ee,xRatio:M/w,yRatio:ee/P,aspectRatio:z,widthPx:T}},D=()=>{if(!o)return;const v=o.getBoundingClientRect(),w=v.width,P=v.height;w===0||P===0||d(Q=>Q.length===0?Q:Q.map(z=>{const T=S.sizeType==="random"?z.widthPx:ql(z.url,S,H.current),{heightPx:O}=_r(T,z.aspectRatio);if(_==="same"){const{x:V,y:me}=Gl(w,P,T,z.aspectRatio);return{...z,x:V,y:me,widthPx:T}}const{x:M,y:ee}=Qa(z.xRatio*w,z.yRatio*P,w,P,T,O);return{...z,x:M,y:ee,widthPx:T}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const v=o.getBoundingClientRect(),w=v.width,P=v.height,Q=K(k[0],w,P);Q&&(d([Q]),u(k.length>1?1:0))},[S,_,o,t,y]),s.useEffect(()=>{if(!o)return;D();const v=new ResizeObserver(D);return v.observe(o),window.addEventListener("resize",D),()=>{v.disconnect(),window.removeEventListener("resize",D)}},[o,_,S,l.length]),s.useEffect(()=>{B==="last One"&&d(v=>v.length>0?[v[v.length-1]]:[])},[B]);const j=v=>{if(!o||k.length===0||!y)return;const w=o.getBoundingClientRect(),P=v.clientX-w.left,Q=v.clientY-w.top;if(F==="image"&&!Ad(P,Q,l))return;let z=0,T=0;_==="on Click"?(z=P,T=Q):_==="same"?(z=w.width/2,T=w.height/2):(z=Math.random()*w.width,T=Math.random()*w.height);const O=k[c%k.length],M=K(O,w.width,w.height,{x:z,y:T});if(!M)return;const ee=B==="all"?[...l,M]:[M];d(ee),u(V=>(V+1)%k.length),E(v.clientX,v.clientY,ee)},$=U==="custom"&&g!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),a.jsxs("div",{ref:r,onClick:j,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:$?"none":"default"},children:[l.map(v=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${v.y}px`,left:`${v.x}px`,width:`${v.widthPx}px`,cursor:$?"none":"default"},children:F==="area"&&v.link?a.jsx("a",{href:v.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:v.url,alt:v.name,className:`${i}-image`})}):a.jsx("img",{src:v.url,alt:v.name,className:`${i}-image`})},v.id)),f&&$&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const fx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16470
16470
|
import { CommonComponentProps } from '../props';
|
|
16471
16471
|
import { useScopedStyles } from '../utils/index';
|
|
16472
16472
|
|
|
@@ -16996,7 +16996,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
16996
16996
|
</>
|
|
16997
16997
|
);
|
|
16998
16998
|
}
|
|
16999
|
-
`,
|
|
16999
|
+
`,yx={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"]}]}]},vx={element:hx,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:yx,sourceCode:fx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},xx=100,bx=70,Vn="cubic-bezier(0.86, 0, 0.07, 1)";function wx(e){return`
|
|
17000
17000
|
.${e}-wrapper {
|
|
17001
17001
|
position: relative;
|
|
17002
17002
|
width: 100%;
|
|
@@ -17106,7 +17106,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17106
17106
|
display: block;
|
|
17107
17107
|
pointer-events: none;
|
|
17108
17108
|
}
|
|
17109
|
-
`}function
|
|
17109
|
+
`}function Sx(e){return e==="blur"?bx:e==="greyscale"?xx:0}function uo(e,t=1,n=1){const i=Sx(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 Xl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function $x(e,t){return t<=1?0:(e-1+t)%t}function Cx(e,t=1){return!e||e.height===0?t:e.width/e.height}function Tx(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 Ul(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 Fd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Yl(e,t,n){return{...Fd(e),[`--${n}-stage-scale`]:t}}function Lx(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 Rx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var he,G,re,pe,we,Pe,Ce;const{prefix:o}=W.useScopedStyles(),r=s.useMemo(()=>wx(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,b=t??[],x=Xl(b.length),[g,m]=s.useState(x.activeIndex),[h,f]=s.useState(x.backgroundIndex),[C,y]=s.useState(!1),[R,H]=s.useState(!1),[S,U]=s.useState(null),[F,_]=s.useState(null),[B,L]=s.useState(0),[N,k]=s.useState(1),[Z,E]=s.useState("none"),[K,D]=s.useState("next"),[j,$]=s.useState({}),[v,w]=s.useState({width:0,height:0}),P=s.useRef(null),Q=s.useRef(null),z=!n||!!i,T=l??60,O=Math.max(10,Math.min(100,d??T)),M=Math.max(10,Math.min(100,c??T)),ee=Math.max(100,u),V=uo(p),me=s.useCallback(Y=>{const xe=Cx(Y?j[Y]:void 0);return Tx(v.width,v.height,xe,O,M)},[v.height,v.width,j,M,O]);s.useEffect(()=>{const Y=Q.current;if(!Y)return;const xe=new ResizeObserver(([ue])=>{const{width:X,height:le}=ue.contentRect;w({width:X,height:le})});return xe.observe(Y),()=>xe.disconnect()},[]),s.useEffect(()=>{const Y=(t??[]).map(xe=>{var ue;return(ue=xe.image)==null?void 0:ue.url}).filter(xe=>!!xe);Lx(Y,(xe,ue)=>{$(X=>{var le,Fe;return((le=X[xe])==null?void 0:le.width)===ue.width&&((Fe=X[xe])==null?void 0:Fe.height)===ue.height?X:{...X,[xe]:ue}})})},[t]),s.useEffect(()=>{const{backgroundIndex:Y,activeIndex:xe}=Xl(b.length);m(xe),f(Y),y(!1),H(!1),U(null),_(null),L(0),k(1),E("none"),D("next")},[b.length,t]),s.useEffect(()=>()=>{P.current&&clearTimeout(P.current)},[]);const Ie=s.useCallback(Y=>{var fe,J,Xe,Oe;if(!z||C||b.length<=1)return;const xe=Y==="next"?(g+1)%b.length:(g-1+b.length)%b.length,ue=me((J=(fe=b[g])==null?void 0:fe.image)==null?void 0:J.url),X=me((Oe=(Xe=b[xe])==null?void 0:Xe.image)==null?void 0:Oe.url),le=Ul(v.width,v.height,ue),Fe=Ul(v.width,v.height,X);P.current&&clearTimeout(P.current),D(Y),H(!0),y(!0),Y==="next"?(U(g),_(xe),L(0),k(1),E(uo(p,0,1))):(f($x(xe,b.length)),U(xe),_(g),L(1),k(Fe),E(uo(p,1,Fe))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{Y==="next"?(L(1),k(le),E(uo(p,1,le))):(L(0),k(1),E(uo(p,0,1)))})}),P.current=setTimeout(()=>{Y==="next"&&f(g),m(xe),U(null),_(null),y(!1)},ee)},[g,p,v.height,v.width,me,C,z,b,ee]),ge=b[g],ae=h!==null?b[h]:null,ne=S!==null?b[S]:null,oe=F!==null?b[F]:null,ie=b.length<=1?0:(g-1+b.length)%b.length,Ae=b.length<=1?0:(g+1)%b.length,be=me((he=ge==null?void 0:ge.image)==null?void 0:he.url),Me=me((G=ne==null?void 0:ne.image)==null?void 0:G.url),q=me((re=oe==null?void 0:oe.image)==null?void 0:re.url),se={[`--${o}-transition-ms`]:`${ee}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:Q,className:ut(`${o}-wrapper`,R&&`${o}-snap`,n&&!i&&`${o}-editor`),style:se,"aria-label":"Zoom gallery",children:[((pe=ae==null?void 0:ae.image)==null?void 0:pe.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ae.image.url,alt:"",style:{filter:V}})}),C&&((we=ne==null?void 0:ne.image)==null?void 0:we.url)&&a.jsx("div",{className:ut(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${K}`),style:Yl(Me,N,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ne.image.url,alt:"",style:{filter:Z}})}),C&&((Pe=oe==null?void 0:oe.image)==null?void 0:Pe.url)&&a.jsx("div",{className:ut(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${K}`),style:Yl(q,B,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:oe.image.url,alt:""})}),!C&&((Ce=ge==null?void 0:ge.image)==null?void 0:Ce.url)&&a.jsx("div",{className:ut(`${o}-stage`,`${o}-foreground`),style:Fd(be),children:a.jsx("img",{className:`${o}-image`,src:ge.image.url,alt:ge.image.name??""})}),z&&b.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:ut(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ie("prev"),"aria-label":`Show previous image (${ie+1} of ${b.length})`}),a.jsx("button",{type:"button",className:ut(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ie("next"),"aria-label":`Show next image (${Ae+1} of ${b.length})`})]})]})]})}const Ix=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17110
17110
|
import cn from 'classnames';
|
|
17111
17111
|
import { CommonComponentProps } from '../props';
|
|
17112
17112
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17625,7 +17625,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17625
17625
|
</>
|
|
17626
17626
|
);
|
|
17627
17627
|
}
|
|
17628
|
-
`,
|
|
17628
|
+
`,Px={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:""}}]}},Ex={element:Rx,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:Px,sourceCode:Ix,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Mx={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},kx=["hover","active"],Ia={left:"flex-start",center:"center",right:"flex-end"};function Ax(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 Fx(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 _x(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}`,b=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,x=`.${e}-button:hover, ${b}`,g=m=>`.${e}-hover-effect-${m}:hover, .${e}-hover-effect-${m}:focus-visible, a:focus-visible .${e}-hover-effect-${m}`;return`
|
|
17629
17629
|
.${e}-root {
|
|
17630
17630
|
line-height: 0;
|
|
17631
17631
|
}
|
|
@@ -17655,11 +17655,11 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17655
17655
|
.${e}-wrapper.${e}-editing .${e}-button {
|
|
17656
17656
|
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms;
|
|
17657
17657
|
}
|
|
17658
|
-
${
|
|
17658
|
+
${g("scale-up")},
|
|
17659
17659
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-scale-up {
|
|
17660
17660
|
transform: scale(1.05);
|
|
17661
17661
|
}
|
|
17662
|
-
${
|
|
17662
|
+
${g("lift")},
|
|
17663
17663
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-lift {
|
|
17664
17664
|
transform: translateY(-2px);
|
|
17665
17665
|
box-shadow: ${p};
|
|
@@ -17721,9 +17721,9 @@ a:focus-visible .${e}-hover-effect-swipe::before,
|
|
|
17721
17721
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe::before {
|
|
17722
17722
|
transform: translateX(0);
|
|
17723
17723
|
}
|
|
17724
|
-
${
|
|
17724
|
+
${g("reveal")},
|
|
17725
17725
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal,
|
|
17726
|
-
${
|
|
17726
|
+
${g("swipe")},
|
|
17727
17727
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe {
|
|
17728
17728
|
background-color: var(--${e}-background-color);
|
|
17729
17729
|
}
|
|
@@ -17786,7 +17786,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
17786
17786
|
transform: translateY(-50%);
|
|
17787
17787
|
opacity: 1;
|
|
17788
17788
|
}
|
|
17789
|
-
${
|
|
17789
|
+
${x} {
|
|
17790
17790
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
17791
17791
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
17792
17792
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
@@ -17865,7 +17865,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17865
17865
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17866
17866
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17867
17867
|
}
|
|
17868
|
-
`}function
|
|
17868
|
+
`}function Pa(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 Kl(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=W.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function Wx({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=W.useScopedStyles(),l=s.useMemo(()=>_x(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:x="text-icon",gap:g=0,iconSize:m=0,iconWidthC:h=0,dimensions:f=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:R={top:0,left:0,right:0,bottom:0},boxShadowColor:H="rgba(0, 0, 0, 0)",innerBoxShadow:S={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:F=0,backgroundColor:_="#000000",textColor:B="#ffffff",borderColor:L="#ffffff",iconColor:N="#ffffff",hoverEffect:k="none",fontFamily:Z,fontSettings:E,fontSize:K,lineHeight:D,letterSpacing:j=0,wordSpacing:$=0,textAppearance:v,stateOverrides:w,minWidth:P=0,minHeight:Q=0,width:z=0,height:T=0}=e,O=W.buildColorVars(r,{backgroundColor:_,textColor:B,borderColor:L,iconColor:N,boxShadowColor:H,innerBoxShadowColor:U},Mx,kx,w),M=i&&i!=="default"?`${r}-state-${i}`:"",ee=t&&!n?`${r}-editing`:"",V=k!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${k}`:"",me=k==="reveal"||k==="swipe",Ie=k==="content-roll",ge=k==="reveal"&&(!t||n),ae=f===!0,oe=d==="a"?b??p:p,ie=d==="c",Ae=d!=="b",be={fontSettings:{fontFamily:Z,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:K??.01,lineHeight:D,letterSpacing:j,wordSpacing:$,textAppearance:v,color:B},q={...Ae?an(Ut(be,t)):{},[`--${r}-box-shadow-x`]:W.scalingValue(R.left,t),[`--${r}-box-shadow-y`]:W.scalingValue(R.top,t),[`--${r}-box-shadow-blur`]:W.scalingValue(R.right,t),[`--${r}-box-shadow-spread`]:W.scalingValue(R.bottom,t),[`--${r}-inner-box-shadow-x`]:W.scalingValue(S.left,t),[`--${r}-inner-box-shadow-y`]:W.scalingValue(S.top,t),[`--${r}-inner-box-shadow-blur`]:W.scalingValue(S.right,t),[`--${r}-inner-box-shadow-spread`]:W.scalingValue(S.bottom,t),paddingTop:W.scalingValue(C.top,t),paddingRight:W.scalingValue(C.right,t),paddingBottom:W.scalingValue(C.bottom,t),paddingLeft:W.scalingValue(C.left,t),borderRadius:W.scalingValue(y,t),borderWidth:W.scalingValue(F,t),...ie?{}:{justifyContent:Ia[oe],textAlign:oe},...ie&&!Ie?{gap:W.scalingValue(g,t)}:{},...ae?{width:W.scalingValue(z,t),height:W.scalingValue(T,t)}:{minWidth:W.scalingValue(P,t),minHeight:W.scalingValue(Q,t),...ie?{width:"100%"}:{}}};let se;const he={display:"inline-flex",alignItems:"center",justifyContent:ie?Ia[oe]:Ia[d==="a"?oe:"center"],gap:ie?W.scalingValue(g,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:oe}:{}};if(d==="b"){const pe=()=>Kl(r,u,m>0?"fixed":"fill",100,m,t);se=Ie?Pa(r,pe,`${r}-icon-roll`,void 0,he):pe()}else if(d==="c"){const pe=()=>{const we=a.jsx("span",{className:`${r}-text`,style:{textAlign:oe},children:c}),Pe=Kl(r,u,h>0?"fixed":"fill",100,h,t);return x==="icon-text"?a.jsxs(a.Fragment,{children:[Pe,we]}):a.jsxs(a.Fragment,{children:[we,Pe]})};se=Ie?Pa(r,pe,`${r}-icon-text-roll`,void 0,he):pe()}else se=Ie?Pa(r,()=>c,`${r}-label-roll`,void 0,he):me?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const G=ge?pe=>Ax(pe,r):void 0,re=ge?pe=>Fx(pe,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:O,children:a.jsx("div",{className:`${r}-wrapper ${M} ${ee}`.trim(),children:a.jsx("div",{className:`${r}-button ${V}`.trim(),style:q,onMouseEnter:G,onMouseLeave:re,role:"button",tabIndex:o||t&&!n?void 0:0,children:se})})})]})}const Nx=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17869
17869
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17870
17870
|
import { CommonComponentProps } from '../props';
|
|
17871
17871
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18492,7 +18492,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18492
18492
|
</>
|
|
18493
18493
|
);
|
|
18494
18494
|
}
|
|
18495
|
-
`,Nx={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hx=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Ox={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:{...Nx.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:[...Hx],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"]},Dx={element:_x,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:Ox,sourceCode:Wx,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function Bx(e){return`
|
|
18495
|
+
`,Hx={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ox=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Dx={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:{...Hx.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:[...Ox],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"]},Bx={element:Wx,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:Dx,sourceCode:Nx,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function jx(e){return`
|
|
18496
18496
|
.${e}-titles-row {
|
|
18497
18497
|
position: relative;
|
|
18498
18498
|
flex: 0 1 auto;
|
|
@@ -18690,7 +18690,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18690
18690
|
pointer-events: auto;
|
|
18691
18691
|
flex-shrink: 0;
|
|
18692
18692
|
}
|
|
18693
|
-
`}const Ln=500,uo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",jx=72,zx=50,Vx=1e4,Gx=650,qx=500;function Xx(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 _d(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Er(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 Ux(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?_d(i,n):null}function Kx(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 yo(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 Yl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return yo(e,i,n)}const Yx=.03;function Wd(e){return e.width*Yx}const Pa={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function dr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Zl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Zx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ja(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function Jx(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ja(e,t.width,t.height)}function Qx(e,t){if(Qr(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 e0(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 t0({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=>Qr(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Ji(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=Wd(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function Fr(e,t,n){const i=Ji(e,t,n);return{...i,left:2*i.left-e.left}}function n0(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 Nd(e,t,n,i){const o=Ji(e,"left",i),r=Ji(e,"right",i),l=Fr(e,"left",i),c=Fr(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:c,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:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function i0(e,t,n,i){const{start:o,end:r}=Nd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function o0(e,t,n){const i=Ji(e,t,n),o=Fr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Qr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function r0({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function ur({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Qr(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 a0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:f,resolveCloseSourceRect:h,onClose:g,onPrev:m,onNext:x}){const T=s.useRef(null),y=s.useRef(null),w=s.useRef(null),B=s.useRef(new Map),[M,G]=s.useState(0),O=s.useRef(null),_=s.useRef(0),j=s.useRef(0),b=s.useRef("none"),H=s.useRef(!1),E=s.useRef(!1),$=s.useRef(!1),S=s.useRef(null),P=s.useRef(null),I=s.useRef(null),N=s.useRef(()=>{}),z=s.useRef(null),C=s.useRef(null),R=s.useRef(null),D=s.useRef(!1),[ie,ee]=s.useState(null),[A,ae]=s.useState(Pa),[k,J]=s.useState(0),[X,me]=s.useState("opening"),[Le,he]=s.useState(0),[K,V]=s.useState(0),[Y,Q]=s.useState(!1),[Te,we]=s.useState(null),[ke,le]=s.useState(null),[ge,be]=s.useState(null),[ne,ce]=s.useState(!1),[ue,xe]=s.useState(null),[Ae,Ie]=s.useState(!1),U=s.useRef(!1),[ve,de]=s.useState(!1),[q,re]=s.useState(!1),Fe=s.useRef(n),pe=s.useRef(void 0),Z=t[n],Xe=Z?Qr(Z):!1,Oe=K!==0||Y,dt=!l&&(!r||!!c),nt=d&&!l,ht=u.length>1,st=s.useCallback((F,$e)=>t.length<=1?null:t[(F+$e+t.length)%t.length]??null,[t]),ze=ht?yo(u,p,-1):st(n,-1),Se=ht?yo(u,p,1):st(n,1),_e=Te===-1&&Oe?ht&&ke!==null?yo(u,ke,-1):ge!==null?st(ge,-1):null:null,Be=Te===1&&Oe?ht&&ke!==null?yo(u,ke,1):ge!==null?st(ge,1):null:null,Ke=_e&&_e.url!==(ze==null?void 0:ze.url)?_e:null,se=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,ye=ze&&nt?(()=>{const F=ht?Yl(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return F&&F.url!==ze.url?F:null})():null,Ee=Se&&nt?(()=>{const F=ht?Yl(u,p,1):t.length>2?st((n+1)%t.length,1):null;return F&&F.url!==Se.url?F:null})():null,Ge=Ke??ye,Ze=se??Ee,Ve=s.useCallback((F,$e,Pe)=>{if(!F||!$e||!Pe)return;const Ne=B.current,ot=Ne.get(F);(ot==null?void 0:ot.width)===$e&&(ot==null?void 0:ot.height)===Pe||(Ne.set(F,{width:$e,height:Pe}),G(Et=>Et+1))},[]),at=s.useCallback(F=>{if(!(F!=null&&F.url))return null;const $e=B.current.get(F.url);return Jx(y.current,$e)},[M,k]),Je=s.useCallback(()=>{if(!Z)return;const F=at(Z);if(F){ee(F);return}const $e=y.current;$e&&ee(Zl($e))},[Z,at]),Me=s.useCallback(F=>{if(ht){const $e=u.length;le((p+F+$e)%$e),be(null);return}t.length>1&&(be((n+F+t.length)%t.length),le(null))},[ht,u.length,p,t.length,n]),qe=s.useCallback(F=>{$.current=F,Q(F)},[]),We=s.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null)},[]),tt=s.useCallback(()=>{We(),S.current=window.setTimeout(()=>{We(),qe(!1)},uo+32)},[We,qe]),rt=s.useCallback(()=>{const F=T.current;if(!F){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:Pa.width,height:typeof window<"u"?window.innerHeight:Pa.height});return}const $e=F.getBoundingClientRect();ae({left:$e.left,top:$e.top,width:$e.width,height:$e.height})},[]),lt=s.useCallback((F,$e)=>{if(Oe){if(ve&&!Y)return`translate(${K}px, 0px)`;if(Y&&Te!==null){const Pe=at(F);if(!Pe)return;const{x:Ne,y:ot}=i0(Pe,$e,Te,A);return`translate(${Ne}px, ${ot}px)`}if(Y)return"translate(0px, 0px)"}},[Oe,ve,Y,K,Te,A,at]),Tt=s.useCallback(()=>{const F=P.current;P.current=null,We(),qe(!1),we(null),le(null),be(null),V(0),de(!1),H.current=!1,j.current=0,b.current="none",F===-1?m():F===1&&x()},[We,qe,m,x]),Xt=s.useCallback(()=>{We(),S.current=window.setTimeout(()=>{P.current!==null&&Tt()},uo+32)},[We,Tt]),Zt=s.useCallback(()=>{We(),P.current=null,qe(!1),we(null),le(null),be(null),V(0),de(!1),H.current=!1,j.current=0,b.current="none"},[We,qe]),xt=s.useCallback(F=>{if(!(!nt||!ie)){if($.current){if(P.current===F){I.current=F,Tt();return}Zt()}We(),Me(F),P.current=F,we(F),qe(!0),Xt()}},[nt,ie,Tt,Zt,We,Me,qe,Xt]);N.current=xt;const wt=s.useCallback(()=>{z.current=null,D.current=!1,C.current!==null&&(window.clearInterval(C.current),C.current=null),R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),Bt=s.useCallback(F=>{C.current!==null&&window.clearInterval(C.current);const $e=D.current?qx:Gx;C.current=window.setInterval(()=>{N.current(F)},$e)},[]),At=s.useCallback(F=>{z.current!==F&&(wt(),z.current=F,D.current=!1,N.current(F),Bt(F),R.current=window.setTimeout(()=>{R.current=null,z.current===F&&(D.current=!0,Bt(F))},Vx))},[wt,Bt]),vt=s.useCallback(()=>{const F=y.current;if(!F)return;const $e=Z==null?void 0:Z.url,Pe=$e?B.current.get($e):void 0;if(Pe!=null&&Pe.width&&(Pe!=null&&Pe.height)){ee(Ja(F,Pe.width,Pe.height));return}const Ne=w.current;if(Ne&&$e&&(Ne.src===$e||Ne.currentSrc===$e)){const{width:Et,height:Qe}=Zx(Ne);if(Et&&Qe){Ve($e,Et,Qe),ee(Ja(F,Et,Qe));return}}const ot=Zl(F);!ot.width||!ot.height||ee(ot)},[Z==null?void 0:Z.url,Ve]),Ft=s.useCallback(F=>{if(w.current=F,!!F){if(F instanceof HTMLVideoElement){F.readyState>=1&&F.videoWidth>0&&vt();return}F.complete&&F.naturalWidth>0&&vt()}},[vt]),Wt=s.useCallback(()=>{rt(),vt(),J(F=>F+1)},[rt,vt]);s.useEffect(()=>{Wt();const F=y.current,$e=T.current,Pe=new ResizeObserver(()=>Wt());return F&&Pe.observe(F),$e&&Pe.observe($e),window.addEventListener("resize",Wt),()=>{Pe.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,v]),s.useLayoutEffect(()=>{if(!Z)return;const F=w.current;if(F){if(F instanceof HTMLImageElement&&F.complete&&F.naturalWidth>0){vt();return}F instanceof HTMLVideoElement&&F.readyState>=1&&F.videoWidth>0&&vt()}},[Z==null?void 0:Z.url,n,vt]),s.useEffect(()=>{Je()},[Je,M]),s.useEffect(()=>{const F=new Set,$e=[],Pe=Ne=>{!(Ne!=null&&Ne.url)||F.has(Ne.url)||(F.add(Ne.url),$e.push(Ne))};t.forEach(Pe),u.forEach(Ne=>Ne.items.forEach(Pe)),$e.forEach(Ne=>{B.current.has(Ne.url)||Qx(Ne,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(X!=="opening"||!ie)return;if(!f){me("open");return}ce(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),me("open")})});return()=>cancelAnimationFrame(F)},[X,ie,f]),s.useEffect(()=>{if(X!=="closing")return;const F=setTimeout(()=>g(),Ln);return()=>clearTimeout(F)},[X,g]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Fe.current===n&&pe.current===(Z==null?void 0:Z.url)||(We(),P.current=null,we(null),le(null),be(null),he(0),V(0),qe(!1),re(!1),de(!1),_.current=0,j.current=0,b.current="none",H.current=!1,O.current=null,E.current=!1,w.current=null,Je(),Fe.current=n,pe.current=Z==null?void 0:Z.url)},[n,Z==null?void 0:Z.url,qe,We,Je]),s.useLayoutEffect(()=>{const F=I.current;F!==null&&(I.current=null,requestAnimationFrame(()=>{N.current(F)}))},[n,p,Z==null?void 0:Z.url]),s.useLayoutEffect(()=>{if(X==="opening"){U.current=!1,Ie(!1);return}if(X!=="open"||U.current)return;if(!ze&&!Se){U.current=!0;return}Ie(!1);const F=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ie(!0),U.current=!0})});return()=>cancelAnimationFrame(F)},[X,ze==null?void 0:ze.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(X!=="open")return;const F=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},$e=Qe=>{const yt=Qe<0?1:-1;We(),Me(yt),P.current=yt,we(yt),qe(!0),Xt()},Pe=Qe=>{if(Math.abs(Qe)>zx&&nt){$e(Qe);return}P.current=null,we(null),le(null),be(null),qe(!0),V(0),tt()},Ne=Qe=>{if(Qe.touches.length!==1||$.current)return;const yt=Qe.touches[0];E.current=!0,O.current={x:yt.clientX,y:yt.clientY},b.current="none",j.current=0,H.current=!1},ot=Qe=>{if(!O.current||Qe.touches.length!==1||$.current)return;const yt=Qe.touches[0],Dt=yt.clientX-O.current.x,Lt=yt.clientY-O.current.y;if(b.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;b.current="horizontal"}else if(Lt>0){if(!dt)return;b.current="vertical"}else return}if(b.current==="horizontal"){H.current=!0,de(!0),j.current=Dt,V(Dt),Qe.preventDefault();return}b.current==="vertical"&&(H.current=!0,de(!0),_.current=Lt,he(Lt),Qe.preventDefault())},Et=()=>{if(!O.current)return;const Qe=b.current,yt=H.current;if(yt&&Qe==="horizontal")Pe(j.current),F();else if(yt&&Qe==="vertical"){const Dt=_.current;if(dt&&Dt>jx){const Lt=window.innerHeight;_.current=Lt,re(!0),he(Lt),me("closing")}else _.current=0,he(0);F()}else Qe==="horizontal"&&Math.abs(j.current)>0&&(Pe(j.current),F());O.current=null,b.current="none",j.current=0,H.current=!1,de(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[X,nt,qe,tt,We,dt,Xt,Me]);const Kt=s.useCallback(()=>{const F=(h==null?void 0:h())??f??null;F&&ie&&(xe(F),ce(!0)),me("closing")},[h,f,ie]);s.useEffect(()=>{const F=Ne=>{if(Ne.key==="Escape"){if(r&&c||X==="closing")return;wt(),Kt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||X!=="open"||!nt)return;Ne.preventDefault();const ot=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&z.current===ot||At(ot)},$e=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ot=Ne.key==="ArrowLeft"?-1:1;z.current===ot&&wt()},Pe=()=>{wt()};return window.addEventListener("keydown",F),window.addEventListener("keyup",$e),window.addEventListener("blur",Pe),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",$e),window.removeEventListener("blur",Pe),wt()}},[X,r,c,Kt,nt,At,wt]),s.useEffect(()=>{X!=="open"&&wt()},[X,wt]);const Jt=()=>{X==="closing"||l||Kt()},Ct=X==="open",Nt=X==="closing",rn=Le>0?Math.max(0,1-Le/500):1,mt=Le>0?Math.max(.35,1-Le/500):1,Re=s.useCallback(F=>{if(!(F.propertyName!=="transform"||!$.current)){if(P.current!==null){Tt();return}We(),qe(!1)}},[We,qe,Tt]),De=X==="closing"?ue??f:f,it=De&&ie&&(X==="opening"||Nt)?Xx(De,ie):void 0,gt=Oe&&Z?lt(Z,"center"):Le>0?`translateY(${Le}px)`:it,ft=ie?dr(ie,A):null,It=!!(De&&ie),pt=It&&(X==="closing"||X==="open"&&ne),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:gt,opacity:Le>0?mt:It?1:X==="opening"||Nt?0:1,transition:ve&&!Y?"none":Y?`transform ${uo}ms ${mn}`:q?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:pt?`transform ${Ln}ms ${mn}`:X==="opening"||Nt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Xe&&Ct&&!Oe?"auto":"none",touchAction:Xe&&Ct?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(F,$e,Pe="adjacent")=>{const Ne=at(F);if(!Ne)return{display:"none"};const ot=Pe==="far"?$e==="left"?"far-left":"far-right":$e==="left"?"left-adjacent":"right-adjacent",{start:Et}=Te!==null?Nd(Ne,ot,Te,A):{start:Pe==="far"?Fr(Ne,$e,A):Ji(Ne,$e,A)},Qe=dr(Et,A),yt=lt(F,ot),Dt=!Oe&&Pe==="adjacent"&&Ct&&!Ae?o0(Ne,$e,A):null,Lt=Pe==="far"&&Oe&&Te===($e==="left"?-1:1),nn=ve&&!Y?!1:Y,un=Pe==="adjacent"&&Ct&&Ae&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Pe==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Pe==="far"?`transform ${uo}ms ${mn}`:`transform ${uo}ms ${mn}, opacity ${Ln}ms ${mn}`:un?`transform ${Ln}ms ${mn}`:X==="opening"||Nt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(F,$e)=>{const Pe=at(F);return Pe?n0(Ji(Pe,$e,A),$e,A):null},Gt=F=>$e=>{if(!l){if(E.current){E.current=!1;return}$e.stopPropagation(),xt(F)}},Ht=ze?Vt(ze,"left"):null,Ot=Se?Vt(Se,"right"):null,_t=Ht?dr(Ht,A):null,St=Ot?dr(Ot,A):null;return a.jsxs("div",{ref:T,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:X==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?rn:0,transition:ve?"none":`opacity ${Ln}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:Ct?1:0,transition:ve?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(yd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Jt})})]}),Ct&&Ge&&a.jsx(ur,{media:Ge,style:Mt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Re},`far-prev-${Ge.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(ur,{media:ze,style:Mt(ze,"left"),onMeasure:Ve,onTransitionEnd:Re},`prev-${ze.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(ur,{media:Se,style:Mt(Se,"right"),onMeasure:Ve,onTransitionEnd:Re},`next-${Se.url}`),St&&a.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&a.jsx(ur,{media:Ze,style:Mt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Re},`far-next-${Ze.url}`),ie&&Z&&(Xe?a.jsx(r0,{src:Z.url,phase:X,onMediaElement:Ft,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Re},`${n}-${Z.url}`):a.jsx("img",{ref:Ft,src:Z.url,alt:Z.name,onLoad:vt,onTransitionEnd:Re,style:jt},`${n}-${Z.url}`))]})}const s0=20,l0=.18;function c0(e){return`
|
|
18693
|
+
`}const Ln=500,po=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",zx=72,Vx=50,Gx=1e4,qx=650,Xx=500;function Ux(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 _d(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=kr(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 Yx(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?_d(i,n):null}function Kx(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 vo(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 Zl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return vo(e,i,n)}const Zx=.03;function Wd(e){return e.width*Zx}const Ea={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 Jl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Jx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function es(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 Qx(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:es(e,t.width,t.height)}function e0(e,t){if(ea(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 t0(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 n0({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=>ea(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 Qi(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 Wr(e,t,n){const i=Qi(e,t,n);return{...i,left:2*i.left-e.left}}function i0(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 Nd(e,t,n,i){const o=Qi(e,"left",i),r=Qi(e,"right",i),l=Wr(e,"left",i),d=Wr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function o0(e,t,n,i){const{start:o,end:r}=Nd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function r0(e,t,n){const i=Qi(e,t,n),o=Wr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ea(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function a0({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 ea(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 s0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:x,resolveCloseSourceRect:g,onClose:m,onPrev:h,onNext:f}){const C=s.useRef(null),y=s.useRef(null),R=s.useRef(null),H=s.useRef(new Map),[S,U]=s.useState(0),F=s.useRef(null),_=s.useRef(0),B=s.useRef(0),L=s.useRef("none"),N=s.useRef(!1),k=s.useRef(!1),Z=s.useRef(!1),E=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(()=>{}),$=s.useRef(null),v=s.useRef(null),w=s.useRef(null),P=s.useRef(!1),[Q,z]=s.useState(null),[T,O]=s.useState(Ea),[M,ee]=s.useState(0),[V,me]=s.useState("opening"),[Ie,ge]=s.useState(0),[ae,ne]=s.useState(0),[oe,ie]=s.useState(!1),[Ae,be]=s.useState(null),[Me,q]=s.useState(null),[se,he]=s.useState(null),[G,re]=s.useState(!1),[pe,we]=s.useState(null),[Pe,Ce]=s.useState(!1),Y=s.useRef(!1),[xe,ue]=s.useState(!1),[X,le]=s.useState(!1),Fe=s.useRef(n),fe=s.useRef(void 0),J=t[n],Xe=J?ea(J):!1,Oe=ae!==0||oe,dt=!l&&(!r||!!d),nt=c&&!l,ht=u.length>1,st=s.useCallback((A,$e)=>t.length<=1?null:t[(A+$e+t.length)%t.length]??null,[t]),ze=ht?vo(u,p,-1):st(n,-1),Se=ht?vo(u,p,1):st(n,1),_e=Ae===-1&&Oe?ht&&Me!==null?vo(u,Me,-1):se!==null?st(se,-1):null:null,Be=Ae===1&&Oe?ht&&Me!==null?vo(u,Me,1):se!==null?st(se,1):null:null,Ye=_e&&_e.url!==(ze==null?void 0:ze.url)?_e:null,de=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,ve=ze&&nt?(()=>{const A=ht?Zl(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return A&&A.url!==ze.url?A:null})():null,Ee=Se&&nt?(()=>{const A=ht?Zl(u,p,1):t.length>2?st((n+1)%t.length,1):null;return A&&A.url!==Se.url?A:null})():null,Ge=Ye??ve,Ze=de??Ee,Ve=s.useCallback((A,$e,Re)=>{if(!A||!$e||!Re)return;const Ne=H.current,ot=Ne.get(A);(ot==null?void 0:ot.width)===$e&&(ot==null?void 0:ot.height)===Re||(Ne.set(A,{width:$e,height:Re}),U(Et=>Et+1))},[]),at=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const $e=H.current.get(A.url);return Qx(y.current,$e)},[S,M]),Je=s.useCallback(()=>{if(!J)return;const A=at(J);if(A){z(A);return}const $e=y.current;$e&&z(Jl($e))},[J,at]),ke=s.useCallback(A=>{if(ht){const $e=u.length;q((p+A+$e)%$e),he(null);return}t.length>1&&(he((n+A+t.length)%t.length),q(null))},[ht,u.length,p,t.length,n]),qe=s.useCallback(A=>{Z.current=A,ie(A)},[]),We=s.useCallback(()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),tt=s.useCallback(()=>{We(),E.current=window.setTimeout(()=>{We(),qe(!1)},po+32)},[We,qe]),rt=s.useCallback(()=>{const A=C.current;if(!A){O({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ea.width,height:typeof window<"u"?window.innerHeight:Ea.height});return}const $e=A.getBoundingClientRect();O({left:$e.left,top:$e.top,width:$e.width,height:$e.height})},[]),lt=s.useCallback((A,$e)=>{if(Oe){if(xe&&!oe)return`translate(${ae}px, 0px)`;if(oe&&Ae!==null){const Re=at(A);if(!Re)return;const{x:Ne,y:ot}=o0(Re,$e,Ae,T);return`translate(${Ne}px, ${ot}px)`}if(oe)return"translate(0px, 0px)"}},[Oe,xe,oe,ae,Ae,T,at]),Tt=s.useCallback(()=>{const A=K.current;K.current=null,We(),qe(!1),be(null),q(null),he(null),ne(0),ue(!1),N.current=!1,B.current=0,L.current="none",A===-1?h():A===1&&f()},[We,qe,h,f]),Xt=s.useCallback(()=>{We(),E.current=window.setTimeout(()=>{K.current!==null&&Tt()},po+32)},[We,Tt]),Zt=s.useCallback(()=>{We(),K.current=null,qe(!1),be(null),q(null),he(null),ne(0),ue(!1),N.current=!1,B.current=0,L.current="none"},[We,qe]),xt=s.useCallback(A=>{if(!(!nt||!Q)){if(Z.current){if(K.current===A){D.current=A,Tt();return}Zt()}We(),ke(A),K.current=A,be(A),qe(!0),Xt()}},[nt,Q,Tt,Zt,We,ke,qe,Xt]);j.current=xt;const wt=s.useCallback(()=>{$.current=null,P.current=!1,v.current!==null&&(window.clearInterval(v.current),v.current=null),w.current!==null&&(window.clearTimeout(w.current),w.current=null)},[]),Bt=s.useCallback(A=>{v.current!==null&&window.clearInterval(v.current);const $e=P.current?Xx:qx;v.current=window.setInterval(()=>{j.current(A)},$e)},[]),At=s.useCallback(A=>{$.current!==A&&(wt(),$.current=A,P.current=!1,j.current(A),Bt(A),w.current=window.setTimeout(()=>{w.current=null,$.current===A&&(P.current=!0,Bt(A))},Gx))},[wt,Bt]),vt=s.useCallback(()=>{const A=y.current;if(!A)return;const $e=J==null?void 0:J.url,Re=$e?H.current.get($e):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){z(es(A,Re.width,Re.height));return}const Ne=R.current;if(Ne&&$e&&(Ne.src===$e||Ne.currentSrc===$e)){const{width:Et,height:Qe}=Jx(Ne);if(Et&&Qe){Ve($e,Et,Qe),z(es(A,Et,Qe));return}}const ot=Jl(A);!ot.width||!ot.height||z(ot)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(A=>{if(R.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&vt();return}A.complete&&A.naturalWidth>0&&vt()}},[vt]),Wt=s.useCallback(()=>{rt(),vt(),ee(A=>A+1)},[rt,vt]);s.useEffect(()=>{Wt();const A=y.current,$e=C.current,Re=new ResizeObserver(()=>Wt());return A&&Re.observe(A),$e&&Re.observe($e),window.addEventListener("resize",Wt),()=>{Re.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,b]),s.useLayoutEffect(()=>{if(!J)return;const A=R.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){vt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{Je()},[Je,S]),s.useEffect(()=>{const A=new Set,$e=[],Re=Ne=>{!(Ne!=null&&Ne.url)||A.has(Ne.url)||(A.add(Ne.url),$e.push(Ne))};t.forEach(Re),u.forEach(Ne=>Ne.items.forEach(Re)),$e.forEach(Ne=>{H.current.has(Ne.url)||e0(Ne,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(V!=="opening"||!Q)return;if(!x){me("open");return}re(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),me("open")})});return()=>cancelAnimationFrame(A)},[V,Q,x]),s.useEffect(()=>{if(V!=="closing")return;const A=setTimeout(()=>m(),Ln);return()=>clearTimeout(A)},[V,m]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Fe.current===n&&fe.current===(J==null?void 0:J.url)||(We(),K.current=null,be(null),q(null),he(null),ge(0),ne(0),qe(!1),le(!1),ue(!1),_.current=0,B.current=0,L.current="none",N.current=!1,F.current=null,k.current=!1,R.current=null,Je(),Fe.current=n,fe.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,We,Je]),s.useLayoutEffect(()=>{const A=D.current;A!==null&&(D.current=null,requestAnimationFrame(()=>{j.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(V==="opening"){Y.current=!1,Ce(!1);return}if(V!=="open"||Y.current)return;if(!ze&&!Se){Y.current=!0;return}Ce(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),Y.current=!0})});return()=>cancelAnimationFrame(A)},[V,ze==null?void 0:ze.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(V!=="open")return;const A=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},$e=Qe=>{const yt=Qe<0?1:-1;We(),ke(yt),K.current=yt,be(yt),qe(!0),Xt()},Re=Qe=>{if(Math.abs(Qe)>Vx&&nt){$e(Qe);return}K.current=null,be(null),q(null),he(null),qe(!0),ne(0),tt()},Ne=Qe=>{if(Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0];k.current=!0,F.current={x:yt.clientX,y:yt.clientY},L.current="none",B.current=0,N.current=!1},ot=Qe=>{if(!F.current||Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0],Dt=yt.clientX-F.current.x,Lt=yt.clientY-F.current.y;if(L.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;L.current="horizontal"}else if(Lt>0){if(!dt)return;L.current="vertical"}else return}if(L.current==="horizontal"){N.current=!0,ue(!0),B.current=Dt,ne(Dt),Qe.preventDefault();return}L.current==="vertical"&&(N.current=!0,ue(!0),_.current=Lt,ge(Lt),Qe.preventDefault())},Et=()=>{if(!F.current)return;const Qe=L.current,yt=N.current;if(yt&&Qe==="horizontal")Re(B.current),A();else if(yt&&Qe==="vertical"){const Dt=_.current;if(dt&&Dt>zx){const Lt=window.innerHeight;_.current=Lt,le(!0),ge(Lt),me("closing")}else _.current=0,ge(0);A()}else Qe==="horizontal"&&Math.abs(B.current)>0&&(Re(B.current),A());F.current=null,L.current="none",B.current=0,N.current=!1,ue(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[V,nt,qe,tt,We,dt,Xt,ke]);const Yt=s.useCallback(()=>{const A=(g==null?void 0:g())??x??null;A&&Q&&(we(A),re(!0)),me("closing")},[g,x,Q]);s.useEffect(()=>{const A=Ne=>{if(Ne.key==="Escape"){if(r&&d||V==="closing")return;wt(),Yt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||V!=="open"||!nt)return;Ne.preventDefault();const ot=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&$.current===ot||At(ot)},$e=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ot=Ne.key==="ArrowLeft"?-1:1;$.current===ot&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",$e),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",$e),window.removeEventListener("blur",Re),wt()}},[V,r,d,Yt,nt,At,wt]),s.useEffect(()=>{V!=="open"&&wt()},[V,wt]);const Jt=()=>{V==="closing"||l||Yt()},Ct=V==="open",Nt=V==="closing",rn=Ie>0?Math.max(0,1-Ie/500):1,mt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!Z.current)){if(K.current!==null){Tt();return}We(),qe(!1)}},[We,qe,Tt]),De=V==="closing"?pe??x:x,it=De&&Q&&(V==="opening"||Nt)?Ux(De,Q):void 0,gt=Oe&&J?lt(J,"center"):Ie>0?`translateY(${Ie}px)`:it,ft=Q?pr(Q,T):null,It=!!(De&&Q),pt=It&&(V==="closing"||V==="open"&&G),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:gt,opacity:Ie>0?mt:It?1:V==="opening"||Nt?0:1,transition:xe&&!oe?"none":oe?`transform ${po}ms ${mn}`:X?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:pt?`transform ${Ln}ms ${mn}`:V==="opening"||Nt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Xe&&Ct&&!Oe?"auto":"none",touchAction:Xe&&Ct?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(A,$e,Re="adjacent")=>{const Ne=at(A);if(!Ne)return{display:"none"};const ot=Re==="far"?$e==="left"?"far-left":"far-right":$e==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ae!==null?Nd(Ne,ot,Ae,T):{start:Re==="far"?Wr(Ne,$e,T):Qi(Ne,$e,T)},Qe=pr(Et,T),yt=lt(A,ot),Dt=!Oe&&Re==="adjacent"&&Ct&&!Pe?r0(Ne,$e,T):null,Lt=Re==="far"&&Oe&&Ae===($e==="left"?-1:1),nn=xe&&!oe?!1:oe,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Re==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${po}ms ${mn}`:`transform ${po}ms ${mn}, opacity ${Ln}ms ${mn}`:un?`transform ${Ln}ms ${mn}`:V==="opening"||Nt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(A,$e)=>{const Re=at(A);return Re?i0(Qi(Re,$e,T),$e,T):null},Gt=A=>$e=>{if(!l){if(k.current){k.current=!1;return}$e.stopPropagation(),xt(A)}},Ht=ze?Vt(ze,"left"):null,Ot=Se?Vt(Se,"right"):null,_t=Ht?pr(Ht,T):null,St=Ot?pr(Ot,T):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?rn:0,transition:xe?"none":`opacity ${Ln}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:Ct?1:0,transition:xe?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(yd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Ct&&Ge&&a.jsx(mr,{media:Ge,style:Mt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Le},`far-prev-${Ge.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:ze,style:Mt(ze,"left"),onMeasure:Ve,onTransitionEnd:Le},`prev-${ze.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Se,style:Mt(Se,"right"),onMeasure:Ve,onTransitionEnd:Le},`next-${Se.url}`),St&&a.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&a.jsx(mr,{media:Ze,style:Mt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Le},`far-next-${Ze.url}`),Q&&J&&(Xe?a.jsx(a0,{src:J.url,phase:V,onMediaElement:Ft,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Le,style:jt},`${n}-${J.url}`))]})}const l0=20,c0=.18;function d0(e){return`
|
|
18694
18694
|
.${e}-wrapper {
|
|
18695
18695
|
box-sizing: border-box;
|
|
18696
18696
|
max-width: 100%;
|
|
@@ -18777,8 +18777,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18777
18777
|
z-index: 2;
|
|
18778
18778
|
pointer-events: auto;
|
|
18779
18779
|
}
|
|
18780
|
-
${
|
|
18781
|
-
`}function
|
|
18780
|
+
${jx(e)}
|
|
18781
|
+
`}function u0(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 p0(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 m0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:W.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:W.scalingValue(i*c0,n??!1),[`--${t}-image-aspect`]:u0(e)}}function g0(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function h0(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 f0(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?_d(d,o):void 0)}}function y0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>d0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,x=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=W.scalingValue(x,n??!1),m=`max(${g}, ${l0}px)`,{objectFitMode:h,imageStyle:f}=h0(e),C=g0(e,n),y=s.useRef(null),[R,H]=s.useState(!1),[S,U]=s.useState([]),[F,_]=s.useState(0),[B,L]=s.useState(0),[N,k]=s.useState(null),[Z,E]=s.useState({title1:"",title2:"",title3:""}),K=(!n||i)&&!R,D=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},j=D.sizeType??"none",$=K&&j!=="none"?`${d}-item-image-hover-${j}`:void 0,v=(D.value??120)/100,w=s.useCallback(ae=>{!ae||j!=="scale"||(ae.style.transformOrigin=ug(ae))},[j]),P=s.useCallback(ae=>{if(ae){if(h==="contain"){const ne=p0(ae);if(ne){const oe=ae.closest(`.${d}-item-image`);oe instanceof HTMLElement&&oe.style.setProperty(`--${d}-item-media-aspect`,String(ne))}}w(ae)}},[d,w,h]),Q={width:W.scalingValue(b,n??!1),...C,...m0(e,d,n),[`--${d}-image-hover-scale`]:String(v)},z=(()=>{const ae={},ne=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return ne&&(ae["--cntrl-article-width"]=ne),ae})(),T=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),O=s.useMemo(()=>Kx(u),[u]),M=s.useMemo(()=>t0(u),[u]),ee=(ae,ne)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const oe=O.findIndex(Ae=>Ae.gridIndex===ae);if(oe<0)return;const ie=O[oe];L(oe),U(ie.items),_(0),E(ie.entry),k(ne??null),H(!0)},V=s.useCallback(()=>{H(!1),k(null)},[]),me=s.useCallback(()=>{const ae=O[B];return!ae||!y.current?N:Yx(y.current,ae.gridIndex,h)??N},[O,B,N,h]),Ie=s.useCallback(ae=>{if(O.length>1){const ne=O.length,oe=(B+ae+ne)%ne,ie=O[oe];L(oe),U(ie.items),_(0),E(ie.entry);return}_(ne=>(ne+ae+S.length)%S.length)},[O,B,S.length]),ge=O.length>1||S.length>1;return s.useEffect(()=>{if(!R||typeof document>"u")return;const ae=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ae}},[R]),s.useEffect(()=>{!n||o||i||H(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&H(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(n0,{mediaList:M}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:Q,children:u.map((ae,ne)=>{var Ae,be;const oe=!!((Ae=ae.image)!=null&&Ae.url),ie=f0(!!T,oe,ne,d,h,ee);return a.jsxs("div",{className:`${d}-item`,children:[ae.title?a.jsx("span",{className:`${d}-item-title`,onClick:ie,style:ie?{cursor:"pointer"}:void 0,children:ae.title}):null,(be=ae.image)!=null&&be.url?a.jsx("span",{className:[`${d}-item-image`,h==="contain"?`${d}-item-image-fit`:void 0,$].filter(Boolean).join(" "),children:ae.image.type==="video"?a.jsx("video",{ref:P,src:ae.image.url,"data-waterfall-index":ne,style:f,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:ie,onLoadedData:Me=>P(Me.currentTarget)}):a.jsx("img",{ref:P,src:ae.image.url,alt:ae.image.name??"","data-waterfall-index":ne,style:f,onClick:ie,onLoad:Me=>P(Me.currentTarget)})}):null,ne<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:g},children:o&&!R&&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:m,height:"100%"}})})]},ne)})}),R&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ae=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:z,"data-selection":"none",children:a.jsx(s0,{prefix:d,items:S,index:F,entry:Z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ge,lightboxEntries:O,entryIdx:B,layoutId:r,sourceRect:N,resolveCloseSourceRect:me,onClose:V,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),ae)})()]})}const v0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18782
18782
|
import type React from 'react';
|
|
18783
18783
|
import { createPortal } from 'react-dom';
|
|
18784
18784
|
import { CommonComponentProps } from '../props';
|
|
@@ -19292,7 +19292,7 @@ export function Waterfall({
|
|
|
19292
19292
|
</>
|
|
19293
19293
|
);
|
|
19294
19294
|
}
|
|
19295
|
-
`,v0="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>'),Gn={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 x0(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...Gn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...Gn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...Gn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...Gn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...Gn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...Gn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...Gn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Qi=Jn.filter(e=>e!=="count"),b0=Qi.reduce((e,t)=>({...e,...x0(t)}),{}),w0=Qi.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ea(e){return Qi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const S0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Qi.map(e=>[Is[e],Ps(e)]))},pr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},$0=[{title:"Salton Sea from Above",...pr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...pr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...pr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...pr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],C0={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:$0},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:{...Gn.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"]}}},...b0},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:v0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...w0},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,...Ea({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,...Ea({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,...Ea({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:[S0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},T0={element:f0,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"},...Qi.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Qi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:C0,sourceCode:y0},Oi=500,Hd="cubic-bezier(0.25, 1, 0.5, 1)",L0=300,R0=5,I0=.15,P0=.4,E0=100,Ii=100,Jl={color:"#000000",hover:"#cccccc"},po={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},M0={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}},Ma={offset:{x:0,y:0},linkColor:"#cccccc"},Ql={sizeType:"drag",value:3},k0="left";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)??.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:k0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function Pi(e,t,n){return`${e}: ${W.scalingValue(t/1440,n)};`}function vo(e,t){return t<=0?0:(e%t+t)%t}function F0(e,t,n,i){if(!i)return{position:vo(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 _0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function W0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,v)=>{n.style.transform=`translate(${p}px, ${v}px)`;const f=n.getBoundingClientRect();return{x:f.left,y:f.top}},o=i(0,0),r=i(Ii,0),l=i(0,Ii);e.removeChild(n);const c={x:(r.x-o.x)/Ii,y:(r.y-o.y)/Ii},d={x:(l.x-o.x)/Ii,y:(l.y-o.y)/Ii},u=c.x*d.y-d.x*c.y;return{ex:c,ey:d,det:u}}function N0(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 H0(e,t){return`
|
|
19295
|
+
`,x0="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>'),Gn={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 b0(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...Gn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...Gn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...Gn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...Gn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...Gn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...Gn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...Gn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const eo=Jn.filter(e=>e!=="count"),w0=eo.reduce((e,t)=>({...e,...b0(t)}),{}),S0=eo.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ma(e){return eo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const $0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(eo.map(e=>[Es[e],Ms(e)]))},gr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},C0=[{title:"Salton Sea from Above",...gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],T0={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:C0},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:{...Gn.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"]}}},...w0},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:x0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...S0},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,...Ma({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,...Ma({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,...Ma({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:[$0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},L0={element:y0,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"},...eo.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...eo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:T0,sourceCode:v0},Bi=500,Hd="cubic-bezier(0.25, 1, 0.5, 1)",R0=300,I0=5,P0=.15,E0=.4,M0=100,Pi=100,Ql={color:"#000000",hover:"#cccccc"},mo={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}},ka={offset:{x:0,y:0},linkColor:"#cccccc"},ec={sizeType:"drag",value:3},A0="left";function F0(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:A0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function Ei(e,t,n){return`${e}: ${W.scalingValue(t/1440,n)};`}function xo(e,t){return t<=0?0:(e%t+t)%t}function _0(e,t,n,i){if(!i)return{position:xo(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 W0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function N0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,b)=>{n.style.transform=`translate(${p}px, ${b}px)`;const x=n.getBoundingClientRect();return{x:x.left,y:x.top}},o=i(0,0),r=i(Pi,0),l=i(0,Pi);e.removeChild(n);const d={x:(r.x-o.x)/Pi,y:(r.y-o.y)/Pi},c={x:(l.x-o.x)/Pi,y:(l.y-o.y)/Pi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function H0(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 O0(e,t){return`
|
|
19296
19296
|
.${e}-wrapper {
|
|
19297
19297
|
position: relative;
|
|
19298
19298
|
width: 100%;
|
|
@@ -19364,7 +19364,7 @@ export function Waterfall({
|
|
|
19364
19364
|
top: 0;
|
|
19365
19365
|
left: 0;
|
|
19366
19366
|
opacity: 0;
|
|
19367
|
-
transition: opacity ${
|
|
19367
|
+
transition: opacity ${Bi}ms ${Hd};
|
|
19368
19368
|
}
|
|
19369
19369
|
.${e}-list-fade .${e}-slide.${e}-is-active {
|
|
19370
19370
|
opacity: 1;
|
|
@@ -19391,29 +19391,29 @@ export function Waterfall({
|
|
|
19391
19391
|
top: 50%;
|
|
19392
19392
|
z-index: 1;
|
|
19393
19393
|
padding: 0;
|
|
19394
|
-
${
|
|
19395
|
-
${
|
|
19394
|
+
${Ei("width",30,t)}
|
|
19395
|
+
${Ei("height",30,t)}
|
|
19396
19396
|
transition: opacity 0.15s ease-in-out;
|
|
19397
19397
|
}
|
|
19398
19398
|
.${e}-arrow-prev {
|
|
19399
|
-
${
|
|
19399
|
+
${Ei("left",-20,t)}
|
|
19400
19400
|
transform: translate3d(-50%, -50%, 0);
|
|
19401
19401
|
}
|
|
19402
19402
|
.${e}-arrow-next {
|
|
19403
19403
|
left: unset;
|
|
19404
|
-
${
|
|
19404
|
+
${Ei("right",-20,t)}
|
|
19405
19405
|
transform: translate3d(50%, -50%, 0);
|
|
19406
19406
|
}
|
|
19407
19407
|
.${e}-arrow-prev-vertical {
|
|
19408
19408
|
left: 50%;
|
|
19409
|
-
${
|
|
19409
|
+
${Ei("top",-20,t)}
|
|
19410
19410
|
transform: translate3d(-50%, -50%, 0);
|
|
19411
19411
|
}
|
|
19412
19412
|
.${e}-arrow-next-vertical {
|
|
19413
19413
|
left: 50%;
|
|
19414
19414
|
right: unset;
|
|
19415
19415
|
top: unset;
|
|
19416
|
-
${
|
|
19416
|
+
${Ei("bottom",-20,t)}
|
|
19417
19417
|
transform: translate3d(-50%, 50%, 0);
|
|
19418
19418
|
}
|
|
19419
19419
|
.${e}-arrow-hidden {
|
|
@@ -19549,10 +19549,10 @@ export function Waterfall({
|
|
|
19549
19549
|
object-fit: cover;
|
|
19550
19550
|
}
|
|
19551
19551
|
.${e}-transition-reveal .${e}-slide.${e}-is-active .${e}-slider-image {
|
|
19552
|
-
animation: ${e}-reveal-horizontal ${
|
|
19552
|
+
animation: ${e}-reveal-horizontal ${Bi}ms ease;
|
|
19553
19553
|
}
|
|
19554
19554
|
.${e}-transition-reveal-vertical .${e}-slide.${e}-is-active .${e}-slider-image {
|
|
19555
|
-
animation: ${e}-reveal-vertical ${
|
|
19555
|
+
animation: ${e}-reveal-vertical ${Bi}ms ease;
|
|
19556
19556
|
}
|
|
19557
19557
|
@keyframes ${e}-reveal-horizontal {
|
|
19558
19558
|
from { clip-path: inset(0 100% 0 0); }
|
|
@@ -19562,7 +19562,7 @@ export function Waterfall({
|
|
|
19562
19562
|
from { clip-path: inset(100% 0 0 0); }
|
|
19563
19563
|
to { clip-path: inset(0 0 0 0); }
|
|
19564
19564
|
}
|
|
19565
|
-
`}function O0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=W.useScopedStyles(),l=A0(e,n),c=t??[],d=c.length,u=(e==null?void 0:e.trigger)??Ql,p=u.sizeType??"drag",v=u.value??Ql.value,f=(e==null?void 0:e.direction)??"horizontal",h=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",x=M0[m],T=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Se=>W.scalingValue(Se*T,n),w=(e==null?void 0:e.show)??"always",B=(e==null?void 0:e.controls)??null,M=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,G=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,O=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,_=(e==null?void 0:e.controlsColor)??Jl.color,j=(e==null?void 0:e.controlsHoverColor)??Jl.hover,b=(e==null?void 0:e.navColor)??po.colors.inactive,H=(e==null?void 0:e.navPaginationColor)??po.colors.pagination,E=(e==null?void 0:e.navBackgroundColor)??po.colors.background,$=(e==null?void 0:e.linkColor)??Ma.linkColor,S=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,P=f==="horizontal",I=p==="click",N=p==="drag",z=p==="auto"&&(!n||!!i),C=!n,R=h==="slide",D=g==="classic",ie=w!=="never",ee=w==="on hover",A=W.scalingValue(M,n),ae={width:A,height:A,maxWidth:A},k=R&&d>1,[J,X]=s.useState(0),[me,Le]=s.useState(k?1:0),[he,K]=s.useState(!1),[V,Y]=s.useState(!1),[Q,Te]=s.useState(!1),[we,ke]=s.useState(0),[le,ge]=s.useState(!1),[be,ne]=s.useState(!1),ce=s.useRef(!1),ue=s.useRef(me);ue.current=me;const xe=s.useRef(null),Ae=s.useRef(0),Ie=s.useRef(null),U=s.useRef(null),ve=s.useRef(null),de=s.useRef(null),q=s.useCallback(Se=>{ce.current=Se,K(Se)},[]),re=s.useCallback(Se=>{if(d<2||Se===0)return;const _e=Se>0?1:-1,Be=Math.abs(Se);if(ge(!0),q(!0),!R){X(Ze=>vo(Ze+Se,d));return}let Ke=ue.current;const se=k&&(Ke===0||Ke===d+1),ye=se?J+1:null;se&&(Ke=J+1);let Ee=Be;for(;Ee>0;){const Ze=F0(Ke,_e,d,k);if(Ke=Ze.position,Ee-=1,Ze.hitBoundary){Ae.current=Ee*_e;break}}const Ge=Be-Ee;if(Ge>0&&X(Ze=>vo(Ze+Ge*_e,d)),ue.current=Ke,ye!==null){if(ue.current=ye,Ke===ye){Y(!0),Le(Ke);return}xe.current=Ke,Y(!0),Le(ye);return}Y(!1),Le(Ke)},[J,d,k,R,q]),Fe=s.useCallback(Se=>{re(Se)},[re]),pe=s.useCallback(Se=>{if(d<2)return;const _e=vo(Se,d);if(!(_e===J&&!ce.current)&&(ge(!0),q(!0),X(_e),R)){const Be=_e+(k?1:0);xe.current=null,Ae.current=0,ue.current=Be,Y(!1),Le(Be)}},[J,d,k,R,q]);s.useEffect(()=>{if(!he)return;const Se=window.setTimeout(()=>{if(k&&(me===0||me===d+1)){xe.current=null,Y(!0),Le(J+1);return}q(!1)},Oi);return()=>window.clearTimeout(Se)},[J,d,k,he,q,me]),s.useEffect(()=>{if(!V)return;let Se=0;const _e=requestAnimationFrame(()=>{Se=requestAnimationFrame(()=>{const Be=xe.current;xe.current=null;const Ke=Ae.current;if(Ae.current=0,Y(!1),Be!==null){ue.current=Be,Le(Be);return}if(Ke!==0){re(Ke);return}q(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(Se)}},[re,q,V]);const Z=`${k}:${d}`,Xe=s.useRef(Z);s.useEffect(()=>{if(Xe.current===Z)return;Xe.current=Z;const Se=d>0?Math.min(J,d-1):0;ve.current=null,de.current=null,Te(!1),ke(0),X(Se),Y(!0),Le(Se+(k?1:0))},[J,d,k,Z]),s.useEffect(()=>{if(!le)return;const Se=window.setTimeout(()=>ge(!1),L0);return()=>window.clearTimeout(Se)},[le,J]),s.useEffect(()=>{if(!z||d<2)return;const Se=Math.max(v,.1)*1e3,_e=window.setInterval(()=>{C&&be||Fe(1)},Se);return()=>window.clearInterval(_e)},[v,d,Fe,z,be,C]);const Oe=s.useCallback(Se=>{const _e=ve.current;if(!_e||_e.pointerId!==Se.pointerId)return;ve.current=null,de.current=null;const Be=Ie.current;if(Be!=null&&Be.hasPointerCapture(Se.pointerId)&&Be.releasePointerCapture(Se.pointerId),!_e.isActive){R&&ke(0);return}const se=!(Se.timeStamp-_e.lastTime>E0)&&Math.abs(_e.velocity)>P0,ye=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*I0;if(Te(!1),!se&&!ye){ke(0);return}const Ee=ye?_e.offset-_e.baseOffset:_e.velocity;let Ge=1;ye&&_e.size>0&&(Ge=Math.max(1,Math.round(Math.abs(Ee)/_e.size))),ke(0),re(Ee<0?Ge:-Ge)},[re,R]);s.useEffect(()=>{const Se=_e=>{de.current===null||_e.pointerId!==de.current||Oe(_e)};return window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[Oe]);const dt=Se=>{const _e=Ie.current;if(!N||d<2||!_e||Se.pointerType==="mouse"&&Se.button!==0)return;xe.current=null,Ae.current=0,ce.current&&q(!1);let Be=0;const Ke=U.current;if(R&&Ke){const se=P?Ke.offsetWidth:Ke.offsetHeight;if(se>0){const ye=_0(Ke,P);let Ee=ue.current;k&&(Ee===0||Ee===d+1)?(Ee=J+1,ue.current=Ee,Y(!0),Le(Ee),Be=0):Be=ye+Ee*se,ke(Be)}}_e.setPointerCapture(Se.pointerId),de.current=Se.pointerId,ve.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,axes:W0(_e,`${r}-axis-probe`),size:P?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Se.timeStamp,velocity:0}},nt=Se=>{const _e=ve.current;if(!_e||_e.pointerId!==Se.pointerId)return;if(Se.pointerType==="mouse"&&Se.buttons===0){Oe(Se);return}const Be=Se.clientX-_e.startClientX,Ke=Se.clientY-_e.startClientY,se=_e.axes?N0(_e.axes,Be,Ke):{x:Be,y:Ke},ye=P?se.x:se.y,Ee=P?se.y:se.x,Ge=_e.baseOffset+ye;if(!_e.isActive){if(Math.max(Math.abs(ye),Math.abs(Ee))<R0)return;if(Math.abs(Ee)>Math.abs(ye)){const Ve=Ie.current;Ve!=null&&Ve.hasPointerCapture(_e.pointerId)&&Ve.releasePointerCapture(_e.pointerId),ve.current=null,de.current=null,R&&ke(0);return}_e.isActive=!0,Te(!0)}const Ze=Se.timeStamp-_e.lastTime;Ze>0&&(_e.velocity=(Ge-_e.offset)/Ze,_e.lastTime=Se.timeStamp),_e.offset=Ge,R&&ke(Ge)},ht=Se=>{Oe(Se)},st=P?`translate3d(calc(${-me*100}% + ${we}px), 0, 0)`:`translate3d(0, calc(${-me*100}% + ${we}px), 0)`,ze=k?[c[d-1],...c,c[0]]:c;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:H0(r,n)}}),a.jsxs("div",{className:ut(`${r}-wrapper`,{[`${r}-transition-reveal`]:h==="reveal",[`${r}-transition-reveal-vertical`]:h==="reveal"&&!P}),onMouseEnter:()=>ne(!0),onMouseLeave:()=>ne(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Ie,className:ut(`${r}-track`,{[`${r}-track-draggable`]:N,[`${r}-track-draggable-vertical`]:N&&!P}),onPointerDown:dt,onPointerMove:nt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:Se=>{de.current===Se.pointerId&&Oe(Se)},children:a.jsx("div",{ref:U,className:ut(`${r}-list`,{[`${r}-list-slide`]:R,[`${r}-list-slide-vertical`]:R&&!P,[`${r}-list-fade`]:!R}),style:R?{transform:st,transition:Q||V?"none":`transform ${Oi}ms ${Hd}`}:void 0,children:ze.map((Se,_e)=>{const Be=k?vo(_e-1,d):_e,se=k&&(_e===0||_e===d+1)?`clone-${_e===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:ut(`${r}-slide`,{[`${r}-is-active`]:!R&&Be===J}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:ut(`${r}-slider-image`,{[`${r}-contain`]:Se.image.objectFit==="contain",[`${r}-cover`]:Se.image.objectFit==="cover"}),src:Se.image.url,alt:Se.image.name??"",draggable:!1})})})},se)})})}),ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(`${r}-arrow`,{[`${r}-arrow-prev`]:P,[`${r}-arrow-prev-vertical`]:!P,[`${r}-hover-arrow`]:ee}),style:{color:_,"--arrow-hover-color":j,...ae},children:a.jsxs("button",{onClick:Se=>{Se.stopPropagation(),Fe(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${W.scalingValue(G,n)}, ${W.scalingValue(O*(P?1:-1),n)}) rotate(${P?"0deg":"90deg"})`},children:[B&&a.jsx(sn,{url:B,fill:_,hoverFill:j,className:ut(`${r}-arrow-img`,`${r}-mirror`),style:ae}),!B&&a.jsx(ec,{color:_,className:ut(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:ut(`${r}-arrow`,{[`${r}-arrow-next`]:P,[`${r}-arrow-next-vertical`]:!P,[`${r}-hover-arrow`]:ee}),style:{color:_,"--arrow-hover-color":j,...ae},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Se=>{Se.stopPropagation(),Fe(1)},style:{transform:`translate(${W.scalingValue(G*(P?-1:1),n)}, ${W.scalingValue(O,n)}) rotate(${P?"0deg":"90deg"})`},children:[B&&a.jsx(sn,{url:B,fill:_,hoverFill:j,className:`${r}-arrow-img`,style:ae}),!B&&a.jsx(ec,{color:_,className:ut(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),I&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Fe(1)}),D&&a.jsx("div",{className:ut(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:P,[`${r}-pagination-inside-left`]:!P}),style:P?{bottom:y(x.inset)}:{left:y(x.inset)},children:a.jsx("div",{className:ut(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!P,[`${r}-animate-dots`]:le}),style:{backgroundColor:E,gap:y(x.gapInactive-x.activeDot+x.dot),...P?{height:y(x.activeDot+x.paddingY*2),paddingTop:y(x.paddingY),paddingBottom:y(x.paddingY),paddingLeft:y(x.paddingActive),paddingRight:y(x.paddingActive)}:{width:y(x.activeDot+x.paddingY*2),paddingLeft:y(x.paddingY),paddingRight:y(x.paddingY),paddingTop:y(x.paddingActive),paddingBottom:y(x.paddingActive)},borderRadius:y(x.borderRadius),transform:`translate(${W.scalingValue(po.offset.x,n)}, ${W.scalingValue(po.offset.y,n)})`},children:c.map((Se,_e)=>{const Be=_e===J,Ke=Be?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>pe(_e),className:`${r}-pagination-item`,style:{width:y(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?H:b,width:y(Ke)}})},_e)})},`${m}-${f}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:W.scalingValue(S,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:c.map((Se,_e)=>a.jsx("div",{className:ut(`${r}-caption-text`,{[`${r}-with-pointer-events`]:_e===J&&n,[`${r}-active`]:_e===J}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Oi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":$,"--link-hover-color":$,position:"relative",top:W.scalingValue(Ma.offset.y,n),left:W.scalingValue(Ma.offset.x,n)},children:a.jsx(wi,{content:Se.imageCaption})})},_e))})]})]})]})}function ec({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 D0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19565
|
+
`}function D0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=W.useScopedStyles(),l=F0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??ec,p=u.sizeType??"drag",b=u.value??ec.value,x=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",m=(e==null?void 0:e.nav)??"classic",h=(e==null?void 0:e.navSize)??"m",f=k0[h],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Se=>W.scalingValue(Se*C,n),R=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,S=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,F=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,_=(e==null?void 0:e.controlsColor)??Ql.color,B=(e==null?void 0:e.controlsHoverColor)??Ql.hover,L=(e==null?void 0:e.navColor)??mo.colors.inactive,N=(e==null?void 0:e.navPaginationColor)??mo.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??mo.colors.background,Z=(e==null?void 0:e.linkColor)??ka.linkColor,E=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,K=x==="horizontal",D=p==="click",j=p==="drag",$=p==="auto"&&(!n||!!i),v=!n,w=g==="slide",P=m==="classic",Q=R!=="never",z=R==="on hover",T=W.scalingValue(S,n),O={width:T,height:T,maxWidth:T},M=w&&c>1,[ee,V]=s.useState(0),[me,Ie]=s.useState(M?1:0),[ge,ae]=s.useState(!1),[ne,oe]=s.useState(!1),[ie,Ae]=s.useState(!1),[be,Me]=s.useState(0),[q,se]=s.useState(!1),[he,G]=s.useState(!1),re=s.useRef(!1),pe=s.useRef(me);pe.current=me;const we=s.useRef(null),Pe=s.useRef(0),Ce=s.useRef(null),Y=s.useRef(null),xe=s.useRef(null),ue=s.useRef(null),X=s.useCallback(Se=>{re.current=Se,ae(Se)},[]),le=s.useCallback(Se=>{if(c<2||Se===0)return;const _e=Se>0?1:-1,Be=Math.abs(Se);if(se(!0),X(!0),!w){V(Ze=>xo(Ze+Se,c));return}let Ye=pe.current;const de=M&&(Ye===0||Ye===c+1),ve=de?ee+1:null;de&&(Ye=ee+1);let Ee=Be;for(;Ee>0;){const Ze=_0(Ye,_e,c,M);if(Ye=Ze.position,Ee-=1,Ze.hitBoundary){Pe.current=Ee*_e;break}}const Ge=Be-Ee;if(Ge>0&&V(Ze=>xo(Ze+Ge*_e,c)),pe.current=Ye,ve!==null){if(pe.current=ve,Ye===ve){oe(!0),Ie(Ye);return}we.current=Ye,oe(!0),Ie(ve);return}oe(!1),Ie(Ye)},[ee,c,M,w,X]),Fe=s.useCallback(Se=>{le(Se)},[le]),fe=s.useCallback(Se=>{if(c<2)return;const _e=xo(Se,c);if(!(_e===ee&&!re.current)&&(se(!0),X(!0),V(_e),w)){const Be=_e+(M?1:0);we.current=null,Pe.current=0,pe.current=Be,oe(!1),Ie(Be)}},[ee,c,M,w,X]);s.useEffect(()=>{if(!ge)return;const Se=window.setTimeout(()=>{if(M&&(me===0||me===c+1)){we.current=null,oe(!0),Ie(ee+1);return}X(!1)},Bi);return()=>window.clearTimeout(Se)},[ee,c,M,ge,X,me]),s.useEffect(()=>{if(!ne)return;let Se=0;const _e=requestAnimationFrame(()=>{Se=requestAnimationFrame(()=>{const Be=we.current;we.current=null;const Ye=Pe.current;if(Pe.current=0,oe(!1),Be!==null){pe.current=Be,Ie(Be);return}if(Ye!==0){le(Ye);return}X(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(Se)}},[le,X,ne]);const J=`${M}:${c}`,Xe=s.useRef(J);s.useEffect(()=>{if(Xe.current===J)return;Xe.current=J;const Se=c>0?Math.min(ee,c-1):0;xe.current=null,ue.current=null,Ae(!1),Me(0),V(Se),oe(!0),Ie(Se+(M?1:0))},[ee,c,M,J]),s.useEffect(()=>{if(!q)return;const Se=window.setTimeout(()=>se(!1),R0);return()=>window.clearTimeout(Se)},[q,ee]),s.useEffect(()=>{if(!$||c<2)return;const Se=Math.max(b,.1)*1e3,_e=window.setInterval(()=>{v&&he||Fe(1)},Se);return()=>window.clearInterval(_e)},[b,c,Fe,$,he,v]);const Oe=s.useCallback(Se=>{const _e=xe.current;if(!_e||_e.pointerId!==Se.pointerId)return;xe.current=null,ue.current=null;const Be=Ce.current;if(Be!=null&&Be.hasPointerCapture(Se.pointerId)&&Be.releasePointerCapture(Se.pointerId),!_e.isActive){w&&Me(0);return}const de=!(Se.timeStamp-_e.lastTime>M0)&&Math.abs(_e.velocity)>E0,ve=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*P0;if(Ae(!1),!de&&!ve){Me(0);return}const Ee=ve?_e.offset-_e.baseOffset:_e.velocity;let Ge=1;ve&&_e.size>0&&(Ge=Math.max(1,Math.round(Math.abs(Ee)/_e.size))),Me(0),le(Ee<0?Ge:-Ge)},[le,w]);s.useEffect(()=>{const Se=_e=>{ue.current===null||_e.pointerId!==ue.current||Oe(_e)};return window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[Oe]);const dt=Se=>{const _e=Ce.current;if(!j||c<2||!_e||Se.pointerType==="mouse"&&Se.button!==0)return;we.current=null,Pe.current=0,re.current&&X(!1);let Be=0;const Ye=Y.current;if(w&&Ye){const de=K?Ye.offsetWidth:Ye.offsetHeight;if(de>0){const ve=W0(Ye,K);let Ee=pe.current;M&&(Ee===0||Ee===c+1)?(Ee=ee+1,pe.current=Ee,oe(!0),Ie(Ee),Be=0):Be=ve+Ee*de,Me(Be)}}_e.setPointerCapture(Se.pointerId),ue.current=Se.pointerId,xe.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,axes:N0(_e,`${r}-axis-probe`),size:K?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Se.timeStamp,velocity:0}},nt=Se=>{const _e=xe.current;if(!_e||_e.pointerId!==Se.pointerId)return;if(Se.pointerType==="mouse"&&Se.buttons===0){Oe(Se);return}const Be=Se.clientX-_e.startClientX,Ye=Se.clientY-_e.startClientY,de=_e.axes?H0(_e.axes,Be,Ye):{x:Be,y:Ye},ve=K?de.x:de.y,Ee=K?de.y:de.x,Ge=_e.baseOffset+ve;if(!_e.isActive){if(Math.max(Math.abs(ve),Math.abs(Ee))<I0)return;if(Math.abs(Ee)>Math.abs(ve)){const Ve=Ce.current;Ve!=null&&Ve.hasPointerCapture(_e.pointerId)&&Ve.releasePointerCapture(_e.pointerId),xe.current=null,ue.current=null,w&&Me(0);return}_e.isActive=!0,Ae(!0)}const Ze=Se.timeStamp-_e.lastTime;Ze>0&&(_e.velocity=(Ge-_e.offset)/Ze,_e.lastTime=Se.timeStamp),_e.offset=Ge,w&&Me(Ge)},ht=Se=>{Oe(Se)},st=K?`translate3d(calc(${-me*100}% + ${be}px), 0, 0)`:`translate3d(0, calc(${-me*100}% + ${be}px), 0)`,ze=M?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O0(r,n)}}),a.jsxs("div",{className:ut(`${r}-wrapper`,{[`${r}-transition-reveal`]:g==="reveal",[`${r}-transition-reveal-vertical`]:g==="reveal"&&!K}),onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Ce,className:ut(`${r}-track`,{[`${r}-track-draggable`]:j,[`${r}-track-draggable-vertical`]:j&&!K}),onPointerDown:dt,onPointerMove:nt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:Se=>{ue.current===Se.pointerId&&Oe(Se)},children:a.jsx("div",{ref:Y,className:ut(`${r}-list`,{[`${r}-list-slide`]:w,[`${r}-list-slide-vertical`]:w&&!K,[`${r}-list-fade`]:!w}),style:w?{transform:st,transition:ie||ne?"none":`transform ${Bi}ms ${Hd}`}:void 0,children:ze.map((Se,_e)=>{const Be=M?xo(_e-1,c):_e,de=M&&(_e===0||_e===c+1)?`clone-${_e===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:ut(`${r}-slide`,{[`${r}-is-active`]:!w&&Be===ee}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:ut(`${r}-slider-image`,{[`${r}-contain`]:Se.image.objectFit==="contain",[`${r}-cover`]:Se.image.objectFit==="cover"}),src:Se.image.url,alt:Se.image.name??"",draggable:!1})})})},de)})})}),Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(`${r}-arrow`,{[`${r}-arrow-prev`]:K,[`${r}-arrow-prev-vertical`]:!K,[`${r}-hover-arrow`]:z}),style:{color:_,"--arrow-hover-color":B,...O},children:a.jsxs("button",{onClick:Se=>{Se.stopPropagation(),Fe(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${W.scalingValue(U,n)}, ${W.scalingValue(F*(K?1:-1),n)}) rotate(${K?"0deg":"90deg"})`},children:[H&&a.jsx(sn,{url:H,fill:_,hoverFill:B,className:ut(`${r}-arrow-img`,`${r}-mirror`),style:O}),!H&&a.jsx(tc,{color:_,className:ut(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:ut(`${r}-arrow`,{[`${r}-arrow-next`]:K,[`${r}-arrow-next-vertical`]:!K,[`${r}-hover-arrow`]:z}),style:{color:_,"--arrow-hover-color":B,...O},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Se=>{Se.stopPropagation(),Fe(1)},style:{transform:`translate(${W.scalingValue(U*(K?-1:1),n)}, ${W.scalingValue(F,n)}) rotate(${K?"0deg":"90deg"})`},children:[H&&a.jsx(sn,{url:H,fill:_,hoverFill:B,className:`${r}-arrow-img`,style:O}),!H&&a.jsx(tc,{color:_,className:ut(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),D&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Fe(1)}),P&&a.jsx("div",{className:ut(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:K,[`${r}-pagination-inside-left`]:!K}),style:K?{bottom:y(f.inset)}:{left:y(f.inset)},children:a.jsx("div",{className:ut(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!K,[`${r}-animate-dots`]:q}),style:{backgroundColor:k,gap:y(f.gapInactive-f.activeDot+f.dot),...K?{height:y(f.activeDot+f.paddingY*2),paddingTop:y(f.paddingY),paddingBottom:y(f.paddingY),paddingLeft:y(f.paddingActive),paddingRight:y(f.paddingActive)}:{width:y(f.activeDot+f.paddingY*2),paddingLeft:y(f.paddingY),paddingRight:y(f.paddingY),paddingTop:y(f.paddingActive),paddingBottom:y(f.paddingActive)},borderRadius:y(f.borderRadius),transform:`translate(${W.scalingValue(mo.offset.x,n)}, ${W.scalingValue(mo.offset.y,n)})`},children:d.map((Se,_e)=>{const Be=_e===ee,Ye=Be?f.activeDot:f.dot;return a.jsx("button",{onClick:()=>fe(_e),className:`${r}-pagination-item`,style:{width:y(f.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?N:L,width:y(Ye)}})},_e)})},`${h}-${x}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:W.scalingValue(E,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Se,_e)=>a.jsx("div",{className:ut(`${r}-caption-text`,{[`${r}-with-pointer-events`]:_e===ee&&n,[`${r}-active`]:_e===ee}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Bi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":Z,"--link-hover-color":Z,position:"relative",top:W.scalingValue(ka.offset.y,n),left:W.scalingValue(ka.offset.x,n)},children:a.jsx(Si,{content:Se.imageCaption})})},_e))})]})]})]})}function tc({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 B0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19566
19566
|
import cn from 'classnames';
|
|
19567
19567
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19568
19568
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20743,14 +20743,14 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20743
20743
|
</svg>
|
|
20744
20744
|
);
|
|
20745
20745
|
}
|
|
20746
|
-
`,
|
|
20746
|
+
`,j0={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"}]}]}]}},z0={element:D0,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:j0,sourceCode:B0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},_i=300/1440,V0=8/1440,gi=.004;function G0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function nc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ic(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((o-t)/2,i)}}function q0(e){return`
|
|
20747
20747
|
.${e}-wrapper {
|
|
20748
20748
|
box-sizing: border-box;
|
|
20749
20749
|
display: flex;
|
|
20750
20750
|
flex-direction: column;
|
|
20751
20751
|
position: relative;
|
|
20752
20752
|
width: 100%;
|
|
20753
|
-
min-height: ${
|
|
20753
|
+
min-height: ${G0(48)};
|
|
20754
20754
|
}
|
|
20755
20755
|
.${e}-single-title-layer {
|
|
20756
20756
|
position: absolute;
|
|
@@ -20960,7 +20960,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20960
20960
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
20961
20961
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
20962
20962
|
}
|
|
20963
|
-
`}const q0="rgba(28,31,34,0.9)",Mn=500,mi="cubic-bezier(0.22, 1, 0.36, 1)",X0=72,U0=50,K0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Y0=[];function Z0(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 J0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Q0(e){const[t]=e.media;return t!=null&&t.url?t:null}function eb(e){if(!Array.isArray(e)||e.length===0)return[];if(Z0(e)){const t=[];for(const n of e){const i=J0(n);if(!i)continue;const o=Q0(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 Qa(e){return e.type==="video"}function tb(e){e.pause(),e.removeAttribute("src"),e.load()}function mr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const ib=1140/1440;function ob(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 rb(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 ab(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function sb({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{tb(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c,style:i})}function lb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u,backgroundColor:p}){const v=i==="cover",f=s.useRef(null),h=s.useRef(null),g=s.useRef(null),m=s.useRef(0),x=s.useRef(0),T=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),B=s.useRef(!1),M=s.useRef(null),[G,O]=s.useState(null),[_,j]=s.useState("opening"),[b,H]=s.useState(0),[E,$]=s.useState(0),[S,P]=s.useState(!1),[I,N]=s.useState(!1),[z,C]=s.useState(!1),R=s.useRef(n),D=t[n],ie=D?Qa(D):!1,ee=E!==0||S,A=s.useCallback(le=>{B.current=le,P(le)},[]),ae=s.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),k=s.useCallback(()=>{ae(),M.current=window.setTimeout(()=>{ae(),A(!1)},Mn+32)},[ae,A]),J=s.useCallback(()=>{const le=f.current,ge=h.current;if(!le)return;const be=le.getBoundingClientRect(),ne=be.width,ce=be.height;if(!ne||!ce)return;if(i==="cover"){O({width:ne,height:ce,left:be.left,top:be.top});return}if(!ge){O(mr(le));return}const{width:ue,height:xe}=nb(ge);if(!ue||!xe){O(mr(le));return}const Ae=ue/xe,Ie=ne/ce;if(Ae>Ie){const U=ne/Ae;O({width:ne,height:U,left:be.left,top:be.top+(ce-U)/2})}else{const U=ce*Ae;O({width:U,height:ce,left:be.left+(ne-U)/2,top:be.top})}},[i]);s.useEffect(()=>{J();const le=f.current;if(!le)return;const ge=new ResizeObserver(()=>J());return ge.observe(le),()=>ge.disconnect()},[J,n]),s.useEffect(()=>{_==="opening"&&G&&j("open")},[_,G]),s.useEffect(()=>{if(_!=="closing")return;const le=setTimeout(()=>r(),Mn);return()=>clearTimeout(le)},[_,r]),s.useEffect(()=>()=>{ae()},[ae]),s.useLayoutEffect(()=>{if(R.current===n)return;ae(),H(0),$(0),A(!1),C(!1),N(!1),m.current=0,x.current=0,T.current="none",y.current=!1,g.current=null,w.current=!1;const le=f.current;le&&O(mr(le)),R.current=n},[n,A,ae]),s.useEffect(()=>{if(_!=="open")return;let le=null;const ge=()=>{le&&(document.removeEventListener("click",le,!0),le=null)},be=()=>{ge(),le=Ie=>{Ie.stopPropagation(),Ie.preventDefault(),ge()},document.addEventListener("click",le,!0)},ne=Ie=>{ae(),B.current=!1,P(!1),$(0),N(!1),y.current=!1,x.current=0,T.current="none";const U=f.current;U&&O(mr(U)),Ie<0?c():l()},ce=Ie=>{if(Math.abs(Ie)>U0&&t.length>1){ne(Ie);return}A(!0),$(0),k()},ue=Ie=>{if(Ie.touches.length!==1||B.current)return;const U=Ie.touches[0];w.current=!0,g.current={x:U.clientX,y:U.clientY},T.current="none",x.current=0,y.current=!1},xe=Ie=>{if(!g.current||Ie.touches.length!==1||B.current)return;const U=Ie.touches[0],ve=U.clientX-g.current.x,de=U.clientY-g.current.y;if(T.current==="none"){if(Math.abs(ve)<10&&Math.abs(de)<10)return;if(Math.abs(ve)>Math.abs(de)){if(t.length<=1)return;T.current="horizontal"}else if(de>0)T.current="vertical";else return}if(T.current==="horizontal"){y.current=!0,N(!0),x.current=ve,$(ve),Ie.preventDefault();return}T.current==="vertical"&&(y.current=!0,N(!0),m.current=de,H(de),Ie.preventDefault())},Ae=()=>{if(!g.current)return;const Ie=T.current,U=y.current;if(U&&Ie==="horizontal")ce(x.current),be();else if(U&&Ie==="vertical")if(m.current>X0){const de=window.innerHeight;m.current=de,C(!0),H(de),j("closing")}else m.current=0,H(0),be();else Ie==="horizontal"&&Math.abs(x.current)>0&&(ce(x.current),be());g.current=null,T.current="none",x.current=0,y.current=!1,N(!1)};return document.addEventListener("touchstart",ue,{passive:!0}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",Ae),document.addEventListener("touchcancel",Ae),()=>{document.removeEventListener("touchstart",ue),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",Ae),document.removeEventListener("touchcancel",Ae),ge()}},[_,t.length,c,l,A,k,ae]),s.useEffect(()=>{const le=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),_!=="closing"&&j("closing"))};return window.addEventListener("keydown",le,!0),()=>window.removeEventListener("keydown",le,!0)},[_]);const X=()=>{_!=="closing"&&j("closing")},me=_==="open",Le=_==="closing",he=b>0?Math.max(0,1-b/500):1,K=b>0?Math.max(.35,1-b/500):1,V=le=>{if(le.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const ge=le.currentTarget.getBoundingClientRect(),be=le.clientY-ge.top,ne=Math.min(52,ge.height*.2);if(!(be>ge.height-ne)){if(le.clientX-ge.left<ge.width/2){l();return}c()}},Y=le=>{if(t.length<=1)return;const ge=le.currentTarget.getBoundingClientRect(),be=le.clientX-ge.left,ne=le.clientY-ge.top,ce=Math.min(52,ge.height*.2);if(ne>ge.height-ce){le.currentTarget.style.cursor="default";return}le.currentTarget.style.cursor=be<ge.width/2?"w-resize":"e-resize"},Q=s.useCallback(le=>{le.propertyName!=="transform"||!B.current||(ae(),A(!1))},[ae,A]),Te=ee?`translateX(${E}px)`:b>0?`translateY(${b}px)`:void 0,we={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,objectFit:i==="cover"?"cover":"contain",transform:Te,opacity:b>0?K:_==="opening"||Le?0:1,transition:I&&!S?"none":S?`transform ${Mn}ms ${mi}`:z?`transform ${Mn}ms ${mi}, opacity ${Mn}ms ${mi}`:_==="opening"||Le?`opacity ${Mn}ms ${mi}`:"none",pointerEvents:ie&&me&&!ee?"auto":"none",touchAction:ie&&me?"none":void 0,zIndex:9998},ke=G?{position:"fixed",top:G.top,height:G.height,width:G.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:_==="open"?"none":void 0},onClick:X,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:me?he:0,transition:I?"none":`opacity ${Mn}ms ${mi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:f,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:me?1:0,transition:`opacity ${Mn}ms ${mi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,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:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:me?1:0,transition:`opacity ${Mn}ms ${mi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),G&&D&&(ie?a.jsx(sb,{src:D.url,phase:_,mediaRef:h,mediaStyle:we,onLoadedMetadata:J,onClick:V,onMouseMove:Y,onTransitionEnd:Q},`${n}-${D.url}`):a.jsx("img",{ref:h,src:D.url,alt:D.name,onLoad:J,onTransitionEnd:Q,style:we},`${n}-${D.url}`)),me&&ke&&t.length>1&&!ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...ke,left:G.left,cursor:"w-resize",pointerEvents:ee?"none":"auto"},onClick:le=>{if(w.current){w.current=!1;return}le.stopPropagation(),l()}}),a.jsx("div",{style:{...ke,left:G.left+G.width/2,cursor:"e-resize",pointerEvents:ee?"none":"auto"},onClick:le=>{if(w.current){w.current=!1;return}le.stopPropagation(),c()}})]})]})}function ic({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${Qa(t)?"video":"image"}`,f=r.display==="cover",h=rb(r),g=_=>W.scalingValue(_,l??!1),m=n??Fi,x=o?{width:"100%",maxWidth:"100%"}:{width:g(m),maxWidth:"100%"},T=i?{borderRadius:g(i)}:{},y={...x,...f?{aspectRatio:h,height:"auto",overflow:"hidden"}:{},...T},w={...f?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...f?{}:T},M={className:v,style:w,onClick:p?_=>{_.stopPropagation(),p()}:void 0},G=Math.max(c,gi),O=Qa(t)?a.jsx("video",{...M,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...M,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[f?a.jsx("div",{style:y,children:O}):O,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(c)},"aria-hidden":"true"}),u&&d&&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:g(G)}})]})}function cb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,f=v>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&f&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),d&&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(c),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"&&f&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),d&&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(c),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function db(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function oc({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 rc({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:c}){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%",...c}})}function ka({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:c,showTextBoxOutline:d=!1,topPaddingControl:u}){const p=s.useRef(null),[v,f]=s.useState(0),h=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const x=()=>f(m.offsetHeight);x();const T=new ResizeObserver(x);return T.observe(m),()=>T.disconnect()},[h,g]),a.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${v}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:d?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:c,children:h})})]})})}const ac=45;function sc(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 ub(e){const t=sc(e,"--cntrl-viewport-height",window.innerHeight),n=sc(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function pb(e,t,n){const{top:i,centerY:o}=ub(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 mb(e,t,n){const i=Array.from({length:t},(l,c)=>{const d=e.current[c];if(!d)return 0;const u=d.getBoundingClientRect(),p=pb(u,n,d);return Math.exp(-(p*p)/(2*ac*ac))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function gb(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(d,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 d=0;const u=()=>{l(mb(i,e,n))},p=()=>{d||(d=window.requestAnimationFrame(()=>{d=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{d&&window.cancelAnimationFrame(d),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:d=>u=>{i.current[d]=u},opacities:o,dominantIndex:r}}function hb(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),c=Math.max(r.length,l.length);if(c===0||o.current===e)return;let d=0;const u=window.setInterval(()=>{d+=1;const p=[...l.slice(0,d),...r.slice(d)].join("");o.current=p,i(p),d>=c&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function fb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var tt;const{prefix:l}=W.useScopedStyles(),c=s.useMemo(()=>G0(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??Fi,f=(e==null?void 0:e.titleWidth)??ib,h=ob(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??z0,m=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,T=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,w=db(e==null?void 0:e.transition),B=(e==null?void 0:e.lightbox)??"on",M=p==="b",G=w==="fade"||w==="retype",{setTitleRef:O,dominantIndex:_}=gb(d.length,G,m),j=((tt=d[_])==null?void 0:tt.title)??"",b=hb(j,w==="retype"),H=w==="fade"||w==="retype",E=w==="retype"?b:j,$=M?void 0:{width:W.scalingValue(v,n??!1)},S=B==="on"&&(!n||i||o),P=o??!1,I=(e==null?void 0:e.galleryPaddingRight)??0,N=(e==null?void 0:e.galleryPaddingLeft)??0,z=(e==null?void 0:e.galleryPaddingBetween)??0,C=rt=>W.scalingValue(rt,n??!1),D={width:C(f)},ie=p==="a"?I:N,ee=M?{width:"100%"}:{width:`calc(100% - ${C(v)} - ${C(ie)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(I,gi),ae=Math.max(N,gi),k=Math.max(z,gi),J=Math.max(x,gi),X=Math.max(T,gi),me=Math.max(y,gi),Le=Math.max(0,(u??1)-(v??Fi)),he=p==="a"?Math.max(0,(u??1)-(v??Fi)-I):p==="c"?Math.max(0,(u??1)-(v??Fi)-N):p==="b"?u??1:1,K=P&&(p==="a"||p==="b"||p==="c")&&m==="top",V=P&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),Y=P&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Q=d.length>1,Te=M?void 0:C((p==="c"?N:I)+(v??Fi)),we=p==="c"&&Te?{left:Te}:void 0,ke=p==="a"&&Te?{right:Te}:void 0,le=M?{left:0,width:"100%"}:p==="a"?{right:C(I),width:C(v)}:{left:C(N),width:C(v)},{titleColor:ge,titleFontFamily:be,titleFontSettings:ne,titleFontSize:ce,titleLineHeight:ue,titleLetterSpacing:xe,titleWordSpacing:Ae,titleAlign:Ie,titleTextAppearance:U,lightboxCounterColor:ve,lightboxCounterFontFamily:de,lightboxCounterFontSettings:q,lightboxCounterFontSize:re,lightboxCounterLineHeight:Fe,lightboxCounterLetterSpacing:pe,lightboxCounterWordSpacing:Z,lightboxCounterTextAppearance:Xe}=e??{},Oe={fontSettings:{fontFamily:be,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:ce??.01,lineHeight:ue,letterSpacing:xe??0,wordSpacing:Ae??0,textAlign:Ie??"left",textAppearance:U,color:ge??"#000000"},nt=an(Ut(Oe,n)),ht=D,st=nc(ce,ue,l,n),ze=tc(ce,ue,`${l}-title`,`${l}-text-tight-leading`),Se={fontSettings:{fontFamily:de,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:re??.01,lineHeight:Fe,letterSpacing:pe??0,wordSpacing:Z??0,textAppearance:Xe,color:ve??"#DEDDDD"},Be={...an(Ut(Se,n)),...nc(re,Fe,l,n)},Ke=tc(re,Fe,`${l}-lightbox-counter`,`${l}-text-tight-leading`),se=W.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:ve??"#DEDDDD"},K0,Y0),ye=s.useRef(null),[Ee,Ge]=s.useState(!1),[Ze,Ve]=s.useState([]),[at,Je]=s.useState(0),Me=s.useCallback((rt,lt)=>{S&&(Ve(rt),Je(lt),Ge(!0))},[S]),qe=s.useCallback(()=>{Ge(!1)},[]),We=s.useMemo(()=>{const rt={...se},lt=ye.current?getComputedStyle(ye.current).getPropertyValue("--cntrl-article-width").trim():"";return lt&&(rt["--cntrl-article-width"]=lt),rt},[se,Ee]);return s.useEffect(()=>{if(!Ee||B!=="on"||typeof document>"u")return;const rt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=rt}},[Ee,B]),s.useEffect(()=>{!n||o||i||Ge(!1)},[n,o,i]),s.useEffect(()=>{B==="off"&&Ge(!1)},[B]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:se,children:a.jsxs("div",{ref:ye,className:`${l}-wrapper`,style:{width:W.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?C(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?C(T):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?C(y):void 0},children:[H&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(ka,{P:l,title:E,position:m,titleRef:()=>{},titleClassName:`${ze} ${l}-single-title`,titleContainerStyle:{...st,...ee},titleTextBoxStyle:ht,titleStyle:nt,showTextBoxOutline:P,topPaddingControl:K?oc({P:l,scaled:C,height:J,paired:!1}):void 0})}),d.map((rt,lt)=>{const Tt=eb(rt.gallery),Xt=lt<d.length-1,Zt=Tt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),xt={P:l,position:m,titleRef:O(lt),titleClassName:ze,titleContainerStyle:st,titleTextBoxStyle:H?{maxWidth:"100%"}:ht,titleStyle:nt,showTextBoxOutline:P&&!H,topPaddingControl:K&&!H?oc({P:l,scaled:C,height:J,paired:Q}):void 0};return a.jsxs("div",{"data-item-index":lt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?C(z):void 0},children:[V&&rc({P:l,controlKey:"titleLeftPadding",scaled:C,width:X,maxFraction:he,side:"left",paired:Q,anchorStyle:we}),Y&&rc({P:l,controlKey:"titleRightPadding",scaled:C,width:me,maxFraction:he,side:"right",paired:Q,anchorStyle:ke}),P&&Xt&&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:C(k),...le}}),M?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Tt.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const vt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(ic,{P:l,media:wt,imgWidth:v||void 0,cornerRadius:g||void 0,imageDisplay:h,isEditor:n,galleryPaddingBetween:z,showPaddingAfter:At<Tt.length-1,showControls:P,onMediaClick:S&&vt>=0?()=>Me(Zt,vt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(ka,{...xt,title:H?"":rt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(ka,{...xt,title:H?"":rt.title}),Tt.length>0&&a.jsx(cb,{P:l,layoutType:p,galleryWidthStyle:$,galleryPaddingRight:I,galleryPaddingLeft:N,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:ae,galleryPaddingMaxFraction:Le,showControls:P,scaled:C,children:Tt.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const vt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(ic,{P:l,media:wt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:h,isEditor:n,galleryPaddingBetween:z,showPaddingAfter:At<Tt.length-1,showControls:P,onMediaClick:S&&vt>=0?()=>Me(Zt,vt):void 0},`${wt.url}-${At}`)})})]})]},lt)})]})}),Ee&&B==="on"&&typeof document<"u"&&e&&(()=>{const rt=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx("div",{style:We,"data-selection":"none",children:a.jsx(lb,{prefix:l,items:Ze,index:at,imageDisplay:ab(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Je(lt=>(lt-1+Ze.length)%Ze.length),onNext:()=>Je(lt=>(lt+1)%Ze.length),counterClassName:Ke,counterStyle:Be,backgroundColor:e.backgroundColor??q0})}),rt)})()]})}const yb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20963
|
+
`}const X0="rgba(28,31,34,0.9)",Mn=500,mi="cubic-bezier(0.22, 1, 0.36, 1)",U0=72,Y0=50,K0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Z0=[];function J0(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 Q0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function eb(e){const[t]=e.media;return t!=null&&t.url?t:null}function tb(e){if(!Array.isArray(e)||e.length===0)return[];if(J0(e)){const t=[];for(const n of e){const i=Q0(n);if(!i)continue;const o=eb(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 ts(e){return e.type==="video"}function nb(e){e.pause(),e.removeAttribute("src"),e.load()}function hr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function ib(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const ob=1140/1440;function rb(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 ab(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 sb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function lb({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()=>{nb(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 cb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",x=s.useRef(null),g=s.useRef(null),m=s.useRef(null),h=s.useRef(0),f=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),R=s.useRef(!1),H=s.useRef(!1),S=s.useRef(null),[U,F]=s.useState(null),[_,B]=s.useState("opening"),[L,N]=s.useState(0),[k,Z]=s.useState(0),[E,K]=s.useState(!1),[D,j]=s.useState(!1),[$,v]=s.useState(!1),w=s.useRef(n),P=t[n],Q=P?ts(P):!1,z=k!==0||E,T=s.useCallback(q=>{H.current=q,K(q)},[]),O=s.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null)},[]),M=s.useCallback(()=>{O(),S.current=window.setTimeout(()=>{O(),T(!1)},Mn+32)},[O,T]),ee=s.useCallback(()=>{const q=x.current,se=g.current;if(!q)return;const he=q.getBoundingClientRect(),G=he.width,re=he.height;if(!G||!re)return;if(i==="cover"){F({width:G,height:re,left:he.left,top:he.top});return}if(!se){F(hr(q));return}const{width:pe,height:we}=ib(se);if(!pe||!we){F(hr(q));return}const Pe=pe/we,Ce=G/re;if(Pe>Ce){const Y=G/Pe;F({width:G,height:Y,left:he.left,top:he.top+(re-Y)/2})}else{const Y=re*Pe;F({width:Y,height:re,left:he.left+(G-Y)/2,top:he.top})}},[i]);s.useEffect(()=>{ee();const q=x.current;if(!q)return;const se=new ResizeObserver(()=>ee());return se.observe(q),()=>se.disconnect()},[ee,n]),s.useEffect(()=>{_==="opening"&&U&&B("open")},[_,U]),s.useEffect(()=>{if(_!=="closing")return;const q=setTimeout(()=>r(),Mn);return()=>clearTimeout(q)},[_,r]),s.useEffect(()=>()=>{O()},[O]),s.useLayoutEffect(()=>{if(w.current===n)return;O(),N(0),Z(0),T(!1),v(!1),j(!1),h.current=0,f.current=0,C.current="none",y.current=!1,m.current=null,R.current=!1;const q=x.current;q&&F(hr(q)),w.current=n},[n,T,O]),s.useEffect(()=>{if(_!=="open")return;let q=null;const se=()=>{q&&(document.removeEventListener("click",q,!0),q=null)},he=()=>{se(),q=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),se()},document.addEventListener("click",q,!0)},G=Ce=>{O(),H.current=!1,K(!1),Z(0),j(!1),y.current=!1,f.current=0,C.current="none";const Y=x.current;Y&&F(hr(Y)),Ce<0?d():l()},re=Ce=>{if(Math.abs(Ce)>Y0&&t.length>1){G(Ce);return}T(!0),Z(0),M()},pe=Ce=>{if(Ce.touches.length!==1||H.current)return;const Y=Ce.touches[0];R.current=!0,m.current={x:Y.clientX,y:Y.clientY},C.current="none",f.current=0,y.current=!1},we=Ce=>{if(!m.current||Ce.touches.length!==1||H.current)return;const Y=Ce.touches[0],xe=Y.clientX-m.current.x,ue=Y.clientY-m.current.y;if(C.current==="none"){if(Math.abs(xe)<10&&Math.abs(ue)<10)return;if(Math.abs(xe)>Math.abs(ue)){if(t.length<=1)return;C.current="horizontal"}else if(ue>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,j(!0),f.current=xe,Z(xe),Ce.preventDefault();return}C.current==="vertical"&&(y.current=!0,j(!0),h.current=ue,N(ue),Ce.preventDefault())},Pe=()=>{if(!m.current)return;const Ce=C.current,Y=y.current;if(Y&&Ce==="horizontal")re(f.current),he();else if(Y&&Ce==="vertical")if(h.current>U0){const ue=window.innerHeight;h.current=ue,v(!0),N(ue),B("closing")}else h.current=0,N(0),he();else Ce==="horizontal"&&Math.abs(f.current)>0&&(re(f.current),he());m.current=null,C.current="none",f.current=0,y.current=!1,j(!1)};return document.addEventListener("touchstart",pe,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",pe),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),se()}},[_,t.length,d,l,T,M,O]),s.useEffect(()=>{const q=se=>{se.key==="Escape"&&(se.preventDefault(),se.stopPropagation(),_!=="closing"&&B("closing"))};return window.addEventListener("keydown",q,!0),()=>window.removeEventListener("keydown",q,!0)},[_]);const V=()=>{_!=="closing"&&B("closing")},me=_==="open",Ie=_==="closing",ge=L>0?Math.max(0,1-L/500):1,ae=L>0?Math.max(.35,1-L/500):1,ne=q=>{if(q.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const se=q.currentTarget.getBoundingClientRect(),he=q.clientY-se.top,G=Math.min(52,se.height*.2);if(!(he>se.height-G)){if(q.clientX-se.left<se.width/2){l();return}d()}},oe=q=>{if(t.length<=1)return;const se=q.currentTarget.getBoundingClientRect(),he=q.clientX-se.left,G=q.clientY-se.top,re=Math.min(52,se.height*.2);if(G>se.height-re){q.currentTarget.style.cursor="default";return}q.currentTarget.style.cursor=he<se.width/2?"w-resize":"e-resize"},ie=s.useCallback(q=>{q.propertyName!=="transform"||!H.current||(O(),T(!1))},[O,T]),Ae=z?`translateX(${k}px)`:L>0?`translateY(${L}px)`:void 0,be={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:Ae,opacity:L>0?ae:_==="opening"||Ie?0:1,transition:D&&!E?"none":E?`transform ${Mn}ms ${mi}`:$?`transform ${Mn}ms ${mi}, opacity ${Mn}ms ${mi}`:_==="opening"||Ie?`opacity ${Mn}ms ${mi}`:"none",pointerEvents:Q&&me&&!z?"auto":"none",touchAction:Q&&me?"none":void 0,zIndex:9998},Me=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:_==="open"?"none":void 0},onClick:V,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:me?ge:0,transition:D?"none":`opacity ${Mn}ms ${mi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:x,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:me?1:0,transition:`opacity ${Mn}ms ${mi}`,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:x,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:me?1:0,transition:`opacity ${Mn}ms ${mi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&P&&(Q?a.jsx(lb,{src:P.url,phase:_,mediaRef:g,mediaStyle:be,onLoadedMetadata:ee,onClick:ne,onMouseMove:oe,onTransitionEnd:ie},`${n}-${P.url}`):a.jsx("img",{ref:g,src:P.url,alt:P.name,onLoad:ee,onTransitionEnd:ie,style:be},`${n}-${P.url}`)),me&&Me&&t.length>1&&!Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Me,left:U.left,cursor:"w-resize",pointerEvents:z?"none":"auto"},onClick:q=>{if(R.current){R.current=!1;return}q.stopPropagation(),l()}}),a.jsx("div",{style:{...Me,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:z?"none":"auto"},onClick:q=>{if(R.current){R.current=!1;return}q.stopPropagation(),d()}})]})]})}function oc({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 b=`${e}-gallery-${ts(t)?"video":"image"}`,x=r.display==="cover",g=ab(r),m=_=>W.scalingValue(_,l??!1),h=n??_i,f=o?{width:"100%",maxWidth:"100%"}:{width:m(h),maxWidth:"100%"},C=i?{borderRadius:m(i)}:{},y={...f,...x?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...C},R={...x?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":m(h)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...x?{}:C},S={className:b,style:R,onClick:p?_=>{_.stopPropagation(),p()}:void 0},U=Math.max(d,gi),F=ts(t)?a.jsx("video",{...S,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...S,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[x?a.jsx("div",{style:y,children:F}):F,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:m(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:m(U)}})]})}function db({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,x=b>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"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"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"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 ub(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function rc({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 ac({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 Aa({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),[b,x]=s.useState(0),g=t??"",m=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!m)return;const h=p.current;if(!h||typeof ResizeObserver>"u")return;const f=()=>x(h.offsetHeight);f();const C=new ResizeObserver(f);return C.observe(h),()=>C.disconnect()},[g,m]),a.jsx("div",{ref:h=>{p.current=h,i(h)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...m?{[`--${e}-title-height`]:`${b}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:g})})]})})}const sc=45;function lc(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 pb(e){const t=lc(e,"--cntrl-viewport-height",window.innerHeight),n=lc(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function mb(e,t,n){const{top:i,centerY:o}=pb(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 gb(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*sc*sc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function hb(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(gb(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 yb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var tt;const{prefix:l}=W.useScopedStyles(),d=s.useMemo(()=>q0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??_i,x=(e==null?void 0:e.titleWidth)??ob,g=rb(e==null?void 0:e.imageDisplay),m=(e==null?void 0:e.cornerRadius)??V0,h=(e==null?void 0:e.position)??"center",f=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,R=ub(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",S=p==="b",U=R==="fade"||R==="retype",{setTitleRef:F,dominantIndex:_}=hb(c.length,U,h),B=((tt=c[_])==null?void 0:tt.title)??"",L=fb(B,R==="retype"),N=R==="fade"||R==="retype",k=R==="retype"?L:B,Z=S?void 0:{width:W.scalingValue(b,n??!1)},E=H==="on"&&(!n||i||o),K=o??!1,D=(e==null?void 0:e.galleryPaddingRight)??0,j=(e==null?void 0:e.galleryPaddingLeft)??0,$=(e==null?void 0:e.galleryPaddingBetween)??0,v=rt=>W.scalingValue(rt,n??!1),P={width:v(x)},Q=p==="a"?D:j,z=S?{width:"100%"}:{width:`calc(100% - ${v(b)} - ${v(Q)})`,...p==="c"?{marginLeft:"auto"}:{}},T=Math.max(D,gi),O=Math.max(j,gi),M=Math.max($,gi),ee=Math.max(f,gi),V=Math.max(C,gi),me=Math.max(y,gi),Ie=Math.max(0,(u??1)-(b??_i)),ge=p==="a"?Math.max(0,(u??1)-(b??_i)-D):p==="c"?Math.max(0,(u??1)-(b??_i)-j):p==="b"?u??1:1,ae=K&&(p==="a"||p==="b"||p==="c")&&h==="top",ne=K&&((p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")),oe=K&&((p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"),ie=c.length>1,Ae=S?void 0:v((p==="c"?j:D)+(b??_i)),be=p==="c"&&Ae?{left:Ae}:void 0,Me=p==="a"&&Ae?{right:Ae}:void 0,q=S?{left:0,width:"100%"}:p==="a"?{right:v(D),width:v(b)}:{left:v(j),width:v(b)},{titleColor:se,titleFontFamily:he,titleFontSettings:G,titleFontSize:re,titleLineHeight:pe,titleLetterSpacing:we,titleWordSpacing:Pe,titleAlign:Ce,titleTextAppearance:Y,lightboxCounterColor:xe,lightboxCounterFontFamily:ue,lightboxCounterFontSettings:X,lightboxCounterFontSize:le,lightboxCounterLineHeight:Fe,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Xe}=e??{},Oe={fontSettings:{fontFamily:he,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:re??.01,lineHeight:pe,letterSpacing:we??0,wordSpacing:Pe??0,textAlign:Ce??"left",textAppearance:Y,color:se??"#000000"},nt=an(Ut(Oe,n)),ht=P,st=ic(re,pe,l,n),ze=nc(re,pe,`${l}-title`,`${l}-text-tight-leading`),Se={fontSettings:{fontFamily:ue,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:le??.01,lineHeight:Fe,letterSpacing:fe??0,wordSpacing:J??0,textAppearance:Xe,color:xe??"#DEDDDD"},Be={...an(Ut(Se,n)),...ic(le,Fe,l,n)},Ye=nc(le,Fe,`${l}-lightbox-counter`,`${l}-text-tight-leading`),de=W.buildColorVars(l,{titleColor:se??"#000000",lightboxCounterColor:xe??"#DEDDDD"},K0,Z0),ve=s.useRef(null),[Ee,Ge]=s.useState(!1),[Ze,Ve]=s.useState([]),[at,Je]=s.useState(0),ke=s.useCallback((rt,lt)=>{E&&(Ve(rt),Je(lt),Ge(!0))},[E]),qe=s.useCallback(()=>{Ge(!1)},[]),We=s.useMemo(()=>{const rt={...de},lt=ve.current?getComputedStyle(ve.current).getPropertyValue("--cntrl-article-width").trim():"";return lt&&(rt["--cntrl-article-width"]=lt),rt},[de,Ee]);return s.useEffect(()=>{if(!Ee||H!=="on"||typeof document>"u")return;const rt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=rt}},[Ee,H]),s.useEffect(()=>{!n||o||i||Ge(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Ge(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:de,children:a.jsxs("div",{ref:ve,className:`${l}-wrapper`,style:{width:W.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&h==="top"?v(f):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")?v(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"?v(y):void 0},children:[N&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Aa,{P:l,title:k,position:h,titleRef:()=>{},titleClassName:`${ze} ${l}-single-title`,titleContainerStyle:{...st,...z},titleTextBoxStyle:ht,titleStyle:nt,showTextBoxOutline:K,topPaddingControl:ae?rc({P:l,scaled:v,height:ee,paired:!1}):void 0})}),c.map((rt,lt)=>{const Tt=tb(rt.gallery),Xt=lt<c.length-1,Zt=Tt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),xt={P:l,position:h,titleRef:F(lt),titleClassName:ze,titleContainerStyle:st,titleTextBoxStyle:N?{maxWidth:"100%"}:ht,titleStyle:nt,showTextBoxOutline:K&&!N,topPaddingControl:ae&&!N?rc({P:l,scaled:v,height:ee,paired:ie}):void 0};return a.jsxs("div",{"data-item-index":lt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?v($):void 0},children:[ne&&ac({P:l,controlKey:"titleLeftPadding",scaled:v,width:V,maxFraction:ge,side:"left",paired:ie,anchorStyle:be}),oe&&ac({P:l,controlKey:"titleRightPadding",scaled:v,width:me,maxFraction:ge,side:"right",paired:ie,anchorStyle:Me}),K&&Xt&&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:v(M),...q}}),S?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Tt.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const vt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(oc,{P:l,media:wt,imgWidth:b||void 0,cornerRadius:m||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:$,showPaddingAfter:At<Tt.length-1,showControls:K,onMediaClick:E&&vt>=0?()=>ke(Zt,vt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Aa,{...xt,title:N?"":rt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Aa,{...xt,title:N?"":rt.title}),Tt.length>0&&a.jsx(db,{P:l,layoutType:p,galleryWidthStyle:Z,galleryPaddingRight:D,galleryPaddingLeft:j,galleryPaddingRightWidth:T,galleryPaddingLeftWidth:O,galleryPaddingMaxFraction:Ie,showControls:K,scaled:v,children:Tt.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const vt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(oc,{P:l,media:wt,cornerRadius:m||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:$,showPaddingAfter:At<Tt.length-1,showControls:K,onMediaClick:E&&vt>=0?()=>ke(Zt,vt):void 0},`${wt.url}-${At}`)})})]})]},lt)})]})}),Ee&&H==="on"&&typeof document<"u"&&e&&(()=>{const rt=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx("div",{style:We,"data-selection":"none",children:a.jsx(cb,{prefix:l,items:Ze,index:at,imageDisplay:sb(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Je(lt=>(lt-1+Ze.length)%Ze.length),onNext:()=>Je(lt=>(lt+1)%Ze.length),counterClassName:Ye,counterStyle:Be,backgroundColor:e.backgroundColor??X0})}),rt)})()]})}const vb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20964
20964
|
import { createPortal } from 'react-dom';
|
|
20965
20965
|
import type React from 'react';
|
|
20966
20966
|
import { CommonComponentProps } from '../props';
|
|
@@ -23010,7 +23010,7 @@ export function Mercury({
|
|
|
23010
23010
|
</>
|
|
23011
23011
|
);
|
|
23012
23012
|
}
|
|
23013
|
-
`;function Ei(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Aa={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"}}},vb={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:Ei("Gallery Padding Right"),galleryPaddingLeft:Ei("Gallery Padding Left"),galleryPaddingBetween:Ei("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:Ei("Title Top Padding"),titleLeftPadding:Ei("Title Left Padding"),titleRightPadding:Ei("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:{...Aa.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:{...Aa.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:{...Aa.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"]}},xb={element:fb,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:vb,sourceCode:yb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},lc=48,bb=10,wb=400,Sb=1,$b=1120/1440,Cb=140/1440,Tb=550/1440,Lb=13,Rb=4,Ib=38/100,Pb=28/100,Od=2.8,Eb=.9,Dd=.22,Mb=.5,kb=1,Ab=1.5,Fb=0,_b=.85;function Wb(e,t){return`
|
|
23013
|
+
`;function Mi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Fa={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"}}},xb={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:Mi("Gallery Padding Right"),galleryPaddingLeft:Mi("Gallery Padding Left"),galleryPaddingBetween:Mi("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:Mi("Title Top Padding"),titleLeftPadding:Mi("Title Left Padding"),titleRightPadding:Mi("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:{...Fa.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:{...Fa.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:{...Fa.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"]}},bb={element:yb,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:xb,sourceCode:vb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},cc=48,wb=10,Sb=400,$b=1,Cb=1120/1440,Tb=140/1440,Lb=550/1440,Rb=13,Ib=4,Pb=38/100,Eb=28/100,Od=2.8,Mb=.9,Dd=.22,kb=.5,Ab=1,Fb=1.5,_b=0,Wb=.85;function Nb(e,t){return`
|
|
23014
23014
|
.${e}-wrapper {
|
|
23015
23015
|
position: relative;
|
|
23016
23016
|
box-sizing: border-box;
|
|
@@ -23055,10 +23055,10 @@ export function Mercury({
|
|
|
23055
23055
|
object-position: center;
|
|
23056
23056
|
}
|
|
23057
23057
|
${t}
|
|
23058
|
-
`}function
|
|
23059
|
-
${
|
|
23058
|
+
`}function Xo(e){return Number(e.toFixed(4))}function dc(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 _a(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 Hb(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 Ob(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function Db(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 Bd(e,t){return(1-e)/(1-e*Math.cos(t))}function Bb(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)*Bd(e,i)))}return t||1}function jb(e,t){return e?1:1+Dd*(.35+t)}function zb(e,t,n,i){const o=t*jb(n,i);return Math.max(0,(e-o)/2)}function jd(e,t,n){const i=Bd(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function zd(e,t,n){return e/2+t*n}function Vb(e,t,n){return e(t-n/2)}function Gb(e,t){return e*t}function Vd(e){return Math.round(e*1e3)}function Gd(e,t,n){const i=Math.cos(e),o=Math.cos(Wb*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Xo(t+(n-t)*r)}function qd(e){return Gd(e,kb,Ab)}function qb(e){return Gd(e,Fb,_b)}function Xd(e,t){if(!t)return"none";const n=qb(e);return n<=0?"none":`blur(${n}px)`}function Xb(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=jd(i,o,r*Math.PI*2),p=r*Math.PI*2,b=zd(t,n,c),x=Xo(u),g=`calc(${e(b)} - var(--helix-base-w) * ${x} / 2)`,m=`calc(var(--helix-base-w) * ${x})`,h=l?`height: calc(var(--helix-base-h) * ${x});`:"";return`left: ${g}; width: ${m}; ${h} z-index: ${Vd(u)}; transform: translateY(-50%); opacity: ${qd(p)}; filter: ${Xd(p,d)};`}function Ub(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=cc;u+=1){const p=u/cc;c.push(` ${Xo(p*100)}% { ${Xb(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
|
|
23059
|
+
${c.join(`
|
|
23060
23060
|
`)}
|
|
23061
|
-
}`}function Ud(e,t){return(e%t+t)%t}function
|
|
23061
|
+
}`}function Ud(e,t){return(e%t+t)%t}function Yb(e,t){return Os(e,t)/t}function Os(e,t){return Ud(e,t)}function Kb(e,t){return Math.floor(e/t)}function Zb(e,t,n,i){return Kb(e,t)*n+Os(e,t)*i}function Jb(e,t,n){const i=n==="left"?1-e:e;return`${Xo(-i*t)}s`}function uc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Yd(e){const t=e%1;return t<0?t+1:t}function Qb(e,t,n){const i=t/Od,o=n==="left"?-e*i:e*i;return Yd(o)}function ew({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=W.useScopedStyles(),r=s.useRef(null),l=_a((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Cb),d=_a(e==null?void 0:e.imageWidth,Tb),c=_a(e==null?void 0:e.turnHeight,Lb),u=dc(e==null?void 0:e.itemsPerTurn,Rb,3,40),p=dc(e==null?void 0:e.turns,Ib,1,30),b=Math.min(Mb,Math.max(0,Pb)),x=Math.min(1,Math.max(0,Eb)),g=Math.max(0,(e==null?void 0:e.speed)??Od),m=(e==null?void 0:e.direction)==="left"?"left":"right",h=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",f=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>Hb(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),R=y.display==="cover",H=z=>W.scalingValue(z,n??!1),S=s.useMemo(()=>Bb(b),[b]),U=s.useMemo(()=>zb(l,d,R,x),[l,d,R,x]),F=s.useMemo(()=>Nb(o,Ub(o,H,l,U,b,S,R,C)),[o,l,U,b,S,R,C,n]),_=s.useMemo(()=>(t??[]).filter(z=>{var T;return!!((T=z.image)!=null&&T.url)}),[t]),B=c/u,L=d*Ob(y),N=Math.min(Sb,p*u),k=$b*u,Z=N+k*2,K=Math.max(0,p-1)*c+(u-1)*B,D=g>0,j=h==="scroll"&&D,$=h==="autoplay"&&D&&(n?!!i:!0),[v,w]=s.useState(0);s.useEffect(()=>{if(!j)return;const z=r.current;if(!z)return;const T=()=>{const M=z.getBoundingClientRect(),ee=window.innerHeight||document.documentElement.clientHeight,V=ee+M.height;V<=0||w(Math.min(1,Math.max(0,(ee-M.top)/V)))};T(),window.addEventListener("scroll",T,{passive:!0}),window.addEventListener("resize",T);const O=new ResizeObserver(T);return O.observe(z),()=>{window.removeEventListener("scroll",T),window.removeEventListener("resize",T),O.disconnect()}},[j]);const P=j?Qb(v,g,m):0,Q=D&&h==="autoplay"?360/(g*wb):0;return _.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:H(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:H(l),height:H(K),marginInline:"auto"},children:Array.from({length:Z},(z,T)=>{const O=T-k,ee=_[Ud(O,_.length)].image,V=Os(O,u),me=Yb(O,u),Ie=j?Yd(me+P):me,ge=Zb(O,u,c,B),ae=x===0?0:(uc(V+7.3)-.5)*x*B,ne=R?1:1+(uc(V+3.1)-.5)*2*Dd*(.35+x),oe=Ie*Math.PI*2,{offset:ie,scale:Ae}=jd(b,S,oe),be=d*ne,Me=Gb(be,Ae),q=zd(l,U,ie),se={"--helix-base-w":H(be),...R?{"--helix-base-h":H(L)}:{}},he={top:H(ge+ae),transform:"translateY(-50%)",...se,...$?{animationDuration:`${Xo(Q)}s`,animationDelay:Jb(me,Q,m),animationDirection:m==="left"?"reverse":"normal"}:{left:Vb(H,q,Me),width:H(Me),...R?{height:H(L*Ae)}:{},zIndex:Vd(Ae),opacity:qd(oe),filter:Xd(oe,C)}},G=f>0?{borderRadius:H(f)}:{},re=R?{...G,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:G,pe=Db(ee)?a.jsx("video",{className:`${o}-media`,style:re,src:ee.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:re,src:ee.url,alt:ee.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:$?`${o}-item`:`${o}-item ${o}-item-static`,style:he,children:R?a.jsx("div",{className:`${o}-cover`,style:G,children:pe}):pe},`${p}-${u}-${O}`)})})]})}const tw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
23062
23062
|
import { CommonComponentProps } from '../props';
|
|
23063
23063
|
import { scalingValue } from '../utils/scalingValue';
|
|
23064
23064
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23596,7 +23596,7 @@ export function Helix({
|
|
|
23596
23596
|
</>
|
|
23597
23597
|
);
|
|
23598
23598
|
}
|
|
23599
|
-
`,tw=["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"],nw={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:tw.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"]}]}]},iw={element:Qb,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:nw,sourceCode:ew,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},uc=typeof window>"u"?s.useEffect:s.useLayoutEffect,Wo=120,pc=3,ow=.12,_a=.25,rw=10,aw=4e3,sw=.12,mc=.92,lw=999,Yd=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function es(e){return e<0?0:e>1?1:e}function mo(e){return e.map(([t,n])=>({x:t,y:n}))}function Wa(e,t=Wo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function $r(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const c of e)for(const d of c)d.x<t&&(t=d.x),d.x>i&&(i=d.x),d.y<n&&(n=d.y),d.y>o&&(o=d.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(c=>c.map(d=>({x:(d.x-t)/r,y:(d.y-n)/l})))}function Zd(e,t){switch(e){case"ellipse":return[Wa(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[Wa(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[mo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[mo([[0,0],[1,0],[.5,1]])];case"diamond":return[mo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[mo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return $r([Wa(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(Wo/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=Wo,r=[];for(let l=0;l<=o;l+=1){const c=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*c)*.09,y:c})}for(let l=o;l>=0;l-=1){const c=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*c+Math.PI/3)*.09,y:c})}return[r]}case"rectangle":case"custom":default:return[mo([[0,0],[1,0],[1,1],[0,1]])]}}const Jd={x:0,y:0,width:100,height:100};function cw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?Jd:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Cr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const ts=16,dw=12,uw=16,_r="0 0 100 100",Wr=100,Na=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,pw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function mw(e){const t=e.match(pw);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 ns(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 gw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function ei(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(gw)}))}function Di(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 gc(e,t,n,i=n){return Di(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 c=Math.abs(t),d=Math.abs(n);if(!c||!d||e.x===l.x&&e.y===l.y)return[{c1:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),v=Math.sin(u),f=(e.x-l.x)/2,h=(e.y-l.y)/2,g=p*f+v*h,m=-v*f+p*h,x=g*g/(c*c)+m*m/(d*d);if(x>1){const z=Math.sqrt(x);c*=z,d*=z}const T=o===r?-1:1,y=c*c*m*m+d*d*g*g,w=Math.max(0,c*c*d*d-y),B=y===0?0:T*Math.sqrt(w/y),M=B*c*m/d,G=-B*d*g/c,O=p*M-v*G+(e.x+l.x)/2,_=v*M+p*G+(e.y+l.y)/2,j=Math.atan2((m-G)/d,(g-M)/c);let H=Math.atan2((-m-G)/d,(-g-M)/c)-j;!r&&H>0&&(H-=Math.PI*2),r&&H<0&&(H+=Math.PI*2);const E=Math.max(1,Math.ceil(Math.abs(H)/(Math.PI/2))),$=H/E,S=4/3*Math.tan($/4),P=(z,C)=>({x:O+p*c*z-v*d*C,y:_+v*c*z+p*d*C}),I=[];let N=j;for(let z=0;z<E;z+=1){const C=N+$,R=Math.cos(N),D=Math.sin(N),ie=Math.cos(C),ee=Math.sin(C);I.push({c1:P(R-S*D,D+S*R),c2:P(ie+S*ee,ee-S*ie),p:z===E-1?on(l):P(ie,ee)}),N=C}return I}function Hs(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},c=null,d=null;const u=()=>{if(o&&i.length>2){const h=i[0],g=i[i.length-1];Math.abs(h.p.x-g.p.x)<1e-6&&Math.abs(h.p.y-g.p.y)<1e-6&&(h.in=g.in??h.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(h,g)=>{i.push({p:h,in:g??null,out:null}),r=h},v=h=>{i.length&&(i[i.length-1].out=h)};Na.lastIndex=0;let f=Na.exec(t);for(;f!==null;){const h=f[1],g=h.toUpperCase(),m=h!==g,x=mw(f[2]),T=y=>m?{x:r.x+x[y],y:r.y+x[y+1]}:{x:x[y],y:x[y+1]};if(g==="Z")o=!0,u(),r=on(l),c=null,d=null;else if(g==="M"){for(let y=0;y+1<x.length;y+=2){const w=T(y);y===0&&(u(),l=on(w)),p(w)}c=null,d=null}else if(g==="L"){for(let y=0;y+1<x.length;y+=2)p(T(y));c=null,d=null}else if(g==="H"){for(const y of x)p({x:m?r.x+y:y,y:r.y});c=null,d=null}else if(g==="V"){for(const y of x)p({x:r.x,y:m?r.y+y:y});c=null,d=null}else if(g==="C"){for(let y=0;y+5<x.length;y+=6){const w=T(y),B=T(y+2),M=T(y+4);v(w),p(M,B),c=B}d=null}else if(g==="S"){for(let y=0;y+3<x.length;y+=4){const w=c?ns(c,r):on(r),B=T(y),M=T(y+2);v(w),p(M,B),c=B}d=null}else if(g==="Q")for(let y=0;y+3<x.length;y+=4){const w=T(y),B=T(y+2);v(gn(r,w,2/3)),p(B,gn(B,w,2/3)),d=w,c=null}else if(g==="T")for(let y=0;y+1<x.length;y+=2){const w=d?ns(d,r):on(r),B=T(y);v(gn(r,w,2/3)),p(B,gn(B,w,2/3)),d=w,c=null}else if(g==="A")for(let y=0;y+6<x.length;y+=7){const w=m?{x:r.x+x[y+5],y:r.y+x[y+6]}:{x:x[y+5],y:x[y+6]};for(const B of hw(r,x[y],x[y+1],x[y+2],x[y+3]!==0,x[y+4]!==0,w))v(B.c1),p(B.p,B.c2);c=null,d=null}f=Na.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function qo(e,t){return!e.out&&!t.in}function hc(e,t){if(qo(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function Nr(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(hc(r,l)),r=l;if(n.closed){const l=hc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Qd(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 is(e,t,n){if(qo(e,t))return gn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,c=3*r*r*n,d=3*r*n*n,u=n*n*n;return{x:l*e.p.x+c*i.x+d*o.x+u*t.p.x,y:l*e.p.y+c*i.y+d*o.y+u*t.p.y}}function Os(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Qd(n)){if(qo(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ts;r+=1)i.push(is(o.from,o.to,r/ts))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function xo(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Os(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 eu(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 tu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=dw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/uw)),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),...eu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function fw(e){if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==_r||!e.customPath)return{x:0,y:0};const t=Hs(e.customPath);if(!t.length)return{x:0,y:0};const n=xo(t);return!isFinite(n.minX)||!isFinite(n.minY)?{x:0,y:0}:{x:n.minX,y:n.minY}}function yw(e,t=1,n){const i=fw(n),o=Zd(e==="custom"?"rectangle":e,t),r=Di(tu(o),l=>({x:l.x*Wr+i.x,y:l.y*Wr+i.y}));return{shape:"custom",customPath:Nr(r),pathFit:"viewbox",pathViewBox:_r}}function fc(e,t){return t>0?Math.round(e/t)*t:e}function yc(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,c=ei(e),d=c[t].nodes[n];return d.p={x:o.p.x+r,y:o.p.y+l},d.in&&(d.in={x:d.in.x+r,y:d.in.y+l}),d.out&&(d.out={x:d.out.x+r,y:d.out.y+l}),c}function vw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const c=ei(e),d=c[t].nodes[n];if(d[i]=on(o),r){const p=i==="in"?"out":"in";d[p]=ns(o,d.p)}return c}function xw(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=ei(e);return r[t].nodes[n][i]=null,r}function bw(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 c=ei(e),d=c[t].nodes,u=n+1;if(qo(r,l))return d.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:c,nodeIndex:u};const p=r.out??r.p,v=l.in??l.p,f=gn(r.p,p,i),h=gn(p,v,i),g=gn(v,l.p,i),m=gn(f,h,i),x=gn(h,g,i),T=gn(m,x,i),y=(n+1)%o.nodes.length;return d[n].out=f,d[y].in=g,d.splice(u,0,{p:T,in:m,out:x}),{contours:c,nodeIndex:u}}function vc(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=ei(e);return o[t].nodes.splice(n,1),o}function ww(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=ei(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const c=i.nodes.length,d=i.nodes[(n-1+c)%c].p,u=i.nodes[(n+1)%c].p,p=eu(d,l.p,u);return l.in=p.in,l.out=p.out,r}function Sw(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)),c={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-c.x,e.y-c.y)}}function $w(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Qd(i)){const l=qo(r.from,r.to)?1:ts;for(let c=0;c<l;c+=1){const d=c/l,u=(c+1)/l,p=Sw(t,is(r.from,r.to,d),is(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:d+(u-d)*p.t,distance:p.distance})}}}),n}function Cw(e,t="stretch",n=Jd){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Hs(i),c=Os(l);if(c.length)return t==="viewbox"?Cr(c,n):$r(c);if(typeof document>"u")return null;const d=i.split(/(?=[Mm])/).map(v=>v.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const v of d){const f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("d",v),u.appendChild(f);let h=0;try{h=f.getTotalLength()}catch{h=0}if(!h)continue;const g=[];for(let m=0;m<Wo;m+=1){const x=f.getPointAtLength(m/Wo*h);g.push({x:x.x,y:x.y})}p.push(g)}return p.length?t==="viewbox"?Cr(p,n):$r(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"?Cr([r],n):$r([r])}function Tw(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],c=o[(r+1)%o.length];(l.y<=t&&c.y>t||c.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(c.y-l.y)*(c.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=es(n[o]),l=es(n[o+1]);l>r&&i.push({x0:r,x1:l})}return Lw(i)}function Lw(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 Rw(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 Iw(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 Pw(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 Ew(e,t,n,i){let o=null;for(let r=0;r<pc;r+=1){const l=es(t+(n-t)*r/Math.max(1,pc-1)),c=Tw(e,l),d=i==="avoid"?Iw(c):c;if(o=o===null?d:Rw(o,d),o.length===0)return[]}return o??[]}function nu(e){return!!e&&typeof e=="object"&&e.type==="link"}function Mw(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(nu(d)){o(d.children??[],d.value,d.target);continue}const u=d,p=(u==null?void 0:u.text)??"";if(p.trim())for(const v of p.split(/\s+/))v&&t.push({text:v,leaf:u,href:l,target:c,para:i})}};o((n==null?void 0:n.children)??[])}),t}function xc(e){return{...e.fontFamily&&{fontFamily:io(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 kw(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(nu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function bc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:c,height:d,allowOverflow:u,capInset:p,capLines:v}=e,f=e.lineHeight*l,h=e.spaceWidth*l,g=[];if(!t.length||c<=0||f<=0)return{segments:g,placed:0,height:0,capLeft:0,capTop:0};const m=Math.max(1,h*.5),x=f*ow;let T=0,y=0,w=0,B=t[0].para,M=0,G=0,O=null;for(;T<t.length&&w<aw;){const _=y+f>d;if(_&&!u)break;const j=t[T].para;if(j>B+1){y+=f*(j-B-1),B=j-1,w+=1;continue}let b=_?[{x0:0,x1:c}]:Ew(i,(y+x)/d,(y+f-x)/d,o).map(E=>({x0:E.x0*c,x1:E.x1*c}));p>0&&v>0&&!_&&b.length&&(O===null&&(O=w,M=b[0].x0,G=y),w-O<v&&(b=Pw(b,{x0:M,x1:M+p})));const H=b.reduce((E,$)=>Math.max(E,$.x1-$.x0),0);for(const E of b){const $=E.x1-E.x0;if($<m)continue;if(T>=t.length||t[T].para!==j)break;const S=T;let P=0;for(;T<t.length&&t[T].para===j;){const I=n[T]*l,N=T===S?I:h+I;if(P+N>$&&!(T===S&&$>=H-.5&&I>c-.5))break;P+=N,T+=1}if(T>S){const I=T>=t.length||t[T].para!==j;g.push({top:y,left:E.x0,width:$,from:S,to:T,justify:r==="justify"&&!I})}if(T>=t.length||t[T].para!==j)break}B=j,y+=f,w+=1}return{segments:g,placed:T,height:g.length?y:0,capLeft:M,capTop:G}}function Aw(e){return`
|
|
23599
|
+
`,nw=["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"],iw={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:nw.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"]}]}]},ow={element:ew,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:iw,sourceCode:tw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Wa=typeof window>"u"?s.useEffect:s.useLayoutEffect,Wo=120,pc=3,rw=.12,Na=.25,aw=10,sw=4e3,lw=.12,mc=.92,cw=3,Kd=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function ns(e){return e<0?0:e>1?1:e}function dw(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 uw(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,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}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 go(e){return e.map(([t,n])=>({x:t,y:n}))}function Ha(e,t=Wo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Tr(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 Zd(e,t){switch(e){case"ellipse":return[Ha(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[Ha(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[go([[.5,0],[1,1],[0,1]])];case"triangle-down":return[go([[0,0],[1,0],[.5,1]])];case"diamond":return[go([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[go([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Tr([Ha(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(Wo/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=Wo,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[go([[0,0],[1,0],[1,1],[0,1]])]}}const Jd={x:0,y:0,width:100,height:100};function pw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?Jd:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Lr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const is=16,mw=12,gw=16,Nr="0 0 100 100",Hr=100,Oa=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,hw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function fw(e){const t=e.match(hw);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 os(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 yw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function ei(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(yw)}))}function xi(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 gc(e,t,n,i=n){return xi(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function vw(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),b=Math.sin(u),x=(e.x-l.x)/2,g=(e.y-l.y)/2,m=p*x+b*g,h=-b*x+p*g,f=m*m/(d*d)+h*h/(c*c);if(f>1){const $=Math.sqrt(f);d*=$,c*=$}const C=o===r?-1:1,y=d*d*h*h+c*c*m*m,R=Math.max(0,d*d*c*c-y),H=y===0?0:C*Math.sqrt(R/y),S=H*d*h/c,U=-H*c*m/d,F=p*S-b*U+(e.x+l.x)/2,_=b*S+p*U+(e.y+l.y)/2,B=Math.atan2((h-U)/c,(m-S)/d);let N=Math.atan2((-h-U)/c,(-m-S)/d)-B;!r&&N>0&&(N-=Math.PI*2),r&&N<0&&(N+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(N)/(Math.PI/2))),Z=N/k,E=4/3*Math.tan(Z/4),K=($,v)=>({x:F+p*d*$-b*c*v,y:_+b*d*$+p*c*v}),D=[];let j=B;for(let $=0;$<k;$+=1){const v=j+Z,w=Math.cos(j),P=Math.sin(j),Q=Math.cos(v),z=Math.sin(v);D.push({c1:K(w-E*P,P+E*w),c2:K(Q+E*z,z-E*Q),p:$===k-1?on(l):K(Q,z)}),j=v}return D}function No(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 g=i[0],m=i[i.length-1];Math.abs(g.p.x-m.p.x)<1e-6&&Math.abs(g.p.y-m.p.y)<1e-6&&(g.in=m.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,m)=>{i.push({p:g,in:m??null,out:null}),r=g},b=g=>{i.length&&(i[i.length-1].out=g)};Oa.lastIndex=0;let x=Oa.exec(t);for(;x!==null;){const g=x[1],m=g.toUpperCase(),h=g!==m,f=fw(x[2]),C=y=>h?{x:r.x+f[y],y:r.y+f[y+1]}:{x:f[y],y:f[y+1]};if(m==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(m==="M"){for(let y=0;y+1<f.length;y+=2){const R=C(y);y===0&&(u(),l=on(R)),p(R)}d=null,c=null}else if(m==="L"){for(let y=0;y+1<f.length;y+=2)p(C(y));d=null,c=null}else if(m==="H"){for(const y of f)p({x:h?r.x+y:y,y:r.y});d=null,c=null}else if(m==="V"){for(const y of f)p({x:r.x,y:h?r.y+y:y});d=null,c=null}else if(m==="C"){for(let y=0;y+5<f.length;y+=6){const R=C(y),H=C(y+2),S=C(y+4);b(R),p(S,H),d=H}c=null}else if(m==="S"){for(let y=0;y+3<f.length;y+=4){const R=d?os(d,r):on(r),H=C(y),S=C(y+2);b(R),p(S,H),d=H}c=null}else if(m==="Q")for(let y=0;y+3<f.length;y+=4){const R=C(y),H=C(y+2);b(gn(r,R,2/3)),p(H,gn(H,R,2/3)),c=R,d=null}else if(m==="T")for(let y=0;y+1<f.length;y+=2){const R=c?os(c,r):on(r),H=C(y);b(gn(r,R,2/3)),p(H,gn(H,R,2/3)),c=R,d=null}else if(m==="A")for(let y=0;y+6<f.length;y+=7){const R=h?{x:r.x+f[y+5],y:r.y+f[y+6]}:{x:f[y+5],y:f[y+6]};for(const H of vw(r,f[y],f[y+1],f[y+2],f[y+3]!==0,f[y+4]!==0,R))b(H.c1),p(H.p,H.c2);d=null,c=null}x=Oa.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function Uo(e,t){return!e.out&&!t.in}function hc(e,t){if(Uo(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 Ho(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(hc(r,l)),r=l;if(n.closed){const l=hc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Qd(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 rs(e,t,n){if(Uo(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 Ds(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Qd(n)){if(Uo(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<is;r+=1)i.push(rs(o.from,o.to,r/is))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Ni(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Ds(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 eu(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 tu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=mw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/gw)),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),...eu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function xw(e){const t={x:0,y:0,width:Hr,height:Hr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Nr||!e.customPath)return t;const n=No(e.customPath);if(!n.length)return t;const i=Ni(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 nu(e,t,n=1){if(!e.length)return!1;const i=Ni(e);return!isFinite(i.minX)||!isFinite(i.maxX)?!1:i.minX<t.x-n||i.minY<t.y-n||i.maxX>t.x+t.width+n||i.maxY>t.y+t.height+n}function bw(e,t=1,n){const i=xw(n),o=Zd(e==="custom"?"rectangle":e,t),r=xi(tu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y}));return{shape:e,customPath:Ho(r),pathFit:"viewbox",pathViewBox:Nr}}function fc(e,t){return t>0?Math.round(e/t)*t:e}function yc(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=ei(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 ww(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=ei(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=os(o,c.p)}return d}function Sw(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=ei(e);return r[t].nodes[n][i]=null,r}function $w(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=ei(e),c=d[t].nodes,u=n+1;if(Uo(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,b=l.in??l.p,x=gn(r.p,p,i),g=gn(p,b,i),m=gn(b,l.p,i),h=gn(x,g,i),f=gn(g,m,i),C=gn(h,f,i),y=(n+1)%o.nodes.length;return c[n].out=x,c[y].in=m,c.splice(u,0,{p:C,in:h,out:f}),{contours:d,nodeIndex:u}}function vc(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=ei(e);return o[t].nodes.splice(n,1),o}function Cw(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=ei(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=eu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Tw(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 Lw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Qd(i)){const l=Uo(r.from,r.to)?1:is;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Tw(t,rs(r.from,r.to,c),rs(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 Rw(e,t="stretch",n=Jd){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=No(i),d=Ds(l);if(d.length)return t==="viewbox"?Lr(d,n):Tr(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",b),u.appendChild(x);let g=0;try{g=x.getTotalLength()}catch{g=0}if(!g)continue;const m=[];for(let h=0;h<Wo;h+=1){const f=x.getPointAtLength(h/Wo*g);m.push({x:f.x,y:f.y})}p.push(m)}return p.length?t==="viewbox"?Lr(p,n):Tr(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"?Lr([r],n):Tr([r])}function Iw(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=ns(n[o]),l=ns(n[o+1]);l>r&&i.push({x0:r,x1:l})}return Pw(i)}function Pw(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 Ew(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 Mw(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 kw(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 Aw(e,t,n,i){let o=null;for(let r=0;r<pc;r+=1){const l=ns(t+(n-t)*r/Math.max(1,pc-1)),d=Iw(e,l),c=i==="avoid"?Mw(d):d;if(o=o===null?c:Ew(o,c),o.length===0)return[]}return o??[]}function iu(e){return!!e&&typeof e=="object"&&e.type==="link"}function Fw(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(iu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function xc(e){return{...e.fontFamily&&{fontFamily:oo(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 _w(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(iu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function bc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,x=e.lineHeight*l,g=e.spaceWidth*l,m=[];if(!t.length||d<=0||x<=0)return{segments:m,placed:0,height:0,capLeft:0,capTop:0};const h=Math.max(1,g*.5),f=x*rw;let C=0,y=0,R=0,H=t[0].para,S=0,U=0,F=null;for(;C<t.length&&R<sw;){const _=y+x>c;if(_&&!u)break;const B=t[C].para;if(B>H+1){y+=x*(B-H-1),H=B-1,R+=1;continue}let L=_?[{x0:0,x1:d}]:Aw(i,(y+f)/c,(y+x-f)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&b>0&&!_&&L.length&&(F===null&&(F=R,S=L[0].x0,U=y),R-F<b&&(L=kw(L,{x0:S,x1:S+p})));const N=L.reduce((k,Z)=>Math.max(k,Z.x1-Z.x0),0);for(const k of L){const Z=k.x1-k.x0;if(Z<h)continue;if(C>=t.length||t[C].para!==B)break;const E=C;let K=0;for(;C<t.length&&t[C].para===B;){const D=n[C]*l,j=C===E?D:g+D;if(K+j>Z&&!(C===E&&Z>=N-.5&&D>d-.5))break;K+=j,C+=1}if(C>E){const D=C>=t.length||t[C].para!==B;m.push({top:y,left:k.x0,width:Z,from:E,to:C,justify:r==="justify"&&!D})}if(C>=t.length||t[C].para!==B)break}H=B,y+=x,R+=1}return{segments:m,placed:C,height:m.length?y:0,capLeft:S,capTop:U}}function Ww(e){return`
|
|
23600
23600
|
.${e}-wrapper {
|
|
23601
23601
|
box-sizing: border-box;
|
|
23602
23602
|
display: flex;
|
|
@@ -23614,6 +23614,14 @@ export function Helix({
|
|
|
23614
23614
|
min-width: 0;
|
|
23615
23615
|
height: 100%;
|
|
23616
23616
|
}
|
|
23617
|
+
.${e}-shape-image {
|
|
23618
|
+
position: absolute;
|
|
23619
|
+
inset: 0;
|
|
23620
|
+
width: 100%;
|
|
23621
|
+
height: 100%;
|
|
23622
|
+
pointer-events: none;
|
|
23623
|
+
overflow: hidden;
|
|
23624
|
+
}
|
|
23617
23625
|
.${e}-flow {
|
|
23618
23626
|
position: absolute;
|
|
23619
23627
|
inset: 0;
|
|
@@ -23780,7 +23788,7 @@ export function Helix({
|
|
|
23780
23788
|
clip-path: inset(50%);
|
|
23781
23789
|
white-space: nowrap;
|
|
23782
23790
|
}
|
|
23783
|
-
`}const go=7,Fw=3.5,ho=9,gr=8,hr=14,wc=10,_w=24,Ww=1,Nw=.05,Sc=1.08;function iu(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 Hw(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function $c(e,t){const n=iu(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*wc,y:n.y+o*wc}}function Ow({P:e,box:t,viewBox:n,contours:i,snap:o,onChange:r,onCommit:l}){const c=s.useRef(null),d=s.useRef(i);d.current=i;const u=s.useRef(null),p=s.useRef(null),v=s.useRef(null),[f,h]=s.useState(null),g=s.useCallback($=>({x:$.x-n.x,y:$.y-n.y}),[n]),m=s.useCallback(($,S)=>{var I;const P=(I=c.current)==null?void 0:I.getBoundingClientRect();return P?{x:n.x+($-P.left),y:n.y+(S-P.top)}:{x:0,y:0}},[n]),x=s.useCallback(($,S)=>{var I;const P=(I=c.current)==null?void 0:I.getBoundingClientRect();return!P||P.width<=0||P.height<=0?{x:0,y:0}:{x:($-P.left)/P.width*t.width,y:(S-P.top)/P.height*t.height}},[t.width,t.height]),T=$=>{const S=v.current;if(S&&$.pointerId===S.pointerId){if($.stopPropagation(),$.preventDefault(),S.startDistance<=0)return;const C=m($.clientX,$.clientY),R=Math.hypot(C.x-S.origin.x,C.y-S.origin.y),D=Math.max(Nw,R/S.startDistance);if(!S.moved&&Math.abs(D-1)<1e-4)return;S.moved=!0,r(gc(S.startContours,S.origin,D));return}const P=p.current;if(P&&$.pointerId===P.pointerId){$.stopPropagation(),$.preventDefault();const C=m($.clientX,$.clientY),{bbox:R}=P,D=R.maxX-R.minX,ie=R.maxY-R.minY,ee=C.x-P.origin.x,A=C.y-P.origin.y;let ae=ee,k=A;if(isFinite(D)&&isFinite(ie)){const J=R.minX-n.x,X=R.minY-n.y,me=Math.min(0,t.width-D),Le=Math.max(0,t.width-D),he=Math.min(0,t.height-ie),K=Math.max(0,t.height-ie),V=Math.min(Le,Math.max(me,J+ee)),Y=Math.min(K,Math.max(he,X+A));ae=V-J,k=Y-X}if(!P.moved&&ae===0&&k===0)return;P.moved=!0,r(Di(P.startContours,J=>({x:J.x+ae,y:J.y+k})));return}const I=u.current;if(!I||$.pointerId!==I.pointerId)return;$.stopPropagation(),$.preventDefault();const N=m($.clientX,$.clientY),z={x:fc(N.x,o),y:fc(N.y,o)};if(I.kind==="anchor"){let C=z.x-I.origin.x,R=z.y-I.origin.y;if($.shiftKey&&(Math.abs(C)>Math.abs(R)?R=0:C=0),!I.moved&&C===0&&R===0)return;I.moved=!0,r(yc(d.current,I.contour,I.node,{x:I.anchor.x+C,y:I.anchor.y+R}));return}I.moved=!0,r(vw(d.current,I.contour,I.node,I.kind,z,I.mirror&&!$.altKey))},y=$=>{const S=v.current;if(S&&$.pointerId===S.pointerId){v.current=null,$.stopPropagation();const z=c.current;z!=null&&z.hasPointerCapture(S.pointerId)&&z.releasePointerCapture(S.pointerId),S.moved&&l(d.current);return}const P=p.current;if(P&&$.pointerId===P.pointerId){p.current=null,$.stopPropagation();const z=c.current;z!=null&&z.hasPointerCapture(P.pointerId)&&z.releasePointerCapture(P.pointerId),P.moved?l(d.current):h(null);return}const I=u.current;if(!I||$.pointerId!==I.pointerId)return;u.current=null,$.stopPropagation();const N=c.current;N!=null&&N.hasPointerCapture(I.pointerId)&&N.releasePointerCapture(I.pointerId),I.moved&&l(d.current)},w=$=>{$.stopPropagation()},B=$=>{var S,P;$.stopPropagation(),$.preventDefault(),(S=c.current)==null||S.focus({preventScroll:!0}),p.current={pointerId:$.pointerId,origin:m($.clientX,$.clientY),startContours:ei(i),bbox:xo(i),moved:!1},(P=c.current)==null||P.setPointerCapture($.pointerId)},M=($,S)=>{var C,R;$.stopPropagation(),$.preventDefault(),(C=c.current)==null||C.focus({preventScroll:!0}),h(null);const P=xo(i),I=iu(P,Hw(S)),N=$c(P,S),z=Math.hypot(N.x-I.x,N.y-I.y);!isFinite(z)||z<=0||(v.current={pointerId:$.pointerId,corner:S,origin:I,startDistance:z,startContours:ei(i),moved:!1},(R=c.current)==null||R.setPointerCapture($.pointerId))},G=($,S,P,I)=>{var z,C,R;$.stopPropagation(),$.preventDefault(),(z=c.current)==null||z.focus({preventScroll:!0});const N=(C=i[P])==null?void 0:C.nodes[I];if(N){if($.altKey){const D=S==="anchor"?vc(i,P,I):xw(i,P,I,S);if(D===i)return;h(S==="anchor"?null:{contour:P,node:I}),r(D),l(D);return}h({contour:P,node:I}),u.current={kind:S,contour:P,node:I,pointerId:$.pointerId,origin:m($.clientX,$.clientY),anchor:N.p,mirror:S!=="anchor"&&!!(N.in&&N.out),moved:!1},(R=c.current)==null||R.setPointerCapture($.pointerId)}},O=$=>{$.stopPropagation(),$.preventDefault();const S=Di(i,g),P=$w(S,x($.clientX,$.clientY));if(!P||P.distance>_w)return;const{contours:I,nodeIndex:N}=bw(i,P.contour,P.segment,P.t);N<0||(h({contour:P.contour,node:N}),r(I),l(I))},_=$=>{var D,ie;if($.key==="="||$.key==="+"||$.key==="-"||$.key==="_"){$.preventDefault(),$.stopPropagation();const ee=xo(i);if(!isFinite(ee.minX)||!isFinite(ee.maxX))return;const A={x:(ee.minX+ee.maxX)/2,y:(ee.minY+ee.maxY)/2},k=$.key==="="||$.key==="+"?Sc:1/Sc,J=gc(i,A,k);r(J),l(J);return}if(!f)return;const{contour:S,node:P}=f;if($.key==="Escape"){$.stopPropagation(),h(null);return}if($.key==="Backspace"||$.key==="Delete"){$.preventDefault(),$.stopPropagation();const ee=vc(i,S,P);if(ee===i)return;h(null),r(ee),l(ee);return}const I=o>0?o:Ww,N=$.shiftKey?I*10:I,z={ArrowLeft:[-N,0],ArrowRight:[N,0],ArrowUp:[0,-N],ArrowDown:[0,N]}[$.key];if(!z)return;$.preventDefault(),$.stopPropagation();const C=(ie=(D=i[S])==null?void 0:D.nodes[P])==null?void 0:ie.p;if(!C)return;const R=yc(i,S,P,{x:C.x+z[0],y:C.y+z[1]});r(R),l(R)},j=s.useMemo(()=>Nr(Di(i,g)),[i,g]),b=s.useMemo(()=>xo(i),[i]),H=g({x:b.minX,y:b.minY}),E=!f&&isFinite(b.minX)&&isFinite(b.maxX)&&b.maxX>b.minX&&b.maxY>b.minY;return a.jsxs("svg",{ref:c,className:`${e}-editor${f?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:_,onPointerDown:()=>{var $;return($=c.current)==null?void 0:$.focus({preventScroll:!0})},onPointerMove:T,onPointerUp:y,onPointerCancel:y,onLostPointerCapture:y,"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>h(null),onClick:O}),a.jsx("path",{className:`${e}-editor-hit`,d:j,onClick:O}),a.jsx("path",{className:`${e}-editor-outline`,d:j}),a.jsx("path",{className:`${e}-editor-body`,d:j,fillRule:"evenodd",onPointerDown:B,onClick:O}),i.map(($,S)=>$.nodes.map((P,I)=>{const N=(f==null?void 0:f.contour)===S&&(f==null?void 0:f.node)===I,z=g(P.p);return a.jsxs("g",{children:[N&&["in","out"].map(C=>{const R=P[C];if(!R)return null;const D=g(R);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:D.x,y2:D.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:D.x,cy:D.y,r:Fw}),a.jsx("circle",{className:`${e}-editor-grab`,cx:D.x,cy:D.y,r:ho,onPointerDown:ie=>G(ie,C,S,I),onClick:w})]},C)}),a.jsx("rect",{className:`${e}-editor-anchor${N?` ${e}-editor-anchor-selected`:""}`,x:z.x-go/2,y:z.y-go/2,width:go,height:go,rx:P.in||P.out?go/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-ho,y:z.y-ho,width:ho*2,height:ho*2,onPointerDown:C=>G(C,"anchor",S,I),onClick:w,onDoubleClick:C=>{C.stopPropagation(),C.preventDefault();const R=ww(i,S,I);r(R),l(R)}})]},`${S}-${I}`)})),E&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:H.x,y:H.y,width:b.maxX-b.minX,height:b.maxY-b.minY}),["nw","ne","se","sw"].map($=>{const S=g($c(b,$)),P=$==="ne"||$==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:S.x-gr/2,y:S.y-gr/2,width:gr,height:gr}),a.jsx("rect",{className:`${e}-editor-scale-grab${P?` ${e}-editor-scale-grab-nesw`:""}`,x:S.x-hr/2,y:S.y-hr/2,width:hr,height:hr,onPointerDown:I=>M(I,$),onClick:w})]},$)})]})]})}function Dw(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function Bw(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 jw(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 c=Dw(e);(!r||!Bw(r,c))&&(r=c,i(c)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function zw(){return typeof document>"u"?null:document.body}function Vw({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:c,allowOverflow:d,fitEnabled:u,scale:p,onFitScale:v,dropCapLines:f,showGuides:h,typography:g,pathEditor:m}){var Le,he;const[x,T]=s.useState(null),y=s.useRef(null),[w,B]=s.useState({width:0,height:0}),[M,G]=s.useState(null),[O,_]=s.useState(0),j=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),b=s.useMemo(()=>Mw(j),[j]),H=s.useMemo(()=>kw(j),[j]),E=f>0?((he=(Le=b[0])==null?void 0:Le.text)==null?void 0:he.charAt(0))??"":"",$=w.height>0?w.width/w.height:1,S=(m==null?void 0:m.contours)??null,{rings:P,isPathShape:I}=s.useMemo(()=>{if(S){const Y=Os(S);if(Y.length)return{rings:Cr(Y,r),isPathShape:!0}}const K=((t==null?void 0:t.path)??"").trim()||(n==="custom"?i:""),V=K?Cw(K,o,r):null;return V&&V.length?{rings:V,isPathShape:!0}:{rings:Zd(n==="custom"?"rectangle":n,$),isPathShape:!1}},[S,t==null?void 0:t.path,n,i,o,r,Math.round($*100)/100]),N=m==null?void 0:m.onConvert,z=(m==null?void 0:m.needsConversion)??!1,C=I||z,R=s.useMemo(()=>{if(!C||w.width<=0||w.height<=0)return P;const K=r.width/w.width,V=r.height/w.height;return P.map(Y=>Y.map(Q=>({x:Q.x*K,y:Q.y*V})))},[P,C,r.width,r.height,w.width,w.height]);s.useEffect(()=>{!z||!N||!P.length||N(Di(tu(P),K=>({x:K.x*Wr,y:K.y*Wr})))},[z,N,P]),uc(()=>{const K=x;if(!K||typeof ResizeObserver>"u")return;const V=()=>{const Q=K.getBoundingClientRect();B(Te=>Math.abs(Te.width-Q.width)<.5&&Math.abs(Te.height-Q.height)<.5?Te:{width:Q.width,height:Q.height})};V();const Y=new ResizeObserver(V);return Y.observe(K),()=>Y.disconnect()},[x]),s.useEffect(()=>{const K=typeof document<"u"?document.fonts:void 0;K!=null&&K.ready&&K.ready.then(()=>{_(V=>V+1)})},[]),uc(()=>{const K=y.current;if(!K)return;if(!b.length){G(null);return}const V=[],Y=document.createDocumentFragment();for(const ue of b){const xe=document.createElement("span");Object.assign(xe.style,xc(ue.leaf)),xe.textContent=ue.text,Y.appendChild(xe),V.push(xe)}const Q=document.createElement("span");Q.textContent=" ",Y.appendChild(Q);const Te=document.createElement("span");Te.textContent=E||"H",Te.style.lineHeight="1",Y.appendChild(Te),K.replaceChildren(Y);const we=window.getComputedStyle(K),ke=parseFloat(we.fontSize)||16,le=parseFloat(we.lineHeight),ge=Number.isNaN(le)?ke*1.2:le;Te.style.fontSize=`${ge*Math.max(1,f)*mc}px`;const be=V.map(ue=>ue.getBoundingClientRect().width),ne=Q.getBoundingClientRect().width,ce=E?Te.getBoundingClientRect().width:0;K.replaceChildren(),G({widths:be,spaceWidth:ne,lineHeight:ge,capWidth:ce})},[b,g,E,f,O,w.width]);const D=M&&E?M.capWidth+M.lineHeight*sw:0,ie=s.useMemo(()=>{if(!M||!b.length||w.width<=0||w.height<=0||!u)return 1;const K=Q=>bc({tokens:b,widths:M.widths,spaceWidth:M.spaceWidth,lineHeight:M.lineHeight,width:w.width,height:w.height,rings:R,mode:l,align:c,scale:Q,allowOverflow:!1,capInset:D*Q,capLines:E?f:0});if(K(1).placed>=b.length)return 1;if(K(_a).placed<b.length)return _a;let V=_a,Y=1;for(let Q=0;Q<rw;Q+=1){const Te=(V+Y)/2;K(Te).placed>=b.length?V=Te:Y=Te}return V},[M,b,w.width,w.height,R,l,c,u,D,E,f]);s.useEffect(()=>{v(ie)},[ie,v]);const ee=u?Math.min(p,ie):1,A=s.useMemo(()=>!M||!b.length||w.width<=0||w.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:bc({tokens:b,widths:M.widths,spaceWidth:M.spaceWidth,lineHeight:M.lineHeight,width:w.width,height:w.height,rings:R,mode:l,align:c,scale:ee,allowOverflow:d,capInset:D*ee,capLines:E?f:0}),[M,b,w.width,w.height,R,l,c,ee,d,D,E,f]),ae=M?M.lineHeight*ee:0,k=c==="justify"?"left":c,J=!!(m&&S&&w.width>0&&w.height>0),X=jw(x,J),me=J&&X?zw():null;return a.jsxs("div",{className:`${e}-column`,ref:T,children:[a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...g,["--"+e+"-fit"]:ee},children:[a.jsx("div",{className:`${e}-measure`,ref:y,style:g,"aria-hidden":!0}),E&&M&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{top:`${A.capTop}px`,left:`${A.capLeft}px`,fontSize:`${ae*Math.max(1,f)*mc}px`,lineHeight:`${ae*Math.max(1,f)}px`},children:E}),A.segments.map((K,V)=>{const Y=b.slice(K.from,K.to),Q=V===0;return a.jsx("div",{className:`${e}-line${K.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${K.top}px`,left:`${K.left}px`,width:`${K.width}px`,textAlign:K.justify?void 0:k},children:Y.map((Te,we)=>{const le=E&&Q&&K.from===0&&we===0?Te.text.slice(1):Te.text,ge=xc(Te.leaf),be=Te.href?a.jsx("a",{className:`${e}-link`,href:Te.href,target:Te.target,style:ge,children:le}):a.jsx("span",{style:ge,children:le});return a.jsxs("span",{children:[!K.justify&&we>0?" ":null,be]},we)})},`${K.from}-${K.to}-${V}`)}),h&&!S&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:R.map((K,V)=>a.jsx("polygon",{points:K.map(Y=>`${Y.x},${Y.y}`).join(" ")},V))})]}),me&&X&&S&&m&&Dn.createPortal(a.jsx("div",{"data-selection":"none",style:{position:"fixed",top:X.top,left:X.left,width:X.width,height:X.height,zIndex:lw,pointerEvents:"none"},children:a.jsx(Ow,{P:e,box:{width:X.width,height:X.height},viewBox:r,contours:S,snap:m.snap,onChange:m.onChange,onCommit:m.onCommit})}),me),a.jsx("div",{className:`${e}-a11y`,children:H.map((K,V)=>a.jsx("p",{children:K},V))})]})}function Gw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:c}=W.useScopedStyles(),d=s.useMemo(()=>Aw(c),[c]),u=n??!1,p=!!r||!!o,v=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),f=(e==null?void 0:e.shape)??"rectangle",h=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",m=s.useMemo(()=>cw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),x=(e==null?void 0:e.shapeMode)??"contain",T=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",w=((e==null?void 0:e.fitText)??"off")==="on",B=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,M=u&&p&&!i,[G,O]=s.useState(!1);s.useEffect(()=>{if(!u||!p){O(!1);return}const k=()=>O(!0),J=()=>O(!1),X=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],me=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const Le of X)window.addEventListener(Le,k);for(const Le of me)window.addEventListener(Le,J);return()=>{for(const Le of X)window.removeEventListener(Le,k);for(const Le of me)window.removeEventListener(Le,J)}},[u,p]);const _=u&&p&&!i&&typeof l=="function",j=!G,b=Math.max(0,(e==null?void 0:e.pathSnap)??0),[H,E]=s.useState(null),$=s.useMemo(()=>{if(!_)return null;if(H&&(H.base===h||H.serialized===h))return H.contours;const k=Hs(h);return k.length?k:null},[_,H,h]),S=f==="custom"&&g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===_r&&!!$,P=s.useCallback((k,J)=>{const X=Nr(k);E(me=>({base:me&&(me.base===h||me.serialized===h)?me.base:h,serialized:X,contours:k})),J&&(l==null||l({...e,customPath:X}))},[h,l,e]),I=s.useMemo(()=>_?{contours:S?$:null,snap:b,needsConversion:!S,onConvert:k=>{const J=Nr(k);E({base:J,serialized:J,contours:k}),l==null||l({...e,shape:"custom",pathFit:"viewbox",pathViewBox:_r,customPath:J})},onChange:k=>P(k,!1),onCommit:k=>P(k,!0)}:null,[_,S,$,b,l,e,P]),N=!((v==null?void 0:v.path)??"").trim(),[z,C]=s.useState(void 0),R=s.useRef(void 0),D=s.useCallback(k=>{const J=R.current;J!==void 0&&Math.abs(J-k)<.005||(R.current=k,C(k))},[]),ie=s.useMemo(()=>w&&typeof z=="number"?z:1,[z,w]),ee=k=>`calc(${k} * var(--${c}-fit, 1))`,A=s.useMemo(()=>{var k,J,X,me,Le;return{fontFamily:io(e==null?void 0:e.textFontFamily),fontWeight:(k=e==null?void 0:e.textFontSettings)==null?void 0:k.fontWeight,fontStyle:(J=e==null?void 0:e.textFontSettings)==null?void 0:J.fontStyle,fontSize:ee(W.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:ee(W.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:ee(W.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ee(W.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(X=e==null?void 0:e.textTextAppearance)==null?void 0:X.textTransform,textDecoration:(me=e==null?void 0:e.textTextAppearance)==null?void 0:me.textDecoration,fontVariant:(Le=e==null?void 0:e.textTextAppearance)==null?void 0:Le.fontVariant}},[e,u,c]),ae={[`--${c}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${c}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${c}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{className:`${c}-wrapper`,style:{...ae},children:a.jsx(Vw,{P:c,item:v,shape:f,customPath:h,pathFit:g,viewBox:m,mode:x,align:T,allowOverflow:y,fitEnabled:w,scale:ie,onFitScale:D,dropCapLines:B,showGuides:(M||_)&&j,typography:A,pathEditor:N&&j?I:null})})]})}const qw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23791
|
+
`}const ho=7,Nw=3.5,fo=9,fr=8,yr=14,wc=10,Hw=24,Ow=1,Dw=.05,Sc=1.08;function ou(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 Bw(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function $c(e,t){const n=ou(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*wc,y:n.y+o*wc}}function jw({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,onChange:l,onCommit:d}){const c=s.useRef(null),u=s.useRef(i);u.current=i;const p=s.useRef(null),b=s.useRef(null),x=s.useRef(null),[g,m]=s.useState(null),h=n.width>0?t.width/n.width:1,f=n.height>0?t.height/n.height:1,C=s.useCallback($=>r?{x:($.x-n.x)*h,y:($.y-n.y)*f}:{x:$.x-n.x,y:$.y-n.y},[r,n,h,f]),y=s.useCallback(($,v)=>{var P;const w=(P=c.current)==null?void 0:P.getBoundingClientRect();return!w||w.width<=0||w.height<=0?{x:0,y:0}:r?{x:n.x+($-w.left)/w.width*n.width,y:n.y+(v-w.top)/w.height*n.height}:{x:n.x+($-w.left),y:n.y+(v-w.top)}},[r,n]),R=s.useCallback(($,v)=>{var P;const w=(P=c.current)==null?void 0:P.getBoundingClientRect();return!w||w.width<=0||w.height<=0?{x:0,y:0}:{x:($-w.left)/w.width*t.width,y:(v-w.top)/w.height*t.height}},[t.width,t.height]),H=s.useCallback($=>{d($)},[d]),S=$=>{const v=x.current;if(v&&$.pointerId===v.pointerId){if($.stopPropagation(),$.preventDefault(),v.startDistance<=0)return;const T=y($.clientX,$.clientY),O=Math.hypot(T.x-v.origin.x,T.y-v.origin.y),M=Math.max(Dw,O/v.startDistance);if(!v.moved&&Math.abs(M-1)<1e-4)return;v.moved=!0,l(gc(v.startContours,v.origin,M));return}const w=b.current;if(w&&$.pointerId===w.pointerId){$.stopPropagation(),$.preventDefault();const T=y($.clientX,$.clientY),{bbox:O}=w,M=O.maxX-O.minX,ee=O.maxY-O.minY,V=T.x-w.origin.x,me=T.y-w.origin.y;let Ie=V,ge=me;if(isFinite(M)&&isFinite(ee))if(r){const ae=Math.min(n.x,n.x+n.width-M),ne=Math.max(n.x,n.x+n.width-M),oe=Math.min(n.y,n.y+n.height-ee),ie=Math.max(n.y,n.y+n.height-ee),Ae=Math.min(ne,Math.max(ae,O.minX+V)),be=Math.min(ie,Math.max(oe,O.minY+me));Ie=Ae-O.minX,ge=be-O.minY}else{const ae=O.minX-n.x,ne=O.minY-n.y,oe=Math.min(0,t.width-M),ie=Math.max(0,t.width-M),Ae=Math.min(0,t.height-ee),be=Math.max(0,t.height-ee),Me=Math.min(ie,Math.max(oe,ae+V)),q=Math.min(be,Math.max(Ae,ne+me));Ie=Me-ae,ge=q-ne}if(!w.moved&&Ie===0&&ge===0)return;w.moved=!0,l(xi(w.startContours,ae=>({x:ae.x+Ie,y:ae.y+ge})));return}const P=p.current;if(!P||$.pointerId!==P.pointerId)return;$.stopPropagation(),$.preventDefault();const Q=y($.clientX,$.clientY),z={x:fc(Q.x,o),y:fc(Q.y,o)};if(P.kind==="anchor"){let T=z.x-P.origin.x,O=z.y-P.origin.y;if($.shiftKey&&(Math.abs(T)>Math.abs(O)?O=0:T=0),!P.moved&&T===0&&O===0)return;P.moved=!0,l(yc(u.current,P.contour,P.node,{x:P.anchor.x+T,y:P.anchor.y+O}));return}P.moved=!0,l(ww(u.current,P.contour,P.node,P.kind,z,P.mirror&&!$.altKey))},U=$=>{const v=x.current;if(v&&$.pointerId===v.pointerId){x.current=null,$.stopPropagation();const z=c.current;z!=null&&z.hasPointerCapture(v.pointerId)&&z.releasePointerCapture(v.pointerId),v.moved&&H(u.current);return}const w=b.current;if(w&&$.pointerId===w.pointerId){b.current=null,$.stopPropagation();const z=c.current;z!=null&&z.hasPointerCapture(w.pointerId)&&z.releasePointerCapture(w.pointerId),w.moved?H(u.current):m(null);return}const P=p.current;if(!P||$.pointerId!==P.pointerId)return;p.current=null,$.stopPropagation();const Q=c.current;Q!=null&&Q.hasPointerCapture(P.pointerId)&&Q.releasePointerCapture(P.pointerId),P.moved&&H(u.current)},F=$=>{$.stopPropagation()},_=$=>{var v,w;$.stopPropagation(),$.preventDefault(),(v=c.current)==null||v.focus({preventScroll:!0}),b.current={pointerId:$.pointerId,origin:y($.clientX,$.clientY),startContours:ei(i),bbox:Ni(i),moved:!1},(w=c.current)==null||w.setPointerCapture($.pointerId)},B=($,v)=>{var T,O;$.stopPropagation(),$.preventDefault(),(T=c.current)==null||T.focus({preventScroll:!0}),m(null);const w=Ni(i),P=ou(w,Bw(v)),Q=$c(w,v),z=Math.hypot(Q.x-P.x,Q.y-P.y);!isFinite(z)||z<=0||(x.current={pointerId:$.pointerId,corner:v,origin:P,startDistance:z,startContours:ei(i),moved:!1},(O=c.current)==null||O.setPointerCapture($.pointerId))},L=($,v,w,P)=>{var z,T,O;$.stopPropagation(),$.preventDefault(),(z=c.current)==null||z.focus({preventScroll:!0});const Q=(T=i[w])==null?void 0:T.nodes[P];if(Q){if($.altKey){const M=v==="anchor"?vc(i,w,P):Sw(i,w,P,v);if(M===i)return;m(v==="anchor"?null:{contour:w,node:P}),l(M),H(M);return}m({contour:w,node:P}),p.current={kind:v,contour:w,node:P,pointerId:$.pointerId,origin:y($.clientX,$.clientY),anchor:Q.p,mirror:v!=="anchor"&&!!(Q.in&&Q.out),moved:!1},(O=c.current)==null||O.setPointerCapture($.pointerId)}},N=$=>{$.stopPropagation(),$.preventDefault();const v=xi(i,C),w=Lw(v,R($.clientX,$.clientY));if(!w||w.distance>Hw)return;const{contours:P,nodeIndex:Q}=$w(i,w.contour,w.segment,w.t);Q<0||(m({contour:w.contour,node:Q}),l(P),H(P))},k=$=>{var M,ee;if($.key==="="||$.key==="+"||$.key==="-"||$.key==="_"){$.preventDefault(),$.stopPropagation();const V=Ni(i);if(!isFinite(V.minX)||!isFinite(V.maxX))return;const me={x:(V.minX+V.maxX)/2,y:(V.minY+V.maxY)/2},ge=$.key==="="||$.key==="+"?Sc:1/Sc,ae=gc(i,me,ge);l(ae),H(ae);return}if(!g)return;const{contour:v,node:w}=g;if($.key==="Escape"){$.stopPropagation(),m(null);return}if($.key==="Backspace"||$.key==="Delete"){$.preventDefault(),$.stopPropagation();const V=vc(i,v,w);if(V===i)return;m(null),l(V),H(V);return}const P=o>0?o:Ow,Q=$.shiftKey?P*10:P,z={ArrowLeft:[-Q,0],ArrowRight:[Q,0],ArrowUp:[0,-Q],ArrowDown:[0,Q]}[$.key];if(!z)return;$.preventDefault(),$.stopPropagation();const T=(ee=(M=i[v])==null?void 0:M.nodes[w])==null?void 0:ee.p;if(!T)return;const O=yc(i,v,w,{x:T.x+z[0],y:T.y+z[1]});l(O),H(O)},Z=s.useMemo(()=>Ho(xi(i,C)),[i,C]),E=s.useMemo(()=>Ni(i),[i]),K=C({x:E.minX,y:E.minY}),D={width:C({x:E.maxX,y:E.minY}).x-K.x,height:C({x:E.minX,y:E.maxY}).y-K.y},j=!g&&isFinite(E.minX)&&isFinite(E.maxX)&&E.maxX>E.minX&&E.maxY>E.minY;return a.jsxs("svg",{ref:c,className:`${e}-editor${g?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:k,onPointerDown:()=>{var $;return($=c.current)==null?void 0:$.focus({preventScroll:!0})},onPointerMove:S,onPointerUp:U,onPointerCancel:U,onLostPointerCapture:U,"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>m(null),onClick:N}),a.jsx("path",{className:`${e}-editor-hit`,d:Z,onClick:N}),a.jsx("path",{className:`${e}-editor-outline`,d:Z}),a.jsx("path",{className:`${e}-editor-body`,d:Z,fillRule:"evenodd",onPointerDown:_,onClick:N}),i.map(($,v)=>$.nodes.map((w,P)=>{const Q=(g==null?void 0:g.contour)===v&&(g==null?void 0:g.node)===P,z=C(w.p);return a.jsxs("g",{children:[Q&&["in","out"].map(T=>{const O=w[T];if(!O)return null;const M=C(O);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:M.x,y2:M.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:M.x,cy:M.y,r:Nw}),a.jsx("circle",{className:`${e}-editor-grab`,cx:M.x,cy:M.y,r:fo,onPointerDown:ee=>L(ee,T,v,P),onClick:F})]},T)}),a.jsx("rect",{className:`${e}-editor-anchor${Q?` ${e}-editor-anchor-selected`:""}`,x:z.x-ho/2,y:z.y-ho/2,width:ho,height:ho,rx:w.in||w.out?ho/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-fo,y:z.y-fo,width:fo*2,height:fo*2,onPointerDown:T=>L(T,"anchor",v,P),onClick:F,onDoubleClick:T=>{T.stopPropagation(),T.preventDefault();const O=Cw(i,v,P);l(O),H(O)}})]},`${v}-${P}`)})),j&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:K.x,y:K.y,width:D.width,height:D.height}),["nw","ne","se","sw"].map($=>{const v=C($c(E,$)),w=$==="ne"||$==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:v.x-fr/2,y:v.y-fr/2,width:fr,height:fr}),a.jsx("rect",{className:`${e}-editor-scale-grab${w?` ${e}-editor-scale-grab-nesw`:""}`,x:v.x-yr/2,y:v.y-yr/2,width:yr,height:yr,onPointerDown:P=>B(P,$),onClick:F})]},$)})]})]})}function zw(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function Vw(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 Gw(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=zw(e);(!r||!Vw(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function qw(){return typeof document>"u"?null:document.body}function Xw({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:b,dropCapLines:x,showGuides:g,typography:m,imageUrl:h,pathEditor:f}){var be,Me;const C=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[y,R]=s.useState(null),H=s.useRef(null),[S,U]=s.useState({width:0,height:0}),[F,_]=s.useState(null),[B,L]=s.useState(0),N=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),k=s.useMemo(()=>Fw(N),[N]),Z=s.useMemo(()=>_w(N),[N]),E=x>0?((Me=(be=k[0])==null?void 0:be.text)==null?void 0:Me.charAt(0))??"":"",K=S.height>0?S.width/S.height:1,D=(f==null?void 0:f.contours)??null,j=s.useMemo(()=>{if(D){const he=Ds(D);if(he.length)return Lr(he,r)}const q=i.trim(),se=q?Rw(q,o,r):null;return se&&se.length?se:Zd(n==="custom"?"rectangle":n,K)},[D,n,i,o,r,Math.round(K*100)/100]),$=f==null?void 0:f.onConvert,v=(f==null?void 0:f.needsConversion)??!1,w=s.useMemo(()=>{const q=D??(i.trim()?No(i):null);return!!(q&&nu(q,r))},[D,i,r]),[P,Q]=s.useState(null);Wa(()=>{if(!w){P&&Q(null);return}!P&&S.width>0&&S.height>0&&Q({width:S.width,height:S.height})},[w,S.width,S.height,P]);const z=s.useMemo(()=>{if(!w||S.width<=0||S.height<=0)return j;const q=P??S,se=r.width/q.width,he=r.height/q.height;return j.map(G=>G.map(re=>({x:re.x*se,y:re.y*he})))},[j,w,P,r.width,r.height,S.width,S.height]),T=s.useRef(null);s.useEffect(()=>{if(!(!$||S.width<=0||S.height<=0)){if(w){if(T.current===i)return;const q=D??(i.trim()?No(i):null);if(!(q!=null&&q.length))return;const se=xi(q,he=>({x:r.x+(he.x-r.x)/S.width*r.width,y:r.y+(he.y-r.y)/S.height*r.height}));T.current=Ho(se),$(se);return}!v||!j.length||$(xi(tu(j),q=>({x:q.x*Hr,y:q.y*Hr})))}},[v,w,$,j,D,i,r,S.width,S.height]),Wa(()=>{const q=y;if(!q||typeof ResizeObserver>"u")return;const se=()=>{const G=q.getBoundingClientRect();U(re=>Math.abs(re.width-G.width)<.5&&Math.abs(re.height-G.height)<.5?re:{width:G.width,height:G.height})};se();const he=new ResizeObserver(se);return he.observe(q),()=>he.disconnect()},[y]),s.useEffect(()=>{const q=typeof document<"u"?document.fonts:void 0;q!=null&&q.ready&&q.ready.then(()=>{L(se=>se+1)})},[]),Wa(()=>{const q=H.current;if(!q)return;if(!k.length){_(null);return}const se=[],he=document.createDocumentFragment();for(const X of k){const le=document.createElement("span");Object.assign(le.style,xc(X.leaf)),le.textContent=X.text,he.appendChild(le),se.push(le)}const G=document.createElement("span");G.textContent=" ",he.appendChild(G);const re=document.createElement("span");re.textContent=E||"H",re.style.lineHeight="1",he.appendChild(re),q.replaceChildren(he);const pe=window.getComputedStyle(q),we=parseFloat(pe.fontSize)||16,Pe=parseFloat(pe.lineHeight),Ce=Number.isNaN(Pe)?we*1.2:Pe;re.style.fontSize=`${Ce*Math.max(1,x)*mc}px`;const Y=se.map(X=>X.getBoundingClientRect().width),xe=G.getBoundingClientRect().width,ue=E?re.getBoundingClientRect().width:0;q.replaceChildren(),_({widths:Y,spaceWidth:xe,lineHeight:Ce,capWidth:ue})},[k,m,E,x,B,S.width]);const O=F&&E?F.capWidth+F.lineHeight*lw:0,M=s.useMemo(()=>{if(!F||!k.length||S.width<=0||S.height<=0||!u)return 1;const q=G=>bc({tokens:k,widths:F.widths,spaceWidth:F.spaceWidth,lineHeight:F.lineHeight,width:S.width,height:S.height,rings:z,mode:l,align:d,scale:G,allowOverflow:!1,capInset:O*G,capLines:E?x:0});if(q(1).placed>=k.length)return 1;if(q(Na).placed<k.length)return Na;let se=Na,he=1;for(let G=0;G<aw;G+=1){const re=(se+he)/2;q(re).placed>=k.length?se=re:he=re}return se},[F,k,S.width,S.height,z,l,d,u,O,E,x]);s.useEffect(()=>{b(M)},[M,b]);const ee=u?Math.min(p,M):1,V=s.useMemo(()=>!F||!k.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:bc({tokens:k,widths:F.widths,spaceWidth:F.spaceWidth,lineHeight:F.lineHeight,width:S.width,height:S.height,rings:z,mode:l,align:d,scale:ee,allowOverflow:c,capInset:O*ee,capLines:E?x:0}),[F,k,S.width,S.height,z,l,d,ee,c,O,E,x]),me=F?F.lineHeight*ee:0,Ie=d==="justify"?"left":d,ge=!!(f&&D&&S.width>0&&S.height>0),ae=Gw(y,ge),ne=ge&&ae?qw():null,oe=s.useMemo(()=>h&&S.width>0&&S.height>0?dw(z,S):"",[h,z,S.width,S.height]),ie=s.useMemo(()=>h&&S.width>0&&S.height>0?uw(z,S):null,[h,z,S.width,S.height]),Ae=`${C}-pattern`;return a.jsxs("div",{className:`${e}-column`,ref:R,children:[h&&oe&&ie?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${S.width} ${S.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("pattern",{id:Ae,patternUnits:"userSpaceOnUse",x:ie.x,y:ie.y,width:ie.width,height:ie.height,children:a.jsx("image",{href:h,x:0,y:0,width:ie.width,height:ie.height,preserveAspectRatio:"xMidYMid slice"})})}),a.jsx("path",{d:oe,fill:`url(#${Ae})`,fillRule:"evenodd"})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...m,["--"+e+"-fit"]:ee},children:[a.jsx("div",{className:`${e}-measure`,ref:H,style:m,"aria-hidden":!0}),E&&F&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{top:`${V.capTop}px`,left:`${V.capLeft}px`,fontSize:`${me*Math.max(1,x)*mc}px`,lineHeight:`${me*Math.max(1,x)}px`},children:E}),V.segments.map((q,se)=>{const he=k.slice(q.from,q.to),G=se===0;return a.jsx("div",{className:`${e}-line${q.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${q.top}px`,left:`${q.left}px`,width:`${q.width}px`,textAlign:q.justify?void 0:Ie},children:he.map((re,pe)=>{const Pe=E&&G&&q.from===0&&pe===0?re.text.slice(1):re.text,Ce=xc(re.leaf),Y=re.href?a.jsx("a",{className:`${e}-link`,href:re.href,target:re.target,style:Ce,children:Pe}):a.jsx("span",{style:Ce,children:Pe});return a.jsxs("span",{children:[!q.justify&&pe>0?" ":null,Y]},pe)})},`${q.from}-${q.to}-${se}`)}),g&&!D&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:z.map((q,se)=>a.jsx("polygon",{points:q.map(he=>`${he.x},${he.y}`).join(" ")},se))})]}),ne&&ae&&D&&f&&Dn.createPortal(a.jsx("div",{"data-selection":"none",style:{position:"fixed",top:ae.top,left:ae.left,width:ae.width,height:ae.height,zIndex:cw,pointerEvents:"none"},children:a.jsx(jw,{P:e,box:{width:ae.width,height:ae.height},viewBox:r,contours:D,snap:f.snap,stretchToBox:!w,onChange:f.onChange,onCommit:f.onCommit})}),ne),a.jsx("div",{className:`${e}-a11y`,children:Z.map((q,se)=>a.jsx("p",{children:q},se))})]})}function Uw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>Ww(d),[d]),u=n??!1,p=!!r||!!o,b=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),x=(e==null?void 0:e.shape)??"rectangle",g=(e==null?void 0:e.customPath)??"",m=(e==null?void 0:e.pathFit)??"stretch",h=s.useMemo(()=>pw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),f=(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",R=((e==null?void 0:e.fitText)??"off")==="on",H=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,S=u&&p&&!i,[U,F]=s.useState(!1);s.useEffect(()=>{if(!u||!p){F(!1);return}const O=()=>F(!0),M=()=>F(!1),ee=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],V=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const me of ee)window.addEventListener(me,O);for(const me of V)window.addEventListener(me,M);return()=>{for(const me of ee)window.removeEventListener(me,O);for(const me of V)window.removeEventListener(me,M)}},[u,p]);const _=u&&p&&!i&&typeof l=="function",B=!U,L=Math.max(0,(e==null?void 0:e.pathSnap)??0),[N,k]=s.useState(null),Z=s.useMemo(()=>{if(!_)return null;if(N&&(N.base===g||N.serialized===g))return N.contours;const O=No(g);return O.length?O:null},[_,N,g]),E=m==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Nr&&!!(Z&&!nu(Z,h)),K=s.useCallback((O,M)=>{const ee=Ho(O);k(V=>({base:V&&(V.base===g||V.serialized===g)?V.base:g,serialized:ee,contours:O})),M&&(l==null||l({...e,shape:"custom",customPath:ee}))},[g,l,e]),D=s.useMemo(()=>_?{contours:E?Z:null,snap:L,needsConversion:!E,onConvert:O=>{const M=Ho(O);k({base:M,serialized:M,contours:O}),l==null||l({...e,pathFit:"viewbox",pathViewBox:Nr,customPath:M})},onChange:O=>K(O,!1),onCommit:O=>K(O,!0)}:null,[_,E,Z,L,l,e,K]),[j,$]=s.useState(void 0),v=s.useRef(void 0),w=s.useCallback(O=>{const M=v.current;M!==void 0&&Math.abs(M-O)<.005||(v.current=O,$(O))},[]),P=s.useMemo(()=>R&&typeof j=="number"?j:1,[j,R]),Q=O=>`calc(${O} * var(--${d}-fit, 1))`,z=s.useMemo(()=>{var O,M,ee,V,me;return{fontFamily:oo(e==null?void 0:e.textFontFamily),fontWeight:(O=e==null?void 0:e.textFontSettings)==null?void 0:O.fontWeight,fontStyle:(M=e==null?void 0:e.textFontSettings)==null?void 0:M.fontStyle,fontSize:Q(W.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:Q(W.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:Q(W.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:Q(W.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(ee=e==null?void 0:e.textTextAppearance)==null?void 0:ee.textTransform,textDecoration:(V=e==null?void 0:e.textTextAppearance)==null?void 0:V.textDecoration,fontVariant:(me=e==null?void 0:e.textTextAppearance)==null?void 0:me.fontVariant}},[e,u,d]),T={[`--${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:{...T},children:a.jsx(Xw,{P:d,item:b,shape:x,customPath:g,pathFit:m,viewBox:h,mode:f,align:C,allowOverflow:y,fitEnabled:R,scale:P,onFitScale:w,dropCapLines:H,showGuides:(S||_)&&B,typography:z,imageUrl:f==="avoid"?e==null?void 0:e.image:null,pathEditor:B?D:null})})]})}const Yw=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23784
23792
|
import type React from 'react';
|
|
23785
23793
|
import { createPortal } from 'react-dom';
|
|
23786
23794
|
import { CommonComponentProps } from '../props';
|
|
@@ -23803,8 +23811,12 @@ const DROP_CAP_SIZE_RATIO = 0.92;
|
|
|
23803
23811
|
* anchors can be grabbed even where a host app's own selection/resize
|
|
23804
23812
|
* chrome renders in a sibling stacking context above this component's own
|
|
23805
23813
|
* box — no z-index set inside that box could ever reach past it.
|
|
23814
|
+
*
|
|
23815
|
+
* Keep this above the CMS article/editor stack (\`.editor\` is z-index 1,
|
|
23816
|
+
* \`#component-portal\` is 2) and below host UI chrome (toolbar 4, ItemParams
|
|
23817
|
+
* SnapBar container 5) so the orange outline never paints over panels.
|
|
23806
23818
|
*/
|
|
23807
|
-
const EDITOR_PORTAL_Z_INDEX =
|
|
23819
|
+
const EDITOR_PORTAL_Z_INDEX = 3;
|
|
23808
23820
|
|
|
23809
23821
|
export const SHAPE_IDS = [
|
|
23810
23822
|
'rectangle',
|
|
@@ -23853,7 +23865,6 @@ type RichBlock = {
|
|
|
23853
23865
|
|
|
23854
23866
|
type PretextContentItem = {
|
|
23855
23867
|
text?: RichBlock[];
|
|
23856
|
-
path?: string;
|
|
23857
23868
|
};
|
|
23858
23869
|
|
|
23859
23870
|
type PretextSettings = {
|
|
@@ -23862,11 +23873,12 @@ type PretextSettings = {
|
|
|
23862
23873
|
pathFit?: PathFit;
|
|
23863
23874
|
pathViewBox?: string;
|
|
23864
23875
|
pathSnap?: number;
|
|
23865
|
-
shapeMode?: '
|
|
23876
|
+
shapeMode?: 'A' | 'B';
|
|
23866
23877
|
overflowMode?: 'clip' | 'visible';
|
|
23867
23878
|
fitText?: 'on' | 'off';
|
|
23868
23879
|
dropCap?: 'on' | 'off';
|
|
23869
23880
|
dropCapLines?: number;
|
|
23881
|
+
image?: string | null;
|
|
23870
23882
|
backgroundColor?: string;
|
|
23871
23883
|
textColor?: string;
|
|
23872
23884
|
linkColor?: string;
|
|
@@ -23902,6 +23914,39 @@ function clamp01(value: number): number {
|
|
|
23902
23914
|
return value < 0 ? 0 : value > 1 ? 1 : value;
|
|
23903
23915
|
}
|
|
23904
23916
|
|
|
23917
|
+
function ringsToPathPx(rings: Ring[], box: { width: number; height: number }): string {
|
|
23918
|
+
return rings
|
|
23919
|
+
.filter(ring => ring.length > 0)
|
|
23920
|
+
.map(ring => \`M \${ring.map(point => \`\${point.x * box.width} \${point.y * box.height}\`).join(' L ')} Z\`)
|
|
23921
|
+
.join(' ');
|
|
23922
|
+
}
|
|
23923
|
+
|
|
23924
|
+
function ringsBBoxPx(rings: Ring[], box: { width: number; height: number }): {
|
|
23925
|
+
x: number;
|
|
23926
|
+
y: number;
|
|
23927
|
+
width: number;
|
|
23928
|
+
height: number;
|
|
23929
|
+
} | null {
|
|
23930
|
+
let minX = Infinity;
|
|
23931
|
+
let minY = Infinity;
|
|
23932
|
+
let maxX = -Infinity;
|
|
23933
|
+
let maxY = -Infinity;
|
|
23934
|
+
for (const ring of rings) {
|
|
23935
|
+
for (const point of ring) {
|
|
23936
|
+
const x = point.x * box.width;
|
|
23937
|
+
const y = point.y * box.height;
|
|
23938
|
+
if (x < minX) minX = x;
|
|
23939
|
+
if (x > maxX) maxX = x;
|
|
23940
|
+
if (y < minY) minY = y;
|
|
23941
|
+
if (y > maxY) maxY = y;
|
|
23942
|
+
}
|
|
23943
|
+
}
|
|
23944
|
+
const width = maxX - minX;
|
|
23945
|
+
const height = maxY - minY;
|
|
23946
|
+
if (!isFinite(width) || !isFinite(height) || width <= 0 || height <= 0) return null;
|
|
23947
|
+
return { x: minX, y: minY, width, height };
|
|
23948
|
+
}
|
|
23949
|
+
|
|
23905
23950
|
function ringOf(pairs: [number, number][]): Ring {
|
|
23906
23951
|
return pairs.map(([x, y]) => ({ x, y }));
|
|
23907
23952
|
}
|
|
@@ -24444,27 +24489,45 @@ export function ringsToContours(rings: Ring[]): VecContour[] {
|
|
|
24444
24489
|
}
|
|
24445
24490
|
|
|
24446
24491
|
/**
|
|
24447
|
-
*
|
|
24448
|
-
*
|
|
24492
|
+
* Where a newly picked preset should sit in path coordinates.
|
|
24493
|
+
* Reuses the previous path's drawn bbox so switching forms keeps size/position
|
|
24494
|
+
* (including after a stretch commit rematerialized the path into pixels).
|
|
24495
|
+
* Falls back to the full edit viewBox when there is no usable previous path.
|
|
24449
24496
|
*/
|
|
24450
|
-
function
|
|
24497
|
+
function editablePathTargetRect(previous?: {
|
|
24451
24498
|
customPath?: string;
|
|
24452
24499
|
pathFit?: string;
|
|
24453
24500
|
pathViewBox?: string;
|
|
24454
|
-
}):
|
|
24501
|
+
}): { x: number; y: number; width: number; height: number } {
|
|
24502
|
+
const full = { x: 0, y: 0, width: EDIT_SPAN, height: EDIT_SPAN };
|
|
24455
24503
|
if (
|
|
24456
24504
|
!previous
|
|
24457
24505
|
|| previous.pathFit !== 'viewbox'
|
|
24458
24506
|
|| previous.pathViewBox !== EDIT_VIEW_BOX
|
|
24459
24507
|
|| !previous.customPath
|
|
24460
24508
|
) {
|
|
24461
|
-
return
|
|
24509
|
+
return full;
|
|
24462
24510
|
}
|
|
24463
24511
|
const contours = parsePathNodes(previous.customPath);
|
|
24464
|
-
if (!contours.length) return
|
|
24512
|
+
if (!contours.length) return full;
|
|
24513
|
+
const bbox = contoursBBox(contours);
|
|
24514
|
+
const width = bbox.maxX - bbox.minX;
|
|
24515
|
+
const height = bbox.maxY - bbox.minY;
|
|
24516
|
+
if (!isFinite(bbox.minX) || !isFinite(bbox.minY) || !(width > 0) || !(height > 0)) {
|
|
24517
|
+
return full;
|
|
24518
|
+
}
|
|
24519
|
+
return { x: bbox.minX, y: bbox.minY, width, height };
|
|
24520
|
+
}
|
|
24521
|
+
|
|
24522
|
+
/** True when path coords live outside the edit viewBox (typically rematerialized pixels). */
|
|
24523
|
+
function pathExceedsEditViewBox(contours: VecContour[], viewBox: ViewBox, pad = 1): boolean {
|
|
24524
|
+
if (!contours.length) return false;
|
|
24465
24525
|
const bbox = contoursBBox(contours);
|
|
24466
|
-
if (!isFinite(bbox.minX) || !isFinite(bbox.
|
|
24467
|
-
return
|
|
24526
|
+
if (!isFinite(bbox.minX) || !isFinite(bbox.maxX)) return false;
|
|
24527
|
+
return bbox.minX < viewBox.x - pad
|
|
24528
|
+
|| bbox.minY < viewBox.y - pad
|
|
24529
|
+
|| bbox.maxX > viewBox.x + viewBox.width + pad
|
|
24530
|
+
|| bbox.maxY > viewBox.y + viewBox.height + pad;
|
|
24468
24531
|
}
|
|
24469
24532
|
|
|
24470
24533
|
/** Turns a preset into the editable viewBox path the editor persists after a shape pick. */
|
|
@@ -24473,19 +24536,21 @@ export function settingsForEditablePreset(
|
|
|
24473
24536
|
aspect = 1,
|
|
24474
24537
|
previous?: { customPath?: string; pathFit?: string; pathViewBox?: string },
|
|
24475
24538
|
): {
|
|
24476
|
-
shape:
|
|
24539
|
+
shape: ShapeId;
|
|
24477
24540
|
customPath: string;
|
|
24478
24541
|
pathFit: 'viewbox';
|
|
24479
24542
|
pathViewBox: string;
|
|
24480
24543
|
} {
|
|
24481
|
-
const
|
|
24544
|
+
const target = editablePathTargetRect(previous);
|
|
24482
24545
|
const rings = getPresetRings(shape === 'custom' ? 'rectangle' : shape, aspect);
|
|
24483
24546
|
const contours = mapContours(
|
|
24484
24547
|
ringsToContours(rings),
|
|
24485
|
-
point => ({ x: point.x *
|
|
24548
|
+
point => ({ x: point.x * target.width + target.x, y: point.y * target.height + target.y }),
|
|
24486
24549
|
);
|
|
24487
24550
|
return {
|
|
24488
|
-
|
|
24551
|
+
// Keep the preset id so the settings dropdown reflects the pick; path
|
|
24552
|
+
// edits later flip to \`custom\` via writePath.
|
|
24553
|
+
shape,
|
|
24489
24554
|
customPath: serializeContours(contours),
|
|
24490
24555
|
pathFit: 'viewbox',
|
|
24491
24556
|
pathViewBox: EDIT_VIEW_BOX,
|
|
@@ -25009,6 +25074,14 @@ function getCSS(P: string): string {
|
|
|
25009
25074
|
min-width: 0;
|
|
25010
25075
|
height: 100%;
|
|
25011
25076
|
}
|
|
25077
|
+
.\${P}-shape-image {
|
|
25078
|
+
position: absolute;
|
|
25079
|
+
inset: 0;
|
|
25080
|
+
width: 100%;
|
|
25081
|
+
height: 100%;
|
|
25082
|
+
pointer-events: none;
|
|
25083
|
+
overflow: hidden;
|
|
25084
|
+
}
|
|
25012
25085
|
.\${P}-flow {
|
|
25013
25086
|
position: absolute;
|
|
25014
25087
|
inset: 0;
|
|
@@ -25277,11 +25350,13 @@ type PathEditorProps = {
|
|
|
25277
25350
|
viewBox: ViewBox;
|
|
25278
25351
|
contours: VecContour[];
|
|
25279
25352
|
snap: number;
|
|
25353
|
+
/** When true, map the edit viewBox across the full component box (presets). */
|
|
25354
|
+
stretchToBox: boolean;
|
|
25280
25355
|
onChange: (contours: VecContour[]) => void;
|
|
25281
25356
|
onCommit: (contours: VecContour[]) => void;
|
|
25282
25357
|
};
|
|
25283
25358
|
|
|
25284
|
-
function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit }: PathEditorProps) {
|
|
25359
|
+
function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, onChange, onCommit }: PathEditorProps) {
|
|
25285
25360
|
const svgRef = useRef<SVGSVGElement | null>(null);
|
|
25286
25361
|
const contoursRef = useRef(contours);
|
|
25287
25362
|
contoursRef.current = contours;
|
|
@@ -25290,21 +25365,37 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25290
25365
|
const shapeScaleRef = useRef<ShapeScale | null>(null);
|
|
25291
25366
|
const [selection, setSelection] = useState<PathSelection | null>(null);
|
|
25292
25367
|
|
|
25293
|
-
|
|
25294
|
-
|
|
25295
|
-
|
|
25296
|
-
|
|
25297
|
-
|
|
25298
|
-
|
|
25368
|
+
const scaleX = viewBox.width > 0 ? box.width / viewBox.width : 1;
|
|
25369
|
+
const scaleY = viewBox.height > 0 ? box.height / viewBox.height : 1;
|
|
25370
|
+
|
|
25371
|
+
// Pinned custom paths: 1 viewBox unit = 1 px. Presets stretch the edit
|
|
25372
|
+
// space across the full component so handles track the text shape.
|
|
25373
|
+
const toPx = useCallback((point: Pt): Pt => (
|
|
25374
|
+
stretchToBox
|
|
25375
|
+
? {
|
|
25376
|
+
x: (point.x - viewBox.x) * scaleX,
|
|
25377
|
+
y: (point.y - viewBox.y) * scaleY,
|
|
25378
|
+
}
|
|
25379
|
+
: {
|
|
25380
|
+
x: point.x - viewBox.x,
|
|
25381
|
+
y: point.y - viewBox.y,
|
|
25382
|
+
}
|
|
25383
|
+
), [stretchToBox, viewBox, scaleX, scaleY]);
|
|
25299
25384
|
|
|
25300
25385
|
const toPath = useCallback((clientX: number, clientY: number): Pt => {
|
|
25301
25386
|
const rect = svgRef.current?.getBoundingClientRect();
|
|
25302
|
-
if (!rect) return { x: 0, y: 0 };
|
|
25387
|
+
if (!rect || rect.width <= 0 || rect.height <= 0) return { x: 0, y: 0 };
|
|
25388
|
+
if (stretchToBox) {
|
|
25389
|
+
return {
|
|
25390
|
+
x: viewBox.x + ((clientX - rect.left) / rect.width) * viewBox.width,
|
|
25391
|
+
y: viewBox.y + ((clientY - rect.top) / rect.height) * viewBox.height,
|
|
25392
|
+
};
|
|
25393
|
+
}
|
|
25303
25394
|
return {
|
|
25304
25395
|
x: viewBox.x + (clientX - rect.left),
|
|
25305
25396
|
y: viewBox.y + (clientY - rect.top),
|
|
25306
25397
|
};
|
|
25307
|
-
}, [viewBox]);
|
|
25398
|
+
}, [stretchToBox, viewBox]);
|
|
25308
25399
|
|
|
25309
25400
|
// Same as toPath, but into this editor's own pixel space (its viewBox is the
|
|
25310
25401
|
// box's own width/height) — what the outline is drawn in and what the
|
|
@@ -25318,6 +25409,12 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25318
25409
|
};
|
|
25319
25410
|
}, [box.width, box.height]);
|
|
25320
25411
|
|
|
25412
|
+
// Keep path coords in viewBox space (0–100) so top/left stay proportional
|
|
25413
|
+
// when the component box scales with the article — never rematerialize to px.
|
|
25414
|
+
const commitContours = useCallback((next: VecContour[]) => {
|
|
25415
|
+
onCommit(next);
|
|
25416
|
+
}, [onCommit]);
|
|
25417
|
+
|
|
25321
25418
|
// The pointer is captured by the overlay for the whole drag, so the move and
|
|
25322
25419
|
// release land here whatever they pass over — and stay off the editor around
|
|
25323
25420
|
// us. Window listeners could not do both: swallowing the release to keep the
|
|
@@ -25354,16 +25451,27 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25354
25451
|
let dx = rawDx;
|
|
25355
25452
|
let dy = rawDy;
|
|
25356
25453
|
if (isFinite(bboxWidth) && isFinite(bboxHeight)) {
|
|
25357
|
-
|
|
25358
|
-
|
|
25359
|
-
|
|
25360
|
-
|
|
25361
|
-
|
|
25362
|
-
|
|
25363
|
-
|
|
25364
|
-
|
|
25365
|
-
|
|
25366
|
-
|
|
25454
|
+
if (stretchToBox) {
|
|
25455
|
+
const lowX = Math.min(viewBox.x, viewBox.x + viewBox.width - bboxWidth);
|
|
25456
|
+
const highX = Math.max(viewBox.x, viewBox.x + viewBox.width - bboxWidth);
|
|
25457
|
+
const lowY = Math.min(viewBox.y, viewBox.y + viewBox.height - bboxHeight);
|
|
25458
|
+
const highY = Math.max(viewBox.y, viewBox.y + viewBox.height - bboxHeight);
|
|
25459
|
+
const clampedMinX = Math.min(highX, Math.max(lowX, bbox.minX + rawDx));
|
|
25460
|
+
const clampedMinY = Math.min(highY, Math.max(lowY, bbox.minY + rawDy));
|
|
25461
|
+
dx = clampedMinX - bbox.minX;
|
|
25462
|
+
dy = clampedMinY - bbox.minY;
|
|
25463
|
+
} else {
|
|
25464
|
+
const pxMinX = bbox.minX - viewBox.x;
|
|
25465
|
+
const pxMinY = bbox.minY - viewBox.y;
|
|
25466
|
+
const lowX = Math.min(0, box.width - bboxWidth);
|
|
25467
|
+
const highX = Math.max(0, box.width - bboxWidth);
|
|
25468
|
+
const lowY = Math.min(0, box.height - bboxHeight);
|
|
25469
|
+
const highY = Math.max(0, box.height - bboxHeight);
|
|
25470
|
+
const clampedMinX = Math.min(highX, Math.max(lowX, pxMinX + rawDx));
|
|
25471
|
+
const clampedMinY = Math.min(highY, Math.max(lowY, pxMinY + rawDy));
|
|
25472
|
+
dx = clampedMinX - pxMinX;
|
|
25473
|
+
dy = clampedMinY - pxMinY;
|
|
25474
|
+
}
|
|
25367
25475
|
}
|
|
25368
25476
|
if (!shapeDrag.moved && dx === 0 && dy === 0) return;
|
|
25369
25477
|
shapeDrag.moved = true;
|
|
@@ -25403,7 +25511,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25403
25511
|
event.stopPropagation();
|
|
25404
25512
|
const svg = svgRef.current;
|
|
25405
25513
|
if (svg?.hasPointerCapture(shapeScale.pointerId)) svg.releasePointerCapture(shapeScale.pointerId);
|
|
25406
|
-
if (shapeScale.moved)
|
|
25514
|
+
if (shapeScale.moved) commitContours(contoursRef.current);
|
|
25407
25515
|
return;
|
|
25408
25516
|
}
|
|
25409
25517
|
const shapeDrag = shapeDragRef.current;
|
|
@@ -25413,7 +25521,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25413
25521
|
const svg = svgRef.current;
|
|
25414
25522
|
if (svg?.hasPointerCapture(shapeDrag.pointerId)) svg.releasePointerCapture(shapeDrag.pointerId);
|
|
25415
25523
|
if (shapeDrag.moved) {
|
|
25416
|
-
|
|
25524
|
+
commitContours(contoursRef.current);
|
|
25417
25525
|
} else {
|
|
25418
25526
|
// A click that never travels deselects, same as the background surface.
|
|
25419
25527
|
setSelection(null);
|
|
@@ -25426,7 +25534,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25426
25534
|
event.stopPropagation();
|
|
25427
25535
|
const svg = svgRef.current;
|
|
25428
25536
|
if (svg?.hasPointerCapture(drag.pointerId)) svg.releasePointerCapture(drag.pointerId);
|
|
25429
|
-
if (drag.moved)
|
|
25537
|
+
if (drag.moved) commitContours(contoursRef.current);
|
|
25430
25538
|
};
|
|
25431
25539
|
|
|
25432
25540
|
|
|
@@ -25491,7 +25599,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25491
25599
|
if (next === contours) return;
|
|
25492
25600
|
setSelection(kind === 'anchor' ? null : { contour: contourIndex, node: nodeIndex });
|
|
25493
25601
|
onChange(next);
|
|
25494
|
-
|
|
25602
|
+
commitContours(next);
|
|
25495
25603
|
return;
|
|
25496
25604
|
}
|
|
25497
25605
|
setSelection({ contour: contourIndex, node: nodeIndex });
|
|
@@ -25523,7 +25631,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25523
25631
|
if (nodeIndex < 0) return;
|
|
25524
25632
|
setSelection({ contour: hit.contour, node: nodeIndex });
|
|
25525
25633
|
onChange(next);
|
|
25526
|
-
|
|
25634
|
+
commitContours(next);
|
|
25527
25635
|
};
|
|
25528
25636
|
|
|
25529
25637
|
const onKeyDown = (event: React.KeyboardEvent) => {
|
|
@@ -25539,7 +25647,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25539
25647
|
const factor = grow ? KEYBOARD_SCALE_STEP : 1 / KEYBOARD_SCALE_STEP;
|
|
25540
25648
|
const next = scaleContours(contours, origin, factor);
|
|
25541
25649
|
onChange(next);
|
|
25542
|
-
|
|
25650
|
+
commitContours(next);
|
|
25543
25651
|
return;
|
|
25544
25652
|
}
|
|
25545
25653
|
if (!selection) return;
|
|
@@ -25556,7 +25664,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25556
25664
|
if (next === contours) return;
|
|
25557
25665
|
setSelection(null);
|
|
25558
25666
|
onChange(next);
|
|
25559
|
-
|
|
25667
|
+
commitContours(next);
|
|
25560
25668
|
return;
|
|
25561
25669
|
}
|
|
25562
25670
|
const base = snap > 0 ? snap : NUDGE_STEP;
|
|
@@ -25569,12 +25677,16 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25569
25677
|
if (!anchor) return;
|
|
25570
25678
|
const next = moveNodeTo(contours, contour, node, { x: anchor.x + shift[0], y: anchor.y + shift[1] });
|
|
25571
25679
|
onChange(next);
|
|
25572
|
-
|
|
25680
|
+
commitContours(next);
|
|
25573
25681
|
};
|
|
25574
25682
|
|
|
25575
25683
|
const outline = useMemo(() => serializeContours(mapContours(contours, toPx)), [contours, toPx]);
|
|
25576
25684
|
const shapeBBox = useMemo(() => contoursBBox(contours), [contours]);
|
|
25577
25685
|
const bboxTopLeft = toPx({ x: shapeBBox.minX, y: shapeBBox.minY });
|
|
25686
|
+
const bboxSize = {
|
|
25687
|
+
width: toPx({ x: shapeBBox.maxX, y: shapeBBox.minY }).x - bboxTopLeft.x,
|
|
25688
|
+
height: toPx({ x: shapeBBox.minX, y: shapeBBox.maxY }).y - bboxTopLeft.y,
|
|
25689
|
+
};
|
|
25578
25690
|
const showScaleHandles = !selection
|
|
25579
25691
|
&& isFinite(shapeBBox.minX)
|
|
25580
25692
|
&& isFinite(shapeBBox.maxX)
|
|
@@ -25665,7 +25777,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25665
25777
|
event.preventDefault();
|
|
25666
25778
|
const next = toggleNodeSmooth(contours, contourIndex, nodeIndex);
|
|
25667
25779
|
onChange(next);
|
|
25668
|
-
|
|
25780
|
+
commitContours(next);
|
|
25669
25781
|
}}
|
|
25670
25782
|
/>
|
|
25671
25783
|
</g>
|
|
@@ -25679,8 +25791,8 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
|
|
|
25679
25791
|
className={\`\${P}-editor-bbox\`}
|
|
25680
25792
|
x={bboxTopLeft.x}
|
|
25681
25793
|
y={bboxTopLeft.y}
|
|
25682
|
-
width={
|
|
25683
|
-
height={
|
|
25794
|
+
width={bboxSize.width}
|
|
25795
|
+
height={bboxSize.height}
|
|
25684
25796
|
/>
|
|
25685
25797
|
{(['nw', 'ne', 'se', 'sw'] as const).map((corner) => {
|
|
25686
25798
|
const point = toPx(scaleHandlePoint(shapeBBox, corner));
|
|
@@ -25794,6 +25906,7 @@ type ColumnProps = {
|
|
|
25794
25906
|
dropCapLines: number;
|
|
25795
25907
|
showGuides: boolean;
|
|
25796
25908
|
typography: React.CSSProperties;
|
|
25909
|
+
imageUrl?: string | null;
|
|
25797
25910
|
pathEditor?: PathEditorBinding | null;
|
|
25798
25911
|
};
|
|
25799
25912
|
|
|
@@ -25827,8 +25940,10 @@ function PretextColumn({
|
|
|
25827
25940
|
dropCapLines,
|
|
25828
25941
|
showGuides,
|
|
25829
25942
|
typography,
|
|
25943
|
+
imageUrl,
|
|
25830
25944
|
pathEditor,
|
|
25831
25945
|
}: ColumnProps) {
|
|
25946
|
+
const imageId = \`pretext-shape-image-\${useId().replace(/:/g, '')}\`;
|
|
25832
25947
|
const [columnEl, setColumnEl] = useState<HTMLDivElement | null>(null);
|
|
25833
25948
|
const measureRef = useRef<HTMLDivElement | null>(null);
|
|
25834
25949
|
const [box, setBox] = useState<{ width: number; height: number }>({ width: 0, height: 0 });
|
|
@@ -25842,48 +25957,86 @@ function PretextColumn({
|
|
|
25842
25957
|
|
|
25843
25958
|
const aspect = box.height > 0 ? box.width / box.height : 1;
|
|
25844
25959
|
const draftContours = pathEditor?.contours ?? null;
|
|
25845
|
-
|
|
25846
|
-
// their own — they only ever make sense stretched to fill the box. An
|
|
25847
|
-
// actual path (a shared custom path, a per-column path override, or a live
|
|
25848
|
-
// vector-editor draft) does have a natural size, given by its viewBox —
|
|
25849
|
-
// \`isPathShape\` marks that case so it can be pinned instead of stretched.
|
|
25850
|
-
const { rings: unitRings, isPathShape } = useMemo(() => {
|
|
25960
|
+
const unitRings = useMemo(() => {
|
|
25851
25961
|
if (draftContours) {
|
|
25852
25962
|
const drawn = flattenContours(draftContours);
|
|
25853
|
-
if (drawn.length) return
|
|
25963
|
+
if (drawn.length) return mapToViewBox(drawn, viewBox);
|
|
25854
25964
|
}
|
|
25855
|
-
|
|
25965
|
+
// Prefer a stored path whenever present (preset picks materialize into
|
|
25966
|
+
// customPath while keeping the preset id on \`shape\` for the dropdown).
|
|
25967
|
+
const spec = customPath.trim();
|
|
25856
25968
|
const parsed = spec ? parsePathSpec(spec, pathFit, viewBox) : null;
|
|
25857
|
-
if (parsed && parsed.length) return
|
|
25858
|
-
return
|
|
25969
|
+
if (parsed && parsed.length) return parsed;
|
|
25970
|
+
return getPresetRings(shape === 'custom' ? 'rectangle' : shape, aspect);
|
|
25859
25971
|
// aspect only matters for the circle preset; round it to avoid churn
|
|
25860
|
-
}, [draftContours,
|
|
25861
|
-
|
|
25862
|
-
//
|
|
25863
|
-
//
|
|
25864
|
-
//
|
|
25865
|
-
//
|
|
25866
|
-
//
|
|
25867
|
-
//
|
|
25868
|
-
//
|
|
25869
|
-
//
|
|
25972
|
+
}, [draftContours, shape, customPath, pathFit, viewBox, Math.round(aspect * 100) / 100]);
|
|
25973
|
+
|
|
25974
|
+
// Layout treats rings as 0..1 fractions of the box. Paths stored in the
|
|
25975
|
+
// edit viewBox (0–100) map through mapToViewBox and scale with the box —
|
|
25976
|
+
// matching CMS article-width scaling for top/left.
|
|
25977
|
+
//
|
|
25978
|
+
// Legacy paths rematerialized into component pixels (while pathViewBox is
|
|
25979
|
+
// still 0 0 100 100) must not pin to absolute px on every resize. Freeze the
|
|
25980
|
+
// first measured box as a reference so pixel coords become stable fractions,
|
|
25981
|
+
// and migrate to real viewBox coords when the editor can persist.
|
|
25870
25982
|
const onConvertPath = pathEditor?.onConvert;
|
|
25871
25983
|
const needsConversion = pathEditor?.needsConversion ?? false;
|
|
25872
|
-
|
|
25873
|
-
|
|
25874
|
-
|
|
25984
|
+
const exceedsEditViewBox = useMemo(() => {
|
|
25985
|
+
const contours = draftContours
|
|
25986
|
+
?? (customPath.trim() ? parsePathNodes(customPath) : null);
|
|
25987
|
+
return Boolean(contours && pathExceedsEditViewBox(contours, viewBox));
|
|
25988
|
+
}, [draftContours, customPath, viewBox]);
|
|
25989
|
+
|
|
25990
|
+
const [legacyRefBox, setLegacyRefBox] = useState<{ width: number; height: number } | null>(null);
|
|
25991
|
+
useIsomorphicLayoutEffect(() => {
|
|
25992
|
+
if (!exceedsEditViewBox) {
|
|
25993
|
+
if (legacyRefBox) setLegacyRefBox(null);
|
|
25994
|
+
return;
|
|
25995
|
+
}
|
|
25996
|
+
if (!legacyRefBox && box.width > 0 && box.height > 0) {
|
|
25997
|
+
setLegacyRefBox({ width: box.width, height: box.height });
|
|
25998
|
+
}
|
|
25999
|
+
}, [exceedsEditViewBox, box.width, box.height, legacyRefBox]);
|
|
25875
26000
|
|
|
25876
26001
|
const rings = useMemo(() => {
|
|
25877
|
-
if (!
|
|
25878
|
-
const
|
|
25879
|
-
const
|
|
26002
|
+
if (!exceedsEditViewBox || box.width <= 0 || box.height <= 0) return unitRings;
|
|
26003
|
+
const ref = legacyRefBox ?? box;
|
|
26004
|
+
const scaleX = viewBox.width / ref.width;
|
|
26005
|
+
const scaleY = viewBox.height / ref.height;
|
|
25880
26006
|
return unitRings.map(ring => ring.map(point => ({ x: point.x * scaleX, y: point.y * scaleY })));
|
|
25881
|
-
}, [unitRings,
|
|
26007
|
+
}, [unitRings, exceedsEditViewBox, legacyRefBox, viewBox.width, viewBox.height, box.width, box.height]);
|
|
25882
26008
|
|
|
26009
|
+
const migratedPathRef = useRef<string | null>(null);
|
|
25883
26010
|
useEffect(() => {
|
|
25884
|
-
if (!
|
|
26011
|
+
if (!onConvertPath || box.width <= 0 || box.height <= 0) return;
|
|
26012
|
+
|
|
26013
|
+
if (exceedsEditViewBox) {
|
|
26014
|
+
if (migratedPathRef.current === customPath) return;
|
|
26015
|
+
const contours = draftContours
|
|
26016
|
+
?? (customPath.trim() ? parsePathNodes(customPath) : null);
|
|
26017
|
+
if (!contours?.length) return;
|
|
26018
|
+
const normalized = mapContours(contours, point => ({
|
|
26019
|
+
x: viewBox.x + ((point.x - viewBox.x) / box.width) * viewBox.width,
|
|
26020
|
+
y: viewBox.y + ((point.y - viewBox.y) / box.height) * viewBox.height,
|
|
26021
|
+
}));
|
|
26022
|
+
migratedPathRef.current = serializeContours(normalized);
|
|
26023
|
+
onConvertPath(normalized);
|
|
26024
|
+
return;
|
|
26025
|
+
}
|
|
26026
|
+
|
|
26027
|
+
if (!needsConversion || !unitRings.length) return;
|
|
25885
26028
|
onConvertPath(mapContours(ringsToContours(unitRings), point => ({ x: point.x * EDIT_SPAN, y: point.y * EDIT_SPAN })));
|
|
25886
|
-
}, [
|
|
26029
|
+
}, [
|
|
26030
|
+
needsConversion,
|
|
26031
|
+
exceedsEditViewBox,
|
|
26032
|
+
onConvertPath,
|
|
26033
|
+
unitRings,
|
|
26034
|
+
draftContours,
|
|
26035
|
+
customPath,
|
|
26036
|
+
viewBox,
|
|
26037
|
+
box.width,
|
|
26038
|
+
box.height,
|
|
26039
|
+
]);
|
|
25887
26040
|
|
|
25888
26041
|
useIsomorphicLayoutEffect(() => {
|
|
25889
26042
|
const element = columnEl;
|
|
@@ -26019,9 +26172,51 @@ function PretextColumn({
|
|
|
26019
26172
|
const showPathEditor = Boolean(pathEditor && draftContours && box.width > 0 && box.height > 0);
|
|
26020
26173
|
const editorRect = useFloatingRect(columnEl, showPathEditor);
|
|
26021
26174
|
const portalTarget = showPathEditor && editorRect ? resolveEditorPortalTarget() : null;
|
|
26175
|
+
const shapeImagePath = useMemo(
|
|
26176
|
+
() => (imageUrl && box.width > 0 && box.height > 0 ? ringsToPathPx(rings, box) : ''),
|
|
26177
|
+
[imageUrl, rings, box.width, box.height],
|
|
26178
|
+
);
|
|
26179
|
+
const shapeImageBounds = useMemo(
|
|
26180
|
+
() => (imageUrl && box.width > 0 && box.height > 0 ? ringsBBoxPx(rings, box) : null),
|
|
26181
|
+
[imageUrl, rings, box.width, box.height],
|
|
26182
|
+
);
|
|
26183
|
+
const patternId = \`\${imageId}-pattern\`;
|
|
26022
26184
|
|
|
26023
26185
|
return (
|
|
26024
26186
|
<div className={\`\${P}-column\`} ref={setColumnEl}>
|
|
26187
|
+
{imageUrl && shapeImagePath && shapeImageBounds ? (
|
|
26188
|
+
<svg
|
|
26189
|
+
className={\`\${P}-shape-image\`}
|
|
26190
|
+
viewBox={\`0 0 \${box.width} \${box.height}\`}
|
|
26191
|
+
preserveAspectRatio="none"
|
|
26192
|
+
aria-hidden
|
|
26193
|
+
>
|
|
26194
|
+
<defs>
|
|
26195
|
+
<pattern
|
|
26196
|
+
id={patternId}
|
|
26197
|
+
patternUnits="userSpaceOnUse"
|
|
26198
|
+
x={shapeImageBounds.x}
|
|
26199
|
+
y={shapeImageBounds.y}
|
|
26200
|
+
width={shapeImageBounds.width}
|
|
26201
|
+
height={shapeImageBounds.height}
|
|
26202
|
+
>
|
|
26203
|
+
<image
|
|
26204
|
+
href={imageUrl}
|
|
26205
|
+
x={0}
|
|
26206
|
+
y={0}
|
|
26207
|
+
width={shapeImageBounds.width}
|
|
26208
|
+
height={shapeImageBounds.height}
|
|
26209
|
+
preserveAspectRatio="xMidYMid slice"
|
|
26210
|
+
/>
|
|
26211
|
+
</pattern>
|
|
26212
|
+
</defs>
|
|
26213
|
+
<path
|
|
26214
|
+
d={shapeImagePath}
|
|
26215
|
+
fill={\`url(#\${patternId})\`}
|
|
26216
|
+
fillRule="evenodd"
|
|
26217
|
+
/>
|
|
26218
|
+
</svg>
|
|
26219
|
+
) : null}
|
|
26025
26220
|
<div
|
|
26026
26221
|
className={\`\${P}-flow\${allowOverflow ? '' : \` \${P}-clip\`}\`}
|
|
26027
26222
|
style={{ ...typography, ['--' + P + '-fit']: appliedScale } as React.CSSProperties}
|
|
@@ -26100,6 +26295,7 @@ function PretextColumn({
|
|
|
26100
26295
|
viewBox={viewBox}
|
|
26101
26296
|
contours={draftContours}
|
|
26102
26297
|
snap={pathEditor.snap}
|
|
26298
|
+
stretchToBox={!exceedsEditViewBox}
|
|
26103
26299
|
onChange={pathEditor.onChange}
|
|
26104
26300
|
onCommit={pathEditor.onCommit}
|
|
26105
26301
|
/>
|
|
@@ -26128,7 +26324,7 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26128
26324
|
const customPath = settings?.customPath ?? '';
|
|
26129
26325
|
const pathFit = settings?.pathFit ?? 'stretch';
|
|
26130
26326
|
const viewBox = useMemo(() => parseViewBox(settings?.pathViewBox), [settings?.pathViewBox]);
|
|
26131
|
-
const mode = settings?.shapeMode
|
|
26327
|
+
const mode = settings?.shapeMode === 'B' ? 'avoid' : 'contain';
|
|
26132
26328
|
const align = settings?.textAlign ?? 'left';
|
|
26133
26329
|
const allowOverflow = (settings?.overflowMode ?? 'clip') === 'visible';
|
|
26134
26330
|
const fitEnabled = (settings?.fitText ?? 'off') === 'on';
|
|
@@ -26182,10 +26378,9 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26182
26378
|
return parsed.length ? parsed : null;
|
|
26183
26379
|
}, [pathEditing, draft, customPath]);
|
|
26184
26380
|
|
|
26185
|
-
const isEditablePath =
|
|
26186
|
-
&& pathFit === 'viewbox'
|
|
26381
|
+
const isEditablePath = pathFit === 'viewbox'
|
|
26187
26382
|
&& (settings?.pathViewBox ?? '') === EDIT_VIEW_BOX
|
|
26188
|
-
&& Boolean(editContours);
|
|
26383
|
+
&& Boolean(editContours && !pathExceedsEditViewBox(editContours, viewBox));
|
|
26189
26384
|
|
|
26190
26385
|
const writePath = useCallback((next: VecContour[], commit: boolean) => {
|
|
26191
26386
|
const serialized = serializeContours(next);
|
|
@@ -26196,7 +26391,10 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26196
26391
|
serialized,
|
|
26197
26392
|
contours: next,
|
|
26198
26393
|
}));
|
|
26199
|
-
if (commit)
|
|
26394
|
+
if (commit) {
|
|
26395
|
+
// Manual point edits diverge from the named preset.
|
|
26396
|
+
onUpdateSettings?.({ ...settings, shape: 'custom', customPath: serialized });
|
|
26397
|
+
}
|
|
26200
26398
|
}, [customPath, onUpdateSettings, settings]);
|
|
26201
26399
|
|
|
26202
26400
|
const pathEditor = useMemo<PathEditorBinding | null>(() => {
|
|
@@ -26210,7 +26408,6 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26210
26408
|
setDraft({ base: serialized, serialized, contours: next });
|
|
26211
26409
|
onUpdateSettings?.({
|
|
26212
26410
|
...settings,
|
|
26213
|
-
shape: 'custom',
|
|
26214
26411
|
pathFit: 'viewbox',
|
|
26215
26412
|
pathViewBox: EDIT_VIEW_BOX,
|
|
26216
26413
|
customPath: serialized,
|
|
@@ -26220,9 +26417,6 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26220
26417
|
onCommit: (next: VecContour[]) => writePath(next, true),
|
|
26221
26418
|
};
|
|
26222
26419
|
}, [pathEditing, isEditablePath, editContours, pathSnap, onUpdateSettings, settings, writePath]);
|
|
26223
|
-
// The path is a component-wide setting, carried by the column unless it has
|
|
26224
|
-
// a path of its own.
|
|
26225
|
-
const usesSharedPath = !(item?.path ?? '').trim();
|
|
26226
26420
|
|
|
26227
26421
|
const [fitScale, setFitScale] = useState<number | undefined>(undefined);
|
|
26228
26422
|
const fitScaleRef = useRef<number | undefined>(undefined);
|
|
@@ -26284,10 +26478,11 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26284
26478
|
dropCapLines={dropCapLines}
|
|
26285
26479
|
showGuides={(showGuides || pathEditing) && shapeOverlayVisible}
|
|
26286
26480
|
typography={typography}
|
|
26287
|
-
|
|
26481
|
+
imageUrl={mode === 'avoid' ? settings?.image : null}
|
|
26482
|
+
pathEditor={shapeOverlayVisible ? pathEditor : null}
|
|
26288
26483
|
/>
|
|
26289
26484
|
</div>
|
|
26290
26485
|
</>
|
|
26291
26486
|
);
|
|
26292
26487
|
}
|
|
26293
|
-
`,Cc=[...
|
|
26488
|
+
`,Cc=[...Kd],Kw={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Zw={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:Cc},enum:Cc},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"}},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:{...Kw.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:{shape:"diamond",customPath:"",pathSnap:0,pathFit:"stretch",shapeMode:"A",fitText:"off",dropCap:"off",dropCapLines: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","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.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",title:"Image",items:["image"]},{type:"row",items:["dropCap"]}]},{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."}]}]}]}},Jw={element:Uw,id:"pretext",name:"Pretext",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||Kd.indexOf(n)===-1?e:{...e,...bw(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/Simple-Marquee.mp4"},schema:Zw,sourceCode:Yw,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},Qw=[fm,$m,vx,hg,Cg,Fg,Qg,Ch,Mh,Hh,df,iy,sv,fv,Jv,cx,Ex,L0,Bx,z0,bb,ow,Jw];exports.components=Qw;exports.isSchemaV1=su;
|